Skip to content

sandbox: depot sandbox snapshot verb — OCI→ext4 via the Sandbox API (DEP-4884)#518

Closed
robstolarz wants to merge 1 commit into
mainfrom
rob/dep-4884-sandbox-snapshot-verb
Closed

sandbox: depot sandbox snapshot verb — OCI→ext4 via the Sandbox API (DEP-4884)#518
robstolarz wants to merge 1 commit into
mainfrom
rob/dep-4884-sandbox-snapshot-verb

Conversation

@robstolarz

Copy link
Copy Markdown
Contributor

depot sandbox snapshot — unpack an OCI image into an ext4 snapshot via the Sandbox API (DEP-4884)

Adds depot sandbox snapshot <image-ref>, which unpacks a registry OCI image into an ext4 snapshot that future sandboxes can boot from.

Approach (deliberate): the unpack runs through the Depot Sandbox API (depot.sandbox.v1) — the verb creates a short-lived sandbox and runs the snapshot helper inside it as a command exec. It does not use Depot CI to perform the snapshot, and it's a plain imperative verb (no sandbox.depot.yml spec).

Flow:

  1. CreateSandbox (builder image with enough disk).
  2. Fetch the snapshot helper into the sandbox (curl from a release URL).
  3. RunCommand: snapshot pull <image-ref> --output <ext4> [--size <size>] — unpacks the image into an ext4.
  4. Register the ext4 as a bootable snapshot, then tear the sandbox down.

Args: depot sandbox snapshot <image-ref> [-o/--output app.ext4] [--size 10GiB] [--snapshot-binary-url …] [--builder-image …] (--token/--org inherited from depot sandbox).

Why this is a draft (what's needed to finish it)

  • SDK-v0 Go client (DEP-4916): depot.sandbox.v1 isn't on cli main yet — it lands with the fresh sandbox verbs. The verb flow is implemented against a small snapshotClient interface (CreateSandbox/RunCommand/Kill); newSnapshotClient returns a clear not-wired error today rather than dialing the legacy CI client (which would violate the SDK-API requirement). Wire it to the real client when it lands.
  • Snapshot helper specifics: the helper release URL + exact subcommand/flags, and the snapshot-registration step (a CreateSnapshot-style Sandbox-API call to persist the ext4), are marked TODO(DEP-4884). The prior mechanics branch (rob/dep-4395-…-build-ext4-start) is no longer on origin, so these are best-effort assumptions to reconcile against that work + the deployed helper.
  • Won't run end-to-end until the Sandbox API is deployed and the client + helper land — expected for a draft.

Build + go vet + gofmt clean. Registered under the existing depot sandbox command tree.

Adds `depot sandbox snapshot <image-ref>` — unpacks a registry OCI image into
an ext4 snapshot via the Depot Sandbox API: it creates a short-lived sandbox and
runs the `snapshot` helper inside it as a command exec. It deliberately does NOT
use Depot CI to perform the unpack, and takes plain arguments rather than a
sandbox spec file.

Draft: the verb flow is implemented against a small Sandbox-API interface
(snapshotClient: CreateSandbox / RunCommand / Kill). The depot.sandbox.v1 Go
client lands with the fresh sandbox verbs (DEP-4916), so newSnapshotClient
currently returns a clear not-wired error rather than dialing the legacy CI
client. The snapshot helper release URL + arg shape and the
snapshot-registration step are marked TODO for reconciliation against the prior
build-ext4 mechanics and the deployed API.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jun 3, 2026

Copy link
Copy Markdown

DEP-4884

@robstolarz robstolarz closed this Jun 4, 2026
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.

1 participant