Skip to content

image adopt: manifest digest, image probe, fit to the nodes and parallel pre-pull - #893

Merged
michaellchung merged 4 commits into
mainfrom
own/image-adopt-checks
Nov 26, 2026
Merged

michaellchung merged 4 commits into
mainfrom
own/image-adopt-checks

Conversation

@michaellchung

@michaellchung michaellchung commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What

own-cluster-fleet-stability task 7.2: the first four steps of yeto image adopt, each over an existing module (yeto/launch/image_adopt.py).

  1. manifest: split_tagged_ref of name:tag@sha256:... drops the tag, so the repository and the token scope are repository:name:pull. image_manifest gains pin_digest (a manifest HEAD by tag or digest through the same token / Basic flow; a tag is pinned to the registry's Docker-Content-Digest). manifest_status keeps its behavior: the HEAD logic moved into _manifest_head unchanged, with a : separator in messages for a tag. A missing or unreadable manifest stops the adoption before any node is contacted. With YETO_IMAGE_MANIFEST_CHECK=off only a digest is accepted.
  2. probe: the probe node first passes the preflight's ssh, host probe and image-root room checks (new ClusterPreflight.hosts()) and an idle check: compute processes from nvidia-smi --query-compute-apps, amd-smi process / rocm-smi --showpids, the process rows of npu-smi info, and running yeto- containers. A busy node is refused unless allowed (allow_busy, a warning); an unreadable card tool is a warning. The probe then runs the image with the node's container engine (profile.container, docker or podman) and no cards: the built architectures come from torch._C._cuda_getArchFlags(); only when those are empty does it run again with the node's device flags. It reads uname -m, the yeto image lock, Python, torch, CUDA / HIP, the arch list and engine package versions.
  3. fit: every node of the role (spares included). Card architectures follow the CUDA binary compatibility rules: a cubin sm_XY runs on the same major with an equal or higher minor, sm_XYa only on exactly X.Y, PTX compute_XY JIT-compiles forward, compute_XYa only on X.Y, sm_XYf / compute_XYf within the family. A pass by the minor-version rule or by PTX is noted in the fit result and in the record's evidence (compatible by CUDA minor-version rule; the smoke test is the final check); strict_arch (--strict-arch in image adopt: trainer and sampler smoke, the yeto image adopt command and its docs #894) wants the exact cubin. ROCm targets drop their feature suffix (gfx90a:xnack-). A mismatch names the rule. The node's architecture is its profile's card_arch (an inventory may set it). Also checked: CPU arch, device runtime, the trainer floor (trainer_image_check.image_problem), a catalog sampler image's record (engine_images.image_mismatch), the role's engine package, and a probe node of no known architecture (refused).
  4. pull: ClusterPreflight.pull() runs ssh and host probes on every node, and only when none fails ssh / host_probe / disk_images (--min-image-free-gib, default 120) runs the parallel pull. The nodes are grouped by their container engine (profile.container): docker nodes are pulled with docker pull, podman nodes with podman pull, and the disk check of a podman node measures podman's storage (podman info graphroot; the fix text points at graphroot in storage.conf). A graphroot that podman info does not print, or that the disk probe does not find, is a disk_images FAIL ("cannot confirm the disk of the image store"), no longer a silent pass. ClusterPreflight and host_sections take the engine and sudo as parameters defaulting to docker without sudo: the preflight's own calls are unchanged and its docker host probe is byte for byte main's (a test pins the sha256 of the rendered script, recorded from main). Fit no longer refuses podman; a node with no container engine is refused.
  5. sudo (AdoptRequest.container_sudo): an ssh sampler pool with container.sudo: true runs sudo -n podman, whose rootful store differs from the user's. With container_sudo every engine call of the adoption goes through sudo -n: the host probe's graphroot (and, for docker, docker info and the data root), the pull, the probe's run and the idle check's ps; the image-removal hint says sudo -n <engine> rmi. The CLI (image adopt: trainer and sampler smoke, the yeto image adopt command and its docs #894) takes it from the pool config or --container-sudo.
  6. site catalog (follow-up of Site image catalog: pick an ssh island's or pool's image from verified records #889): in rl_backend, a trainer-spare node that names its own image: no longer turns the site image catalog off for the island; only the island's own nodes decide whether the configuration names its image (the spares still have to fit the record).

Adopter.run() then calls the smoke (step 5, injected; the real smoke is in #894) and writes the catalog only after it passed. Every failed step raises AdoptError(step, reason); once the image is on some nodes (the probe node, the nodes whose pull passed) the error names them, says the image stays there for a retry and how to remove it (docker rmi), and carries them in AdoptError.holding.

Tests

  • tests/test_image_adopt.py (65 tests) with a fake registry and the preflight's fake B300 cluster: manifest pinning (anonymous, token flow, no digest header, check off, missing, denied); the probe argv without cards, with cards as the fallback, podman, a node with no container engine; the probe body under bash without torch; host checks before the probe (no probe on a full image root); busy parsing per family (nvidia-smi CSV, npu-smi process rows, amd-smi CSV, rocm-smi table), the busy script under bash, busy refused / allowed with a warning / unreadable tool warned; the fallback probe; CUDA rule table (sm_100 on B300 and sm_80 on A10G pass by the minor rule, sm_86 on A100, sm_100a on B300, sm_120 on B300, arch-specific PTX, newer PTX refused; family suffix; exact cubins; ROCm with and without feature suffix; empty list), strict arch, family PTX across majors (compute_100f on B300 passes, on RTX PRO 6000 and compute_103f on B200 refused), profile card_arch, minor-rule notes in the fit and the evidence; unknown probe-node architecture refused; trainer floor; catalog sampler record; pull gates; no docker node; held nodes on fit, pull and smoke failures; success writes the record. Added this round: podman nodes probed, checked and pulled with podman (the first one runtime rootfs, so the engine, not the runtime, decides); the podman graphroot disk check; a pull with no container engine; the docker host probe of the preflight unchanged; a tag next to a digest left out of the repository and of the token scope (the fake registry checks the scope it was asked for).
  • Round 3 tests: an image store whose disk cannot be confirmed fails (no graphroot printed, a graphroot not on the node); a sudo pool engine reads its rootful store (every podman info of the host probe through sudo), pulls, probes and checks idle through sudo -n; docker with sudo reads docker info and its data root through sudo, without sudo unchanged; the docker host probe's digest equals main's for a node with and without mounts; a spare naming its own image does not turn the catalog off, a trainer node naming one does. The podman tests now give the graphroot a disk row (they passed before only because a missing row passed silently).
  • tests/test_image_adopt.py 70 tests, tests/test_site_images.py 69.
  • Related suites on this head (73 files: ssh, inventory, node profile, engine images, rl_backend, preflight, cluster, image, run flags, layout, home guard, leases, and every test file importing the inventory, the cluster preflight or the manifest check): 1641 passed, 6 skipped, 3 xfailed.
  • Full suite on the stack head (image adopt: trainer and sampler smoke, the yeto image adopt command and its docs #894): see that PR.
  • Mutation check, round 3: 17 mutations, all killed (2 after the sudo test was tightened): the sudo prefix, sudo on the podman graphroot in the disk paths and in its section, sudo on docker info and on the docker root, the unconfirmed-store FAIL and its status, sudo into the node states, the pull and the host probe, sudo on the probe run, the idle ps, the host checks, the idle check call, the probe call and the pull call, and the spare's image.
  • Mutation check, earlier rounds: 24 new mutations for this round (minor and arch-specific rules, PTX forward rule, strict arch, ROCm suffix, profile arch, notes in fit and evidence, the fallback probe, idle and host checks, allow-busy, containers counted, held nodes from the probe and the pull, no docker node, smoke failure holding, device flags only with cards, the container engine, per-family busy parsers, unreadable tool): 24 killed (2 after tests were added). Round 2: 11 mutations, all killed (the tag kept next to a digest, the family PTX major check twice, the engine of the pull and of the host probe, the podman graphroot root and its disk branch, the podman probe section always on, the runtime filter for every engine twice, the engine of the node states). One planned mutation was not applicable: the runtime branch of engine_of was removed as redundant.

Customer gate

  • 52 customer goldens: 52 passed.
  • examples/k31 dry-runs, normalized: line-for-line identical to main d9fb379. No golden file changed (the preflight goldens included).

Base is now main: #889 merged as d9fb379 and its commits are gone from this branch (rebased onto main d9fb379, which also has #897 and #898; ClusterPreflight keeps main's max_parallel / inventory next to engine / sudo).

The CLI side of the profile fix (load_profiles, the dry-run text per engine, --container-sudo / --pool-config) is in #894, where yeto image adopt's main() lives.

Not merged; part 2 of 3 (#894 is stacked on it).

🤖 Generated with Claude Code

michaellchung and others added 4 commits November 26, 2026 22:26
yeto.launch.image_adopt runs the first four steps of yeto image adopt
on an SSH node inventory, each over an existing module:

1. manifest: a manifest HEAD (image_manifest) pins a tag to the
   registry's digest; a missing or unreadable manifest stops here,
   before any node is asked anything;
2. probe: one node runs the image once with its device flags and reads
   the CPU architecture, Python, torch, CUDA / HIP, the card
   architectures the kernels were built for, the engine packages and
   the yeto image lock;
3. fit: every node of the role against the image: CPU, device runtime,
   built card architectures (PTX counts for newer cards), the trainer
   floor of trainer_image_check, a catalog sampler image's record
   (engine_images.image_mismatch) and the role's engine package;
4. pull: the cluster preflight's ssh, host probe and image-root checks
   on every node, then the parallel docker pull only when every node
   has room (ClusterPreflight.pull).

Every failing step raises AdoptError with its name and reason. The
catalog is written only after step 5 (the smoke, wired in the next
change) passed.

own-cluster-fleet-stability 7.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st checks first

- fit follows the CUDA binary compatibility rules: a cubin runs on the same
  major with an equal or higher minor, an arch-specific cubin only on its own
  capability, PTX forward-compiles (arch-specific PTX does not). A pass by the
  minor-version rule or PTX JIT is noted in the fit and the evidence; strict
  arch asks for the exact cubin. ROCm targets drop their feature suffix. The
  error names the rule.
- the probe reads torch's build flags with no cards in the container and only
  falls back to the node's device flags when they are empty; it runs the
  node's container engine. Before it, the probe node passes the preflight host
  checks and an idle check (card processes from nvidia-smi / amd-smi /
  rocm-smi / npu-smi and running yeto containers); a busy node is refused
  unless allowed.
- a failed step names the nodes that already hold the image.
- the pull refuses a role with no docker node.

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

- the preflight's host probe and pull take a container engine (default
  docker, byte-for-byte the trainer preflight as before); podman checks its
  storage graphroot for room and pulls with podman. yeto image adopt pulls
  every node with its profile's engine and probes the probe node's image
  root of that engine; a role with no container engine is refused
- split_tagged_ref drops a tag written before a digest, so the manifest URL
  and the token scope name the repository
- tests for podman nodes, a full podman graphroot, family PTX across majors
  and to a lower minor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, spares' images

- container_sudo: the engine runs as `sudo -n <engine>`, as an ssh sampler
  pool's container.sudo runs it, so the rootful store is the one the host
  probe checks, the pull fills and the probe and idle check use.
  ClusterPreflight and host_sections take sudo (default off: the docker host
  probe of the preflight is byte for byte main's, pinned by its digest).
- A podman node whose graphroot podman info does not print, or prints a path
  the disk probe does not find, fails disk_images ("cannot confirm the disk
  of the image store") instead of passing silently.
- rl_backend: a trainer-spare that names its own image no longer turns the
  site image catalog off for the island; the island's own nodes decide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaellchung
michaellchung merged commit d28c492 into main Nov 26, 2026
7 checks passed
@michaellchung
michaellchung deleted the own/image-adopt-checks branch November 26, 2026 15:47
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