An experimental orchestrator for even more experimental gVisor forks

sand boots a container image in a gVisor-family runtime, forks running sandboxes instead of cold-booting new ones, and puts every runtime under the same commands. Stock gVisor, the copy-on-write fork RFC, TimeTravelContainer, or the runsc you patched last night.

Get the source $go build -o sand ./cmd/sand

A sandbox is booted from an image by a runtime. After that it is a tree.

Fork clones a sandbox with its processes, memory and filesystem. A paused sandbox is a template, and forking it is cheaper because its state cannot change.

Boot an image

Import a docker save archive and run it cold. Rootless, with no daemon, and no network inside the sandbox yet.

$ docker save python:3.12-alpine | sand image import -
$ sand run python python -c 'print(1)'

Freeze a template

Start a sandbox detached, let it warm up, then pause it. Its state stops changing, so it can be forked cheaply.

$ T=$(sand run -d python python -c 'import json, time; time.sleep(1e9)')
$ sand pause $T

Fork it a hundred times

Children start with the template's memory. Fork a running sandbox instead to branch it in the middle of a task.

$ sand fork -n 100 $T
$ sand bench -n 100 -c 8 -from $T true

Runtimes are external binaries. The interesting ones are not merged anywhere.

An adapter drives each runtime and no runtime code is vendored. That makes it cheap to point sand at a patched build and compare it with stock gVisor.

NameForkIsolation between forksHow experimental
gvisorCheckpoint and restoreSeparate process per sandboxStock gVisor from the official release.The baseline everything else is compared with.
fork RFCCopy-on-write from a native templateSeparate process per sandboxThe sandbox-fork RFC, gvisor#17850, and its closed PR, gvisor#17869.KVM only, and it needs real root.
ttcLive copy-on-writeOne shared Sentry per fork familyNVlabs TimeTravelContainer.Its own documentation says it is not a production security boundary.
yoursWhatever your patch doesUp to youA fork that keeps the runsc CLI needs no code, only an entry.sand runtime add myfork -adapter runsc -bin /path/to/runsc -platform kvm

Not built yet

sand is a Go library with a thin CLI on top. This is what it does not do.