orca worker-token create --pool bgent [--days N] [--label L] prints the token once
orca worker-token list id, pool, label, worker, last seen
orca worker-token revoke <id>
A pipeline placed worker:<pool> (placement in orca.toml, or orca register --placement worker:<pool>) has its runs started by a worker of
that pool (orca worker, orca.worker), never by the scheduler, which
keeps them queued, held "waiting for a worker of pool <pool>", requeues
one whose heartbeat went stale (a worker that died, or a laptop that went
to sleep) as it would start any dead run again, and fails one that has no
retries left. A run whose worker is gone (not seen for half the stale
limit, or seen since without it) is queued again whatever its trigger. A
pipeline with fills = "all" has its fill runs queued the same way, held
for a worker, at most fill_max_runs of them queued or running across the
pool (orca.fill).
Tokens. A worker token is an API token (orca.tokens: orca_ and 64
hex digits, kept only as its SHA-256), in orca.workers rather than
orca.api_tokens, scoped to one pool: it can claim that pool's runs and
make the store calls of the runs it claimed, and nothing else; a user's
token gets nothing here, and a worker token gets nothing elsewhere. It
lasts --days (default and at most ORCA_WORKER_TOKEN_DAYS, 365). A
revoked token stays listed, as revoked, and is answered 401.
The API (orca.api.worker): /api/worker/claim, the worker's
heartbeat and its claims; /api/worker/release, a run it won't start;
/api/worker/exited, a run's process ended; /api/worker/store/<call>,
store_call, a RunStore call of a run it claimed.
A claim takes, under its pipeline's lock, a queued run whose pipeline isn't
paused and has fewer than max_runs live runs (a fill run: fewer than
fill_max_runs running fill runs, inside its fill_window, with fills on),
its other runs before its fill runs (the oldest of each pipeline's, so one
pipeline's queue at its cap never holds up another's), and starts it as the
scheduler starts a run: running, owner worker, no heartbeat yet (the
run's process claims it, within the start grace), one more start. Each
claim is a row of orca.audit (user worker:<label>, source worker).
Versions. A run needs its pipeline's image (--image, image in
orca.toml) to be the worker's (ORCA_IMAGE), both empty included: a worker
of another image isn't given it, and it stays queued, held saying why. The
worker checks the spec again before it starts anything (orca.worker).