Skip to content

feat(metal): Let customers install images from a published catalog - #192

Merged
scotwells merged 4 commits into
feat/manual-inventory-recordsfrom
feat/machine-image-catalog
Nov 29, 2026
Merged

scotwells merged 4 commits into
feat/manual-inventory-recordsfrom
feat/machine-image-catalog

Conversation

@scotwells

@scotwells scotwells commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Implements the image catalog increment of #184. Customers select a published MachineImage by name. Admission verifies the consumer tenant, published copy and provider image incarnations, checks architecture and firmware compatibility, and pins the digest and allowed firmware modes on the DeviceInstallation. An admitted operation retains its inputs after catalog changes. Bootstrap data remains unsupported.

Integrates staging through #189 (a4327a43). Firmware mode comes from commissioning evidence through the existing capacity projector; publishing an image does not write capacity status. Redfish checks the current boot mode before network boot or virtual media, and refuses unknown or incompatible firmware before effects. The local VM worker requires BIOS. Physical BMC qualification and production image-use authorization remain outside this increment.

Local validation includes build, vet, catalog and worker race tests, Kustomize renders, overlay and network isolation checks, and documentation links. Live multi-plane acceptance was not run.

Installations named an image as name@sha256 and only a test parser read
it. The provider now defines immutable MachineImages by digest and
publishes them into consumer tenants. A published copy names its
publisher with a typed publisherRef plus the image's name, and a
protected publication record names the consumer with a typed
consumerRef. A tenant is a Milo Project, or a Namespace in standalone
mode; every other kind is refused, and Publish writes nothing for one.

No spec holds an object UID. The record's name derives from the consumer
tenant, copy and provider image UIDs, and its spec holds names and the
digest. Admission reads the copy and the provider image, looks up the
record under the derived name, and refuses a missing record, so a
recreated tenant, copy or provider image is refused. Republishing a
recreated image writes its own record. Admission also refuses a
withdrawn image and checks architecture and firmware mode against the
allocation's hardware. The DeviceInstallation keeps the digest and the
image's firmware modes, and each install worker reads the server's
firmware mode again before it sends anything.

Customer roles may only read and use images, and the publisher may
delete stale records. The standalone and multi-plane compositions
publish their one image and resolve it with a fixture authorizer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scotwells
scotwells force-pushed the feat/machine-image-catalog branch from 5b0555d to 00111b7 Compare November 26, 2026 01:22
Base automatically changed from feat/device-custody-cutover to feat/manual-inventory-records November 28, 2026 14:54
@scotwells
scotwells marked this pull request as ready for review November 29, 2026 19:30
@scotwells
scotwells requested a review from a team as a code owner November 29, 2026 19:30
@scotwells

Copy link
Copy Markdown
Contributor Author

@ecv please review exact head d3e44da2578ffdb72919a0847ba3581bf81d50a7. This merge includes staging through #189. The main integration points are firmware evidence from commissioning, the shared pre-effect firmware check for network boot and virtual media, and retaining delivery and IPAM inputs on retry.

@scotwells

Copy link
Copy Markdown
Contributor Author

@ecv the final head for review is 6fff24869005a8d52ac69582d262573a702a63c3, superseding d3e44da2. Only four NSO release test fixtures changed after the merge commit: each now supplies the resolved catalog image, and all four pass against envtest.

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve.

Customers install only images the provider published to their project: admission resolves the Installation's image through a provider-side publication record bound to the consumer tenant, the copy and the provider image by UID, and pins the digest from the record. I mutated the catalog at this head (record spec match, publisher match) and each fails a test.

  • Cross-project read and install holds. A customer role gets only machineimages.use (consumer, claimant) and list/get/watch on its own project's copies (viewer); it holds no create, update or delete on images or on publication records. Records live in the provider project and only the publisher role creates or deletes them. A hand-made copy naming a provider image, or a recreated copy, tenant or source, finds no record and is refused. The record is immutable (self == oldSelf) and the image's definition and source are immutable.
  • No Milo IAM image-use check exists yet: the authorizer in the multi-plane and standalone runs allows every creator, so machineimages.use is not exercised by any test. Catalog.Authorize == nil refuses, so a deployment that wires nothing fails closed, but the allow-all func lives in non-test internal/multiplane. Add a real authorizer test, and keep production wiring out of that package.
  • The webhook that rejects image writes from anyone but the publisher is not implemented (the doc says so); IAM alone keeps customers from writing images. A holder of the publisher role in a consumer project can write copies and status there; the record still gates entitlement, so this entitles nothing, but bind that role to the Fleet publisher only.
  • Install now refuses any image the catalog did not resolve and ParseImage is gone, so the production release flow has no path to install until it calls Catalog.Resolve. Only the two lab runners call it today.
  • The allocator change shares allocator.go, harness_test.go and multiplane/seed.go with #193: git reports conflicts merging the two. Whichever lands second must resolve them, keeping pinCleaning and the catalog image together, and re-run the allocation tests.

Follow-ups:

  • Multi-plane runs of the image catalog are not verified (the doc says so).

@scotwells
scotwells requested a review from ecv November 29, 2026 21:03

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve.

The delta since my last review is a merge of the updated stack base, which now carries the merged cleaning policy, drive discovery, power UI and multi-plane changes. The hand resolutions keep both sides: the catalog and cleaning imports and fixtures, both CRDs and protected resources, and the installation-requester role holding both cleaningpolicies get and sealedpayloads create. Earlier findings stand.

@scotwells
scotwells merged commit 7c77665 into feat/manual-inventory-records Nov 29, 2026
17 checks passed
@scotwells
scotwells deleted the feat/machine-image-catalog branch November 29, 2026 21:19
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.

2 participants