Repository navigation
Add an OpenSandbox Sandbox Provider - #913
Merged
Merged
Conversation
Run Core-managed sandboxes on an operator's OpenSandbox server through its official Go SDK: a direct adapter with no helper or local state, ownership in sandbox metadata, the Runtime bootstrap through execd, and Core's egress mapped to the sidecar's dns+nft policy. Checkpoint and the preparation cache stay unmapped.
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.
Adds
opensandbox, a direct Sandbox Provider over the official OpenSandbox Go SDK (sdks/sandbox/gov1.2.0). It maps the native lifecycle, execd and egress APIs and links OpenSandbox's own documentation instead of restating it.Adapter
Required operations and Observe map to the native lifecycle API, execd (through the server proxy) and
/metrics. The adapter stores nothing: it finds sandboxes by four ownership metadata keys, and settlement is any non-Pending owned sandbox.Create waits for the egress sidecar inside the SDK readiness check and requires
dns+nftenforcement. It then uploads the bootstrap file (mode 0600), runsoac-daemon connectand marks completion in metadata.Network: every sandbox denies the private, shared and link-local ranges. OpenSandbox's deny rules win over any allow, and its domain rules open every port of an answer's addresses. So the private denies keep allowed names off private answers, and Core must resolve to global addresses: Create rejects a non-global Core before dispatch (
invalid).publicallows the rest by default. Non-public denies by default and allows Core, model endpoints and domains.PrivateDomainsis unsupported.Settlement:
DOCKER::SANDBOX_IMAGE_PULL_FAILED), the adapter lists the allocation. An empty listing settles it as absent; a leftover sandbox settles it for cleanup.Key replacement needs each unreleased allocation to list its sandboxes with the candidate key, because an empty listing does not prove access.
Server requirements include
[docker] publish_host = "127.0.0.1": on the Docker runtime, execd answers on published sandbox ports without authentication, and Core uses only the server proxy.The adapter guide also requires:
disable_ipv6left at its default;deny.alwayscovering cluster ranges outside the private ranges.It also states that only Core may reach the server, because the sandbox proxy route accepts requests without the API key.
The shared
sandbox_configuration_errorcopy no longer says HTTPS. Core only refuses a loopback public URL.The checkpoint group and preparation are declared unsupported. Pause/resume is runtime-specific in OpenSandbox, and there is no preparation cache.
deploy/opensandbox/Dockerfilederives the Runtime image. OpenSandbox runs the image's user, so the layout is prepared at build time and the sandbox needs no root.Setup wizard, registry entry, generated contracts and documentation (English and Chinese) are included.
Verification
All runs used real Sessions on a temporary Core selecting
opensandbox, against an OpenSandbox 1.2.0 server (Docker runtime,dns+nftegress):codexandclaude_sdkhosted acceptance: 9/9 each. These runs predate the global-Core requirement: the test Core is on a private IP, so the previous Core carve-out was in place. Bootstrap, commands, files and Kill have not changed since.disabled: blocks DNS and TCP.restricted ["example.com"]: allows example.com and blocks www.example.com and example.org.public: trueandpublic: false.publish_host = "127.0.0.1", the server proxy reaches execd, and the host address refuses the published port.provider_type: opensandboxwith memory usage and limit.go test ./services/core/internal/sandbox/opensandbox/ ./services/core/internal/sandbox/providers/,go vet ./..., translation check.