Repository navigation
feat(compute): run cloud workspaces through the Sandbox SDK - #483
Draft
iamnbutler wants to merge 5 commits into
Draft
iamnbutler wants to merge 5 commits into
iamnbutler wants to merge 5 commits into
Conversation
Spike: the Compute object drives its workspace through @sandbox-sdk/core with the Cloudflare adapter instead of ctx.container, so another adapter can replace it. The controller reaches the runner with shell and file calls rather than a container port, and marks those calls so the runner's quiescence check ignores them. The SDK is vendored until it is published to npm.
Why: services/compute/index.ts | a container restart loses the runner, so running means the sandbox reports running and the runner answers /health
…its workspace Why: services/compute/index.ts#class Compute | start replaces a running sandbox only when its project is gone, so work newer than the checkpoint is never destroyed
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.
Draft, parked for now. This moves cloud workspaces (
services/compute) from Cloudflare's container API to the Sandbox SDK, a provider-neutral sandbox API (Cloudflare, Vercel, E2B, Daytona, Modal and others), so teams could run workspaces on providers other than Cloudflare. Related: #58.The SDK isn't on npm, so it is forked to githubnext/sandbox (branch
ace), and its built output is vendored inservices/compute/vendor/sandbox-sdk. The fork adds:status(), so the controller can tell whether a sandbox is running without starting it.stop()that treats the expected Durable Object reset as success.create()that doesn't wake the container.What changes in Ace:
curlagainst localhost inside the sandbox. Request and reply bodies travel as files, so the runner needs no exposed port on any provider. These calls carryACE_CONTROL=1so the checkpoint's idle check ignores them./health. A container restarted by an image rollout used to look like it was running even though its runner was gone.cloudflare/sandbox:0.12.9, which the SDK's Cloudflare adapter needs.Tested against a deployed copy of the service through the host's real
computecreate, start and stop:Why it's parked: on Cloudflare alone this is a step back from the direct container API.
wrangler.jsoncand the size setting is ignored.Durable Object reset because its code was updated(HTTP 409). The checkpoint had already been saved, and later cycles worked; I couldn't reproduce it on demand.This is worth merging only once a second provider (Vercel or E2B) runs a workspace through the same controller. If that works, the next steps are adding resources and direct port access to the fork.
Built in Ace
No. Claude Code in a terminal did the research, the SDK fork and the live tests against a deployed spike Worker. The session started there as a research question about GitHub Sandboxes and continued there; Ace wasn't missing anything for this work. Tracked under #5.