Briq
One running OCI image on its own microVM.
A briq is one OCI image running on its own microVM, with an internal address, optional ports and volume, a size, and a sleep window.
Fields
| Field | Notes |
|---|---|
id | bq_ and 12 characters, e.g. bq_7kq2m9x1p4ab |
stackId, name | Name: lowercase, digits and dashes, up to 32 characters, unique in its stack |
image | Any public OCI reference allowed by the agent's policy |
cmd, entrypoint, env, ports | As in a container spec. An env value is a string, { secret: NAME } for a generated, write-only secret, or { secret: NAME, value } for a credential you already have, stored encrypted and never shown again. With scope: "boot", a secret for a recipe's boot steps only, never in the environment. Plain values show in status and the dashboard: a credential always goes as a secret. See Secrets |
size | pico, micro, nano, small, medium, large or xlarge. Availability: briq_quota. See Cost |
files | Written before the process starts, and whenever it starts over. See Files |
state | running, sleeping, stopped… See Lifecycle |
stoppedReason, lastExit | Why a stopped or sleeping briq is not running; how its process last exited. See When the process exits |
internalHost | Reachable from any briq in the team |
endpoints | Its URL, once published (expose on briq_run, or briq_expose), and its TCP endpoints (briq_expose with a protocol) |
databasePorts | Its recipe's database ports and their protocol: what to pass briq_expose |
onExit | Explicit image exit policy: retain or destroy. destroy requires no healthcheck. See worker cleanup |
sleep, sleepsAt | Sleeps after this long unused: "30m", "3h", "7d" or "never", a string. Default "1h" on briq.cloud. sleepsAt: when, unless used first. See Sleep |
startedAt | When its current run started: how long it has been awake |
costCentsSoFar | Metered per second while it runs |
A briq spec
Run an image with its own configuration. The CLI accepts structured fields through a stack file.
MCP takes the fields directly; REST takes them under spec.
Save as briq.yaml:
stack: app
services:
db:
image: postgres:16
env:
POSTGRES_PASSWORD: { secret: POSTGRES_PASSWORD }
POSTGRES_DB: app
ports: [5432]
size: small
volume: { mount: /var/lib/postgresql/data, gb: 2 }
healthcheck: { cmd: [pg_isready, -h, 127.0.0.1, -U, postgres] }
sleep: 1hbriq upbriq_run({
"stack": "app",
"name": "db",
"image": "postgres:16",
"env": {
"POSTGRES_PASSWORD": {
"secret": "POSTGRES_PASSWORD"
},
"POSTGRES_DB": "app"
},
"ports": [
5432
],
"size": "small",
"volume": {
"mount": "/var/lib/postgresql/data",
"gb": 2
},
"healthcheck": {
"cmd": [
"pg_isready",
"-h",
"127.0.0.1",
"-U",
"postgres"
]
},
"sleep": "1h"
})curl -X POST https://api.briq.cloud/v1/briqs \
-H "Authorization: Bearer $BRIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"spec": {
"name": "db",
"image": "postgres:16",
"env": {
"POSTGRES_PASSWORD": {
"secret": "POSTGRES_PASSWORD"
},
"POSTGRES_DB": "app"
},
"ports": [
5432
],
"size": "small",
"volume": {
"mount": "/var/lib/postgresql/data",
"gb": 2
},
"healthcheck": {
"cmd": [
"pg_isready",
"-h",
"127.0.0.1",
"-U",
"postgres"
]
},
"sleep": "1h"
},
"stack": "app"
}'With a healthcheck, the briq is running only once the command succeeds. Without one, running
means the process started: if it exits a moment later, the briq stops and its status says how (see
Lifecycle).
A probe should ask 127.0.0.1, not localhost: inside a briq, localhost is ::1, which a server
listening on IPv4 only refuses.
Files
files puts files in place before the process starts: your app's sources, a config file. Text
goes as it is, binary as { "base64": "…" } (padded, on one line; base64 whose length shows it
was cut short is refused); 256 KB in all.
cat > server.py <<'PYTHON'
from http.server import HTTPServer, SimpleHTTPRequestHandler
HTTPServer(("0.0.0.0", 8080), SimpleHTTPRequestHandler).serve_forever()
PYTHON
briq run python:3.12-slim --name web --file /app/server.py=./server.py \
--cmd 'python /app/server.py' --port 8080briq_run({
"name": "web",
"image": "python:3.12-slim",
"files": {
"/app/server.py": "from http.server import HTTPServer, SimpleHTTPRequestHandler\nHTTPServer((\"0.0.0.0\", 8080), SimpleHTTPRequestHandler).serve_forever()\n"
},
"cmd": [
"python",
"/app/server.py"
],
"ports": [
8080
]
})curl -X POST https://api.briq.cloud/v1/briqs \
-H "Authorization: Bearer $BRIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"spec": {
"name": "web",
"image": "python:3.12-slim",
"files": {
"/app/server.py": "from http.server import HTTPServer, SimpleHTTPRequestHandler\nHTTPServer((\"0.0.0.0\", 8080), SimpleHTTPRequestHandler).serve_forever()\n"
},
"cmd": [
"python",
"/app/server.py"
],
"ports": [
8080
]
}
}'They are written again whenever the process starts over (a restart, a cold start), so the spec
stays their source of truth: an edit made inside the briq to one of them lasts until then. A
resume from a memory snapshot is not a start over: the process carries
on where it was, files included. A fork gets them too. For anything
bigger, fetch it from inside the briq (git clone, curl).
- Paths are absolute, without
.or..segments:/app/server.py, notserver.py. - 64 files and 256 KB in all.
- Status lists them by path and size; their content is not shown again, and the audit log records the path and size only.
briq_files_puton one of them answers with a warning: the change lasts until the next start.
Disk
A briq keeps its disk. Files written anywhere in it, by its process, briq_exec or
briq_files_put, are still there after a stop, a start, a restart or an expose. A destroy removes
them.
A volume is the durable part: use one for data you cannot afford to lose, such as a database's
files. Its size is gb, 2 by default and up to 500, set at creation and counted toward your
plan's disk; a recipe takes volume: { gb }. The rest of the disk can be reset
to the image during the provider's host maintenance, and a fork copies the
volume only.
What a briq is not
- Not a container on a shared kernel: each briq is a Firecracker microVM.
- Not a place for data you cannot lose outside a
volume, and nothing survives a destroy. - Not reachable from the internet until you publish it (
exposeonbriq_run, orbriq_expose).