run · PENDING
run · PROVISIONING
run · RUNNING
run · COMPLETED
CallerCLI or HTTP clientignitify task:run resize
--payload '{"width":800}'
--wait
Public ingressTLS ends here
Load balancertwo brains
Brain 1a peer
Brain 2a peer
PostgreSQL
run 019a3f6e…PENDING
run 019a3f6e…PROVISIONING
run 019a3f6e…RUNNING
run 019a3f6e… · result storedCOMPLETED
quota of the tenantchecked under a lock
host capacityreserved under a lock
progress of the run{ "percent": 40 }
usage row of the runsettled by a trigger
the answer · 201
run_id
019a3f6e-7c21-7b4e-9d05-3f1a2b6c8e40
resource_id
run_7Kp2mQx9LwZd
status
PENDING
the caller reads
Run COMPLETED
Result:
{ "ok": true, "width": 800 }
Callback URLsigned POST · run id and status
brain 1 · before the transaction, in this order
1 · API key
2 · plan of the tenant
3 · request body
4 · capability and limits
5 · monthly limits
6 · deployment is built
brain 1 · one locked transaction
lock for this tenant
quota of the tenant: checked
run written: PENDING
usage row of the run: opened
brain 2 · a warm VM first
looks for PENDING runs: every 2 s
on a warm VM: PENDING → RUNNING
same tenant · same deployment · same boot shape
here: none fits
Host agentthe link to the brains
Host daemonlocal sockets
heartbeat: stops here
Supervisorchild of PID 1
Tenant codeuid 10001
one-shot taskVM destroyed
can be reusedstays warm
HTTPS
mTLS
mTLS · spawn
unix socket
vsock
A caller sends POST /runs, with an API key and a payload.
The call enters at the public ingress, when that door is open. The load balancer gives it to one of the two brains.
The brain checks the API key first. Then come the gates: a capability that the plan does not have stops the run here.
Admission is one locked transaction. It checks the quota of the tenant, writes the run and opens its usage row.
The brain answers at once: 201, the run id and the status PENDING. It does not wait for the VM.
By default, a brain looks for PENDING runs every 2 seconds. First it looks for a warm VM.
A warm VM of the same tenant, deployment and boot shape takes the run with no new boot. Here, none fits.
So the brain picks a host and reserves capacity on it, under a lock. A host is not over-booked.
Then the brain claims the run: PROVISIONING. The claim needs the status PENDING, so one brain wins.
The brain sets RUNNING. Then it sends the spawn order to the host agent, over mTLS.
The agent passes the order to the daemon on a local unix socket. The daemon starts the jailer, which becomes Firecracker.
In the guest, PID 1 starts the supervisor as a child. It dials the host over vsock and asks for work: getPayload.
The request goes to the daemon, to the host agent, to the load balancer, and then to a brain. Any brain may answer.
The answer carries the payload. The tenant code runs as uid 10001, with no new privileges.
A progress chunk is stored on the run. The host agent keeps only the newest chunk. Heartbeats stop at the daemon.
The supervisor sends the result: postResult. It waits for the answer of the brain.
A brain stores the result and sets COMPLETED. The write needs the status RUNNING, so the first end result wins.
With --wait, the CLI reads GET /runs/:id again and again, 0.5 to 3 seconds apart, until the run ends.
A deployment can have a callback URL. It gets a signed POST when a run ends: the run id and the status, not the result.
The VM of a one-shot task is destroyed. A VM that can be reused stays warm. With no work for 30 seconds, it is evicted.