nemo_gym.sandbox.providers.opensandbox.snapshots
nemo_gym.sandbox.providers.opensandbox.snapshots
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 snapshots.py —connection-config env.yaml —name-prefix “ng-$(cat <state_dir>/state_dir_id)-” —reap
Partial-rollout checkpoints name their snapshots ng-<state dir id>-..., with that id in
<checkpoint.state_dir>/state_dir_id; it identifies the state directory and is not the run_id of a rollouts
manifest. A running job deletes the snapshots of the checkpoints its controller releases, and the service never
expires one, so once a job has ended for good, or under a controller that never releases, the last line is what
deletes its snapshots.
Module Contents
Functions
Data
API
Run the cleanup and turn its failures into a message and a status.
List matching snapshots (and paused sandboxes) and optionally delete them.
snapshot_ids=None lists snapshots; a list, even an empty one, names them
exactly. name_prefix keeps only listed snapshots whose name starts with it;
the API’s name filter matches whole names, so it is applied here. Blank
selectors are rejected rather than widening the scope.