Skip to content

RELOPS-2402: fleetbench PSU/firmware-throttle detector (hardware fleet) - #1263

Open
markcor wants to merge 2 commits into
masterfrom
RELOPS-2402-fleetbench
Open

markcor wants to merge 2 commits into
masterfrom
RELOPS-2402-fleetbench

Conversation

@markcor

@markcor markcor commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fleetbench-based PSU / firmware-throttle detector for the NUC13 hardware fleet.
Split out of #1235, which combined this with the Windows Defender hardening
(RELOPS-2396); that half is now in a separate PR.

Hardware-only: gated to the datacenter maintain-system path + the hardware_observability
profile, so cloud/VM workers are unaffected.

What it does (per hardware node)

  1. Install — new win_fleetbench module installs the version-pinned collector to
    C:\fleetbench plus per-hardware baselines (fleetbench_baselines.json), wired via
    hardware_observability. Version pinned in data/os/Windows.yaml.
  2. Benchmarkmaintainsystem-hw.ps1 runs fleetbench cpu --mode quick --duration 900s --json
    before worker-runner starts (once post-bootstrap, then at most once per 72h). 900s
    self-warms the node so PSU/thermal throttling actually surfaces — a short cold-boot run
    can false-pass.
  3. Evaluate — GOOD / BAD / MARGINAL / UNKNOWN vs the locked per-hardware baseline
    (nuc13: min-floor ≥75 / mean ≥100 / tputCV ≤25 = GOOD; min<50 OR cv>40 OR mean<95 = BAD).
    Hardware type identified in-script from Win32_ComputerSystem.Model; unknown hardware
    logs and does not error/block.
  4. Variance — compares the latest run to the node's first recorded run (drift over time).
  5. Report — NSClient++ external checks fleetbench and fleetbench_variance surface
    verdict + metrics to Marlin (matching Marlin services live in mozilla-it/marlin).

Files

New: modules/win_fleetbench/{manifests/init.pp,files/run_fleetbench.ps1,files/fleetbench_baselines.json},
modules/win_nsclient/files/check_fleetbench.ps1, modules/win_nsclient/files/check_fleetbench_variance.ps1

Modified: data/os/Windows.yaml, hardware_observability.pp, win_nsclient/manifests/init.pp,
win_nsclient/templates/nsclient.ini.epp, win_scheduled_tasks/files/maintainsystem-hw.ps1
(fleetbench functions + the Invoke-FleetbenchCheck call before StartWorkerRunner).

🤖 Generated with Claude Code

markcor and others added 2 commits July 1, 2026 08:58
Split out of PR #1235 (combined RELOPS-2396 branch) into fleetbench-only.

Per NUC13 hardware node, before worker-runner starts:
- win_fleetbench module installs the version-pinned collector to C:\fleetbench
  plus per-hardware baselines, wired via the hardware_observability profile.
- maintainsystem-hw.ps1 runs `fleetbench cpu --mode quick --duration 900s --json`
  once post-bootstrap then at most once per 72h; 900s self-warms the node so
  PSU/thermal throttling surfaces (a short cold-boot run can false-pass).
- Evaluates GOOD/BAD/MARGINAL/UNKNOWN vs the locked per-hardware baseline, plus
  drift vs the node's first recorded run.
- NSClient++ checks `fleetbench` and `fleetbench_variance` surface verdict +
  metrics to Marlin (Icinga2/Grafana).

Hardware-only: gated to the datacenter maintain-system path + hardware_observability.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Invoke-FleetbenchCheck runs `fleetbench cpu --duration 900s` (~15 min) before
worker-runner starts, so generic-worker is intentionally not up during the run.
The hourly gw_exe_check task can fire mid-benchmark once uptime passes its
15-minute grace period, see no generic-worker process, and escalate to
reboot/PXE reimage.

maintainsystem-hw.ps1: set MOZ_FLEETBENCH_RUNNING (run's UTC start time) at
Machine scope around the benchmark call, cleared in a finally so it is always
removed even on error.

gw_exe_check.ps1: read the marker live from the registry
([Environment]::GetEnvironmentVariable(..,'Machine'), not the possibly-stale
process env block) and skip the check while it is fresh. The marker is a
timestamp with a 30-min staleness cap, so a crash/reboot mid-run cannot
silently disable the watchdog.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@markcor

markcor commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Incorporated into the wim-bake-role branch (PR #1297, the Windows HW WIM pre-bake pipeline's ronin branch): both commits here were cherry-picked — 06badfa5 (fleetbench PSU/firmware-throttle detector) and 48a8b9d4 (skip gw_exe_check watchdog while fleetbench runs). Clean cherry-pick — maintainsystem-hw.ps1 auto-merged with that branch's Intel-GPU adapter / refresh-rate check (no conflict), and all PS files are AST-clean. So the pre-bake ronin branch now carries the fleetbench detector too.

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