Skip to content

Contributing

Here’s how to work on SwarmCracker.


  • Go 1.26+
  • Git
  • Make
  • golangci-lint (for linting)
Terminal window
git clone https://github.com/restuhaqza/SwarmCracker
cd SwarmCracker
go mod download
make all

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 docs
infrastructure/ # Ansible deployment
test-automation/ # tests + multi-node lab (test-automation/multinode/)

Follow Effective Go. Run golangci-lint before submitting.

Conventional commits:

feat(executor): add snapshot restore
fix(network): VXLAN FDB race condition
docs(cli): document new flags

Types: feat, fix, docs, refactor, test, chore, perf Scopes: executor, network, discovery, jailer, storage, cli


Terminal window
# Everything
make test
# One package
go test ./pkg/network/...
# Coverage
go test -cover ./pkg/executor/...

The blessed development path is the Go E2E suite:

Terminal window
make test-e2e

For a real multi-node cluster (microVMs scheduled across nodes over the VXLAN overlay), use the single-host lab:

Terminal window
sudo test-automation/multinode/cluster-lab.sh up 2
sudo test-automation/multinode/cluster-lab.sh test

  1. Fork it
  2. Branch for your change
  3. Write code + tests
  4. make lint && make test
  5. Push and open PR

Describe what you changed and why. If it fixes an issue, mention the number.


  • Tests pass
  • Lint clean
  • No secrets in code (tokens, keys)
  • Documentation updated if needed

Open an issue or ask in discussions.

Terminal window
make all # Build all binaries
make test # Run tests
make lint # Run linter
make clean # Clean artifacts
make install # Install binaries to $GOPATH/bin

{
"go.toolsManagement.autoUpdate": true,
"go.lintTool": "golangci-lint",
"go.lintOnSave": "package"
}
  • Enable golangci-lint
  • Configure Go 1.26 SDK

Terminal window
# Check Go version
go version # Must be 1.26+
# Clear module cache
go clean -modcache
# Re-download dependencies
go mod download
Terminal window
# Run lint with details
golangci-lint run ./pkg/...
# Fix auto-fixable issues
golangci-lint run --fix
Terminal window
# Run with verbose output
go test -v ./pkg/executor/...
# Check for race conditions
go test -race ./pkg/...


See Also: Testing Overview | Architecture