Skip to main content
A volume is named storage that outlives any sandbox. Create it once, attach it to sandboxes at a mount path, write to it, and publish to share the result with future sandboxes. More than one sandbox can write to the same volume.
Sandbox volumes (prime sandbox volumes) are separate from Hosted Training volumes, which back Model Factory training runs.

How a volume works

  • A sandbox that attaches a volume gets a private copy of the volume’s latest published version. The copy is made when the sandbox is created.
  • Volumes attach read-write (the default) or read-only (:ro). A read-only attachment cannot write or publish.
  • Publishing adds one sandbox’s changes to the volume as a new version. Sandboxes created after the publish completes see the new version. A running sandbox sees it after a sync. A volume that was never published is empty.
  • Syncing updates the volume in a running sandbox to the latest published version. See Sync.
  • Each publish is stored as a checkpoint. The publish command shows the checkpoint ID. Use this ID to check the status of the publish.
  • A volume is mounted with noatime, so reading a file does not update its access time.
  • Published data survives sandbox termination; unpublished writes do not. Publish before deleting a sandbox whose writes you want to keep.
  • A volume is a separate disk: it doesn’t count against the sandbox’s disk_size_gb, and a sandbox checkpoint captures the root filesystem only, never a mounted volume. A volume’s capacity is 100 GiB by default, set at creation, and can grow up to 10 TiB — see Size and growth.
A mounted volume is not a shared live filesystem. Writes in one sandbox stay in that sandbox until it publishes. A running sandbox does not see publishes from other sandboxes until it syncs. To read the latest version, sync the sandbox or create a new sandbox.

Checkpoints, fork and restore

A checkpoint holds only the sandbox’s root disk. A fork or restore attaches no volume unless you pass --volume. The mount path is then an empty directory. --volume attaches the volume at its latest published content. It does not attach the state of the volume at the time of the checkpoint.
A restore that includes memory (--memory) does not accept --volume. A sandbox with an attached volume cannot be paused, so it cannot be snapshotted or memory-forked.

Quickstart

Pass --volume NAME:/mount/path[:ro] up to 8 times per sandbox. :ro mounts the volume read-only; writable mounts have no suffix.

Publish

publish saves the sandbox’s copy and adds its changes to the volume. By default, it waits until the publish is complete. After that, new sandboxes that attach the volume see the changes.
  • Each publish includes all changes since the sandbox’s last successful publish, or since it attached the volume.
  • The publishes of one volume complete one at a time. There is no fixed completion time.
  • The CLI and the SDK wait up to 300 seconds. Use --wait-timeout <seconds> to change this in the CLI. When the wait ends, the CLI exits with status 1 and the SDK raises TimeoutError, but the publish continues.
  • --no-wait (CLI) or wait=False (SDK) returns at once. To check a publish, run prime sandbox checkpoint get <checkpoint-id> or call client.get_checkpoint(...). The publish is complete when the state is DURABLE and the merge status is merged. DURABLE alone does not mean that the changes are in the volume.
  • If a publish fails, the CLI prints the reason and exits with status 1. The SDK raises RuntimeError with the reason. The volume keeps its earlier version, and the sandbox keeps its writes. If the cause stays, a new publish from the same sandbox also fails.
  • Read-only attachments cannot publish.

Multiple writers

Many sandboxes can attach the same volume read-write at the same time. Use CLI prime 0.20.4 or later, or SDK prime-sandboxes 0.5.11 or later: earlier versions can return before the changes are in the volume. Each sandbox changes only its own copy. Each publish adds its changes to the volume’s current version, which can already include publishes from other sandboxes. In this example, sandboxes A and B attach the same version, and both write the same file. A publishes first, then B. A new sandbox reads B’s version.

How changes combine

The last writer wins per file: the last publish replaces the whole file, with its permissions, owner, and extended attributes. “Last” is the order in which the publishes complete, not the order in which the sandboxes write.
  • Changes to different files all stay.
  • Deletes follow the same rule. If the last publish deletes a directory, or puts a file at its path, the directory is removed with all of its contents, including files that other sandboxes added.
  • A moved or renamed item keeps the changes that other sandboxes publish to it.
  • If moves from two sandboxes would put a directory inside itself, the later publish fails.
A change to only a file’s permissions, owner, modification time, or extended attributes also replaces the file’s contents with that sandbox’s copy.

Sync

A volume in a running sandbox shows the content from when the sandbox started, or from its last sync. sync updates the volume in the sandbox to the latest published version.
  • Read-write mount: sync first publishes the sandbox’s unpublished changes. The platform adds them to the volume as in How changes combine. Then sync updates the volume in the sandbox. After the sync, the sandbox shows its own changes and the changes that other sandboxes published.
  • Read-only mount: sync updates the volume in the sandbox.
  • --discard (CLI) or discard=True (SDK): sync does not publish the sandbox’s unpublished changes. It deletes them. The volume in the sandbox then shows the latest published version.
The sandbox must be running.
During a sync, the volume is not available in the sandbox for a few seconds. File operations on the mount path fail until the sync ends. Stop any work that uses the volume before you sync.
A sync that publishes waits for its publish to be added to the volume. Publishes to a volume are added in the order the platform receives them, so when many sandboxes publish to one volume at the same time, a sync can take a few minutes.

Sync failures

When a sync fails, the platform restores the volume in the sandbox to its state before the sync. The unpublished changes stay in the sandbox. The exceptions are DEADLINE and ROLLBACK_FAILED: the volume can be missing from the sandbox. In that case, run the sync again.

Import a local directory

Combine --from with --size-gb to size the new volume in the same step. --from needs rsync on your machine. The CLI copies the directory through a short-lived helper sandbox and publishes from it; the helper is deleted once the publish is complete. If the volume already exists, the import publishes like any other sandbox: its files are added to the volume’s current version.

Size and growth

A volume’s capacity is the maximum it can hold, set at creation in whole GiB: 100 (the default) up to 10240 (10 TiB). volumes list and volumes get show it as Capacity; the SDK exposes it as Volume.size_gb.
Grow an existing volume to a larger size:
  • Growth is one-way: a size at or below the volume’s current size returns 409. Volumes cannot shrink.
  • A grow applies to sandboxes created after it; running sandboxes keep their current size. The filesystem is grown when a sandbox attaches the volume read-write, and publishing from that sandbox records the larger size. Until then, a read-only attachment shows the last published size.
  • Large grows add a few seconds to sandbox startup. Pick the size you need at creation.
  • Capacity is a ceiling, not a quota: billing stays based on stored data, as documented at the bottom of this page.
Do not grow a volume while more than one sandbox writes to it. Sandboxes that started from different sizes of the volume cannot combine their changes. The later publish fails, the volume keeps its earlier version, and publishing again does not fix it.

Manage volumes

  • list paginates with --page / --num (max 100 per page); --json prints raw fields.
  • delete fails with 409 while any active sandbox has the volume attached, and removes the volume and all of its published data. Deleting a team volume requires a team admin.

Scopes and permissions

  • Volumes are personal by default. Pass --team-id (CLI) or team_id (SDK) to work in a team; without it, the CLI uses the team from your config, if any.
  • Team members can create, attach, publish, and sync team volumes; only team admins can delete them.
  • API tokens need the sandbox:read scope to list or get volumes and sandbox:write to create, delete, publish, or sync.

Names and mount paths

  • Volume names: 1–40 characters, lowercase letters, digits, and hyphens; must start and end with a letter or digit; unique within their scope.
  • Mount paths: absolute, not /, unique per sandbox, and not nested inside each other.

Common errors

Published volume data is billed as checkpoint storage.