Concepts

Volumes

Named volumes that outlive a briq. A briq starts from a copy of one, and can publish its own volume as the next copy.

A volume dies with its briq. A named volume is one the team keeps: the next briq that names it starts with the data the last publishing briq left.

briq_run({ image: "ghcr.io/acme/app:24.04", size: "large",
  volume: { mount: "/work", gb: 50, from: "deps-linux-x64", publish: true } })
→ bq_7kq2m9x1p4ab app (…) running · volume deps-linux-x64: restored, generation 12
  1. from names a volume of your team. A name that does not exist yet starts an empty volume.
  2. The briq gets its own copy. Nothing it writes reaches the volume or any other briq, so briqs in parallel never see each other's files.
  3. With publish: true, the briq's volume becomes the volume's next copy when the briq is destroyed after a clean stop. A volume is made by its first publish; there is no create call.

A name is lowercase letters and digits, joined by single dots or dashes, up to 63 characters: deps-linux-x64, data.v2.

What a briq gets

The briq's volume.from says what it got:

{ "volume": "vol_…", "name": "deps-linux-x64", "generation": 12, "restored": true }

A briq that starts empty has "restored": false and a reason. It runs with an empty volume of the size asked. This is a normal start, not an error.

reasonMeaningPublishes?
newThe name has no copy yetYes
expiredThe copy was deleted before the briq startedYes
lostThe machine that held the copy lost itYes
host_unavailableThe machine that holds the copy is down, draining or upgradingYes
capacityThe machine that holds the copy had no roomNo
busyToo many briqs were starting from this volume there at onceNo
stackThe briq joined a stack that runs on another machineNo
sizeA larger copy was published while this briq was being admittedNo
unsupportedThis environment has no named volumesNo

A briq that starts empty and does not publish leaves the volume where it is, so one busy moment does not move it. A lost volume is made again by the next publishing briq.

Publish

Every later briq that names it reads what a publishing briq wrote. Whoever sets publish decides what later briqs read.

  • A briq that starts from a name without publish only reads. What it writes goes away with it.
  • Keep credentials off the volume: only data you want every later briq to read belongs on the mount.

A publish needs a clean stop. A destroy call stops the briq first, and the volume is published only when that stop is clean. Otherwise the briq is destroyed without publishing.

  • briq_destroy with publish: false skips the publish.
  • onExit: destroy publishes only after exit code 0.
  • A briq that went to sleep does not publish.

The last publish wins. Two briqs that finish together each publish, and the later one is the copy.

Once a briq that asked to publish is destroyed, its volume.from.published says what came of it:

{ "generation": 13 }
{ "generation": null, "reason": "unclean" }
reasonMeaning
uncleanThe briq did not stop cleanly, for example it was asleep
refusedThe machine refused or could not publish it
skippedIt started empty by placement, exited non-zero under onExit: destroy, or was destroyed with publish: false
staleA later publish already held the copy, or the briq started before the volume moved machines
deletingThe volume was being deleted

How long a volume lives

Idle limit7 days by default, 1 to 30 per volume (idleDays). A restore or a publish starts the count again
AttachedA volume is never deleted while a briq is attached to it
Deletebriq_volume_destroy, or the dashboard. The volume is deleting at once: a briq that names it starts empty
Not a backupA volume can be lost with its machine. A lost one starts the next briq empty, and nothing restores it

A volume never shrinks. A briq that asks for more gb than the volume has gets the larger volume, and its publish keeps the larger size. A volume counts toward the team's disk from its first publish until it is deleted or lost. A deleting volume counts only while its copy is still on a host, and a lost one holds no disk. Every briq not destroyed holds its own copy too, stopped and failed ones included. A volume deleted while a briq that started from it is still running keeps counting until that briq is destroyed and the machine confirms the delete.

Limits

  • A briq with from cannot be forked.
  • from and publish are for an image run. A recipe mounts its own volume, and a recipe run that sends them is refused.
  • A volume with copy: "never" takes neither from nor publish.
  • A volume lives in one region. A briq placed in another region starts empty.

Manage volumes

SurfaceListDelete
MCPbriq_volumesbriq_volume_destroy
CLIbriq volumesbriq volume-destroy <name or id>
RESTGET /v1/volumesDELETE /v1/volumes/:id
SDKclient.volumes.list()client.volumes.delete(id)
Pythonclient.volumes.list()client.volumes.delete(id)
DashboardVolumesDelete in the row

A volume shows its name, size, state, generation, last use and expiry. pending is a name a briq that asked to publish was created with, and that has no copy yet. A sandbox credential cannot list, name or delete volumes.

On this page

Free to try

Try briq, on us.

Every new account starts with €10 of credits. No card.

Start building

How can we help?

Message to the briq team