Repository navigation
Site image catalog: pick an ssh island's or pool's image from verified records - #889
Merged
Merged
Conversation
michaellchung
force-pushed
the
own/image-adopt
branch
from
November 26, 2026 08:57
c313c1e to
741d692
Compare
michaellchung
force-pushed
the
own/image-adopt
branch
from
November 26, 2026 10:38
741d692 to
0b29f69
Compare
A site that adopts an image for a model records it in a site image catalog (~/.yeto/site-images.yaml, or the inventory's top-level site_images:). Each record names the model, role, engine, digest, CPU and card architectures, versions, smoke evidence and its status. An ssh: trainer island whose --rl-image and inventory name no image, and an ssh sampler pool node on container.image auto without an inventory image, now take the newest verified-smoke record that fits every node, before the built-in default; the launcher and the pool dry-run print the image and where it came from. A configuration that names its image never reads the catalog, so explicit images (every customer config) are unchanged. A broken catalog is refused when it is read. own-cluster-fleet-stability 7.1, 7.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two image adopt runs writing one catalog could each read the old file and the later rename would drop the other's record. add() now reads and writes under an flock on a lock file next to the catalog, and save() fsyncs the temporary file and the directory around the rename. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- read the catalog for a trainer only when every --gpu entry is ssh:; a mixed fleet takes the built-in default and prints why - a record is one image on one hardware: same_image keys on the CPU and card architectures too - evidence.at must be an ISO-8601 time with a zone; it is read as UTC and records order by the time; a bad one names the catalog and the entry - an ssh sampler pool chooses its images once for all its nodes (a spare starts the same image), keeps them in its state, and the dry-run prints the same choice - YETO_SITE_IMAGES_PATH moves the default catalog; the test home guard points it into the session tree - card_archs are checked against the known architectures; a fallback names the closest records and why they do not fit - ref follows the docker reference grammar; no node matches nothing; the catalog keeps its file mode (a new one is 0644); the model alias is resolved before matching; errors start with "[yeto] site image catalog:" - unknown keys and a newer catalog version are warnings, read as far as they go; the inventory key is checked by node_inventory and reused Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; spares in the trainer match - SshSamplerPoolOps.image_for chooses the pool's images under a lock (double-checked): parallel starts of an IslandPool take one choice, and the kept file names the image the nodes run; it is written through a temporary file of its own (mkstemp in the same directory) and os.replace - the ssh: trainer island's catalog match covers the trainer nodes and every node of a trainer-* role (a trainer-spare starts the island's image) - tests for the kept file never replacing a named image or another model's choice, and for a record of another device family Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michaellchung
force-pushed
the
own/image-adopt
branch
from
November 26, 2026 12:52
0b29f69 to
0970f1e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
own-cluster-fleet-stability tasks 7.1 and 7.4: the site image catalog and the image selection order.
yeto/launch/site_images.py: the catalog (~/.yeto/site-images.yaml,YETO_SITE_IMAGES_PATHoverrides the default, or the inventory's top-levelsite_images:; a relative path is taken from the inventory's directory). A record holds model, role, engine, ref (docker reference grammar, pinned by digest), device family, CPU and card architectures (known values only), versions, evidence (evidence.atan ISO-8601 time with a zone, read as UTC) and status (verified-smoke/retired). A bad record is refused with[yeto] site image catalog: <file>: images[i]: ...; an unknown key or a newer catalogversionis a warning and the catalog is read as far as it goes.addreads and writes under anflockon a lock file next to the catalog, fsyncs the temporary file beforeos.replaceand the directory after, keeps the file mode (a new catalog is 0644) and never overwrites a broken catalog. A record replaces only the one of the same model, role, engine, ref, CPU and card architectures: one image adopted on two kinds of cards keeps two records.match(model, role, profile)resolves the model alias (yeto.models.resolve) and returns the verified records that fit every node (none for no node), newestevidence.at(by time) first, then the later record.select(explicit, model, role, profile) -> (ref, source): explicit, then site catalog, then built-in default; a fallback names the closest records and why each does not fit (SiteImage.problems).ssh:trainer island: only when every--gpuentry isssh:,--rl-imageis omitted and the inventory names no trainer image. A mixed fleet (ssh and cloud islands) takes the built-in default and prints one line saying why. The trainer nodes matched are the inventory nodes with no roles or with a role that istraineror starts withtrainer-, so a trainer spare (trainer-spare) must fit the image too. main has no trainer-spare role yet: the own-cluster spare PR (ssh islands: replace a lost node of a resident trainer island with a spare (own-cluster 4.1-4.4) #885) hooks its role in when it rebases onto this one; the prefix match already covers it.container.image: autonodes without an inventory image. The catalog is matched once against all those nodes of the pool (a spare starts the same image); the pool fixes the choice at its first start, keeps it in its state file next to the pool record (a restarted controller starts the same image) and never re-reads the catalog mid-run;pool --dry-runprints the same choice.tempfile.mkstempfile in the same directory and moved withos.replace. The kept file's key is the model, the engine and the catalog: a kept choice of another model is not reused, and a kept choice never replaces an image the inventory names.--rl-image, inventoryimage/images,container.image) never reads the catalog and prints nothing new. The inventory key is validated innode_inventory.site_images_value, whichsite_imagesreuses (no import cycle).tests/yeto_home_guard.py:YETO_SITE_IMAGES_PATHjoinsSTATE_ENV, so the test session never touches a real catalog.Tests
tests/test_site_images.py(68 tests): schema refusals per key (ref grammar, card architectures, evidence time zone), unknown-key and newer-version warnings, broken catalog prefix, flock across 8 spawned processes and a blocked writer, fsync calls, file mode, two records for two kinds of cards, match priority by UTC time (offsets, sub-second), alias resolution, no-node match, fallback reasons, trainer wiring (site record, default with reason, mixed fleet, explicit / other cloud / no inventory unchanged with a broken catalog present), pool wiring (site record, engine catalog fallback, pool-wide match, choice fixed once and kept across a restart, named images unchanged, broken catalog reported). Added this round: parallel starts choose the pool images once (6 threads at a barrier: one choice, every start gets it); a kept image never replaces a named one and is not reused for another model; a record of another device family does not fit; the trainer match takes trainer spares; the kept file goes through a temporary file of its own (a directory at a fixed temporary name does not break it).Customer gate
tests/test_k31_customer_plan_golden.py,tests/golden/breakers): 52 passed.examples/k31dry-runs (run up --dry-runof both customer run configs with their preflight logs, NC pool--dry-run), normalized, are line-for-line identical to main 61af344. No golden or example file changed.Rebased onto main 61af344 (#882, #883, #884, #887, #896): the inventory knows
images,lease_store,node_health,nodesandsite_images(the unknown-key message of #884's test now listssite_imagestoo), and the pool keeps #883's health wiring and #884'slease_storenext tosite_images.Not merged; part 1 of 3 (7.2 and 7.3 + 7.5 follow, stacked on this branch).
🤖 Generated with Claude Code