Skip to content

fleet.jsonl: learner id as island_id, chunked copy into the run store - #910

Merged
michaellchung merged 4 commits into
mainfrom
own/fleet-log-store
Nov 26, 2026
Merged

michaellchung merged 4 commits into
mainfrom
own/fleet-log-store

Conversation

@michaellchung

@michaellchung michaellchung commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two gaps of the launcher's fleet.jsonl (own-cluster acceptance G-M4 and G-M3).

island_id is the learner id (G-M4). An island launch of a fleet launched island by island (fleet.launch: per_island) runs one island, island 0 of its launch (<prefix>-l0-<cloud>), so every record of such a fleet had island_id 0 and did not match the learner ids of the syncer tape; the dashboard folded every island of the fleet into island 0. The launch now passes its fleet learner id (--rl-fleet-learner-id) to the fleet log (FleetLog meta learner_id, used for island_id; no new record field). Every other launch keeps the -l<m> index of the island name, as on main. The reducer groups fleet records by island_id first, so the per-island records now land on the learner's island next to its tapes (test: two island launches fold into islands 0 and 1).

fleet.jsonl in the run store (G-M3). The file lived only on the host running the launch: a control plane that moved split it over two hosts, and a lost host took its part with it. A launch that keeps its island records in the run store (an island fleet, or --island-lifecycle on with --rl-checkpoint-store) now also copies the file there in chunks, reusing the tape uploader (TapeUploader gains an optional prefix, default tapes, keys unchanged):

fleet/log/<lane>/<host>-p<pid>-<nonce>-<UTC start>/<seq>.jsonl

lane is l<k> for the island launch of learner k and fleet for a whole-fleet launch; each launcher process writes its own folder (the random nonce keeps two launchers of one host apart, even with the same pid in the same second). Only this run's part of the local file is copied: fleet.store.json next to it records the run (the run registry's started_at, new for each run of a name), the store and the start offset. A restarted launcher of the same run for the same store goes on from that offset; any other launch starts at the file's end. A launch that does not copy the file (no store, no island records, or the copy turned off) voids an existing record (no store, the file's end), and yeto down copies the island_stop lines it appends for islands a killed launcher left open only into the store the record of this run names, so a run's lines never reach another run's store. A run directory that never had a record gets none. The fleet log is built before the fleet controller, so its copy is stopped even when the controller cannot be built. The copy is observation only: failures are rate-limited WARN lines and are retried with the next chunk, and the launcher's end waits at most 15 s for the final upload. A launch without island records (one trainer island, the customer path) uploads nothing.

Readers: yeto dashboard serve|export --store read every folder next to the island tapes (a record also present in a local fleet.jsonl counts once), and python -m yeto.dashboard.fleet_store merge --store URI [--fleet-log PATH]... writes one time-ordered, de-duplicated fleet.jsonl for tools that read the file.

The reducer (Reducer._feed_fleet, a minimal block) folds the records of one source (one local file, one launcher folder) in write order, as on main, so a host clock stepped back by NTP folds as before. A record older than the newest record of another source (a lost host's copy read after the newer host's) replays the island's lifecycle in that order: it adds its closed ready -> lost intervals and does not reset the island's current state; each shape field follows the newest record that names it. In-order streams fold exactly as before. Known limits, documented in the code and docs/DASHBOARD.md: records of two sources with the same time_unix fold in read order, and a whole host's copy read after the newer host's costs a quadratic replay (10k lifecycle records of one island: some seconds, once per reader start).

