Skip to content

feat: --bake-images — pre-pulled multi-arch release-image store - #17

Merged
raghavendra-talur merged 4 commits into
TheEasyShift:mainfrom
raghavendra-talur:rtalur-bake-images-macos
Aug 25, 2026
Merged

feat: --bake-images — pre-pulled multi-arch release-image store#17
raghavendra-talur merged 4 commits into
TheEasyShift:mainfrom
raghavendra-talur:rtalur-bake-images-macos

Conversation

@raghavendra-talur

@raghavendra-talur raghavendra-talur commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Opt-in --bake-images: pre-pull the entire OCP release payload into a read-only, multi-arch (amd64 + aarch64) disk attached to the master, so the install never reaches quay.io for platform images. Built once per OCP version, shared across clusters.

  • Build: oc adm release info enumerates every supported arch's pullspecs (union), skopeo copy --all into a rootless overlay store, packed into a labeled ext4 image — virt-make-fs → qcow2 on Linux (libvirt pool), mke2fs -d → raw on macOS (vfkit's virtio-blk takes raw; no libguestfs on macOS, Homebrew e2fsprogs keg paths probed).
  • Attach: per-cluster copy (libvirt pool volume on Linux; APFS clonefile in the vfkit state dir on macOS — vfkit has no read-only virtio-blk, so the per-cluster copy is the isolation) attached after the primary disk in both boot phases.
  • Wire: mounted by label at /var/lib/baked-images and registered as a CRI-O additional image store — post-pivot via a master MachineConfig rendered into the node ignition, bootstrap via a merge into the live ignition (live-ISO on Linux, HTTP-served config.ign on macOS).

Docs: docs/dev/image-baking.md. Remaining: a real-cluster validation that CRI-O serves from the store (needs ~40+ GB free disk; tracked in ROADMAP.md).

Test plan

  • make check — green (renderers, baker command construction, vfkit ImportDisk/ExtraDisks, stage preflights, app-level bake pipeline against fakes).
  • Full darwin pipeline under --simulate; real mke2fs -d pack verified against e2fsprogs (clean labeled ext4 with the store contents).

🤖 Generated with Claude Code

Add the plumbing for opt-in image baking (--bake-images): the CLI flag,
ClusterConfig.BakeImages, the ImageBaker interface + BakeSpec, store
path helpers, the bake-image-store stage slot in the manager, ignition
hooks (MachineConfig manifest + live-ISO merge), the ExtraDisk VM-spec
support with libvirt ImportDisk, and fakes + app-level tests. The
concrete baker and stage land in the follow-up commit.

Also ignore the local .gstack/ tool-state directory.

Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
Assisted-by: Claude Code/claude-fable-5
The wiring for --bake-images already landed (interfaces, deps, stages,
config, CLI flag), but the concrete pieces it references were untracked.
Add them so the tree builds on its own:

- providers/openshift/baker.go: OpenShiftImageBaker. Enumerates the
  union of every supported release arch's pullspecs (amd64 + aarch64) so
  a baked store is multi-arch-correct, skopeo copy --all into a rootless
  overlay store, then virt-make-fs packs it into a labeled ext4 qcow2.
  Pure renderers for the storage.conf drop-in, mount unit, and master
  MachineConfig, plus live-ISO ignition merge.
- stages/bakeimagestore: the bake-image-store stage. No-op unless the
  cluster opts in; preflights pull secret + skopeo/virt-make-fs on PATH.
- docs/dev/image-baking.md: design + operator notes.

Baking stays opt-in (--bake-images, default off).

Assisted-by: Claude Code/claude-opus-4-8
Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
The bake feature deferred its macOS half to the on-hardware phase. Wire
it up end to end:

- publish-pxe-assets merges the baked-store mount + CRI-O drop-in into
  the HTTP-served bootstrap ignition — the macOS equivalent of
  embed-ignition-iso's live-ISO merge on Linux.
- The baker packs with mke2fs -d on darwin (no libguestfs on macOS;
  Homebrew e2fsprogs, keg paths probed) into a raw image — vfkit's
  virtio-blk takes raw, not qcow2 — sized from the overlay contents.
  ImageStoreDiskPath/ImageStoreVolName pick the extension per OS.
- vfkit ImportDisk clones the cached store per cluster (APFS clonefile,
  plain-copy fallback) into the state dir; ExtraDisks attach after the
  primary disk in both boot phases; Delete removes the clone. vfkit has
  no read-only virtio-blk, so the per-cluster copy is the isolation.
- bake-image-store preflight requires skopeo + mke2fs on darwin with a
  brew hint (skopeo + virt-make-fs unchanged on Linux).

Validated on hardware: mke2fs -d pack produces a clean labeled ext4
image; the full darwin pipeline runs under --simulate. A real baked
install needs ~40+ GB free disk — tracked in ROADMAP.md.

Assisted-by: Claude Code/claude-fable-5
Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
Assisted-by: Claude Code/claude-fable-5
Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
@raghavendra-talur
raghavendra-talur force-pushed the rtalur-bake-images-macos branch from 48705b4 to dae6134 Compare August 25, 2026 05:46
@raghavendra-talur raghavendra-talur changed the title feat: --bake-images — pre-pulled multi-arch release-image store (stacked on #16) feat: --bake-images — pre-pulled multi-arch release-image store Aug 25, 2026
@raghavendra-talur
raghavendra-talur merged commit fe0c459 into TheEasyShift:main Aug 25, 2026
2 checks passed
@raghavendra-talur
raghavendra-talur deleted the rtalur-bake-images-macos branch August 25, 2026 05:50
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