Skip to content

feat(site-explorer): create power shelves by default#3276

Merged
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3152
Jul 11, 2026
Merged

feat(site-explorer): create power shelves by default#3276
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3152

Conversation

@chet

@chet chet commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Completes what #3280 started for switches: explored power shelves that match an expected_power_shelves record are now ingested out of the box too -- create_power_shelves and explore_power_shelves_from_static_ip default to true instead of false. The expected-hardware records remain the per-device gate, so these defaults only ever ingest hardware an operator has declared, and the flags stay available as site-wide kill switches.

Primary callouts are:

  • The power shelf creation defaults flip to true, matching create_machines (true all along) and create_switches (true since feat(site-explorer): default create_switches to true and log when skipping #3280).
  • The two default paths now agree by construction: Default::default() delegates to the serde default fns, and SiteExplorerConfig's PartialEq compares every field, destructuring Self without .. so a future field is a compile error rather than a silent comparison gap. Previously a config with no [site_explorer] section at all ran with these flags on while a config with the section got false -- and the parity test couldn't see it because PartialEq skipped the creation flags.
  • The now-exhaustive comparison made three full-config fixture tests assert their site_explorer fields for real, surfacing stale values that predate the nv-redfish default (explore_mode: LibRedfish, one old machines_created_per_run); the fixtures now match the parsed config.
  • Skipped-creation visibility rounds out: the power shelf skip log mirrors the switch one from feat(site-explorer): default create_switches to true and log when skipping #3280 (num_power_shelves, same actionable wording), both skip logs now name the full prerequisite (the creation flag plus a matching expected-hardware record), and an explored switch with no expected_switches record now logs per endpoint instead of silently vanishing (power shelves and machines already logged this case).
  • Docs follow: the configurability book page records all three creation defaults and the expected-record gating, and the config reference README gets fuller row descriptions plus a stale explore_mode default fix (it said libredfish; the code default is nv-redfish). The auto-generated metrics reference gains site_explorer_create_power_shelves_latency_seconds, which the now-default-on shelf creation phase emits.

Upgrade note: a site that declares expected_power_shelves records but never set the creation flags starts ingesting those shelves on upgrade (switches got this behavior in #3280). Setting the flags to false keeps ingestion off, exactly as before.

Tests added!

This supports #3152

Closes #3152

@chet chet requested a review from a team as a code owner July 8, 2026 20:20
@chet

chet commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b0ba32e1-ca80-40cd-ad69-68d384d5523c

📥 Commits

Reviewing files that changed from the base of the PR and between d1ea2cc and 468917a.

📒 Files selected for processing (7)
  • book/src/configuration/configurability.md
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/switch_creator.rs
  • docs/observability/core_metrics.md
✅ Files skipped from review due to trivial changes (4)
  • docs/observability/core_metrics.md
  • crates/api-core/src/cfg/README.md
  • crates/site-explorer/src/lib.rs
  • book/src/configuration/configurability.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/site-explorer/src/switch_creator.rs
  • crates/api-core/src/cfg/file.rs
  • crates/site-explorer/src/config.rs

Summary by CodeRabbit

  • New Features

    • Power shelves can be discovered via declared static IPs without requiring a DHCP lease (while still requiring power-shelf creation to be enabled).
    • Site Explorer now enables machine, switch, and power-shelf creation by default (when corresponding expected-device records are present).
    • Added power-shelf creation latency monitoring.
  • Documentation

    • Clarified configuration defaults and the rules that control creation eligibility and static-IP discovery.
  • Observability

    • Added informational logs guiding how to enable switch/power-shelf creation when discovery finds candidates but creation is turned off.

Walkthrough

Site Explorer defaults now enable machine, switch, and power-shelf creation plus static-IP power-shelf discovery. Exploration mode, equality checks, configuration tests, documentation, skip logging, and power-shelf latency documentation were updated.

Changes

Site Explorer configuration and observability

Layer / File(s) Summary
Configuration defaults and equality
crates/site-explorer/src/config.rs
Default helpers now initialize creation and discovery settings consistently, static-IP power-shelf exploration defaults to enabled, and SiteExplorerConfig equality compares all fields.
Configuration parsing and documentation
crates/api-core/src/cfg/README.md, crates/api-core/src/cfg/file.rs, book/src/configuration/configurability.md
Configuration expectations and tests use NvRedfish, updated machine limits, and enabled creation flags; documentation describes expected_* gating and static-IP discovery.
Creation gating logs and metrics
crates/site-explorer/src/lib.rs, crates/site-explorer/src/switch_creator.rs, docs/observability/core_metrics.md
Informational logs identify explored power shelves skipped when creation is disabled and switches skipped without matching expected records; the power-shelf creation latency histogram is documented.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 76.92% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: power shelves are now created by default in Site Explorer.
Description check ✅ Passed The description is directly related to the changeset and accurately describes the config, logging, tests, and docs updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@chet, you're welcome! I'll kick off a full review of all the changes in this PR now.

🐇✨

✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 4 minutes.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔍 Container Scan Summary

Service Total Critical High Medium Low Other
boot-artifacts-aarch64 3 0 0 3 0 0
boot-artifacts-x86_64 3 0 0 3 0 0
forge-admin-cli-x86_64 271 13 34 91 7 126
machine-validation-runner 804 40 237 296 36 195
machine_validation 804 40 237 296 36 195
machine_validation-aarch64 804 40 237 296 36 195
nvmetal-carbide 804 40 237 296 36 195
TOTAL 3493 173 982 1281 151 906

Per-CVE detail lives in the per-service grype-* artifacts (JSON + SARIF). Severity counts only — no CVE IDs published here.

@chet chet changed the title feat(site-explorer): create switches and power shelves by default feat(site-explorer): create power shelves by default Jul 10, 2026
@chet

chet commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@chet, you're welcome! I'll kick off another full review of all the changes in this PR now.

✅ Action performed

Full review finished.

@github-actions

Copy link
Copy Markdown

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@book/src/configuration/configurability.md`:
- Line 1192: Update the quick-reference table entry for site explorer settings
to include the site-wide `explore_power_shelves_from_static_ip` option, or add a
dedicated row distinguishing static-IP discovery from switch/power-shelf
creation; use the exact repository configuration terminology and document its
behavior and default consistently.

In `@crates/api-core/src/cfg/README.md`:
- Line 306: The README description for `explore_power_shelves_from_static_ip`
should explicitly state that discovery uses the static IPs declared in
`expected_power_shelves`, rather than discovering arbitrary power shelves.
Update the option’s description to document this configuration prerequisite
accurately.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6cea4b35-9eaf-4fb2-9178-58e491750cfb

📥 Commits

Reviewing files that changed from the base of the PR and between 2c3bf2f and cbeb549.

📒 Files selected for processing (6)
  • book/src/configuration/configurability.md
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/switch_creator.rs

Comment thread book/src/configuration/configurability.md Outdated
Comment thread crates/api-core/src/cfg/README.md Outdated
@chet chet requested a review from polarweasel as a code owner July 10, 2026 04:21
@chet

chet commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@chet, you're welcome! Kicking off another full review of all the changes in this PR now.

(ᵔᴥᵔ)

✅ Action performed

Full review finished.

@chet chet enabled auto-merge (squash) July 10, 2026 04:43
@chet

chet commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@chet, you're welcome! Kicking off another full review of all the changes in this PR now.

✅ Action performed

Full review finished.

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/site-explorer/src/lib.rs`:
- Around line 890-895: Update the skip log in the exploration handling branch to
mention both prerequisites: set [site_explorer] create_power_shelves=true and
provide matching expected_power_shelves records. Adjust the tracing::info!
message so operators understand that shelves are also skipped when no
expected-hardware record exists.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b75a2916-a42f-4669-8739-31027973c1c0

📥 Commits

Reviewing files that changed from the base of the PR and between fde34a4 and 437ecf1.

📒 Files selected for processing (7)
  • book/src/configuration/configurability.md
  • crates/api-core/src/cfg/README.md
  • crates/api-core/src/cfg/file.rs
  • crates/site-explorer/src/config.rs
  • crates/site-explorer/src/lib.rs
  • crates/site-explorer/src/switch_creator.rs
  • docs/observability/core_metrics.md

Comment thread crates/site-explorer/src/lib.rs
@chet

chet commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

@chet, you're welcome! Kicking off another full review of all the changes in this PR now.

✅ Action performed

Full review finished.

Comment thread book/src/configuration/configurability.md Outdated
plus thresholds for DPU agent compliance. Operators flip this from
`MonitorOnly` to `Enforce` once their fleet's baseline is clean.

### Site Explorer

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.

This whole section (and doubtless a bunch of others around the docs) could be a bulleted list, or dictionary term entries. If you want to do that, the ParamField component is a fun one to play with: https://buildwithfern.com/learn/docs/writing-content/components/parameter-fields

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@polarweasel Done! Thanks!

| SPDM | siteConfig | `[spdm].enabled` | off | Hardware attestation via NRAS. |
| Rack Management | siteConfig | `rack_management_enabled = true` | off | Standalone infrastructure manager mode (GB200/GB300/VR144). |
| Site Explorer machine auto-creation | siteConfig | `[site_explorer].create_machines` | on | Disable for manual-onboarding environments. |
| Site Explorer switch / power shelf auto-creation | siteConfig | `[site_explorer].create_switches` / `[site_explorer].create_power_shelves` | on | Ingests only declared hardware (`expected_switches` / `expected_power_shelves` records). Disable to hold switch or power shelf ingestion back site-wide. |

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.

Either use "pause" here, or "hold back", but don't split "hold back" if you use it.

Suggested change
| Site Explorer switch / power shelf auto-creation | siteConfig | `[site_explorer].create_switches` / `[site_explorer].create_power_shelves` | on | Ingests only declared hardware (`expected_switches` / `expected_power_shelves` records). Disable to hold switch or power shelf ingestion back site-wide. |
| Site Explorer switch / power shelf auto-creation | siteConfig | `[site_explorer].create_switches` / `[site_explorer].create_power_shelves` | on | Ingests only declared hardware (`expected_switches` / `expected_power_shelves` records). Disable to pause switch or power shelf ingestion site-wide. |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@polarweasel Done! Thanks!

Completes what NVIDIA#3280 started for switches: explored power shelves that match an `expected_power_shelves` record are now ingested out of the box too -- `create_power_shelves` and `explore_power_shelves_from_static_ip` default to true instead of false. The expected-hardware records remain the per-device gate, so these defaults only ever ingest hardware an operator has declared, and the flags stay available as site-wide kill switches.

Primary callouts are:

- The power shelf creation defaults flip to true, matching `create_machines` (true all along) and `create_switches` (true since NVIDIA#3280).
- The two default paths now agree by construction: `Default::default()` delegates to the serde default fns, and `SiteExplorerConfig`'s `PartialEq` compares every field, destructuring `Self` without `..` so a future field is a compile error rather than a silent comparison gap. Previously a config with no `[site_explorer]` section at all ran with these flags on while a config with the section got false -- and the parity test couldn't see it because `PartialEq` skipped the creation flags.
- The now-exhaustive comparison made three full-config fixture tests assert their `site_explorer` fields for real, surfacing stale values that predate the `nv-redfish` default (`explore_mode: LibRedfish`, one old `machines_created_per_run`); the fixtures now match the parsed config.
- Skipped-creation visibility rounds out: the power shelf skip log mirrors the switch one from NVIDIA#3280 (`num_power_shelves`, same actionable wording), both skip logs now name the full prerequisite (the creation flag plus a matching expected-hardware record), and an explored switch with no `expected_switches` record now logs per endpoint instead of silently vanishing (power shelves and machines already logged this case).
- Docs follow: the configurability book page records all three creation defaults and the expected-record gating, and the config reference README gets fuller row descriptions plus a stale `explore_mode` default fix (it said `libredfish`; the code default is `nv-redfish`). The auto-generated metrics reference gains `site_explorer_create_power_shelves_latency_seconds`, which the now-default-on shelf creation phase emits.

Upgrade note: a site that declares `expected_power_shelves` records but never set the creation flags starts ingesting those shelves on upgrade (switches got this behavior in NVIDIA#3280). Setting the flags to false keeps ingestion off, exactly as before.

Tests added!

This supports NVIDIA#3152

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet chet merged commit 4a3d005 into NVIDIA:main Jul 11, 2026
108 of 110 checks passed
@chet chet deleted the gh-issue-3152 branch July 11, 2026 03:12
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.

docs/ux(site-explorer): create_switches defaults to false — explored switches are silently never ingested

3 participants