Note for the PRs that touch Reducer._feed_fleet after this one (#891, #901): straggler, spare and node-health events must return before the life insort.

No dashboard page change (same views, more complete data). Not touched: topology_diloco.py, fleet_islands.py, static/*.js, yeto/launch/fleet.py. Small edits in yeto/launcher.py (pass the store objects to the fleet log; close it at the end).

Tests

  • tests/test_fleet_log_store.py: a launch without a copy between a copy into S1 and yeto down (S1 gets nothing of the later run), a record left by another run (yeto down and the next launch ignore it), S2 -> no copy -> S2 (the middle run's lines stay local), a restarted launcher of the run, the copy turned off, no record written for a run directory that never had one, a clock stepped back in one file (as main, also when another host's records are replayed after it), a late record of another source replayed at its place, learner id vs name index, record shape unchanged for a single-island launch, store copy keys and bytes, failing store is a WARN only, rate limit, interval 0 / explicit interval, a moved host (local file of the new host only, store with both: the island runs, the old interval is billed), folder stamps 2 h off, lifecycle independent of read order, same host/pid/second folders and per-folder cursors, reused run directory, yeto down copy (store, local-only, failing store), store status, merge CLI, concurrent writer and uploader.
  • tests/test_fleet_log_store_launch.py: launcher.run() with island records leaves the full fleet.jsonl in the store; without island records nothing is uploaded; a controller that cannot be built still gets the copy stopped; every customer K3.1 run keeps no island records (no upload); default tape keys unchanged.
  • Mutation testing (this round): 23 mutants (run check at start, run equality, unknown run, run check in yeto down, void only an existing record, void offset, never void, launch voids, launch passes the run, yeto down passes the run, run identity, per-source order, per-source time, replay gate, replay times, shape times, no replay, shape gate, copy start offsets, launch offset, yeto down copy, record check), all killed; the earlier 31 still apply or were adapted to the rewritten code, all killed.
  • Mutation testing (earlier rounds): 31 mutants (learner id fallback, launch wiring, store copy gate, final close, key prefix, readers, rate limit, dedupe, ordering, status sums, lane rules, merge failure, CLI wiring, island lifecycle threshold, default prefix, folder nonce, out-of-order replay, shape field times, copy start offsets, yeto down copy, controller-failure close, interval check, status last_ok_at / last_error), all killed.
  • Full suite in 4 shards locally (one process per shard, this round, rebased on main): 18292 passed, 377 skipped, 11 xfailed, 0 failed. A first run of shard 1 had 6 failures: one test of this PR compared two store folders in key order, and the folder names carry a random nonce (fixed: it compares the folders as a set; 6 runs in a row pass), and 5 tests/test_node_lease.py probe tests that saw a yeto-ssh-sampler:run-a: process of another test session on the same machine (they pass on rerun, on this branch and on main).
  • Goldens: test_k31_customer_plan_golden + tests/golden/breakers 52 passed, golden files unchanged.
  • customer dry-run diff: none (examples/k31 run*.json through yeto run up --dry-run with the trainer launch rc=0, and the pool dry-run, against origin/main)

🤖 Generated with Claude Code

michaellchung and others added 4 commits November 27, 2026 02:57
An island launch of a fleet launched island by island runs one island, island 0
of its launch, so every fleet.jsonl record of such a fleet had island_id 0 and did
not match the syncer tape's learner ids. The launch now passes its fleet learner
id (--rl-fleet-learner-id) to the fleet log; every other launch keeps the -l<m>
index of the island name.

fleet.jsonl lived only on the host running the launch. A launch that keeps its
island records in the run store now also copies the file there in chunks
(fleet/log/<lane>/<host>-p<pid>-<UTC start>/<seq>.jsonl, one folder per launcher
process), reusing the tape uploader. Upload failures are rate-limited WARN lines
and never reach the launcher; the final upload at the end is bounded to 15 s.
Launches without island records (one trainer island) upload nothing.

dashboard serve/export --store read every folder next to the island tapes (each
record folded once, also against a local fleet.jsonl), and
python -m yeto.dashboard.fleet_store merge writes one time-ordered, de-duplicated
fleet.jsonl from the store and local copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…load); default tape keys unchanged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Folder names carry a random nonce before the UTC start: two launchers of one
  host with the same pid in the same second write two folders (the dashboard
  keeps one cursor per folder).
- The dashboard folds an island's fleet lifecycle records by their own time:
  an older host's records that arrive after the newer host's (store copy read
  after the local file) add their closed intervals and no longer reset the
  island's state; each shape field follows the newest record that names it.
- yeto down copies the island_stop lines it appends into the store (same lane,
  WARN on failure).
- The fleet log is built before the fleet controller, so its store copy is
  stopped even when the controller cannot be built. fleet.store.json records
  the store and the start offset of the copy: a run directory reused by a run
  with another store starts at the file's end.
- An explicit upload interval must be positive; the store status of the two
  readers reports the oldest clean poll.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rce in write order

The copy record (fleet.store.json) now names the run it belongs to (the run
registry's started_at, new for each run of a name). copy_start resumes only
for the same run and store; yeto down copies its island_stop lines only into
the store the record of this run names. A launch that does not copy the file
(no store, no island records, the copy turned off) voids an existing record
(no store, the file's end), so a later yeto down or launch never puts its
lines into an earlier run's store. A run directory that never had a record
still gets none.

The reducer folds the records of one source in write order (a clock
stepped back in one file folds as on main) and replays an island's
lifecycle only for a record older than the newest one of another source.
The replay cost and the same-time tie across sources are documented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaellchung
michaellchung merged commit c78adf4 into main Nov 26, 2026
7 checks passed
@michaellchung
michaellchung deleted the own/fleet-log-store branch November 26, 2026 20:28
michaellchung added a commit that referenced this pull request Nov 26, 2026
…fewer look-alike hints; quoted preflight command (#925)

* run up: print the dry run's cluster preflight command quoted

The command run up's dry run prints was joined with spaces; an argument
with a space or a shell character (an inventory path, say) did not paste
back as one word. It is shlex.join'ed now, as the launch gate already does.
The customer K3.1 dry runs print the same line (nothing there needs quotes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* exact_argparse: offer a spelling only at difflib similarity 0.8

0.6 offered look-alikes: --rl-max named --rl-image (0.78) next to the
--rl-max-* options it is a prefix of. 0.8 keeps typos such as --modle
(--model, 0.86) and --rl-imgae (--rl-image, 0.9).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Every argparse entry point under yeto/ takes full option names only

The command tree, the NC pool tool and the Miles island moved to
ExactArgumentParser in #904; the module entry points did not. The 62
modules that build a parser (node-side ones whose argv the launcher
renders: engine sampler, init_from_release, tape_upload, store_dispense,
role_switch, controller, health readers, spot watchdog, ssh_harness,
learners, exporters, ...) now build an ExactArgumentParser; their
sub-parsers inherit it.

weights_sync.py and preflight/bench.py run as single files on a node
(no yeto package there): they keep argparse and set allow_abbrev=False
on the parser and, through parser_class, on every subcommand.

Tests: every parser under yeto/ is exact (a plain ArgumentParser fails),
the two standalone tools refuse a prefix in a subcommand, and error()
replaces argparse's "unrecognized arguments" message only (another
error, a caller's look-alike message and parse_known_args stay as they
were); look-alike options are not offered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* codepack: keep stdlib argparse (a node imports it from a partly unpacked pack)

PACK_FETCH_PY puts the pack's yeto/ files on sys.path and imports
yeto.codepack before the tree is unpacked and verified; its contract
(test_rl_ssh_resident's tiny pack of __init__.py + codepack.py) is a
module with no top-level yeto import. It keeps argparse and sets
allow_abbrev=False on the parser and its subcommands, like the two tools
shipped alone to a node; the coverage test names it with them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fleet_store: its merge CLI takes full option names too (new since the switch, #910)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
michaellchung added a commit that referenced this pull request Nov 26, 2026
Since #910 a fleet's island records come from several sources (a host's file
and the store copies) and fold by their own time. The straggler mark follows
the newest mark event by its source's time: a clear read before the report it
closes, or a report twice, ends as the newest says; one source's clock stepped
back folds in write order; the lifecycle replay leaves the mark alone. The mark
lands on the island of its learner id.

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