Using bay
Executors
The executor finishes each landing after the agent leaves.
bay is in development. These pages describe bay as it will ship.
bay land returns at once with an operation id. An executor then runs that operation to an outcome. It claims the operation, runs the required checks, and lands the candidate on trunk. It signs the landing commit with its own executor key. When it cannot land, it records a refusal with a reason and a next step.
Run the local executor
bay executor run drives queued operations on one machine. It makes a pass every 10 seconds by default. --once makes one pass and exits. Run it under a supervisor that restarts it.
bay executor run # a pass every 10 seconds
bay executor run --interval-s 30 # a pass every 30 seconds
bay executor run --once # one pass, then exitRun at least two
One executor is a single point of failure. Run at least two, so that one can take over from the other. An owner renews its claim with a heartbeat, every 10 seconds by default. After 60 seconds with no heartbeat, another executor can claim the operation. A replaced executor can never land that operation. After a reboot, an executor waits one full lease before it claims.
Operation states
An operation moves through submitted, admitted, running, checked and published. It can also end as blocked, failed or superseded. Each step is a commit in the change chain, so bay status reads the true state.
The external executor contract
A CI system or a queue host can act as an executor. It implements five actions that read and write JSON. No agent types these actions.
| Action | Input | What it does |
|---|---|---|
submit | op id, attempt id, request digest, candidate | Idempotent. The same op id and request digest return the existing job. A different digest under one op id is refused. |
inspect | op id | Returns the durable job id, its owner, its state, and the receipts so far. |
resume | op id | Reconciles an interrupted job with the work already done. Never repeats a finished check unit. |
cancel | op id, reason (cancelled or superseded) | Records the request and reports whether the landing already happened. An executor that no longer owns the job must not land. |
complete | op id | Returns the evidence for the exact candidate and the inputs it actually used. |