Skip to content

feat(site): Declare delivery methods in enrollment - #231

Open
scotwells wants to merge 11 commits into
proto/virtual-media-deliveryfrom
proto/site-delivery-declaration
Open

scotwells wants to merge 11 commits into
proto/virtual-media-deliveryfrom
proto/site-delivery-declaration

Conversation

@scotwells

@scotwells scotwells commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Each site now declares its boot delivery methods in its own enrollment, and the coordinator and the Metal provider read that declaration only from a fresh report from the site, keeping no copy. While any serving site has no current declaration, admission leaves installations, wipes and commissionings waiting and the Metal provider creates nothing. A declaration is a strict list, and one that is empty, or that the site cannot read, offers nothing. Stacked on #229.

Related to #227

How it stays inactive

Network boot runs only where a site's enrollment selects it. No packaged configuration declares any method, so a site offers nothing until its environment declares one, and a CI check fails if any configuration root declares methods. The DHCP reservation feed starts only for a site whose enrollment both synchronizes DHCP and declares network boot, so a site that declares only virtual media, or nothing, starts no feed, claims no boot address and attaches no boot NIC. The lab declares network boot for its own runs, and its virtual media suite adds virtual media to the enrollment mid-run.

Decisions for a person

  • An existing site deployment whose environment does not set the declaration offers nothing once this lands: its installations, wipes and commissionings wait until it does. Setting it is an environment change this PR does not make, and nothing here enables network boot or virtual media for any staging site.
  • The feed reads the declaration when it starts. A site that stops declaring network boot admits no new network boot, but a running feed keeps serving the operations already admitted until it restarts.
  • Including the DHCP component is the site's explicit choice of network boot; Kea itself does not read the declaration, and without a feed it holds no reservation.
  • The standalone smoke and the simulator keep a fixed network-boot-only declaration, so they never exercise the waiting or virtual media paths of the allocator.

Test plan

  • Strict parsing, and the hub following a changed, unreadable or stale declaration
  • Admission and the allocator wait while a declaration is unknown, for installations, wipes and commissionings
  • The feed starts only where the enrollment declares network boot, and no packaged root declares a method
  • Every gh pr checks entry green on the head, and every acceptance shard green, with the Redfish and virtual media shards green twice in a row

🤖 Generated with Claude Code

@scotwells
scotwells requested review from ecv and kevwilliams November 27, 2026 18:18
@scotwells
scotwells force-pushed the proto/site-delivery-declaration branch 2 times, most recently from 666ac4c to d2e9ba1 Compare November 27, 2026 22:35
@scotwells
scotwells force-pushed the proto/site-delivery-declaration branch 8 times, most recently from 6eda2ce to a56c11b Compare November 28, 2026 02:43
@scotwells
scotwells force-pushed the proto/virtual-media-delivery branch from 8ac1862 to a841421 Compare November 29, 2026 00:13
@scotwells
scotwells force-pushed the proto/site-delivery-declaration branch from a56c11b to 4327b32 Compare November 29, 2026 00:24
@scotwells
scotwells force-pushed the proto/virtual-media-delivery branch from a841421 to 1c2ee99 Compare November 29, 2026 01:20
@scotwells
scotwells force-pushed the proto/site-delivery-declaration branch from 4327b32 to 2cbf76f Compare November 29, 2026 01:20
@scotwells
scotwells force-pushed the proto/virtual-media-delivery branch from 1c2ee99 to 6865ae1 Compare November 29, 2026 02:04
@scotwells
scotwells force-pushed the proto/site-delivery-declaration branch from 2cbf76f to 6b566f9 Compare November 29, 2026 02:04
@scotwells
scotwells force-pushed the proto/virtual-media-delivery branch from 6865ae1 to b1fed7b Compare November 29, 2026 02:15
@scotwells
scotwells force-pushed the proto/site-delivery-declaration branch from 6b566f9 to 1226af9 Compare November 29, 2026 02:15
@scotwells scotwells added the multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners label Nov 29, 2026
@scotwells
scotwells force-pushed the proto/site-delivery-declaration branch from 1226af9 to c3fba11 Compare November 29, 2026 02:48
@scotwells scotwells added multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners and removed multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners labels Nov 29, 2026
@scotwells
scotwells force-pushed the proto/site-delivery-declaration branch 2 times, most recently from f385b61 to b4bdd77 Compare November 29, 2026 03:28
@scotwells scotwells removed the multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners label Nov 29, 2026
@scotwells scotwells added multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners and removed multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners labels Nov 29, 2026

