feat(nico): add NICo governance metrics validation (CAP01-01) - #451
Conversation
Adds a provider-agnostic GovernanceMetricsCheck plus a NICo-side
aggregator so the bare_metal suite verifies that the cloud governance
API surfaces the canonical Delivered, Healthy, Reserved, and Active
buckets for both nodes and GPUs (CAP01-01).
- GovernanceMetricsCheck (isvtest): asserts the four canonical metric
buckets exist with non-negative integer (nodes, gpus) counts and that
the inter-metric invariants hold (Healthy / Reserved \u2286 Delivered,
Active \u2286 Reserved). Optional min_delivered_{nodes,gpus} thresholds.
- NICo query_metrics.py: reuses the shared NICo client to page through
the site's machines and classify each by MachineStatus into the
governance buckets (Decommissioned/Unknown excluded so they cannot
leak into Reserved/Active). GPU counts sum MachineCapability.count.
- bare_metal suite: new query_governance_metrics step + GovernanceMetrics
validation; the step is omitted by providers that have not wired it
yet so it skips automatically (matches the ingestion/dpu pattern).
- Provider config: wires the NICo provider to invoke the new script.
- Documentation: suites/README.md lists the new step and JSON fields.
Tests cover the validation's bucket-shape, value-type, threshold and
invariant paths, plus the NICo script's status-bucket mapping,
nullable-field tolerance, error propagation, and an end-to-end contract
test that pipes the script's JSON through the validation.
Ships unreleased (released_tests.json is unchanged); exercise via
ISVTEST_INCLUDE_UNRELEASED=1.
Closes #251
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Alexandre Begnoche <abegnoche@users.noreply.github.com>
|
/ok to test 63aac42 |
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-06-08 17:59:59 UTC | Commit: 63aac42 |
Collapse the per-bucket helpers in query_metrics.py: drop the _EMPTY_BUCKET constant and its copies for a name-tuple + dict comprehension, remove the trivial _add() wrapper, and fold the four near-identical conditionals into a single membership map. Behavior is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
63aac42 to
8c9a573
Compare
|
/ok to test 63aac42 |
@abegnoche, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
|
/ok to test dfa76f4 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (8)
WalkthroughThis PR introduces a complete governance metrics capability for bare-metal NICo validation. A new query_metrics.py script queries the NICo API for machines at a site, classifies them into delivered/healthy/reserved/active buckets based on status rules, and outputs aggregated node and GPU counts. A new GovernanceMetricsCheck validation reads this output, enforces schema correctness, rejects invalid types and negative values, validates bucket subset relationships, and optionally enforces minimum delivered thresholds. Comprehensive tests cover the script's classification logic and edge cases, plus full validation unit coverage. ChangesGovernance Metrics Query and Validation
🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
Adds the M6 CAP01-01 governance metrics validation as a follow-up to the NICo work in #450. A Cloud Governance API must expose Delivered, Healthy, Reserved, and Active counts for nodes and GPUs; this PR validates that contract end-to-end on the NICo provider.
GovernanceMetricsCheck(isvtest/.../validations/governance.py): provider-agnostic check that the four buckets exist with non-negative integer(nodes, gpus)counts and thatHealthy/Reserved ⊆ DeliveredandActive ⊆ Reserved. Optionalmin_delivered_{nodes,gpus}thresholds.query_metrics.py(providers/nico/scripts/governance/): pages the site's machines via the shared NICo client and maps eachMachineStatusinto a bucket (Decommissioned/Unknownexcluded). GPU counts sumMachineCapability.count.bare_metal.yamlgets agovernance_metricsvalidation on a newquery_governance_metricsstep (opt-in, so providers that don't wire it skip automatically); the NICo config wires the script with the existingorg/site_id/api_basesettings.configs/suites/README.mdlists the new step and JSON fields.NICo
MachineStatus→ bucket: Delivered = not{Decommissioned, Unknown}; Healthy = Delivered with nohealth.alerts; Reserved ={InUse, Maintenance}; Active ={InUse}.Ships unreleased (
released_tests.jsonuntouched); run withISVTEST_INCLUDE_UNRELEASED=1.Testing
make test— 925 pass (17 new validation cases + 6 new NICo script cases, incl. an end-to-end test piping the script's JSON through the validation).make lint/uvx pre-commit run -a— clean.make demo-test—my-isvconfigs pass; new check skips withstep_not_configuredwhere the step isn't wired.ISVTEST_INCLUDE_UNRELEASED=1 isvctl test run -f providers/nico/config/bare_metal.yaml):GovernanceMetricsCheck PASSED — delivered: nodes=20, gpus=160across the 20-machine site.Closes #251
Summary by CodeRabbit
New Features
Documentation
Tests