-
Notifications
You must be signed in to change notification settings - Fork 51
cloudflare sandbox backend #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
deathbyknowledge
wants to merge
3
commits into
ColeMurray:main
Choose a base branch
from
deathbyknowledge:feat/cloudflare-sandbox-backend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
cloudflare sandbox backend #17
deathbyknowledge
wants to merge
3
commits into
ColeMurray:main
from
deathbyknowledge:feat/cloudflare-sandbox-backend
Conversation
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
Add support for choosing between Modal and Cloudflare sandbox backends via the SANDBOX_BACKEND environment variable (or sandbox_backend in Terraform). Changes: - Add SandboxManager interface for backend abstraction - Create ModalSandboxManager implementing the interface - Create CloudflareSandboxManager implementing the interface - Add factory function that selects backend based on env var - Update SessionDO to use abstraction for spawn/snapshot/restore - Add packages/sandbox/ with Cloudflare container code: - TypeScript supervisor (port of Modal's entrypoint.py) - TypeScript bridge (port of Modal's bridge.py) - Dockerfile for Cloudflare container image - inspect-plugin.js (same as Modal, OpenCode custom tool) - Update Terraform to support sandbox_backend variable - Make Modal resources conditional (only deployed when backend=modal) - Add docs/SANDBOX_BACKENDS.md with setup instructions Backend comparison: - Modal: Supports snapshot/restore, Python supervisor, full Terraform support - Cloudflare: No snapshot support yet, TypeScript supervisor, requires wrangler for containers Default backend is 'modal' for backward compatibility. Set sandbox_backend="cloudflare" in terraform.tfvars for Cloudflare.
- Move sandbox backend documentation from docs/SANDBOX_BACKENDS.md to README - Add condensed comparison table and configuration example - Update architecture diagram to show Modal/Cloudflare options - Add packages/sandbox/**/*.js to ESLint ignores - Fix inspect-plugin.js globals and unused parameter
- Add @cloudflare/sandbox dependency and export Sandbox class - Support both header-based (Modal) and query param (Cloudflare/Bun) auth - Fix Terraform outputs for conditional backend modules
Greptile OverviewGreptile SummaryAdded Cloudflare Sandbox as an alternative backend to Modal, creating a pluggable sandbox architecture. Key Changes
ArchitectureThe abstraction properly handles backend differences:
Important Files Changed
|
|
@ColeMurray if we good get this feature - would be really awesome |
Owner
|
thanks @deathbyknowledge, super cool! I created an issue here for discussion: #26 |
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.
Greetings 👋
I'm Steve from Cloudflare's Agents team. We build and maintain the Sandbox SDK and we thought it'd be a great idea to expand the sandboxing here to allow different provider options (modal/cloudflare), customizable at deploy time.
Cloudflare's Sandbox SDK has fast cold starts and great placements, although we do not support snapshotting (yet! coming soon).
PS: Cool repo!