nemo_gym.sandbox.providers.docker.provider
nemo_gym.sandbox.providers.docker.provider
Docker sandbox provider: one long-lived container per sandbox, driven via the docker CLI.
Module Contents
Classes
Functions
Data
DOCKER_MISSING_CONTAINER_MARKERS
API
Bases: SandboxCreateError
Raised when Docker cannot create a sandbox.
Bases: SandboxCreateVerificationError
Raised when a new container fails its readiness probe.
Sandbox provider backed by the local Docker CLI / daemon.
Configured exec shell, else bash when the image has it (for conda source), else sh.
Run a docker CLI command as (return_code, stdout, stderr); SIGKILL the group on timeout.
Poll the readiness probe until it passes stable_count times or the deadline elapses.
Force-remove the container (already-gone counts as success).
Create a handle for an existing running container, rediscovering its image and shell via the Docker CLI.
sandbox_id is required. AsyncSandbox.serialize() adds a
top-level ports key from the original spec; read it back here so
endpoint() still works after reconnecting.
Start a detached keep-alive container (image ENTRYPOINT overridden) and probe readiness.
spec.ttl_s bounds the lifetime (the keep-alive sleeps for it and --rm self-removes on
exit). spec.provider_options may carry volumes (-> -v) and run_args (extra run
flags). A half-created container is force-removed on any failure.
Download one container file to the host.
Resolve a dynamically-published TCP port through the Docker daemon.
Run <shell> -c <command> via docker exec; never raises for command failure.
user maps to --user (root/0 -> 0). A timeout kills the local docker client only; the
in-container process is reaped when the sandbox is closed.
Return a descriptor for reattaching to this container by id.
Docker recovers image and shell from the running container on connect,
and docker exec runs inside the container’s own environment, so the
id alone is enough; AsyncSandbox.serialize() layers the declared
ports on top. scope is unused by the Docker provider.
Container status via docker inspect (missing -> STOPPED; error/timeout -> UNKNOWN).
Upload one host file (creates the parent dir; the file lands owned by root).
Parse one docker port binding such as 127.0.0.1:49153.
argv copy with --env KEY=VALUE values masked, so timeouts/logs don’t leak secrets.