Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7935d8b
feat(custody): Record each install's boot method
scotwells Nov 27, 2026
0cd9e75
feat(site): Install over Redfish virtual media
scotwells Nov 27, 2026
f5e678b
feat(lab): Boot lab targets from virtual media
scotwells Nov 27, 2026
9cafec4
test(multiplane): Run the virtual media suite
scotwells Nov 27, 2026
801d89e
test(lab): Pad the fake config medium
scotwells Nov 27, 2026
bd1fdac
test(multiplane): Give stale opens report ranges
scotwells Nov 27, 2026
8a00a79
feat(site): Take reports only from the Machine
scotwells Nov 27, 2026
39207e8
test(lab): Report from each guest's IPAM address
scotwells Nov 27, 2026
77eaaae
fix(multiplane): Give refused installs an address
scotwells Nov 27, 2026
13fd957
fix(lab): Run IPAM in the media suite on CI
scotwells Nov 27, 2026
3a789c1
fix(lab): Verify IPAM's Flux layers as Flux writes
scotwells Nov 28, 2026
e013b81
test(lab): Report why a media report went missing
scotwells Nov 28, 2026
848e5c3
fix(lab): Admit relayed reports to the media service
scotwells Nov 28, 2026
a1ecac9
test(lab): Match the report range exactly
scotwells Nov 28, 2026
d10cb67
fix(lab): Arm the stray source with the run state
scotwells Nov 28, 2026
df50527
test(lab): Check each lab fault gets the run state
scotwells Nov 28, 2026
0b7f8d3
fix(lab): Give stale-fence opens a report address
scotwells Nov 28, 2026
3fc692d
fix: Key virtual media windows by the operation's admission
scotwells Nov 29, 2026
9c82c39
ci(multiplane): Run the virtual media suite
scotwells Nov 27, 2026
202a785
ci(multiplane): Shorten the media suite's windows
scotwells Nov 28, 2026
128d337
feat(custody): Network-boot wipes and commissionings only where offered
scotwells Nov 29, 2026
78fdc74
fix(lab): Accept a medium's mount before fetching it
scotwells Nov 29, 2026
b87e2af
fix(site): Close relayed connections nothing accepted
scotwells Nov 29, 2026
08af73b
test(lab): Match the stale-fence probe's open fields exactly
scotwells Nov 29, 2026
ce8431d
fix(custody): Leave an installation's delivery optional in its schema
scotwells Nov 29, 2026
f904d6d
fix(site): Prove media release only with every override disabled
scotwells Nov 29, 2026
25b511f
fix(lab): Change media state only under the adapter's lock
scotwells Nov 29, 2026
b284802
fix(lab): Keep the lab adapter executable
scotwells Nov 29, 2026
f802664
fix(multiplane): Give IPAM's token to every run with IPAM
scotwells Nov 29, 2026
1f94792
fix(multiplane): Read the worker's own BMC credential by Device
scotwells Nov 29, 2026
cec3463
fix(multiplane): Commission the media suite's target before allocating
scotwells Nov 29, 2026
fe7863f
fix(lab): Stamp a deferred power-on's reset when it is accepted
scotwells Nov 29, 2026
e451f8c
test(manager): Declare network boot for the customer power site
scotwells Nov 29, 2026
8b94f85
fix(lab): Leave a failed deferred power-on Off
scotwells Nov 29, 2026
951b40c
ci: Split the allocation tests across two shards
scotwells Nov 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ jobs:
# Every Go test runs once, with the race detector. No package is excluded
# from race runs by a build tag. The shards partition `go list ./...`: the
# rest shard takes every package the others do not name, so a new package
# is always tested. The custody package runs its envtest-backed tests one
# after another, so its tests are dealt round-robin across three shards.
# is always tested. The custody and allocation packages run their
# envtest-backed tests one after another, so their tests are dealt
# round-robin across shards: three for custody and two for allocation,
# whose tests together come near go test's ten-minute package timeout.
# -count=1 keeps a restored cache from replaying results, and a skipped test
# fails the shard: every skip in this repository means a missing tool or
# envtest assets.
Expand All @@ -30,6 +32,8 @@ jobs:
- {shard: custody-1, packages: custody, part: 1, parts: 3}
- {shard: custody-2, packages: custody, part: 2, parts: 3}
- {shard: custody-3, packages: custody, part: 3, parts: 3}
- {shard: allocation-1, packages: allocation, part: 1, parts: 2}
- {shard: allocation-2, packages: allocation, part: 2, parts: 2}
- {shard: api, packages: api, part: 1, parts: 1}
- {shard: rest, packages: rest, part: 1, parts: 1}
steps:
Expand Down Expand Up @@ -69,8 +73,9 @@ jobs:
all=$(go list ./...)
case "$PACKAGES" in
custody) packages=$(grep -x "$module/internal/custody" <<<"$all") ;;
allocation) packages=$(grep -x "$module/internal/allocation" <<<"$all") ;;
api) packages=$(grep "^$module/internal/api/" <<<"$all") ;;
rest) packages=$(grep -vx -e "$module/internal/custody" -e "$module/internal/api/.*" <<<"$all") ;;
rest) packages=$(grep -vx -e "$module/internal/custody" -e "$module/internal/allocation" -e "$module/internal/api/.*" <<<"$all") ;;
esac
[ -n "$packages" ] || { echo "shard $PACKAGES has no packages"; exit 1; }
run=()
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/multiplane-acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
mode:
description: Site provider
type: choice
options: [both, localvm, redfish]
options: [both, localvm, redfish, media]
default: both
groups:
description: Scenario groups
Expand Down Expand Up @@ -40,8 +40,14 @@ jobs:
strategy:
fail-fast: false
matrix:
mode: ${{ fromJSON(github.event_name == 'workflow_dispatch' && inputs.mode != 'both' && format('["{0}"]', inputs.mode) || '["localvm","redfish"]') }}
group: ${{ fromJSON((github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.groups == 'split')) && '["flux","release"]' || '["all"]') }}
# Each shard is one suite in one scenario group. A labeled pull request
# run, or a manual run that asks for split, runs the local VM and
# Redfish suites as their flux and release shards; the nightly run, and
# a manual run unless it asks for split, runs each in the all group. The
# virtual media suite (run.sh --redfish --virtual-media) always runs as
# one all shard: its scenarios are one ordered sequence of installs.
# Both selects every suite.
include: ${{ fromJSON(github.event_name == 'workflow_dispatch' && inputs.mode == 'media' && '[{"mode":"media","group":"all"}]' || github.event_name == 'workflow_dispatch' && inputs.mode == 'localvm' && (inputs.groups == 'split' && '[{"mode":"localvm","group":"flux"},{"mode":"localvm","group":"release"}]' || '[{"mode":"localvm","group":"all"}]') || github.event_name == 'workflow_dispatch' && inputs.mode == 'redfish' && (inputs.groups == 'split' && '[{"mode":"redfish","group":"flux"},{"mode":"redfish","group":"release"}]' || '[{"mode":"redfish","group":"all"}]') || (github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.groups == 'split')) && '[{"mode":"localvm","group":"flux"},{"mode":"localvm","group":"release"},{"mode":"redfish","group":"flux"},{"mode":"redfish","group":"release"},{"mode":"media","group":"all"}]' || '[{"mode":"localvm","group":"all"},{"mode":"redfish","group":"all"},{"mode":"media","group":"all"}]') }}
# A newer labeled run for the same pull request replaces an older one;
# nightly and manual runs never cancel each other. A cancelled run never
# counts as passed.
Expand Down Expand Up @@ -134,7 +140,11 @@ jobs:
- name: Run multi-plane acceptance (${{ matrix.mode }})
timeout-minutes: 100
env:
TASK: ${{ matrix.mode == 'localvm' && 'multiplane:acceptance' || 'multiplane:redfish-acceptance' }}
TASK: ${{ matrix.mode == 'localvm' && 'multiplane:acceptance' || matrix.mode == 'media' && 'multiplane:media-acceptance' || 'multiplane:redfish-acceptance' }}
# The virtual media suite's lab windows, short enough for KVM guests:
# each held installation waits out both.
FLEET_MULTIPLANE_MEDIA_FETCH: ${{ matrix.mode == 'media' && '2m0s' || '' }}
FLEET_MULTIPLANE_MEDIA_REPORT: ${{ matrix.mode == 'media' && '3m0s' || '' }}
run: |
mkdir -m 0700 "$FLEET_MULTIPLANE_STATE_ROOT"
task "$TASK"
Expand Down
7 changes: 7 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ tasks:
cmds:
- ./hack/multiplane/run.sh --redfish {{.CLI_ARGS}}

