← Back to Pull requests

feat(uat): validate NVSentinel GPU health monitors on the sim lane #3019

Closed
unknown closed this pull request without merging on Oct 06, 2026 12:30 UTC
View on GitHub
unknown unknown commented on Oct 01, 2026 11:30 UTC
Author

Supersedes #2964, which GitHub closed automatically when its base branch (feat/2358-uat-slurm-kwok-lane, #2661) was deleted on merge. This PR carries the same feature commit, replayed onto main with its hand-written lines byte-identical, plus fixes for the four CodeRabbit findings raised on #2964. Each fix is a failing test commit followed by its fix commit:

  • A failed sibling DaemonSet read was treated as zero (4122548818). Valid. An API error yielded empty output, ${desired:-0} made it 0, and the gate reported the sibling "correctly inactive". The read's exit status is now checked and a numeric count required; each failure has its own message. Test d8d449847, fix 3d71a1e9d.

  • Wait for the labeler instead of failing on the first read (4122548806). Valid. The labeler writes dcgm.version from its own pod event handlers after its caches sync, and nothing before this step waits for that. The label and the DaemonSet are now polled under one MONITOR_TIMEOUT deadline. Test 40a1b665e, fix b191ae2bc.

  • Require monitor coverage on every simulated worker (4122548811). Valid, adopted by node name rather than by count, so a labelled control plane cannot stand in for a missing worker. Also requires the DaemonSet to schedule and ready one pod per worker. Test daa53a930, fix 25cd0a891.

  • The step timeout equalled the polling deadline (4122548777). Valid. Past the 900s deadline the script still makes up to four bounded kubectl reads (1030s worst case), so the step is now 20 minutes and a test pins it above that bound. Test 943a58b86, fix 1446a4d51.
  • Summary

    Adds a DCGM host engine to the simulated-GPU lane so NVSentinel's GPU health monitor runs and is gated there, with no GPU hardware.

    Motivation / Context

    The lane already deploys NVSentinel, but its GPU health monitors never run there. They are DaemonSets gated on nvsentinel.dgxc.nvidia.com/dcgm.version, which NVSentinel's labeler writes only when it finds a Ready pod labelled app=nvidia-dcgm whose image string matches dcgm:<major>.. This lane excludes gpu-operator, so nothing supplies a host engine, the label is never written, and the monitors sit at desiredNumberScheduled: 0 with nothing failing.

    Nothing on that path inspects a GPU. A real DCGM host engine reading the mocked NVML driver the lane already installs is enough.

    Fixes: #3020
    Related: #2623
    Related: #2358

    Type of Change

  • Bug fix (non-breaking change that fixes an issue)

  • New feature (non-breaking change that adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

  • Documentation update

  • Refactoring (no functional changes)

  • Build/CI/tooling
  • Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)

  • API server (cmd/aicrd, pkg/server)

  • Recipe engine / data (pkg/recipe)

  • Bundlers (pkg/bundler, pkg/component/*)

  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)

  • Validator (pkg/validator)

  • Core libraries (pkg/errors, pkg/k8s)

  • Docs/examples (docs/, examples/)

  • Other: tests/uat/kind, .github/workflows/uat-kind-sim.yaml
  • Implementation Notes

    Three details are load-bearing, each failed at least once while this was built, and all three fail silently.

    The image reference carries both a tag and a digest. Everything else in this lane is pinned by bare digest. A bare digest contains no dcgm:<major>. substring, so pinning that way stops the labeler stamping and the monitors never schedule. The digest still decides which bytes run; the tag exists for the labeler to parse. Two independent checks enforce both halves.

    nv-hostengine binds loopback by default, so -b ALL is required. Without it the monitor fails the handshake and reports a Python AttributeError naming neither the bind address nor the Service.

    The host engine image is ~2GB and is not side-loaded, so it gets its own rollout budget rather than the shared 300s. A 905MB image measured 338s cold on this hardware. Sharing the budget would fail the lane for being slow rather than wrong, and the usual repair is to widen a timeout until it stops discriminating.

    The gate is a lane step rather than a recipe health check because recipes/checks/nvsentinel must stay tolerant of desiredNumberScheduled: 0, which is correct on every lane that supplies no host engine. Same split, and the same reason, as verify-topology.sh.

    What the gate requires. Every worker named by worker_indices carries dcgm.version=<major>.x, compared by node name; the matching monitor DaemonSet has one Ready pod per worker; and its sibling DaemonSet reads a successful 0. The label wait and the DaemonSet wait share one MONITOR_TIMEOUT (900s): the DaemonSet cannot schedule before the label exists, so they are one sequence. Each loop reads before it checks the deadline, so a label that lands at the deadline still gets the DaemonSet read. A failed read is retried while waiting and is never counted as success.

    Step order on main. The chain is install, readiness, topology, gpu_health, conformance. Conformance names both topology and gpu_health explicitly. The chain would hold transitively, but the invariant this lane states is that conformance must not publish evidence for a wrong topology, and an invariant surviving only by transitivity is one a later edit can drop without noticing. The job budget comment now includes the step (sum 283, under the 300-minute job timeout).

    Testing

    cd tests/uat/kind && shellcheck -x setup-gpu-sim.sh setup-gpu-sim_test.sh \
      verify-gpu-health-monitors.sh verify-gpu-health-monitors_test.sh   # rc=0
    actionlint -shellcheck= .github/workflows/uat-kind-sim.yaml          # rc=0
    yamllint -c .yamllint.yaml .github/workflows/uat-kind-sim.yaml       # rc=0
    for t in tests/uat/lib/*_test.sh tests/uat/kind/*_test.sh; do bash "$t"; done
    go test -race -count=1 ./tests/uat/...                               # ok
    golangci-lint run -c .golangci.yaml ./tests/uat/...                  # 0 issues
    git merge-tree --write-tree upstream/main HEAD                       # clean
    

    Shell suites, all rc=0:

    tests/uat/lib/cuj-dispatch_test.sh                 ok=14
    tests/uat/lib/phases_test.sh                       rc=0
    tests/uat/lib/platform-crd-map_test.sh             ok=7
    tests/uat/lib/platform-gate_test.sh                ok=32
    tests/uat/lib/validate-phases_test.sh              ok=20
    tests/uat/kind/bootstrap-cluster_test.sh           ok=26
    tests/uat/kind/setup-gpu-sim_test.sh               ok=60
    tests/uat/kind/skip-checks_test.sh                 ok=6
    tests/uat/kind/topology-golden_test.sh             ok=61
    tests/uat/kind/verify-gpu-health-monitors_test.sh  ok=42
    

    The new cases drive the verifier's main with only kubectl stubbed, one layer deep, and sleep advancing SECONDS, so polling costs no real time. Each was red before its fix, and each new guard was mutation-checked: removing the read's exit-status check, removing the numeric check, swapping the by-name worker comparison for a count, dropping the one-pod-per-worker clause, and checking the deadline before the first DaemonSet read each turn the suite red. Raising MONITOR_TIMEOUT to 1200 without the step turns the budget check red. The guards from #2964 (tag plus digest, app label, -b ALL, Service port, separate rollout budgets, conformance gating, step id) were mutation-checked there and are unchanged.

    Live verification predates this revision. #2964's feature commit was run on a two-node kind cluster with no GPU, against nvsentinel v1.20.0: the labeler stamped dcgm.version=4.x from the tag-plus-digest reference, and gpu-health-monitor-dcgm-4.x reached 1/1 Ready, logging Successfully created DCGM handle and supported gpus are [0, 1, 2, 3]. main now pins nvsentinel v1.25.0. Its labeler (same dcgm:<major>. regexes, same app pod index, same Ready requirement) and its monitor DaemonSets (same names, same dcgm.version nodeSelector, the new DCGM startup gate off by default) were checked against v1.25.0 source, not run. The four-worker lane, the polling, and the per-worker coverage have not been run live.

    make qualify has not been run for this revision. #2921 (open) tracks a make qualify failure on main.

    Risk Assessment

  • Low: Additive, scoped to one lane that runs only on manual dispatch. The new step runs after topology and before conformance, so a failure blocks evidence rather than producing it.

  • Medium: Touches multiple components or has broader impact

  • High: Breaking change, affects critical paths, or complex rollout
  • Rollout notes: The bootstrap step's budget is raised from 25 to 30 minutes (6cf889e9e), because the waits inside it now total 27.5 minutes at worst (node Ready 300s, device plugin rollout 300s, DCGM rollout 900s, capacity 150s) and the step has to outlive them to report why it failed. The comments that cite the NVSentinel labeler now name the pinned v1.25.0 (2b01b56ff).

    Checklist

  • Tests pass locally (make test with -race): go test -race ./tests/uat/... and the shell suites above; make test not run

  • Linter passes (make lint): golangci-lint, shellcheck, actionlint and yamllint on the changed paths; make lint not run

  • I did not skip/disable tests to make CI green

  • I added/updated tests for new functionality

  • I updated docs if user-facing behavior changed (N/A, CI-only)

  • Changes follow existing patterns in the codebase

  • Commits are cryptographically signed (git commit -S): GPG signing info
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: ArangoGutierrez Review duration: 7260m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3019"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%
    Repository