Skip to content

gateway: GET /v1/berth/board reads the node in one call - #142

Merged
T-Crypt merged 1 commit into
mainfrom
T-Crypt/gateway-board
Oct 22, 2026
Merged

T-Crypt merged 1 commit into
mainfrom
T-Crypt/gateway-board

Conversation

@T-Crypt

@T-Crypt T-Crypt commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Step 3 of the switchboard plan: the read side the phone board will draw.

Change

GET /v1/berth/board (keyed) answers one node:

{name, reachable, cards: [{index, name, state, total, used, holders}],
 engines: [{name, gui, api, launch, state, message, detail, code, card, stoppable, models: [{id, loaded}]}]}
  • Card state: free, held, draining, passthrough (in a VM) or probe-failed.
  • Engine rows are the /gui/ board's rows, plus stoppable (holds the card under an active lease that isn't pinned) and its models: the engine's own list while it is up, its serves otherwise. A model's loaded comes from berthd's engine reader, which for llama-swap reads /running.
  • Built in the gateway because only the gateway knows about a start that is still in flight. The harbor will read this endpoint with the node key and, in the fleet, merge one board per node.
  • guiStateAll becomes guiRows(ctx, node), so the board and /gui/state share one berthd status read.

Proof

  • TestBoard: idle node (card free), then a switch. The card becomes held by strata/active, strata is up and stoppable with its model, and a stopped comfyui is launchable but not stoppable, with its serves.
  • TestBoardOf (table): berthd unreachable, held with one llama-swap model ready and one starting, a pinned game (not stoppable), draining, and in a VM.
  • build, gofmt, vet, go test ./..., Windows build and vet, golangci-lint (0 issues), -race -count=3.

Not run against the live gateway, for the same reason as #141.

The switchboard's read side: the card and who holds it, every engine in
berth.toml with its state and whether it can be switched to or stopped,
and each engine's models with the ones its reader reports loaded. The
gateway builds it because it alone knows a start in flight. Cards is a
list and every engine row names itself, so more cards and more nodes add
rows to the same shape.
@T-Crypt
T-Crypt merged commit 0d8e42b into main Oct 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant