Tags: regisiet/forkd
Tags
Merge pull request deeplethe#18 from deeplethe/dev ci(release): release workflow + v0.1.2
feat(controller): TLS support + comparison docs (v0.1.1)
Daemon
- axum-server + rustls 0.23 (aws-lc-rs provider) replace plain
axum::serve. New `--tls-cert` / `--tls-key` flags (and FORKD_TLS_*
env vars). When both are set the daemon speaks HTTPS; otherwise
it falls back to plain HTTP (unchanged loopback default).
- Graceful shutdown promoted to axum_server::Handle with a 30 s
drain deadline on SIGTERM/SIGINT, replacing the previous
serve-then-drop pattern.
- --tls-cert and --tls-key must be supplied together; mismatch is
a hard error rather than a silent downgrade.
Tests
- End-to-end integration test generates a self-signed cert via
rcgen, brings up the daemon with TLS, and verifies /healthz and
/version handshake successfully with reqwest configured to
accept invalid certs. 7 integration tests pass (was 6), 19 unit
tests pass.
Docs
- README: new "How forkd compares" section with a properties table
spanning forkd, Tencent CubeSandbox, Daytona, Alibaba OpenSandbox,
E2B, Modal, raw Firecracker, Docker, gVisor. Cited numbers come
from each project's upstream documentation.
- DESIGN.md: new "Related work" subsection with longer prose for
each project — what the primitive is, what cold-start numbers
they advertise, where forkd's niche differs.
- docs/SECURITY.md: TLS guidance (cert rotation, file permissions,
interaction with bearer-token auth).
- docs/API.md, docs/RUNBOOK.md: cross-references to the new flags.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
forkd 0.1.0 — initial release
A microVM sandbox runtime that forks children from a warmed parent
snapshot. Children inherit the parent's address space copy-on-write
via `mmap(MAP_PRIVATE)`, so they boot in tens of milliseconds while
keeping each one in its own KVM-backed Firecracker microVM.
This release includes:
crates/forkd-vmm Firecracker wrapper: snapshot/restore,
ForkOpts (per-child netns + cgroup v2
memory.max), raw HTTP/1.1 over Unix
socket.
crates/forkd-cli `forkd` binary: snapshot, fork, run,
exec, eval, ping, parent build.
crates/forkd-controller Long-running daemon: REST API on
127.0.0.1:8889, persistent JSON
registry, /metrics (Prometheus),
append-only JSON audit log, bearer-
token auth, graceful shutdown.
Operational surface:
docs/API.md Full v1 REST API reference.
docs/SECURITY.md Threat model, default posture, hardening notes.
docs/RUNBOOK.md Bring-up, daily ops, failure modes, capacity.
packaging/systemd forkd-controller.service with capability + path
restrictions.
Dockerfile Multi-stage build for the controller image.
Test coverage: 7 vmm unit tests, 19 controller unit tests, 6 real-
HTTP integration tests covering auth, audit, snapshot/sandbox CRUD,
404/400/401 paths. CI green on stable Rust.
Benchmarks (Ubuntu 24.04 / Linux 6.14 / 20 vCPU / 30 GiB / KVM,
spawn 100 sandboxes ready to run `import numpy`):
forkd 101 ms 0.12 MiB per sandbox
CubeSandbox¹ 390 ms 5 MiB
Firecracker cold 759 ms 84 MiB
gVisor (runsc) 288.6 s —
Docker (runc) 335.3 s 4 MiB
Reproduce with bench/bench-spawn-100.sh + bench/generate_charts.py.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
v0.0.1-alpha: first usable forkd Highlights: - 100 truly multi-tenant Python sandboxes in 193 ms (per-child netns) - 96× faster than fresh subprocess via eval() on warmed interpreter - E2B-compatible Python SDK (drop-in for e2b.Sandbox) - Issue deeplethe#1 (MAC/IP collision) solved via netns, no binary patching - Issue deeplethe#2 (RNG re-seed) handled by upstream Linux vmgenid Closed in this release: deeplethe#1 MAC/IP hot-patch — replaced by per-child netns design deeplethe#2 RNG re-seed — kernel vmgenid handles automatically (Linux >= 5.20) deeplethe#10 ext4 rootfs builder — scripts/build-rootfs.sh deeplethe#11 Python SDK skeleton — sdk/python/ deeplethe#12 bash wait gotcha — scripts/README.md Open: deeplethe#3 TSC offset randomization deeplethe#4 vsock CID allocator (deferred — netns sidesteps the need) deeplethe#5 KSM directed hints deeplethe#6 hugepage-backed snapshot memory deeplethe#7 OOM protection (parent refcount) deeplethe#8 internet egress from children (partial — netns done, NAT pending) deeplethe#9 hyper migration (refactor)