Repository navigation
docs(guides): add Cloudflare Sandbox migration guide - #389
Draft
NathanFlurry wants to merge 2 commits into
Draft
NathanFlurry wants to merge 2 commits into
NathanFlurry wants to merge 2 commits into
Conversation
Map the Cloudflare Sandbox SDK to a Rivet Actor that owns one sandbox through @rivet-dev/sandbox-adapter: identity by key, exec and streaming output, background processes, files, git, code runs, preview URLs, and sleep and destroy. The example keeps the sandbox id in SQLite and the connected sandbox in vars, and is type-checked in examples/docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🚅 Environment agents-pr-389 in rivet-frontend has no services deployed. 3 services not affected by this PR
|
📟 Pip-Boy ·
|
| job | wall time | slowest step |
|---|---|---|
changes |
17s | checkout · 13s |
zizmor |
15s | checkout · 9s |
report |
25s | checkout · 8s |
⏭ native · ${{ matrix.platform }} |
— | skipped |
⏭ footprint |
— | skipped |
⏭ hygiene |
— | skipped |
⏭ self-test |
— | skipped |
🔭 Full CI trace for this commit
One OpenTelemetry trace of CI and Pip-Boy for a35ab1f: every job and step, with the sizes above attached. Run after CI finishes.
pnpm install --frozen-lockfile --filter 'pipboy...'
pnpm --filter pipboy pipboy trace --sha a35ab1ffbff6cc28ef8f76ed14cf4d0ac3c947dfAdd --otlp <url> to send it to any OTLP/HTTP collector.
Agent instruction: From a rivet-dev/agents checkout, run the commands above, then read the trace file the last command prints. List the slowest jobs and steps and explain where CI time went.
- Pass the git token in a `-c` http.extraHeader setting so it is not saved in the clone's .git/config, and say it is visible in the sandbox while the clone runs. - Note that Daytona cannot stop a running command or stream its output. - Take the exec timeout per call and say to raise it with actionTimeout. - Give each execStream call its own id in output events. - Delete files with `rm -f`, and remove runPython's snippet after the run. - Say dockerPortAddress needs the `ports` option, and that Freestyle and agentOS have no port helper. - Title the sidebar entry "From Cloudflare Sandbox". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7 of 11 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
/guides/migrate-cloudflare-sandboxthat maps the Cloudflare Sandbox SDK to a Rivet Actor that owns one sandbox through@rivet-dev/sandbox-adapter. It covers identity by key,execand streamed output, background processes, files, git checkout, running code, preview URLs, and sleep and destroy, plus a concept map and the differences to plan for.examples/docs/migrate-cloudflare-sandbox/(server.ts,client.ts). It stores the sandbox id in SQLite and the connected sandbox inc.vars, shares one in-flight open across concurrent actions, and uses no actor state, queues, or KV.docs/sidebar.json. It merges with the Actors bundle's group of the same name on rivet.dev.Gaps documented in the guide
There is no adapter API for shell sessions, binary writes,
waitForPort, terminals, snapshots, file watching, or bucket mounts. The guide points to provider SDKs orexecpatterns for these. Preview URLs call the provider SDK directly (E2BgetHostin the example).Notes
pnpm exec tsc --noEmit -p examples/docspasses, and Biome is clean on the changed files.🤖 Generated with Claude Code