feat(sandbox): sandbox server for cross-server sandbox sharing - #2081
Closed
ananthsub wants to merge 1 commit into
Closed
feat(sandbox): sandbox server for cross-server sandbox sharing#2081ananthsub wants to merge 1 commit into
ananthsub wants to merge 1 commit into
Conversation
Add a fourth Gym server type (sandbox_servers/) that owns physical sandboxes and lends them across servers by reference, so a box created by one server (e.g. an agent running a rollout) can be operated by another (e.g. a resources server that scores it): attach to the same live box or spin up a fresh eval box. - SandboxRef: a serializable, signed lease capability (server_url, sandbox_id, scope) that travels in a request body; owner leases may destroy the box, operate co-leases may not. Leases bind to the rollout id. - ConnectableProvider: an optional runtime_checkable capability protocol (serialize_handle/connect) separate from the base SandboxProvider. - AsyncSandbox.serialize/connect: facade methods that use the capability. - RemoteSandboxProvider: forwards the provider protocol to a sandbox server over an injected SandboxHttpTransport, so nemo_gym.sandbox never imports the server framework. - Direct reattach for the OpenSandbox provider via Sandbox.connect(id), so external-control-plane providers can be shared without a sandbox server. - nemo_gym.sandbox_client: the one bridge that injects Gym's aiohttp client. - sandbox_servers/sandbox_server: the server, config, and fourth-server-type registration in config_types. Hermetic tests use a fake in-process provider to drive both the direct reattach path and a full in-process HTTP round-trip against the real server. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
Author
|
Superseded by the PR stack here for easier review: #2083 |
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.
Summary
Adds a sandbox server, a fourth composable Gym server type (
sandbox_servers/) that owns physical sandboxes and lends them across servers by reference. A box created by one server (an agent running a rollout) can be operated by another (a resources server that scores it): either the same live box, or a fresh eval box the verifier creates. It is standalone and does not depend on any agent.Changes
ConnectableProvider— an optionalruntime_checkablecapability protocol (serialize_handle/connect), separate from the baseSandboxProvider, which is unchanged.AsyncSandbox.serialize/AsyncSandbox.connect— facade methods that use the capability.serialize(scope="operate")produces a co-lease descriptor;connect(descriptor, provider=...)rebuilds a started sandbox in another process.RemoteSandboxProvider— forwards the provider protocol to a sandbox server over an injectedSandboxHttpTransport, sonemo_gym.sandboxnever imports the server framework (no dependency cycle).SandboxRef— a serializable, signed lease capability (server_url,sandbox_id,scope) that travels in a request body. Owner leases may destroy the box; operate co-leases may not. Leases are bound to the rollout id.Sandbox.connect(id)), so external-control-plane providers can be shared without standing up a sandbox server or paying an extra network hop.nemo_gym.sandbox_client— the single bridge that injects Gym's aiohttp client (make_remote_provider,connect_sandbox).sandbox_servers/sandbox_server— the server (create/exec/upload/download/status + lease grant/release, in-process registry,max_concurrentadmission, TTL reaping, teardown on shutdown) and registration of the fourth server type inconfig_types.py.Test plan
tests/unit_tests/test_sandbox_server.py(new), hermetic with a fake in-process provider:SandboxRefserialization and scope.serialize->connect).serializerejects a provider without the connect capability.serialize, co-leaseconnect, bad-lease rejection, release keeps the box alive, owner close.server_utilsimports.