Skip to content

gvisor: resume Data snapshots on the golden snapshot (#451, phase 2) - #790

Draft
Dmitry Berkovich (dberkov) wants to merge 1 commit into
agent-substrate:mainfrom
dberkov:resumeFromDataGVisor
Draft

gvisor: resume Data snapshots on the golden snapshot (#451, phase 2)#790
Dmitry Berkovich (dberkov) wants to merge 1 commit into
agent-substrate:mainfrom
dberkov:resumeFromDataGVisor

Conversation

@dberkov

Copy link
Copy Markdown
Collaborator

Phase 2 of #451: extends the onResume.fromData: Golden data resume (micro-VM support merged in #683) to the gVisor runtime.

What

A gVisor actor with onCommit: Data + onResume: { fromData: Golden } now resumes as the template's golden snapshot (guest memory + rootfs) with the actor's durable-dir data restored over it — instead of cold-booting. Works for both durable (commit) snapshots and local pause checkpoints.

How

Built on runsc's new split checkpoints:

  • runsc checkpoint -split-fscheckpoint writes the memory snapshot at the checkpoint's top level and the durable-dir fs image under fs/; runsc restore -split-fsrestore reads both halves from -image-path.
  • ateom-gvisor: lists snapshot files recursively so the fs/ half ships with the manifest; passes --fs-restore-image-path <dir>/fs at create/restore time when the fs/ folder exists; DATA_ON_GOLDEN restores through the Full path.
  • atelet: stages a gVisor DATA_ON_GOLDEN restore as one folder shaped like a Full split snapshot whose fs half is the actor's — the golden's files minus its fs/ contents at the top level, and the actor's flat fscheckpoint image set re-rooted into fs/, overriding it wholesale. Micro-VM keeps its flat shadow-merge. Staging is subdir-aware, with parent directories created once per distinct dir (ensureParentDirs) on the download, local-copy, and pause-move paths.
  • Version guard: gVisor checkpoint images are runsc-version-coupled (unlike the micro-VM durable tar), so a combine requires the actor's and golden's pinned runsc sha256 to match — FailedPrecondition otherwise.
  • CRD: the CEL gate restricting onResume.fromData: Golden to sandboxClass: microvm is lifted.

Testing

  • Unit: atelet staging tests for the gVisor fs-override layout (golden fs/ excluded, actor image re-rooted, subdir created on demand) and the micro-VM merged layout; filesOutsideDir filter; recursive listSnapshotFiles.
  • e2e (suites/demo): the two OnGolden lifecycle cases (commit path and pause path) are no longer micro-VM-gated and run in the gVisor lane; expected counters are unchanged.
  • Manually verified on GKE: gVisor actor created from golden, called, suspended (Data), resumed with the golden's memory and the actor's file counter continuing.

Draft blockers

  • sandboxconfig-gvisor.yaml temporarily pins a split-checkpoint runsc build from a private test bucket (gs://snapshot-substrate-test-…/gvisor-split-checkpoint/runsc); needs a public/released runsc with -split-fscheckpoint/-split-fsrestore before this can merge (the gVisor e2e lane also depends on it).
  • runsc debug logging is enabled on create/start/checkpoint/restore for bring-up; decide whether to keep it before merge.

🤖 Generated with Claude Code

…ta, agent-substrate#451 phase 2)

Extends the OnGolden data resume to the gVisor runtime, built on runsc's
new split checkpoints: 'runsc checkpoint -split-fscheckpoint' writes the
memory snapshot at the checkpoint's top level and the durable-dir fs
image under fs/, and 'runsc restore -split-fsrestore' reads both halves
from -image-path.

atelet stages a DATA_ON_GOLDEN gVisor restore as one folder shaped like
a Full split snapshot whose fs half is the actor's: the golden's files
minus its fs/ contents at the top level, and the actor's flat
fscheckpoint image set re-rooted into fs/, overriding it wholesale
(micro-VM keeps its flat shadow-merge). Staging is subdir-aware —
parent directories are created once per distinct dir (ensureParentDirs)
on the download, local-copy, and pause-move paths — and gVisor combines
require the actor's and golden's pinned runsc to match: the images are
runsc-version-coupled, unlike the micro-VM durable tar.

ateom-gvisor lists snapshot files recursively so the fs/ half ships
with the manifest, passes the fs image at create/restore time when the
fs/ folder exists, and restores DATA_ON_GOLDEN through the Full path.
The CRD gate restricting onResume.fromData: Golden to microvm is
lifted, and the counter demos exercise the flow (the gvisor
SandboxConfig temporarily pins a split-checkpoint runsc build).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants