sb.
Checkpoint
checkpoint() creates a durable checkpoint handle. Running Sailboxes are
snapshotted first. Paused and sleeping Sailboxes return a handle to their
existing checkpoint without waking.
checkpoint() after important setup, such as installing packages,
fetching remote data, or writing files. On host failure, Sail restores from the
most recent completed checkpoint and does not replay commands that ran before
that checkpoint.
name labels the handle. The TTL, when set, overrides the server’s default
retention window. Set it when you keep a checkpoint to reuse as a template, so
the handle does not expire while you still need it. The returned handle carries
the expiry time (expires_at), when it becomes eligible for garbage
collection.
Start From Checkpoint
Create a separate running Sailbox from a durable checkpoint handle:expose.
Sleeping and paused Sailboxes can be cloned too: checkpoint() returns the
existing checkpoint handle without waking the parent. Starting multiple
children from the same checkpoint reuses the same checkpoint artifacts, so the
second and later children avoid re-checkpointing the parent.
Fork
fork() clones a Sailbox in one call, without creating a durable checkpoint
first:
expose.
The two clone paths differ in what you keep. fork is one call and keeps
nothing: the child starts running, and there is no artifact to manage or
reuse. checkpoint returns a durable handle you can start any number of
Sailboxes from later with from_checkpoint, even after the parent is
terminated. So for fan-out, set up one Sailbox (install dependencies, load
your data), then fork it once per task. Take a checkpoint when you want
to keep that state around to boot from later.
Pause
pause() checkpoints the Sailbox and powers it down until you explicitly resume
it:
Sleep
sleep() checkpoints the Sailbox and powers it down until network ingress,
exec, or an explicit resume wakes it:
Resume
resume() restores a paused or sleeping Sailbox:
exec and file operations wake a sleeping Sailbox automatically, so binding
an existing box by id needs no explicit resume in any language.
Sleep Until a Wake
Pass a wake time tosleep() to schedule a wall-clock wake as the Sailbox
goes down. When the moment arrives and the Sailbox is still sleeping, Sail
restores it:
sleep with a wake time on a Sailbox that is already sleeping just
updates the scheduled wake. The CLI accepts a delay like 30m or 2h, or
an absolute RFC 3339 timestamp. The wake can fire a little after the time
you set, so treat it as approximate. Schedule a minute or two of headroom
rather than an exact deadline. Paused Sailboxes only wake on an explicit
resume and reject scheduled wakes.
Use scheduled wakes for agents and services that sleep between runs and need
to be running again at a known time, such as a daily job or a follow-up an
agent set for itself.
Upgrade
upgrade() reboots the Sailbox on its same disk onto the latest in-guest Sail
agent, picking up new features, fixes, and performance improvements without
recreating the Sailbox:
applied is true. On
a paused or sleeping Sailbox the upgrade is recorded without waking it and
applied is false; it applies automatically the next time the Sailbox wakes. A
Sailbox that is already on the current runtime version reports true without
rebooting.
A Sailbox whose runtime is too old for Sail to resume safely is
upgraded automatically the next time it wakes, as if upgrade() had been
called on it first.
Before a runtime version reaches that automatic-upgrade cutoff, get and
list return a deprecation notice with a deadline and upgrade instructions.
The CLI and Python/TypeScript SDKs also surface the first such notice as a
warning once per process (Python emits SailDeprecationWarning through the
warnings module); Rust callers
can install a callback with sail::set_notice_handler. Treat it as advance
notice to schedule upgrade() on your own terms before the deadline; it is not
an immediate failure.
Terminate
terminate() permanently destroys the Sailbox:
pause() or sleep() when you want to keep
the VM state for later.