@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 site's delivery declaration now reaches the coordinator only from the site's own report, and every choice that follows (method, media service, windows) is taken from it and re-checked at admission, so a tenant cannot widen or redirect it. I ran go test ./internal/coordination/ and the custody suite with envtest at b4bdd77 and mutated the guards.

  • The default is safe: no report, a stale one (MaxAge), an unreadable one or an invalid one (ParseOffered, strict, DisallowUnknownFields, https IPv4 host only, no path or credentials) is "not known", and checkDelivery, selectDelivery and the wipe path wait with Retry instead of deciding. Removing the staleness check fails internal/coordination; loosening ParseOffered's path check fails TestParseOffered.
  • Admission compares the recorded delivery input with the declared offer, so a media service or window an operation records that the site does not offer is refused; dropping that compare fails TestDeliveryMethodAdmission (confirmed at #229's head, and delivery.go is the same check here).
  • The declaration is read from a read-only ConfigMap mount and served only behind the site API's bearer token; the new /v1/delivery-methods is covered by an unauthenticated 401 test.
  • The DHCP feed now starts only where the declaration includes network boot (feedEnrollment), so a media-only site opens no DHCP surface.

Follow-ups:

  • A media-only site, or one that has not reported, cannot wipe: offersNetworkBoot returns ErrNoWipeMethod or ErrDeliveryUnknown, so a release there waits indefinitely. That is the safe side, but name it in the operations docs and consider surfacing it in the allocation's status rather than only an error.
  • The coordinator now has no copy of the declaration, so a site cell that reports a bad MediaService steers every installation it serves. The trust sits in whoever edits that site's ConfigMap; say so in docs/operations/gitops.md.
  • Sites.DeliveryMethods in siteapi.Client ignores its device argument and returns one declaration for every Device the simulator serves; fine for the simulator, but add a guard test so a real client does not inherit it.

@scotwells
scotwells requested a review from ecv November 29, 2026 06:22

@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.

Still approved at 1130a97: nothing has changed since my last review.

@scotwells
scotwells force-pushed the proto/virtual-media-delivery branch from c08b5b4 to e451f8c Compare November 29, 2026 07:19
@scotwells
scotwells force-pushed the proto/site-delivery-declaration branch from 1130a97 to c3641c1 Compare November 29, 2026 07:19
@scotwells scotwells added multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners and removed multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners labels Nov 29, 2026
@scotwells
scotwells requested a review from ecv November 29, 2026 07:19
@scotwells
scotwells force-pushed the proto/site-delivery-declaration branch from c3641c1 to eef6e4b Compare November 29, 2026 07:33
@scotwells scotwells added multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners and removed multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners labels Nov 29, 2026
scotwells and others added 11 commits November 29, 2026 01:56
Each site now reports its boot delivery declaration, and the coordinator
and the Metal provider read it there instead of from the coordinator's
own site configuration, per #227.

- The cell observer publishes the declaration on every report handoff;
  the hub returns it only from a fresh report of this cell.
- The simulator's site API serves its declaration (network boot).
- Admission leaves an operation Pending while a serving site has not
  reported a current, valid declaration, and the allocator creates no
  installation until it has.
- A declaration is a JSON list of offers, parsed strictly: each method
  once, network boot with no media settings, virtual media with
  DataNetwork addresses and an https media service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The site's fleet-site-delivery ConfigMap is its delivery declaration,
from the environment's FLEET_SITE_DELIVERY_METHODS. The observer mounts
it read only and reads it on every pass, so a change is a source
revision with no coordinator restart.

The virtual media suite adds virtual media as revision 3 and waits until
the coordinator reads it from the cell's report. Dispatch moves to
revision 4. Network boot only is the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Karmada aggregates handoff status through Lua, where an empty list and
an empty object are the same table, so an empty declaration could come
back as an object or not at all. The observation now carries the
declaration's JSON as a string, and the hub parses it again, strictly.

- The observer reads the declaration once per pass and reports an
  unreadable one once, not once per Device.
- A declaration of null, or a media service with a user, query or
  fragment, is refused.
- The site's static fence report carries no declaration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Flux's variable substitution dropped the quotes around the declaration's
JSON, so the ConfigMap's data held a YAML list and the services layer
failed its dry run. The environment now gives the declaration base64
encoded, as the ConfigMap's binaryData; the mounted file is the JSON.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The report address tests from the base read the site's declaration the
way the coordinator used to. They now read it from the site, as the
coordinator and the Metal provider do here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An active operation records its kind and name, never its object UID, so
the declaration test checks the admitted installation by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The release wipe guard reads the serving sites' reported declarations, as
installation selection does. A release makes no wipe, and claims no boot
address for one, while a serving site has not reported its declaration or
does not offer network boot.

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

The reservation feed now reads the site enrollment's delivery declaration
and refuses to start unless it offers network boot, as well as requiring
synced DHCP. A site that declares only virtual media, or declares nothing,
starts no feed. The feed component mounts the fleet-site-delivery
ConfigMap read-only, and the DHCP render check requires it.

The network boot render check also fails if any packaged root declares
delivery methods: the ConfigMap carries only the environment's
substitution, so a site offers nothing until its environment declares it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A wipe or commissioning whose serving site had no current declaration was
refused for good, as though the site offered no network boot. It now
waits, as an installation does, and is admitted once the site reports a
declaration that offers network boot. The simulator says why its
declaration is network boot only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The media suite publishes its revisions after the commissioning's, so its
enrollment and dispatch revisions no longer have fixed numbers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The customer power test still set the declaration on its sites and
allocator, which now read it from the site. Its site serves network boot
only, as the other simulated sites do, and its allocator reads that from
the site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scotwells
scotwells force-pushed the proto/site-delivery-declaration branch from eef6e4b to 42123cd Compare November 29, 2026 07:56
@scotwells scotwells added multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners and removed multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners labels Nov 29, 2026

@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.

Rebased onto #229's two new commits (lab deferred power-on fix and the allocation CI shards); this PR's own commits are unchanged from my last review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants