Contributing
Here’s how to work on SwarmCracker.
Prerequisites
Section titled “Prerequisites”- Go 1.26+
- Git
- Make
- golangci-lint (for linting)
git clone https://github.com/restuhaqza/SwarmCrackercd SwarmCrackergo mod downloadmake allRepo Structure
Section titled “Repo Structure”cmd/├── swarmcracker/ # Main CLI wrapper├── swarmctl/ # Direct SwarmKit commands├── swarmd-firecracker/ # Daemon
pkg/├── executor/ # SwarmKit task → VM config├── network/ # Bridges, TAP, VXLAN├── discovery/ # Consul├── swarmkit/ # SwarmKit glue├── image/ # OCI extraction├── lifecycle/ # VM start/stop├── jailer/ # Security├── storage/ # Volumes, secrets├── snapshot/ # State snapshots├── metrics/ # Prometheus├── types/ # Shared types
docs/ # User + dev docsinfrastructure/ # Ansible deploymenttest-automation/ # tests + multi-node lab (test-automation/multinode/)Code Style
Section titled “Code Style”Follow Effective Go. Run golangci-lint before submitting.
Commits
Section titled “Commits”Conventional commits:
feat(executor): add snapshot restorefix(network): VXLAN FDB race conditiondocs(cli): document new flagsTypes: feat, fix, docs, refactor, test, chore, perf Scopes: executor, network, discovery, jailer, storage, cli
Testing
Section titled “Testing”# Everythingmake test
# One packagego test ./pkg/network/...
# Coveragego test -cover ./pkg/executor/...Integration / E2E Tests
Section titled “Integration / E2E Tests”The blessed development path is the Go E2E suite:
make test-e2eFor a real multi-node cluster (microVMs scheduled across nodes over the VXLAN overlay), use the single-host lab:
sudo test-automation/multinode/cluster-lab.sh up 2sudo test-automation/multinode/cluster-lab.sh testPull Requests
Section titled “Pull Requests”- Fork it
- Branch for your change
- Write code + tests
make lint && make test- Push and open PR
Describe what you changed and why. If it fixes an issue, mention the number.
Before Submitting
Section titled “Before Submitting”- Tests pass
- Lint clean
- No secrets in code (tokens, keys)
- Documentation updated if needed
Questions
Section titled “Questions”Open an issue or ask in discussions.
make all # Build all binariesmake test # Run testsmake lint # Run lintermake clean # Clean artifactsmake install # Install binaries to $GOPATH/binIDE Setup
Section titled “IDE Setup”VS Code
Section titled “VS Code”{ "go.toolsManagement.autoUpdate": true, "go.lintTool": "golangci-lint", "go.lintOnSave": "package"}GoLand
Section titled “GoLand”- Enable golangci-lint
- Configure Go 1.26 SDK
Troubleshooting
Section titled “Troubleshooting”Build Fails
Section titled “Build Fails”# Check Go versiongo version # Must be 1.26+
# Clear module cachego clean -modcache
# Re-download dependenciesgo mod downloadLint Errors
Section titled “Lint Errors”# Run lint with detailsgolangci-lint run ./pkg/...
# Fix auto-fixable issuesgolangci-lint run --fixTest Fails
Section titled “Test Fails”# Run with verbose outputgo test -v ./pkg/executor/...
# Check for race conditionsgo test -race ./pkg/...External Resources
Section titled “External Resources”See Also: Testing Overview | Architecture