Broker probe
agent-board broker probe --config FILE [--apply] checks whether the
inference broker answers and keeps one outage issue open while it does not.
It is tracker's .github/poll/broker.cjs (at bb5a14f, tracker#603) moved
here. A scheduled workflow that can reach the broker runs it, for example
every 15 minutes from the tailnet.
It is still needed beside the pass: a pass that cannot read the
broker's /usage prints one usage error line, counts a failure and paces
on the published snapshot, but opens no issue. The outage issue is what a
person sees, and what poll's brokerOutage reads to give back
fix rounds; the supervisor's broker check reads
the probe workflow's runs.
The configuration, from the caller's default branch; every key is required and no other is accepted:
{"url": "http://broker.example:8080/", "repository": "OWNER/REPO", "label": "outage"}url: any HTTP(S) address on the broker, without credentials. The probe opens a TCP connection, then makes one GET without the token, redirects or an environment proxy, each within 10 seconds. Any HTTP answer, a redirect, 401, 404 or 500 included, counts as reachable.repository: where the outage issue is.label: the issue's label, created if missing. Poll'sbrokerOutagereadsoutage.
With GH_TOKEN, the bot's, it reads the token's login and one page of 100
open issues with the label; a full page stops the probe. Only an issue (not
a pull request) that login opened, whose body starts with
<!-- tracker-broker-outage -->, is the outage issue, as anyone who can
open an issue can copy the label and marker. Then:
| Broker | Outage issue | Writes |
|---|---|---|
| reachable | none | none |
| reachable | open | close it, then comment that the broker is back |
| unreachable | open | rewrite its body with the time |
| unreachable | none | create the label (an existing one is fine), open the issue |
Closing comes first, so a probe that fails between the two writes does not
report the outage again. Without --apply each write is printed as
would: .... The first line is broker: reachable or broker: unreachable;
an unreachable broker exits 1, after the writes, so the run fails too.