multiplane:media-acceptance:
desc: "The Redfish-mode virtual media suite: the worker installs a lab VM over Redfish VirtualMedia from the site's media service, then proves release (same exit codes)."
env:
FLEET_MULTIPLANE_INOTIFY: '1024'
cmds:
- ./hack/multiplane/run.sh --redfish --virtual-media {{.CLI_ARGS}}

multiplane:preflight:
desc: Check local prerequisites and implementation readiness without creating resources.
env:
Expand Down
6 changes: 5 additions & 1 deletion cmd/fleet-manager/synthetic.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ func syntheticCustody(ctx context.Context, scheme *runtime.Scheme, providerConfi
return nil, nil, nil, err
}
namespace := flags.syntheticDeviceNamespace
sites := &delivery.Sites{Sites: map[string]delivery.Site{syntheticSite: remote}, Devices: map[string][]string{}}
// The simulator's installs and wipes are simulated, so its declaration
// keeps the lifecycle it always had: it starts no DHCP, claims no boot
// address and attaches no boot NIC, and offers no virtual media.
sites := &delivery.Sites{Sites: map[string]delivery.Site{syntheticSite: remote}, Devices: map[string][]string{}, Methods: map[string][]custody.OfferedMethod{syntheticSite: custody.NetworkBootOnly}}
for device := range enrollment {
deviceNamespace, name, _ := strings.Cut(device, "/")
if deviceNamespace != namespace {
Expand Down Expand Up @@ -109,6 +112,7 @@ func syntheticCustody(ctx context.Context, scheme *runtime.Scheme, providerConfi
Capacity: &capacity.Projector{Reader: provider, Namespace: namespace, Cleaning: cleaning},
// The synthetic site enrolls one boot NIC and one disk per Device.
BootInterface: "primary", TargetDisks: []string{"disk-0"},
DeliveryMethods: custody.NetworkBootOnly,
}
// Synthetic staging has no BMC discovery. The manager writes fixture
// discovery for the synthetic site's Devices instead.
Expand Down
65 changes: 60 additions & 5 deletions cmd/fleet-multiplane/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"errors"
"flag"
"fmt"
"net/netip"
"os"
"os/signal"
"strings"
Expand All @@ -32,7 +33,7 @@ func main() {

func run() error {
if len(os.Args) < 2 {
return fmt.Errorf("usage: fleet-multiplane coordinator|site-worker|site-observer|image|boot-service|boot-withhold|boot-denials|dhcp-feed|redfish-probe|<management phase> [flags]")
return fmt.Errorf("usage: fleet-multiplane coordinator|site-worker|site-observer|image|boot-service|boot-withhold|media-stale|media-service|boot-denials|dhcp-feed|redfish-probe|<management phase> [flags]")
}
fs := flag.NewFlagSet(os.Args[1], flag.ContinueOnError)
once := fs.Bool("once", false, "one attempt, for fault injection")
Expand All @@ -52,8 +53,17 @@ func run() error {
syncToken := fs.String("sync-token-file", "", "file holding the DHCP synchronizer bearer token (dhcp-feed)")
installationDeadline := fs.Duration("installation-deadline", 0, "replace the installation deadline for operations this coordinator admits (coordinator)")
skewMargin := fs.Duration("skew-margin", 0, "replace the margin after a deadline before the coordinator declares it exceeded (coordinator)")
tlsCert := fs.String("tls-cert", "", "TLS certificate the DHCP feed serves (dhcp-feed)")
tlsKey := fs.String("tls-key", "", "TLS key of the DHCP feed (dhcp-feed)")
tlsCert := fs.String("tls-cert", "", "TLS certificate the DHCP feed or media service serves (dhcp-feed, media-service)")
tlsKey := fs.String("tls-key", "", "TLS key of the DHCP feed or media service (dhcp-feed, media-service)")
deviceName := fs.String("device", "", "exact <namespace>/<name> Device (media-stale)")
listen := fs.String("listen", "127.0.0.1:18443", "listen address (media-service)")
mediaRoot := fs.String("state-dir", "", "the media service's own state directory (media-service)")
mediaArtifacts := fs.String("artifacts", "", "directory of the image's pinned artifacts (media-service)")
mediaClients := fs.String("clients", "", "comma-separated IPv4 prefixes the media service serves (media-service)")
proxyListen := fs.String("proxy-listen", "", "comma-separated addresses where report relays connect with a PROXY header (media-service)")
relays := fs.String("relays", "", "comma-separated prefixes of the report relays trusted to name a report's source (media-service)")
upstream := fs.String("upstream", "", "the media service's PROXY listener, IP:port (report-relay)")
clientCA := fs.String("client-ca", "", "CA that signs the site workers' client certificates (media-service)")
if err := fs.Parse(os.Args[2:]); err != nil {
return err
}
Expand All @@ -69,7 +79,7 @@ func run() error {
return multiplane.Coordinate(ctx, config, multiplane.CoordinatorOptions{InstallationDeadline: *installationDeadline, SkewMargin: *skewMargin}, func(err error) {
fmt.Fprintf(os.Stderr, "%s coordinator: pass incomplete: %v\n", time.Now().UTC().Format(time.RFC3339), err)
})
case "seed", "commission", "allocate", "install", "admit-install", "admit-install-b", "release", "release-b", "reuse", "recovery-mismatch", "probe-unallocatable", "tenant-isolation":
case "seed", "commission", "allocate", "install", "admit-install", "admit-install-b", "release", "release-b", "reuse", "recovery-mismatch", "probe-unallocatable", "tenant-isolation", "media-not-offered", "media-unpinned", "media-install-held", "media-install-download", "media-install-lost", "media-install":
return phase(os.Args[1], *configPath, *once)
case "redfish-probe":
return probe(*endpoint, *credentials, *system, *uuid, *pin, *clientID)
Expand All @@ -84,6 +94,50 @@ func run() error {
return boot(os.Args[1], *origin, *extraMAC, *syncToken, *tlsCert, *tlsKey)
case "boot-withhold":
return armWithhold(fs.Arg(0))
case "media-stale":
return mediaStale(*deviceName)
case "media-service":
config, err := multiplane.ReadConfig(*configPath)
if err != nil {
return err
}
var clients, trusted []netip.Prefix
for _, value := range strings.Split(*mediaClients, ",") {
prefix, err := netip.ParsePrefix(strings.TrimSpace(value))
if err != nil {
return fmt.Errorf("media-service: -clients must list IPv4 prefixes")
}
clients = append(clients, prefix.Masked())
}
for _, value := range strings.Split(*relays, ",") {
if value = strings.TrimSpace(value); value == "" {
continue
}
prefix, err := netip.ParsePrefix(value)
if err != nil {
return fmt.Errorf("media-service: -relays must list prefixes")
}
trusted = append(trusted, prefix.Masked())
}
if *proxyListen != "" && len(trusted) == 0 {
return fmt.Errorf("media-service: -proxy-listen needs -relays")
}
if *mediaRoot == "" || *mediaArtifacts == "" || *tlsCert == "" || *tlsKey == "" || *clientCA == "" {
return fmt.Errorf("media-service needs -state-dir, -artifacts, -tls-cert, -tls-key and -client-ca")
}
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer cancel()
fmt.Println("media-service: central media service running")
return multiplane.MediaService(ctx, config, *listen, *proxyListen, *tlsCert, *tlsKey, *clientCA, *mediaRoot, *mediaArtifacts, clients, trusted)
case "report-relay":
// Lab only: forwards the guests' report connections, naming each
// guest's address, to the media service's PROXY listener.
if *upstream == "" {
return fmt.Errorf("report-relay needs -listen and -upstream")
}
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer cancel()
return multiplane.ReportRelay(ctx, *listen, *upstream)
case "site-worker", "site-observer":
default:
return fmt.Errorf("unknown command")
Expand Down Expand Up @@ -156,6 +210,7 @@ func phase(name, configPath string, once bool) error {
"commission": r.Commission, "allocate": r.Allocate, "admit-install": r.AdmitInstall, "install": r.Install,
"release": r.Release, "release-b": r.ReleaseSecond, "reuse": r.Reuse,
"admit-install-b": r.AdmitInstallSecond, "recovery-mismatch": r.RecoveryMismatch, "probe-unallocatable": r.ProbeUnallocatable, "tenant-isolation": r.TenantIsolation,
"media-not-offered": r.MediaNotOffered, "media-unpinned": r.MediaUnpinned, "media-install-held": r.MediaInstallHeld, "media-install-download": r.MediaInstallDownload, "media-install-lost": r.MediaInstallLost, "media-install": r.MediaInstall,
}[name]
last := ""
for {
Expand All @@ -170,7 +225,7 @@ func phase(name, configPath string, once bool) error {
fmt.Println("Installation admitted and delivered; its result remains Unknown")
return nil
}
if err == nil && (name == "commission" || name == "recovery-mismatch" || name == "probe-unallocatable" || name == "tenant-isolation") {
if err == nil && (name == "commission" || name == "recovery-mismatch" || name == "probe-unallocatable" || name == "tenant-isolation" || strings.HasPrefix(name, "media-")) {
return nil
}
if err == nil {
Expand Down
69 changes: 67 additions & 2 deletions cmd/fleet-multiplane/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package main

import (
"context"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"net/netip"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -170,7 +172,38 @@ func redfishConfig() (redfishwork.Config, redfish.Enrollment, error) {
if err != nil {
return redfishwork.Config{}, redfish.Enrollment{}, err
}
return redfishwork.Config{ConsoleRoot: console, BootRoot: boot, Synced: enrollment.DHCP == redfish.DHCPSynced, DHCPInstances: enrollment.DHCPInstances}, enrollment, nil
work := redfishwork.Config{ConsoleRoot: console, BootRoot: boot, Synced: enrollment.DHCP == redfish.DHCPSynced, DHCPInstances: enrollment.DHCPInstances, Artifacts: artifacts}
// The site's trust for the central media service: its certificate in
// PEM, base64 encoded. A site without it cannot use virtual media.
if value := os.Getenv("FLEET_MEDIA_CA"); value != "" {
ca, err := base64.StdEncoding.DecodeString(value)
if err != nil {
return redfishwork.Config{}, redfish.Enrollment{}, errors.New("FLEET_MEDIA_CA must be a base64 PEM certificate")
}
work.MediaCA = ca
}
// Where the media service sees this site's installed servers report
// from: IPv4 or IPv6 prefixes, comma separated.
for _, value := range strings.Split(os.Getenv("FLEET_MEDIA_REPORT_FROM"), ",") {
if value = strings.TrimSpace(value); value == "" {
continue
}
prefix, err := netip.ParsePrefix(value)
if err != nil {
return redfishwork.Config{}, redfish.Enrollment{}, errors.New("FLEET_MEDIA_REPORT_FROM must list address prefixes")
}
work.ReportFrom = append(work.ReportFrom, prefix.Masked())
}
// How this site's installed servers reach the media service, when not
// at its recorded endpoint.
if value := os.Getenv("FLEET_MEDIA_REPORT_ORIGIN"); value != "" {
origin, err := redfish.ParseEndpoint(value)
if err != nil || !strings.HasPrefix(origin, "https://") {
return redfishwork.Config{}, redfish.Enrollment{}, errors.New("FLEET_MEDIA_REPORT_ORIGIN must be https://IP:port")
}
work.ReportOrigin = origin
}
return work, enrollment, nil
}

// siteRunner is the site runner for this cell's mode. A Redfish worker reads
Expand Down Expand Up @@ -206,7 +239,13 @@ func siteRunner(_ context.Context, config *rest.Config, cell string, store *site
for _, target := range enrollment.Targets {
targets[target.Device] = target
}
runner.Access = site.RedfishAccess{Credentials: site.SecretCredentials{Reader: reader, Namespace: namespace, Project: project}, Targets: targets}
access := site.RedfishAccess{Credentials: site.SecretCredentials{Reader: reader, Namespace: namespace, Project: project}, Targets: targets}
// The site worker's media service identity is its own Secret, read under
// a grant of its own, never part of a Device's BMC credential.
if identity := os.Getenv("FLEET_SITE_WORKER_IDENTITY_NAMESPACE"); identity != "" {
access.MediaIdentity = site.SecretWorkerIdentity{Reader: reader, Namespace: identity}
}
runner.Access = access
// The site serves one boot image, which also burns in.
image, err := siteImage()
if err != nil {
Expand Down Expand Up @@ -307,3 +346,29 @@ func feedEnrollment(raw []byte) (redfish.Enrollment, error) {
}
return enrollment, nil
}

// mediaStale probes the site store for a delayed worker: below the Device's
// stored fence it can neither open a media window nor journal a media step.
// Both attempts are refused, so the probe writes nothing.
func mediaStale(device string) error {
store, err := openStore()
if err != nil {
return err
}
fence, _, err := store.Peek(device)
if err != nil {
return err
}
if fence < 2 {
return fmt.Errorf("media-stale: the Device has no fence above the first")
}
stale := fence - 1
if err := store.PutRecord(device, stale, "media", "stale-probe", map[string]any{"operation": "stale-probe", "fence": stale}); !errors.Is(err, site.ErrStaleFence) {
return fmt.Errorf("media-stale: a media window at fence %d was not refused: %v", stale, err)
}
if _, _, err := store.IntendWithPayload(device, stale, "stale-probe", "media-insert-boot", nil); !errors.Is(err, site.ErrStaleFence) {
return fmt.Errorf("media-stale: a media step at fence %d was not refused: %v", stale, err)
}
fmt.Printf("PASS at stored fence %d, a worker at fence %d was refused a media window and the media-insert-boot step\n", fence, stale)
return nil
}
4 changes: 3 additions & 1 deletion cmd/fleet-standalone-smoke/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ func main() {
Capacity: offers,
// The fixture Device's boot NIC and the simulator's one enrolled disk.
BootInterface: "primary", TargetDisks: []string{"disk-0"},
// The simulator site offers only network boot.
DeliveryMethods: custody.NetworkBootOnly,
}
runner := standalone.Runner{Client: provider, Allocator: allocator, Options: options}
if phase == standalone.PhaseCommission {
Expand Down Expand Up @@ -119,7 +121,7 @@ func coordinate(ctx context.Context, config *rest.Config, registry *custody.Regi
if err != nil {
return err
}
sites := &delivery.Sites{Sites: map[string]delivery.Site{siteName: remote}, Devices: map[string][]string{}}
sites := &delivery.Sites{Sites: map[string]delivery.Site{siteName: remote}, Devices: map[string][]string{}, Methods: map[string][]custody.OfferedMethod{siteName: custody.NetworkBootOnly}}
for _, device := range devices {
if device = strings.TrimSpace(device); device != "" {
sites.Devices[device] = []string{siteName}
Expand Down
Loading
Loading