Skip to content

SDK/CLI: non-default streaming mode for sandbox image builds (cas-streaming)#741

Open
diptanu wants to merge 3 commits into
mainfrom
streaming-rootfs-cas-contract
Open

SDK/CLI: non-default streaming mode for sandbox image builds (cas-streaming)#741
diptanu wants to merge 3 commits into
mainfrom
streaming-rootfs-cas-contract

Conversation

@diptanu

@diptanu diptanu commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

SDK half of the content-addressed streaming rootfs build contract (design: tensorlakeai/compute-engine-internal#1121). Opt-in, non-default: existing builds are unchanged.

  • tensorlake sbx image create --streaming (CLI) / streaming option (SDK, node + python bindings): requests rootfsFormat: cas-streaming at prepare time.
  • CAS-aware completion: complete_request_from_metadata reads the builder's prepare metadata (manifest URI, image sha, image size, rootfs_disk_bytes) instead of the .tlsnap fields.
  • Async admission: /complete now returns 202 for streaming builds while the trusted ingest service verifies and admits chunks; the SDK polls the build endpoint (wait_for_build_completed, 3 s interval, 30 min cap) until the build finalizes or fails.

Once built, streaming images are handled by the dataplane transparently — no server/executor opt-in flags.

Testing

  • cargo build -p tensorlake -p tensorlake-cli clean after rebase onto main.
  • cargo test -p tensorlake --lib sandbox_images: 28 passed.

Companion PRs: tensorlakeai/firecracker#40, tensorlakeai/platform-api#572, compute-engine-internal (dataplane/server/ingest service).

🤖 Generated with Claude Code

diptanu and others added 2 commits June 13, 2026 00:54
tl sbx image create --streaming opts a build into the content-addressed
streaming rootfs format. The SDK sends rootfsFormat=cas-streaming on the
prepare request (the prepared response — including the staged manifest
upload and rootfsFormat — flows into the builder spec verbatim), rejects
registered-template FROMs up front (streaming builds are base-only), and
completes with the staged-artifact metadata: snapshot_format_version
content_addressed_streaming_v1, the staged image URI, and the
builder-reported image size. The registered identity (manifest URI +
image sha) is produced by the platform's trusted verify-and-admit, so
the SDK emits an explicit "verifying and admitting" status while the
synchronous completion runs. The node and python bindings expose the
same non-default streaming option.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cas-streaming /complete now answers 202 {status: ingesting} while the
trusted service runs the admission as a job; the SDK polls
GET sandbox-template-builds/{buildId} every 3s (30 min cap) until the
build settles, returning the registered template from the completed
status and surfacing the admission error on failure. ext4 builds keep
the synchronous 200 path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The sandbox_templates integration test constructed the options struct
without the new streaming field, failing cargo test compilation in CI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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