Advanced Topics
Rolling updates, memory balloon, multi-arch, init systems, build from source.
Rolling Updates
Section titled “Rolling Updates”SwarmCracker supports zero-downtime rolling updates via SwarmKit orchestration.
How It Works
Section titled “How It Works”- Manager creates new task with updated spec
- SwarmCracker starts new Firecracker VM
- VM reports RUNNING status
- Manager waits for Monitor period (default: 5s)
- Manager stops old task
- Executor removes old VM
Update a Service
Section titled “Update a Service”# Update image (triggers rolling update)swarmctl update svc-nginx --image nginx:1.25
# Update with environmentswarmctl update svc-app --env LOG_LEVEL=debugConfiguration
Section titled “Configuration”SwarmKit controls update behavior (not SwarmCracker):
| Parameter | Default | Description |
|---|---|---|
| Parallelism | 1 | Tasks updated simultaneously |
| Delay | 0s | Wait between batches |
| Monitor | 5s | Verify task stability |
| Failure Action | pause | On failure: pause/continue/rollback |
Memory Balloon
Section titled “Memory Balloon”A service and a vm create VM can declare a virtio-balloon target: how much
guest memory the node reclaims from the VM. The balloon inflates to that target
from boot and holds it there regardless of host pressure; the guest can take
the memory back when it comes under pressure. A balloon never lets a VM grow
beyond its memory limit.
# A 1 GiB VM that can give back up to 256 MiBswarmcracker service create --name cache --image redis:7 \ --memory 1G --balloon-mib 256
# Direct VMs take the same flagswarmcracker vm create --memory 1024 --balloon-mib 256 alpine:latest
# Change the target on a running service (rolls the task), or remove itswarmcracker service update cache --balloon-mib 384swarmcracker service update cache --balloon-mib 0Units and validation
Section titled “Units and validation”--balloon-mib is an integer count of MiB, not a size string (256, not
256m). It must be a positive integer smaller than the memory the VM will boot
with: a target at or above the memory can never be honoured, so the request is
rejected with an error naming both numbers — before the service is created or the
VM is prepared. That memory is the size the VM will actually boot with — the
declared --memory, or the 512 MiB default when nothing is declared — so
--memory 256m --balloon-mib 300 is rejected rather than accepted against a
floor the VM would never have.
On service create and vm create the flag is optional; an omitted flag means
no balloon device. Because the flag exists only to configure one, an explicit
--balloon-mib 0 is rejected as invalid rather than read as “no balloon”. On
service update the flag is tri-state: omitting it keeps the service’s
current target, a value replaces it, and --balloon-mib 0 removes it. An update
validates a new target against the memory the task will get — the
--memory-limit given on the same command, else the limit already on the
service.
The device, and when it takes effect
Section titled “The device, and when it takes effect”The balloon is created before the VM boots (PUT /balloon runs before
InstanceStart), and Firecracker rejects the request once a VM is running. It
therefore cannot be added to a running VM: enable it when the VM is created,
or let service update roll the task with the new target.
The device is configured with deflate_on_oom: true, so when the guest comes
under memory pressure it can take the ballooned pages back instead of being
OOM-killed — reclamation is cooperative, not a hard cap. Statistics polling is
left off.
The balloon only takes effect if the guest kernel has the virtio-balloon driver. If it does not, the device still exists on the host side, but the guest’s memory use is unchanged — the guest has no way to hand pages back. Check the image’s kernel before relying on the flag.
A service that does not declare a balloon gets no balloon key at all, so its VM config and the requests sent to Firecracker are byte-identical to a build without the feature.
How the target reaches the node
Section titled “How the target reaches the node”For a service the target travels as the swarmcracker.balloon service label,
which SwarmKit copies onto each task and the node reads when it translates the
task into a VM config (a vm create VM carries it as a task annotation instead).
You can set that label directly with --label swarmcracker.balloon=<n>, but
--balloon-mib and a swarmcracker.balloon label that disagree are refused
rather than resolved silently; a label whose value agrees is accepted (compared
as the literal string, so --label swarmcracker.balloon=0256 is refused
alongside --balloon-mib 256 even though the numbers agree). A hand-set label
bypasses the CLI’s check and is validated by the node at translation time, where
an invalid value fails the task loudly.
CPU Pinning and cgroup Limits
Section titled “CPU Pinning and cgroup Limits”--cpuset pins a VM’s VMM process to a set of host CPUs. Independently, each
service task gets a cgroup v2 cgroup that caps the VM’s CPU, memory and I/O.
The pin is a hard promise; the quotas are defence in depth around the VM size
the hypervisor already enforces.
# Pin a service to CPUs 0-3 and give it two vCPUsswarmcracker service create --name api --image myapp:1.4 \ --cpu 2 --cpuset 0-3
# Re-pin it (effective on the next task SwarmKit starts), or remove the pinswarmcracker service update api --cpuset 4-7swarmcracker service update api --cpuset ""
# A direct VM is pinned on the host that runs the commandswarmcracker vm create --cpu 2 --memory 1024 --cpuset 0-3 alpine:latestThe value is a Linux cpulist — 0, 0-3, 0-3,8 — and it is canonicalised
before it is stored (3,1-2 becomes 1-3). See the
CLI reference for the flag semantics:
syntax, --cpuset "" clearing (on service update only), and why
--cpuset cannot be combined with --rollback.
What is enforced
Section titled “What is enforced”The cgroup lives at /sys/fs/cgroup/swarmcracker/<task-id>/ and holds the VMM
process — Firecracker itself, or the jailer process that launches it when the
jailer is enabled.
| Enforced value | File | Limit | If it cannot be applied |
|---|---|---|---|
| CPU set | cpuset.cpus |
Exactly the requested CPUs | Fatal — the VM does not start |
| CPU quota | cpu.max |
<quota> 1000000, from --cpu/--cpu-limit (1 vCPU = 1000000 1000000) |
Warning; the VM runs |
| Memory hard limit | memory.max |
Guest memory + 128 MiB | Warning; the VM runs |
| Memory throttle | memory.high |
90% of memory.max |
Warning; the VM runs |
| I/O weight | io.weight |
default 100 |
Warning; the VM runs |
cpuset.mems is written next to a requested cpuset.cpus as well. It is a
NUMA-node list (a node mask such as 0-1, not CPU numbers). Without an
explicit request the daemon resolves it automatically — the nearest readable
ancestor cpuset.mems (swarmcracker/, then the cgroup root), else the host’s
online nodes from /sys/devices/system/node/online — so a CPU pin never
restricts memory to a subset of the nodes the host already allows.
--numa-node overrides that resolution with an explicit list, which is what
binds the guest memory to the named nodes; see
NUMA placement below.
The cpuset is a hard promise. If the requested CPUs are not online on the
node — or the cpuset controller cannot be delegated there — the VM is not
started. The error names the request and the host’s online CPUs
(/sys/devices/system/cpu/online), for example:
cannot apply cpuset "0-3" to task <task-id>: ... (host online CPUs: 0-1,8-15)There is no scheduler admission for CPU availability: the CLI checks the
syntax, and a task can be placed on a node that cannot honour the pin. Use a
placement constraint (for example node.labels.cpus==0-3) to keep pinned
services off unsuitable nodes.
The quotas are defence in depth. A CPU, memory or I/O quota that cannot be
written is logged as a warning and the VM starts anyway — the hypervisor already
bounds the guest to its vCPU count and memory size. The cgroup is kept so a
requested pin still takes effect. Quotas come from the task’s Resources.Limits,
else Resources.Reservations, else the VM’s booted size (--cpu / --memory,
or the 1 vCPU / 512 MiB defaults): the CPU quota is 1,000,000 µs of CPU time per 1,000,000 µs period
per vCPU (one full core-second per second), and the memory cap is the guest’s
memory plus the headroom below.
A malformed request fails the task; a host-side quota failure does not. The warnings above describe enforcement failing on the host after a valid request. A request that cannot be honoured at all — a CPU limit below 0.001 core (fewer than 1,000,000 NanoCPUs, i.e. a quota under 1,000 µs), or a cpuset that does not parse — is rejected while the limits are derived, before any cgroup file is written, and fails the task even when it requested no CPU or memory placement.
Why memory.max is larger than the VM’s memory. The cgroup accounts for the
whole VMM process, whose resident memory is the guest’s RAM plus Firecracker’s
own allocations. A limit equal to the guest size would OOM-kill a healthy VM, so
the daemon adds 128 MiB of headroom: a 512 MiB VM gets memory.max of
640 MiB, and memory.high (the throttle threshold) of 576 MiB. The guest is
still bounded at 512 MiB by the hypervisor; the extra 128 MiB is for the VMM, not
for the workload.
Which VMs get a cgroup. Service tasks get one whenever the daemon’s
--enable-cgroups is on — the default — and this no longer requires
--enable-jailer (also off by default), so cgroups apply to both the jailed
and the direct start paths. A vm create VM gets a cgroup only when
--cpuset or --numa-node is given; without either the command never touches
/sys/fs/cgroup. That CLI path is not gated by the daemon’s
executor.enable_cgroups (--enable-cgroups): the flag controls service tasks
only, so vm create --cpuset creates a cgroup even when the daemon runs with
cgroups disabled. The cgroup is removed on stop, on remove, and when a start
fails.
Verify it on the host
Section titled “Verify it on the host”Run these on the node that owns the task. The service ps table truncates the
task ID to 12 characters, while the cgroup directory is named with the
full task ID — so take the ID from -q, which prints it untruncated. Filter
to this node and to running tasks instead of picking the first row:
# Full task ID of the service's running task on this node. NODE_ID is this# node's ID (`swarmcracker node ls -q`); SERVICE_ID is the service's ID# (`swarmcracker service ls -q --filter name=api`).TASK=$(swarmcracker task ls -q --filter state=running \ --node "$NODE_ID" --service "$SERVICE_ID" | head -1)BASE=/sys/fs/cgroup/swarmcracker/$TASK
ls "$BASE" # the directory must exist, or TASK is wrong
cat "$BASE/cpuset.cpus" # the pin, canonicalised (e.g. 0-3)cat "$BASE/cgroup.procs" # the VMM process's PIDcat "$BASE/cpu.max" # "<quota> 1000000", e.g. "2000000 1000000"cat "$BASE/memory.max" # guest memory + 128 MiB, in bytescat "$BASE/memory.high" # 90% of memory.maxcat "$BASE/io.weight" # "default 100"
PID=$(cat "$BASE/cgroup.procs")taskset -pc "$PID" # the process's current CPU affinitygrep Cpus_allowed_list "/proc/$PID/status"taskset -pc <pid> and Cpus_allowed_list must agree with cpuset.cpus; that
is the pin actually in effect, not just a stored request. An unpinned service VM
leaves cpuset.cpus empty, which means “inherit the parent’s set”, and a
vm create VM without --cpuset has no directory under
/sys/fs/cgroup/swarmcracker/ at all. For a direct VM, use the ID vm create
prints on success (or swarmcracker task ls -q); it is already the full one.
There are no cgroup metrics. The daemon exports no CPU/memory/IO series from these files, so the files above are the observable surface; see Metrics for the series that do exist.
Host requirements
Section titled “Host requirements”cgroup v2 must be mounted at /sys/fs/cgroup and the daemon must be able to
delegate cpu, memory, io and cpuset into the per-task cgroups. On the
shipped install the daemon runs as root with /sys/fs/cgroup as the cgroup
root, and writes cgroup.subtree_control there directly — no systemd drop-in
is needed. Delegation only has to be arranged when the daemon’s
/sys/fs/cgroup is a delegated subtree (a container, or a unit started in a
cgroup namespace); for such a systemd unit that is Delegate=yes. Either way, a
v1-only host or a refused delegation fails the pin with an error naming the
controllers that could not be enabled. See
Configuration → cgroups for
the requirement, the exact error, and what happens without a pin.
Hugepages and NUMA Placement
Section titled “Hugepages and NUMA Placement”Two opt-in flags configure how a VM’s memory is backed and placed on the host.
Both are per-workload — there is no daemon-wide switch and no config.yaml key —
and both are validated by the CLI for syntax only, then enforced by the node when
it starts the VM. A request the host cannot satisfy fails the task; it is
never silently downgraded.
# Service: 2 GiB guest memory backed by 2M pages, on NUMA node 0, CPUs 0-3swarmcracker service create --name api --image myapp:1.4 \ --memory 2G --hugepages --cpuset 0-3 --numa-node 0
# Change or clear either request (effective on the next task)swarmcracker service update api --hugepages=falseswarmcracker service update api --numa-node ""
# Direct VM: the same flags, applied on the host running the commandswarmcracker vm create --memory 2048 --hugepages --numa-node 0 alpine:latestHugepages
Section titled “Hugepages”--hugepages asks Firecracker to back the guest memory with 2M huge pages.
Firecracker supports no other hugepage size, so the flag is a boolean request,
not a size: it is stored as swarmcracker.hugepages=true. On service create
and vm create an omitted flag makes no request, so the VM uses ordinary 4K
memory; on service update an omitted flag leaves the existing request
untouched, and --hugepages=false removes it.
Host prerequisites
Section titled “Host prerequisites”The pages come from the host’s pre-allocated hugetlbfs pool, which is host-global and shared by every hugepage-backed VM on that node. On each node that may run the workload:
grep -i huge /proc/meminfo# HugePages_Total: 1024 <- pages currently allocated# HugePages_Free: 1024 <- allocated pages not yet in use# Hugepagesize: 2048 kB <- must be 2M- The pool must already exist. Firecracker maps guest memory with
MAP_NORESERVEfrom that pool; it does not allocate huge pages on demand. Size the pool withsysctl vm.nr_hugepages=<pages>(persist it in/etc/sysctl.d/). The value is the pool total, not an increment: a 2 GiB VM needs1024pages, two concurrently running 2 GiB VMs need2048, and pages already used by something else count too. - The page size must be 2M. A host configured with 1G pages fails the
request. Firecracker v1.15.1 offers only 2M hugetlbfs pages through
huge_pages, and SwarmCracker exposes exactly that; it does not expose a transparent-hugepage setting. - Memory must be an even number of MiB. 2M pages cannot cover an odd tail,
so
--memory 513is rejected while the task is translated rather than booted at 4K.
What the node checks
Section titled “What the node checks”The request’s size is validated earlier, while the task is translated:
resolveHugepages rejects a memory size that is not a multiple of 2 MiB, so an
odd size fails before the node is asked to start anything. The node’s own
pre-flight then reads /proc/meminfo before the VMM process exists — and before
any cgroup is created — and requires all of:
Hugepagesizeis2048 kB.HugePages_Freeis at leastmem_size_mib / 2.
Both checks use the same mem_size_mib the VM boots with, so a refusal cannot
disagree with the guest size. A task that did not request hugepages never reads
the pool and behaves exactly as before.
Failure shape
Section titled “Failure shape”A short pool is a hard failure: the task does not start, and it leaves no VM
and no cgroup behind. The error names the request, the pages needed, the host
pool, and the vm.nr_hugepages total that would leave enough free pages —
(Total - Free) + required:
task <task-id>: cannot back a 512 MiB VM with 2M huge pages (256 pages needed): the host pool has 100 free of 512 allocated: raise the pool total to 668 pages with sysctl vm.nr_hugepages=668A wrong page size is reported first, with the same request/pool wrapper:
task <task-id>: cannot back a 512 MiB VM with 2M huge pages (256 pages needed): the host pool has 0 free of 0 allocated: the host's hugepage size is 1048576 KiB, but Firecracker supports only 2M (2048 KiB) pages: reconfigure the host pool with 2M pagesAn odd size fails earlier, in translation, naming the size:
invalid hugepage-backed memory size 513 MiB: 2M huge pages require a multiple of 2 MiBThere is no scheduler admission for pool capacity, and the check is a
pre-flight snapshot of a host-global pool — two starts racing for the last pages
can both pass it, and the loser faults later. Constrain hugepage workloads to
nodes you have sized for them (for example a node.labels.hugepages==yes label
plus --constraint node.labels.hugepages==yes).
Verify it on the host
Section titled “Verify it on the host”Use the full task ID: the service ps table truncates it to 12
characters, while the cgroup directory uses the whole ID; -q prints it
untruncated. The cgroup path is node-local, so filter for the running task
on this node rather than taking the first row:
# NODE_ID from `swarmcracker node ls -q`; SERVICE_ID from# `swarmcracker service ls -q --filter name=api`.TASK=$(swarmcracker task ls -q --filter state=running \ --node "$NODE_ID" --service "$SERVICE_ID" | head -1)BASE=/sys/fs/cgroup/swarmcracker/$TASKPID=$(cat "$BASE/cgroup.procs")
# The VMM process's hugetlb-backed memory, in kB (non-zero when hugepages are in use)grep -E 'HugetlbPages|VmRSS' "/proc/$PID/status"
# The host pool the VM drew from; Free falls as the guest faults its memory ingrep -i huge /proc/meminfoHugetlbPages is the authoritative per-process counter (smaps shows the same
backing per mapping); it is reported in kB, so it grows toward
mem_size_mib × 1024 (524288 kB for a 512 MiB guest) as the guest touches its
memory. HugePages_Free falls as those pages are faulted, so it may not drop by
the full page count immediately after boot. For a direct VM, use the ID
vm create printed (or swarmcracker task ls -q); it is already the full one.
NUMA Placement
Section titled “NUMA Placement”--numa-node <nodelist> binds the VM’s guest memory to the listed host NUMA
nodes by writing cpuset.mems on the task’s cgroup. The kernel then allocates
the guest’s pages only from those nodes, which is observable as
Mems_allowed_list in /proc/<pid>/status.
# Memory on node 0, CPUs pinned to 0-3swarmcracker service create --name db --image postgres:16 \ --memory 4G --cpuset 0-3 --numa-node 0
# A range is allowed; the value is canonicalised before storage (3,1 -> 1,3)swarmcracker service update db --numa-node 0-1- Syntax is a Linux cpulist of node numbers:
0,0-1,0-1,3. Overlapping and adjacent ranges are merged, so1,0is stored and shown as0-1. A malformed list is rejected before any RPC. - It binds memory, not CPUs. CPU affinity is
--cpuset; pass both for a full node placement.--numa-nodedoes not derive CPUs from the node and--cpusetdoes not derive memory nodes. - It does not create guest topology. Firecracker exposes no SRAT or NUMA
topology, so the guest still sees one NUMA node (
numactl --hardwareinside the guest shows a single node). The placement is host-side only. - A NUMA-only request creates a cgroup, on both the daemon and
vm createpaths, becausecpuset.memsneeds one — even when--cpusetwas not given. - It overrides the automatic value. Without the flag, a cgroup’s
cpuset.memsis inherited from the nearest readable ancestor or the host’s online nodes; an explicit request replaces that with exactly the named nodes. - No scheduler admission; the node pre-checks the request. Before the task’s
cgroup directory is created, the node compares every requested node with two
sets: the host’s online memory nodes (
/sys/devices/system/node/online) and the parent cgroup’s allowed memory nodes (cpuset.mems.effective, from the nearest readable ancestor; if none is readable, only the online list is enforced). If either excludes a requested node, the task fails; the remaining nodes are never used as a fallback. This pre-check is what makes an offline-but-possible node fatal: the kernel by itself would accept the write, keep the requested list incpuset.mems, and silently narrow the effective set to the parent ∩ online intersection, which is the silent ignore this project forbids.
The failure names each exclusion. An offline node and a node withheld by the parent are reported separately, and both reasons are included when the request fails both checks:
cannot apply NUMA node list "3" to task <task-id>: cgroup validate stage: requested NUMA nodes 3 are not grantable: node(s) 3 are not online (host online NUMA nodes: 0-1)cannot apply NUMA node list "3" to task <task-id>: cgroup validate stage: requested NUMA nodes 3 are not grantable: node(s) 3 are excluded by the parent cgroup's cpuset.mems.effective 0-1 (/sys/fs/cgroup/swarmcracker/cpuset.mems.effective; host online NUMA nodes: 0-1)A malformed annotation that bypassed the CLI (a hand-set
swarmcracker.numa-node label) fails as:
invalid NUMA node annotation swarmcracker.numa-node="1-" on task <task-id>: ...Verify it on the host
Section titled “Verify it on the host”The cgroup path is node-local: use the full task ID of the running task on this node, filtered rather than taken from the first row.
# NODE_ID from `swarmcracker node ls -q`; SERVICE_ID from# `swarmcracker service ls -q --filter name=db`.TASK=$(swarmcracker task ls -q --filter state=running \ --node "$NODE_ID" --service "$SERVICE_ID" | head -1)BASE=/sys/fs/cgroup/swarmcracker/$TASKPID=$(cat "$BASE/cgroup.procs")
cat "$BASE/cpuset.mems" # the request, canonicalised (e.g. 0 or 0-1)cat "$BASE/cpuset.cpus" # the CPU pin, if --cpuset was also givengrep Mems_allowed_list "/proc/$PID/status" # the effective set (can be narrower than cpuset.mems)cpuset.mems records the request; Mems_allowed_list is the effective
set the process actually has. The kernel intersects the request with the parent
cgroup’s allowed nodes and the host’s online nodes, so the effective set can
legitimately be narrower than the request when a parent cgroup restricts memory
nodes — that is not a failed binding. A placement failure is fatal and leaves no
VM, so a running VM with a narrower effective set was not silently downgraded;
compare it with the parent’s set rather than requiring equality. For a
vm create VM, take the ID the command printed instead of service ps.
Known limitations
Section titled “Known limitations”- 2M pages only. Guest memory must be an even number of MiB. Firecracker
v1.15.1 maps guest memory only from 2M hugetlbfs pages through
huge_pages; SwarmCracker exposes exactly that. It does not expose 1G pages, mixed page sizes, or a transparent-hugepage setting. - Snapshot restore of a hugepage-backed VM is UFFD-only.
vm snapshot createworks, but Firecracker can restore hugepage-backed memory only through a userfaultfd backend. SwarmCracker’s file-backed restore path (PUT /snapshot/loadwithmem_file_path) cannot restore such a snapshot — Firecracker rejects the load loudly. UFFD restore is not implemented yet; see Snapshots → Limitations. - The balloon cannot reclaim hugepage backing. A hugepage-backed VM may
still configure
--balloon-mib, and the balloon can inflate, but it frees guest pages at 4K granularity and those pages are 2M-backed. Do not rely on the balloon to return hugepage memory to the host pool. - The guest sees a single NUMA node. Host-side
--numa-nodeplacement has no guest-visible topology. - No scheduler admission and no reservation. Pool and node availability are checked on the node at start; a task can be placed on a node that cannot satisfy it and fail there. The hugepage pool is host-global, so concurrent starts can race.
Multi-Architecture Support
Section titled “Multi-Architecture Support”SwarmCracker supports multiple CPU architectures. Pick the variant that matches your nodes through the image you deploy.
Supported Architectures
Section titled “Supported Architectures”| Arch | Firecracker Support | Notes |
|---|---|---|
| x86_64 | ✅ Full support | Primary target |
| arm64 | ✅ Experimental | AWS Graviton, Ampere |
Architecture Constraints
Section titled “Architecture Constraints”swarmctl create-service is a minimal debug client and parses only
--network, --name, and --replicas — it does not accept
--constraint. Use swarmcracker service for deployment: --constraint and
--placement-pref are enforced by the SwarmKit scheduler (node.hostname,
node.role, node.labels.*, …), and the architecture itself is selected
through the image you deploy.
A node.labels.<key> constraint is satisfiable only once a matching label
exists on a node, and labels are set through swarmcracker node update:
# Label a node, then place work on itswarmcracker node update <node-id> --label-add disk=ssdswarmcracker service create --name web --image nginx:alpine \ --constraint node.labels.disk==ssd--label-add KEY=VALUE and --label-rm KEY are both repeatable and at least one
is required; an existing key is overwritten, and removing a key the node does not
have is a no-op. See node update.
Multi-Arch Images
Section titled “Multi-Arch Images”Use OCI image indexes for cross-arch compatibility:
# Build multi-arch imagedocker buildx build --platform linux/amd64,linux/arm64 -t myapp:latest .
# SwarmCracker pulls correct variant based on node archInit Systems
Section titled “Init Systems”MicroVMs need an init system for proper process management.
Why Init Matters
Section titled “Why Init Matters”- Zombie reaping — Orphan processes must be reaped
- Signal handling — Forward SIGTERM to children
- Process supervision — Restart failed processes
Supported Init Systems
Section titled “Supported Init Systems”| Init | Size | Features |
|---|---|---|
| tini | ~20KB | Minimal, Docker default |
| dumb-init | ~30KB | Signal proxy, lightweight |
| s6 | ~100KB | Process supervision |
| systemd | Large | Full service management |
Configure Init
Section titled “Configure Init”executor: init_system: tini # none | tini | dumb-init init_grace_period: 10 # seconds before SIGKILL during shutdownRootfs with Init
Section titled “Rootfs with Init”# Install tini in rootfscurl -fsSL https://github.com/krallin/tini/releases/download/v0.19.0/tini-static -o rootfs/sbin/tinichmod +x rootfs/sbin/tiniBuild from Source
Section titled “Build from Source”Prerequisites
Section titled “Prerequisites”- Go 1.26+
- Git
- Make
Clone and Build
Section titled “Clone and Build”# Clone repositorygit clone https://github.com/restuhaqza/SwarmCrackercd SwarmCracker
# Build binariesmake all
# Output:# build/swarmcracker# build/swarmd-firecracker# build/swarmcracker-agent
# Installsudo make installBuild Targets
Section titled “Build Targets”make all # Build all binariesmake swarmcracker # Build the main CLImake test # Run unit testsmake lint # Run lintersmake fmt # Format codemake clean # Clean build artifactsmake install # Install binaries to $GOPATH/binDevelopment Build
Section titled “Development Build”# Build a debug/dev binarygo build -o build/swarmcracker ./cmd/swarmcracker
# Run the CLI./build/swarmcracker --helpsystemd Services
Section titled “systemd Services”swarmcracker cluster init (manager) and swarmcracker cluster join (worker)
generate and enable the systemd units for you:
swarmcracker-manager.service— runsswarmd-firecracker --manageron the managerswarmcracker-worker.service— runsswarmd-firecrackeron workers
Inspect and control them with systemd:
sudo systemctl status swarmcracker-managersudo systemctl restart swarmcracker-worker
# Logssudo journalctl -u swarmcracker-manager -fsudo journalctl -u swarmcracker-worker -fThere is no standalone swarmcracker service.
File Management
Section titled “File Management”Manage rootfs and kernel images.
Rootfs Directory
Section titled “Rootfs Directory”executor: rootfs_dir: "/var/lib/firecracker/rootfs"Kernel Management
Section titled “Kernel Management”executor: kernel_path: "/usr/share/firecracker/vmlinux"Image Storage
Section titled “Image Storage”/var/lib/firecracker/├── rootfs/ # executor.rootfs_dir│ ├── nginx-rootfs.ext4│ └── redis-rootfs.ext4└── golden/ # prebuilt golden image artifacts
/usr/share/firecracker/└── vmlinux # executor.kernel_path (default kernel)Troubleshooting
Section titled “Troubleshooting”Rolling Update Stuck
Section titled “Rolling Update Stuck”# Check task statusswarmctl ls-tasks
# Check node availabilityswarmctl ls-nodes
# Force rollback if neededswarmctl update <service-id> --image nginx:1.25-alpineInit Process Missing
Section titled “Init Process Missing”# Check init in rootfsls rootfs/sbin/tini
# Verify init binaryfile rootfs/sbin/tiniBuild Fails
Section titled “Build Fails”# Check Go versiongo version # Must be 1.26+
# Check dependenciesgo mod download
# Run lint for errorsmake lintSee Also: Configuration | Contributing Guide