nemo_gym.sandbox.providers.opensandbox.snapshots

View as Markdown

Audit or delete OpenSandbox snapshots, and optionally the paused sandboxes that hold them.

Pausing a sandbox checkpoints it server-side. Interrupted runs leave snapshots and paused sandboxes behind, and both hold cluster storage until deleted. Like cleanup_sandboxes.py, this talks to the management API directly so it runs from any Python with aiohttp and PyYAML, for example as a job submitted by file path.

snapshots.py —connection-config env.yaml # audit every snapshot snapshots.py —connection-config env.yaml —sandbox-id <id> —reap snapshots.py —connection-config env.yaml —kill-paused —reap # also delete paused sandboxes snapshots.py —domain <host> —api-key <key> —snapshot-id <id> —reap

Module Contents

Functions

NameDescription
_runRun the cleanup and turn its failures into a message and a status.
cleanup_snapshotsList matching snapshots (and paused sandboxes) and optionally delete them.
main-

Data

PAGE_SIZE

REAP_CONCURRENCY

REAP_SWEEPS

REQUEST_TIMEOUT_SECONDS

API

nemo_gym.sandbox.providers.opensandbox.snapshots._run(
parser: argparse.ArgumentParser,
domain: str,
access_key: str,
protocol: str,
args: argparse.Namespace
) -> int

Run the cleanup and turn its failures into a message and a status.

nemo_gym.sandbox.providers.opensandbox.snapshots.cleanup_snapshots(
domain: str,
protocol: str,
access_key: str,
sandbox_id: str | None,
states: list[str] | None,
snapshot_ids: list[str] | None,
kill_paused: bool,
reap: bool
) -> int
async

List matching snapshots (and paused sandboxes) and optionally delete them.

snapshot_ids=None lists snapshots; a list, even an empty one, names them exactly. Blank selectors are rejected rather than widening the scope.

nemo_gym.sandbox.providers.opensandbox.snapshots.main(
argv: list[str] | None = None
) -> int
nemo_gym.sandbox.providers.opensandbox.snapshots.PAGE_SIZE = 100
nemo_gym.sandbox.providers.opensandbox.snapshots.REAP_CONCURRENCY = 32
nemo_gym.sandbox.providers.opensandbox.snapshots.REAP_SWEEPS = 3
nemo_gym.sandbox.providers.opensandbox.snapshots.REQUEST_TIMEOUT_SECONDS = 30