Skip to content

dashboard: spare nodes and node health of resident ssh trainer islands (own-cluster 4.5) - #901

Open
michaellchung wants to merge 2 commits into
mainfrom
own/island-spares-dash
Open

michaellchung wants to merge 2 commits into
mainfrom
own/island-spares-dash

Conversation

@michaellchung

@michaellchung michaellchung commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Own-cluster fleet stability task 4.5: the dashboard shows the spare-node state and node health of a resident ssh: trainer island. Rebased on main (after #885 spares backend and #910 fleet.jsonl store copy). Two commits: the feature, then the REV-901c review fixes.

What the page shows

  • Trainer card (topology)
    • Waiting for a spare node: the phase line waiting for a spare node | <how long> (warn; no second badge saying the same) and a line saying why no spare is free, what to act on first (gpu-e: lease held by run ... | no free spare in rack-b, placement reason kept).
    • Past fleet.waiting_absent_after_s (plan, default 1 h): waiting for a spare node | counts as absent (warn).
    • Past --spare-max-wait-s (the island record's, default 24 h), or no record or event reporting the wait for 1 h 12 min (the hourly wait report, two health periods and 10 min): the wait is not believed; the island reads lost (expired) or unknown (unreported), with the dashed box, the lost badge and the reason in red.
    • node x badge (bad) and the reason line (gpu-d: GPU 3 XID 79, the reason in red) for a node whose health check turned lost. One bad check is the reason as a warning, no badge. A check without reasons reads in words (health bad in 2 checks in a row, health unread, health unread (stale)).
    • replaced Nx | gpu-d -> gpu-e | 2m41s ago once a spare took a node's place; the reason it gave up (replacement limit, given-up wait) in red.
    • Trainer tip: every unhealthy node, the wait (how long, the whole reason, absent / not believed), the lost nodes, the last replacement (names, resume step, when) and the 24 h count against the limit. On a 400 px touch page this is where the whole reason is read.
  • Syncer: a trainer waiting for a spare or replacing a lost node is out of the roster; the roster is then in the warning colour (bad only for a real loss), and the layout line counts trainers the same way (1/2 trainer(s) live (1 replacing a lost node)).
  • Islands now: the mark (waiting spare 1m36s, | counts as absent past the absent limit, or node x) in place of the trainer row's status. The reason has its own Nodes column, added only on a page with such an island (every other page keeps its columns): one line cut by the column's width with an ellipsis, the whole on hover. An island that ended has no mark.
  • Event stream: island_node_lost (lost), island_waiting_spare (wait, or stop when given_up), island_node_replaced (swap), island_replacement_limit (max), node_health* (node), each with its own fields. A field over 80 characters is cut with an ellipsis; the line's hover has the whole fields.
  • Card, tip and table measure a wait or a replacement against one time (the snapshot's time offline, the topology clock live).

Data

  • fleet_islands._trainer_records passes the record's spares (with its updated) and health only when the record has them, read defensively. The island record's spares now carries max_wait_s (--spare-max-wait-s); the plan's roster.waiting_absent_after_s is read when the plan sets it.
  • Node health: only the island's current nodes (spares.nodes; a node a spare replaced is gone). The stale rule (a check older than 3 periods before the record's own write reads health unread (stale)) applies only while the island runs: checks stop on purpose while it recovers, so a waiting island keeps its lost node's lost | GPU 3 XID 79.
  • A relaunch on the same nodes keeps the old job's checks (reset: true) until the new job's first check. FleetController._health_key now counts reset, so that first check writes the record again: a healthy running island no longer reads stale for good.
  • A later wait or a replacement ends an earlier give-up (stopped); a running record shows none.
  • An island that ended (done / failed / stopped) shows no health and no wait; a finished run shows no badge. The card merges the record (wins) with the fleet.jsonl events (fallback, and the names of the last replacement).

Ordering guard (same as #910 M2)

  • Spare-node events fold in replay order: by time_unix across sources, in write order within one source (a line never goes before an earlier line of its own source, even with an older time; an untimed line keeps the time of the line before it).
  • A record that sorts before one already folded (a lost host's store copy read after the new host's records) replays the island's spares mark from its records; in-order streams fold as before.
  • In Reducer._feed_fleet, spare-node and node_health* events return right after self.island(iid), before fleet.jsonl: learner id as island_id, chunked copy into the run store #910's shape fields and lifecycle insort: they are neither a sign of life nor a lifecycle state.
  • Spare-node events are now fleet records (before, they fell through to learner records). tests/test_fleet_log_store.py::test_the_moved_host_s_island_is_running_with_the_lost_host_s_history now asserts every fleet.jsonl record of both hosts once, the spare-node events included; its lifecycle assertions are unchanged.
  • Known limits, documented in docs/DASHBOARD.md next to the fleet log's: a host clock behind by more than the gap between two hosts' records can show a replaced island still waiting; two hosts' events with the same time_unix fold in read order. The island record in the run store wins over the events either way.

REV-901c review fixes

  • M1 (relaunch on the same nodes reads stale for good): _health_key counts reset; stale applies only while running. Test: tests/test_dashboard_island_health_relaunch.py (the review's counterexample, asserting the fixed behaviour; fails on the old key).
  • M2 (a wait masks a loss): absent / expired / unreported as above, one test each (plus the plan's own limit, the record's own max wait and an events-only wait).
  • L1 waiting island keeps the lost node's reason; L2 replaced nodes not shown; L3 give-up cleared by a later wait or replacement and ignored on a running record; L4 / L5 documented.
  • Mutation gaps: M05 (the earliest wait start is kept) and M11 (a fresh failure still live on its tape is out of the roster by its wait alone) now killed.
  • Visual: reason column by available width with hover (Nodes), key info first, no duplicate wait badge, roster warn colour and one count with the layout line, one time for card / tip / table, full-height 400 px screenshots.

Tests

  • tests/test_dashboard_island_spares.py (65 tests) and tests/test_dashboard_island_health_relaunch.py (2): reducer folds and record precedence, replay order, no shape field or lifecycle state from spare / health events, stale / ended / relaunched / recovering health, replaced nodes, give-ups, long waits, roster and layout counts, defensive reads, no new field on any of the 9 customer dashboard fixtures, and node-smoke renders of the card, tip, Islands now and event stream.
  • Mutation testing: 51 mutants of this PR (the first round's 21 plus 30 for the review fixes), all killed; the review's own script: every mutant that applies to the new code (19) killed, and its M06 / M10 / M11 (code restructured) covered by equivalents above.
  • Full suite, 4 shards, one process each, on the final head: 18700 passed, 377 skipped, 11 xfailed, 1 failed (run on the review-fix head before the last rebase onto two unrelated main commits). The failure was test_exact_option_names.py::test_every_entry_point_under_yeto_parses_full_names_only on yeto/node/smoke.py, which failed on main too and is fixed on main by node smoke: take full option names only (fixes main's exact-parser coverage test) #927; it and this PR's suites (186 tests) pass on the final head. Reported, not re-run.
  • Customer gate:
    • Goldens: test_k31_customer_plan_golden + tests/golden/breakers: 52 passed on both sides, golden files unchanged.
    • examples/k31 dry-runs (yeto run up --dry-run, full plan, trainer launch rc=0) and the pool dry-run: line-for-line identical to main after normalization (5 outputs and the preflight logs; only the known offline model_pull / sandbox status failures).
    • Customer pages: the 9 dashboard fixtures, full page at 2540 / 1920 / 1440 / 400 against main with fixture mtimes aligned: 34 of 36 pairs pixel-identical in the first pass; breakers_r2_healthy at 400 px identical in two reshoots of both sides; breaker_stop at 400 px has two possible captures on either side (main against main differs too, at the page's last panel); both sides produce the same two images.
  • Screenshots of a synthetic two-island fleet (normal, lost node, waiting, replaced, waiting past the absent limit, past --spare-max-wait-s, unreported) at 2540 / 1920 / 1440 / 400, full height: no horizontal overflow, no NaN / undefined / null on the page; reviewed for proportion with the rest of the page, redundant labels and corner radii.

Notes (not changed here)

  • On main, the diloco fixture's breaker rate scope (breakers.layers[0].rows[2].acted.rate.scope) depends on PYTHONHASHSEED (island 0 or island 1); identical on both sides for a fixed seed.
  • tests/test_dashboard_island_join_leave.py sets the mtime of the lora_ended fixture's teardown.json in the repository tree (os.utime), so that fixture's operator_stop time depends on which tests ran before.

🤖 Generated with Claude Code

michaellchung and others added 2 commits November 27, 2026 06:41
…s (own-cluster 4.5)

A resident ssh: trainer island with spare nodes now shows on the page:

- trainer card (topology): a "waiting spare" badge, "waiting for a spare node | <how long>"
  and why no spare is free; a "node x" badge and the reason ("gpu-d: GPU 3 XID 79") of a
  node whose health check is lost (one bad check: the reason as a warning, no badge);
  "replaced Nx | old -> new | <ago>" once a spare took a node's place; why the island gave
  up (replacement limit, given-up wait). The trainer tip lists every unhealthy node, the
  wait, the lost nodes, the last replacement and the 24 h count against the limit.
- Islands now: the mark in place of the trainer row's status, the reason in its last cell
  (one line, the whole on hover).
- event stream: island_node_lost, island_waiting_spare, island_node_replaced,
  island_replacement_limit and the node_health events; a field over 80 characters is
  cut with an ellipsis, the whole fields on the line's hover.

The island's record (spares / health in fleet/trainers/<k>/state.json) wins over its
fleet.jsonl events; the events alone mark the card when there is no record. A node
check older than three periods before the record's own write reads as stale; an island
that ended shows no health and no wait. A trainer waiting for a spare or replacing a
lost node is out of the syncer roster and is not drawn as a lost trainer.

The spare-node events fold in replay order: by time_unix across sources, in write
order within one source; a record that sorts before one folded already (a lost host's
store copy read late) replays the island's mark. Spare-node and node health events
return before the island's shape fields and lifecycle: they are neither a sign of life
nor a lifecycle state. They are fleet records now: the moved-host test of the fleet
log store expects every fleet.jsonl record once, the spare-node events included.

An island without spare nodes or health checks gets no new field: every customer page
is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es column)

- A relaunch on the same nodes no longer leaves a healthy running island reading
  "health unread (stale)" for good: the node checks kept over the relaunch carry
  reset: true and FleetController._health_key counts it, so the first check of the new
  job writes the record again. The page applies the stale check only while the island
  runs (checks stop on purpose while it recovers): a waiting island keeps its lost
  node's "lost | GPU 3 XID 79".
- A wait for a spare node no longer masks a loss: past fleet.waiting_absent_after_s
  (plan, default 1 h) it reads "waiting for a spare node | counts as absent" (warn);
  past --spare-max-wait-s (now on the island record, default 24 h) the island reads
  lost, and with no record or event reporting the wait for 1 h 12 min (the hourly
  report, two health periods and 10 min) it reads unknown; both restore the dashed box
  and the lost badge.
- Health checks show only the island's current nodes (a node a spare replaced is gone).
- A later wait or a replacement ends an earlier give-up; a running record shows none.
- Islands now: the reason moves to its own Nodes column (only on a page with such an
  island), cut by the column's width with the whole on hover; what to act on (the
  skipped nodes and why, e.g. a lease) comes first. The card's wait is its phase line
  only (no second badge). The syncer roster of an island waiting for a spare is a
  warning, and the layout line counts trainers the same way. Card, tip and table
  measure a wait against one time.
- docs/DASHBOARD.md: the clock skew and same-time limits of the spare-node events,
  next to the fleet log's, and how long waits read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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