Skip to content

fix(infiniband): make accelerator discovery pluggable - #457

Merged
dmitsh merged 1 commit into
mainfrom
ds-nvl
Aug 11, 2026
Merged

fix(infiniband): make accelerator discovery pluggable#457
dmitsh merged 1 commit into
mainfrom
ds-nvl

Conversation

@dmitsh

@dmitsh dmitsh commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Decouple accelerator-domain discovery from InfiniBand fabric discovery.
Support nvidia-smi, Kubernetes Node labels, and disabled discovery through
provider.params.accelerator.

Query NVL partition IDs using the nvidia-smi CSV interface, deduplicate
per-GPU results, reject unavailable fields, and normalize IDs as
ClusterUUID.CliqueId. Grant node-data-broker GPU Operator permissions only
when nvidia-smi discovery is enabled.

BREAKING CHANGE: remove useGpuCliqueLabel. Omitting accelerator, using an
empty accelerator section, or selecting source: none disables accelerator
discovery.

closes #458

@dmitsh
dmitsh requested a review from ravisoundar as a code owner August 11, 2026 03:12
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added configurable InfiniBand accelerator-domain discovery via NVIDIA-SMI, Kubernetes labels, or no discovery.
    • Improved NVLink partition identification by merging duplicate records, normalizing IDs, and rejecting invalid data.
    • Added configuration-file support for node data broker settings and health-port configuration.
  • Bug Fixes

    • Added validation and clearer errors for invalid accelerator settings.
  • Documentation

    • Updated provider, API, Helm, and architecture documentation with the new options.
    • Added an unreleased changelog entry.

Walkthrough

InfiniBand providers now support configurable accelerator discovery through NVIDIA SMI, Kubernetes labels, or no discovery. NVIDIA SMI output is normalized into accelerator assignments used to build topology domains. The node data broker now receives provider configuration through a mounted YAML file.

Changes

InfiniBand accelerator discovery

Layer / File(s) Summary
Accelerator contracts and NVIDIA SMI discovery
pkg/accelerator/*
The new package validates accelerator sources, supports metadata and no-op discovery, executes NVIDIA SMI, and normalizes ClusterUUID.CliqueId values.
InfiniBand provider integration
pkg/providers/infiniband/*
Bare-metal and Kubernetes providers configure accelerator discoverers and build topology domains from discovered assignments.
Node data broker configuration flow
cmd/node-data-broker/*, charts/topograph/templates/nodeDataBroker/*
The broker loads YAML configuration and receives provider parameters through a mounted ConfigMap. RBAC now grants NVIDIA SMI permissions only when that source is selected.
Helm validation and documentation
charts/topograph/*, docs/*, CHANGELOG.md, AGENTS.md, .claude/CLAUDE.md
Helm validation, examples, documentation, changelog entries, and repository guidance now describe configurable accelerator sources.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: ravisoundar

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.69% 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 and concisely summarizes the main change: pluggable accelerator discovery for InfiniBand.
Description check ✅ Passed The description directly explains the accelerator discovery changes, supported sources, behavior, permissions, and breaking changes.
Linked Issues check ✅ Passed The changes implement the linked issue objectives for pluggable sources, configuration rules, nvidia-smi ID handling, and conditional GPU permissions.
Out of Scope Changes check ✅ Passed The code, chart, documentation, tests, and repository guidance changes all support the linked accelerator discovery objectives.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ds-nvl

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

@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR separates InfiniBand fabric discovery from accelerator-domain discovery and introduces configurable NVIDIA SMI, Kubernetes-label, and disabled accelerator sources.

  • Adds the reusable pkg/accelerator discovery and validation layer.
  • Composes accelerator assignments with both Kubernetes and bare-metal InfiniBand topology.
  • Migrates node-data-broker configuration from individual flags to a mounted YAML configuration.
  • Conditionally grants GPU Operator access when NVIDIA SMI discovery is enabled.
  • Updates Helm validation, configuration schema, tests, examples, and documentation.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the scope of this follow-up review.

No blocking failure remains.

Important Files Changed

Filename Overview
pkg/accelerator/accelerator.go Defines accelerator configuration parsing, source validation, metadata discovery, and the shared assignment model.
pkg/accelerator/nvidia_smi.go Implements NVIDIA SMI discovery with CSV parsing, per-GPU deduplication, unavailable-field rejection, and normalized partition IDs.
pkg/providers/infiniband/provider_k8s.go Composes Kubernetes-backed accelerator assignments with independently discovered InfiniBand fabric topology.
pkg/providers/infiniband/provider_bm.go Makes bare-metal accelerator discovery configurable and merges its assignments with the InfiniBand graph.
cmd/node-data-broker/main.go Migrates broker startup to mounted YAML configuration and delegates node-local accelerator collection to the new discovery layer.
charts/topograph/templates/nodeDataBroker/daemonset.yaml Mounts the generated broker configuration and restarts pods when that configuration changes.
charts/topograph/templates/nodeDataBroker/rbac.yaml Restricts GPU Operator permissions to deployments selecting NVIDIA SMI discovery.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Config[provider.params.accelerator] --> Source{Accelerator source}
  Source -->|nvidia-smi| SMI[NVIDIA SMI discovery]
  Source -->|kubernetes-label| Label[Kubernetes Node label]
  Source -->|none or omitted| Disabled[No accelerator assignments]
  SMI --> Assignments[Accelerator assignments]
  Label --> Assignments
  Disabled --> Assignments
  IB[ibnetdiscover fabric topology] --> Provider[InfiniBand provider]
  Assignments --> Provider
  Provider --> Graph[Canonical topology graph]
Loading

Reviews (7): Last reviewed commit: "fix(infiniband): make accelerator discov..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@pkg/providers/infiniband/common.go`:
- Around line 30-40: Treat rows whose parsed ClusterUUID or CliqueId is the
NVIDIA-SMI unavailable sentinel “N/A” as explicitly unavailable in
parseNVLPartitionID, and update bm.go’s setID flow and k8s.go’s partitions
collection to skip those results before creating domains or annotations. In
pkg/providers/infiniband/bm_test.go at lines 18-57, add unavailable-only and
valid-plus-unavailable regression cases; in pkg/providers/infiniband/k8s_test.go
at lines 86-111, add an unavailable-only case ensuring N/A.N/A is never emitted,
and include malformed-input coverage as required.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: 2cb97d13-16af-4b41-af83-b4caf0b9c939

📥 Commits

Reviewing files that changed from the base of the PR and between d138d34 and 4ff7e7f.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • docs/providers/infiniband.md
  • pkg/providers/infiniband/bm.go
  • pkg/providers/infiniband/bm_test.go
  • pkg/providers/infiniband/common.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/k8s_test.go
  • pkg/providers/infiniband/provider_bm.go
📜 Review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: build
  • GitHub Check: test
  • GitHub Check: govulncheck
  • GitHub Check: check
  • GitHub Check: k8s / gcp-sim
  • GitHub Check: k8s / aws-sim
  • GitHub Check: oci-sim / slinky
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (7)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/common.go
  • pkg/providers/infiniband/k8s_test.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/bm_test.go
  • pkg/providers/infiniband/bm.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must return a *topology.Graph and *httperr.Error; plain error is not acceptable at the provider interface boundary.
Providers discover topology and return the canonical topology.Graph; they must not emit scheduler-specific output.
When using ClusterTopology, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call ToGraph.

Files:

  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/common.go
  • pkg/providers/infiniband/k8s_test.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/bm_test.go
  • pkg/providers/infiniband/bm.go
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not publicly disclose suspected security vulnerabilities; report them privately through NVIDIA PSIRT using the channels documented in SECURITY.md.
Every commit must include a Signed-off-by: trailer for DCO compliance.
Use Conventional Commits with an allowed type such as feat, fix, docs, chore, refactor, test, build, or ci.
Before pushing, run make qualify; all CI checks, including Go build/test/lint, Codecov, and DCO, must be green before merge.
Changes to provider, engine, chart, API, configuration schema, labels, annotations, or user-facing behavior must include the corresponding documentation updates described in the documentation impact table.

Files:

  • pkg/providers/infiniband/provider_bm.go
  • CHANGELOG.md
  • docs/providers/infiniband.md
  • pkg/providers/infiniband/common.go
  • pkg/providers/infiniband/k8s_test.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/bm_test.go
  • pkg/providers/infiniband/bm.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/common.go
  • pkg/providers/infiniband/k8s_test.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/bm_test.go
  • pkg/providers/infiniband/bm.go
CHANGELOG.md

📄 CodeRabbit inference engine (AGENTS.md)

Record applicable user-facing features, fixes, breaking changes, or Helm migrations under [Unreleased].

Files:

  • CHANGELOG.md
docs/providers/**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Provider additions or changes require the corresponding provider documentation, including prerequisites, credentials, parameters, operation, and verification.

Files:

  • docs/providers/infiniband.md
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior and new code paths should be covered by tests.

Files:

  • pkg/providers/infiniband/k8s_test.go
  • pkg/providers/infiniband/bm_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/infiniband/k8s_test.go
  • pkg/providers/infiniband/bm_test.go
🔇 Additional comments (6)
pkg/providers/infiniband/common.go (1)

21-21: LGTM!

pkg/providers/infiniband/k8s.go (1)

13-13: LGTM!

Also applies to: 73-76

docs/providers/infiniband.md (1)

49-49: LGTM!

CHANGELOG.md (1)

29-29: LGTM!

pkg/providers/infiniband/bm.go (1)

22-32: LGTM!

Also applies to: 85-90

pkg/providers/infiniband/provider_bm.go (1)

40-40: LGTM!

Comment thread pkg/providers/infiniband/common.go Outdated
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.09677% with 102 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.90%. Comparing base (8468abe) to head (faf279d).
⚠️ Report is 51 commits behind head on main.

Files with missing lines Patch % Lines
pkg/accelerator/kubernetes.go 36.36% 27 Missing and 1 partial ⚠️
pkg/providers/infiniband/provider_k8s.go 0.00% 20 Missing ⚠️
cmd/node-data-broker/main.go 48.57% 18 Missing ⚠️
pkg/accelerator/nvidia_smi.go 82.35% 6 Missing and 6 partials ⚠️
pkg/providers/infiniband/bm.go 71.42% 10 Missing ⚠️
pkg/accelerator/accelerator.go 93.10% 4 Missing and 2 partials ⚠️
pkg/providers/infiniband/k8s.go 55.55% 2 Missing and 2 partials ⚠️
pkg/providers/infiniband/provider_bm.go 66.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #457      +/-   ##
==========================================
+ Coverage   72.15%   76.90%   +4.74%     
==========================================
  Files          89       99      +10     
  Lines        5689     7149    +1460     
==========================================
+ Hits         4105     5498    +1393     
+ Misses       1382     1365      -17     
- Partials      202      286      +84     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🤖 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 @.claude/CLAUDE.md:
- Around line 27-30: Add the text language identifier to the opening
repository-map code fence in .claude/CLAUDE.md at lines 27-30 and apply the same
change to the corresponding fence in AGENTS.md at lines 27-30; leave the
repository-map contents unchanged.

In `@charts/topograph/templates/_validation.tpl`:
- Around line 23-43: Normalize the persisted provider configuration’s
accelerator source to lowercase, not only the local $source validation value.
Update the provider serialization used by nodeObserver/configmap.yml so
accelerator.source values such as NVIDIA-SMI are emitted as lowercase constants
accepted by accelerator.Config.Validate(), while preserving the existing
validation behavior.

In `@charts/topograph/tests/node-data-broker_rbac_test.yaml`:
- Around line 116-147: Expand both negative RBAC test cases for the absent
accelerator section and the kubernetes-label accelerator source to assert that
rules also exclude daemonsets:get and pods:list, in addition to
pods/exec:create. Apply the same complete absence checks to the additional case
referenced after this diff, preserving the existing test structure and
least-privilege expectations.

In `@docs/providers/infiniband.md`:
- Around line 121-156: Update docs/providers/infiniband.md lines 121-156 to
explicitly describe the breaking migration from
provider.params.useGpuCliqueLabel to accelerator.source: kubernetes-label with
accelerator.kubernetesLabel.key, including that omitted accelerator
configuration defaults to none. Update CHANGELOG.md line 11 to mark this change
as breaking and include the same migration mapping.
- Around line 121-132: Update the accelerator documentation to distinguish
topology request parameters from Helm deployment settings: move or relabel
accelerator.nvidiaSmi.gpuOperatorNamespace and devicePluginDaemonSet as
Helm-only broker configuration, state that accelerator.source in requests must
match the broker’s rendered source, and note that changing broker settings
requires restarting the node-data-broker.

In `@pkg/accelerator/accelerator_test.go`:
- Around line 81-105: Extend TestNvidiaSMIDiscoverer with a canceled-context
case using a command runner that inspects the context passed to Run and asserts
ctx.Err() is context.Canceled. Cancel the context before calling Discover, then
verify the runner observes that cancellation and the discovery path returns the
expected error. Keep the existing success and command-error cases unchanged.

In `@pkg/providers/infiniband/provider_bm.go`:
- Around line 42-57: Preserve or explicitly migrate the prior default
accelerator discovery behavior: update accelerator configuration handling in
pkg/providers/infiniband/provider_bm.go (lines 42-57) and
pkg/providers/infiniband/provider_k8s.go (lines 35-39 and 65-72) so absent
accelerator settings do not silently become SourceNone, or reject legacy
useGpuCliqueLabel with a clear migration error; translate it to the
corresponding accelerator.source if supported. Add regression coverage in
pkg/providers/infiniband/provider_bm_test.go (line 24) and
pkg/providers/infiniband/provider_k8s_test.go (line 30) for legacy configuration
and the selected compatibility policy.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: dd77cd4b-292f-4fbc-b6a2-4efffb74de84

📥 Commits

Reviewing files that changed from the base of the PR and between d99978a and b439be2.

⛔ Files ignored due to path filters (1)
  • charts/topograph/tests/__snapshot__/render_snapshot_test.yaml.snap is excluded by !**/*.snap
📒 Files selected for processing (32)
  • .claude/CLAUDE.md
  • AGENTS.md
  • CHANGELOG.md
  • charts/topograph/templates/NOTES.txt
  • charts/topograph/templates/_validation.tpl
  • charts/topograph/templates/nodeDataBroker/_helpers.tpl
  • charts/topograph/templates/nodeDataBroker/daemonset.yaml
  • charts/topograph/templates/nodeDataBroker/rbac.yaml
  • charts/topograph/tests/node-data-broker_rbac_test.yaml
  • charts/topograph/tests/node-data-broker_test.yaml
  • charts/topograph/tests/validation_test.yaml
  • charts/topograph/values.k8s.ib-example.yaml
  • charts/topograph/values.slinky.ib.block-example.yaml
  • charts/topograph/values.yaml
  • docs/api.md
  • docs/architecture.md
  • docs/engines/k8s.md
  • docs/providers/infiniband.md
  • docs/reference/node-labels.md
  • pkg/accelerator/accelerator.go
  • pkg/accelerator/accelerator_test.go
  • pkg/accelerator/nvidia_smi.go
  • pkg/engines/slinky/engine.go
  • pkg/providers/infiniband/bm.go
  • pkg/providers/infiniband/bm_test.go
  • pkg/providers/infiniband/common.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/k8s_test.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/infiniband/provider_k8s_test.go
💤 Files with no reviewable changes (2)
  • pkg/engines/slinky/engine.go
  • pkg/providers/infiniband/common.go
📜 Review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: Greptile Review
  • GitHub Check: k8s / gcp-sim
  • GitHub Check: k8s / aws-sim
  • GitHub Check: k8s / test
  • GitHub Check: test
  • GitHub Check: check
  • GitHub Check: build
  • GitHub Check: oci-sim / slinky
🧰 Additional context used
📓 Path-based instructions (11)
charts/topograph/**

⚙️ CodeRabbit configuration file

charts/topograph/**: - Check RBAC least privilege and Kubernetes API compatibility.

  • ingress.enabled and gatewayAPI.enabled must remain mutually exclusive.
  • HTTPRoute must contain only portable Gateway API v1 fields.
  • Flag changes where values, schema, templates, NOTES, tests,
    snapshots, documentation, or changelog become inconsistent.

Files:

  • charts/topograph/templates/NOTES.txt
  • charts/topograph/tests/validation_test.yaml
  • charts/topograph/values.yaml
  • charts/topograph/values.slinky.ib.block-example.yaml
  • charts/topograph/tests/node-data-broker_test.yaml
  • charts/topograph/templates/nodeDataBroker/daemonset.yaml
  • charts/topograph/templates/nodeDataBroker/_helpers.tpl
  • charts/topograph/templates/_validation.tpl
  • charts/topograph/values.k8s.ib-example.yaml
  • charts/topograph/tests/node-data-broker_rbac_test.yaml
  • charts/topograph/templates/nodeDataBroker/rbac.yaml
charts/topograph/tests/**/*.{yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

Run Helm lint and helm-unittest suites when changing the Helm chart; review snapshot updates before committing.

Files:

  • charts/topograph/tests/validation_test.yaml
  • charts/topograph/tests/node-data-broker_test.yaml
  • charts/topograph/tests/node-data-broker_rbac_test.yaml
charts/topograph/**/*.{yaml,yml,tpl}

📄 CodeRabbit inference engine (AGENTS.md)

Changes to chart templates or values schemas require corresponding documentation updates, including values comments, NOTES.txt, and affected engine documentation.

Files:

  • charts/topograph/tests/validation_test.yaml
  • charts/topograph/values.yaml
  • charts/topograph/values.slinky.ib.block-example.yaml
  • charts/topograph/tests/node-data-broker_test.yaml
  • charts/topograph/templates/nodeDataBroker/daemonset.yaml
  • charts/topograph/templates/nodeDataBroker/_helpers.tpl
  • charts/topograph/templates/_validation.tpl
  • charts/topograph/values.k8s.ib-example.yaml
  • charts/topograph/tests/node-data-broker_rbac_test.yaml
  • charts/topograph/templates/nodeDataBroker/rbac.yaml
docs/engines/**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Adding, changing, or removing an engine requires updating the corresponding engine documentation.

Files:

  • docs/engines/k8s.md
charts/topograph/templates/**/*.yaml

📄 CodeRabbit inference engine (AGENTS.md)

Do not enable both ingress.enabled and gatewayAPI.enabled in the same Helm release; the routing resources are mutually exclusive.

Files:

  • charts/topograph/templates/nodeDataBroker/daemonset.yaml
  • charts/topograph/templates/nodeDataBroker/rbac.yaml
CHANGELOG.md

📄 CodeRabbit inference engine (AGENTS.md)

Record applicable user-facing features, fixes, breaking changes, or Helm migrations under [Unreleased].

Files:

  • CHANGELOG.md
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code must not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/accelerator/accelerator.go
  • pkg/providers/infiniband/bm.go
  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/accelerator/nvidia_smi.go
  • pkg/providers/infiniband/k8s_test.go
  • pkg/accelerator/accelerator_test.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/infiniband/bm_test.go
  • pkg/providers/infiniband/provider_k8s_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/accelerator/accelerator.go
  • pkg/providers/infiniband/bm.go
  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/accelerator/nvidia_smi.go
  • pkg/providers/infiniband/k8s_test.go
  • pkg/accelerator/accelerator_test.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/infiniband/bm_test.go
  • pkg/providers/infiniband/provider_k8s_test.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must discover topology and return a canonical *topology.Graph; they must not emit scheduler-specific output.
At the provider interface boundary, return *httperr.Error; plain error is not acceptable because the API server must propagate the correct HTTP status.
Providers using ClusterTopology must populate fabric tiers closest-first, set optional accelerator domain and sub-domain IDs, and call ToGraph.

Files:

  • pkg/providers/infiniband/bm.go
  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/k8s_test.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/infiniband/bm_test.go
  • pkg/providers/infiniband/provider_k8s_test.go
**/*_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/k8s_test.go
  • pkg/accelerator/accelerator_test.go
  • pkg/providers/infiniband/bm_test.go
  • pkg/providers/infiniband/provider_k8s_test.go
docs/providers/**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Adding, changing, or removing a provider requires updating its provider documentation and the provider list and scenario table in docs/overview.md.

Files:

  • docs/providers/infiniband.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T16:04:26.698Z
Learning: Every commit must carry a `Signed-off-by:` DCO trailer.
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T16:04:26.698Z
Learning: Potential security vulnerabilities must be reported privately through NVIDIA PSIRT rather than public issues or PRs.
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T16:04:26.698Z
Learning: Breaking changes to the config schema, label keys, or `Vertex` shape require prior discussion in an issue.
🪛 LanguageTool
docs/api.md

[grammar] ~79-~79: Ensure spelling is correct
Context: ...d by Kubernetes collection. Defaults to nvidia-device-plugin-daemonset. - engine: (optional) Selects the...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🪛 markdownlint-cli2 (0.23.2)
.claude/CLAUDE.md

[warning] 27-27: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

AGENTS.md

[warning] 27-27: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (25)
pkg/providers/infiniband/bm.go (1)

19-83: LGTM!

pkg/providers/infiniband/bm_test.go (1)

18-57: LGTM!

pkg/providers/infiniband/k8s.go (1)

70-127: LGTM!

pkg/providers/infiniband/k8s_test.go (1)

74-125: LGTM!

pkg/accelerator/nvidia_smi.go (1)

53-57: 🗄️ Data Integrity & Integration

Keep the full NVL partition identifier in DomainID.

InfiniBand NVIDIA SMI discovery defines the accelerator domain as ClusterUUID.CliqueId. The parser and current tests correctly preserve that value. Splitting it into DomainID and SubDomainID would change the documented contract.

			> Likely an incorrect or invalid review comment.
charts/topograph/templates/NOTES.txt (1)

45-49: LGTM!

charts/topograph/templates/nodeDataBroker/_helpers.tpl (1)

56-69: LGTM!

charts/topograph/templates/nodeDataBroker/daemonset.yaml (2)

3-5: LGTM!


46-55: 🗄️ Data Integrity & Integration

No change needed. The node-data-broker passes --set values to infiniband.GetNodeAnnotations, which consumes all three exact keys and validates the selected source.

docs/engines/k8s.md (1)

80-80: LGTM!

docs/providers/infiniband.md (1)

20-20: LGTM!

Also applies to: 44-54, 65-76, 94-101

docs/reference/node-labels.md (1)

43-44: LGTM!

Also applies to: 54-54

.claude/CLAUDE.md (1)

21-26: LGTM!

AGENTS.md (1)

21-26: LGTM!

CHANGELOG.md (2)

11-11: 📐 Maintainability & Code Quality

Verify the DCO trailer before merge.

Confirm that every commit in this PR contains a Signed-off-by: trailer.

Based on learnings: “Every commit must carry a Signed-off-by: DCO trailer.”

Source: Learnings


30-30: LGTM!

charts/topograph/templates/nodeDataBroker/rbac.yaml (1)

2-21: LGTM!

charts/topograph/tests/node-data-broker_rbac_test.yaml (1)

74-115: LGTM!

charts/topograph/tests/node-data-broker_test.yaml (1)

107-109: LGTM!

Also applies to: 146-173

charts/topograph/tests/validation_test.yaml (1)

80-99: LGTM!

charts/topograph/values.k8s.ib-example.yaml (1)

4-7: LGTM!

charts/topograph/values.slinky.ib.block-example.yaml (1)

15-20: LGTM!

Also applies to: 43-43

charts/topograph/values.yaml (1)

9-19: LGTM!

docs/api.md (1)

75-79: LGTM!

docs/architecture.md (1)

29-29: LGTM!

Comment thread .claude/CLAUDE.md
Comment thread charts/topograph/templates/_validation.tpl
Comment thread charts/topograph/tests/node-data-broker_rbac_test.yaml Outdated
Comment thread docs/providers/infiniband.md Outdated
Comment thread docs/providers/infiniband.md
Comment thread pkg/accelerator/accelerator_test.go
Comment thread pkg/providers/infiniband/provider_bm.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 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 `@charts/topograph/tests/validation_test.yaml`:
- Around line 80-112: Extend the accelerator validation tests with an
infiniband-bm provider using source kubernetes-label, asserting the
corresponding rejection message. Add malformed-input cases where accelerator is
null and where it is a non-map value, asserting each expected template failure;
keep the existing infiniband-k8s validation cases unchanged.

In `@docs/api.md`:
- Around line 75-79: Update the accelerator documentation to remove
nvidiaSmi.gpuOperatorNamespace and nvidiaSmi.devicePluginDaemonSet from
topology-request parameters, document them instead as Helm deployment settings
for infiniband-k8s, and state that the request source must match the
node-data-broker source.

In `@pkg/providers/infiniband/k8s.go`:
- Around line 70-75: Add regression coverage for GetGpuClusterID’s Kubernetes
execution path: verify k8s.ExecInPod receives the expected pod, namespace, and
strings.Fields(accelerator.NvidiaSMICommand) arguments, validate parsing of
duplicate-row output, and add a case asserting invalid CSV output returns an
error. Keep TestParseNvidiaSMIOutput focused on parsing and restore a direct
TestGetGPUClusterID-style test for this path.

In `@pkg/providers/infiniband/provider_bm_test.go`:
- Around line 42-70: Extend the LoaderBM test loop to inspect
ProviderBM.accelerator for successful cases: assert the nvidia-smi case uses a
non-none accelerator discoverer, and assert the none case uses
accelerator.NewNoneDiscoverer(). Keep the existing error assertions and provider
type checks unchanged.

In `@pkg/providers/infiniband/provider_bm.go`:
- Around line 78-83: Add a focused test for ProviderBM.GenerateTopologyConfig
that injects a failing accelerator.Discoverer, without invoking IB discovery,
and verifies the returned error has HTTP status 500 and includes the “failed to
discover accelerator domains: ...” message.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: 5c97ca2f-7b28-435c-84f5-82a4af1afaca

📥 Commits

Reviewing files that changed from the base of the PR and between b439be2 and 17d3827.

📒 Files selected for processing (17)
  • CHANGELOG.md
  • charts/topograph/templates/_validation.tpl
  • charts/topograph/templates/nodeDataBroker/_helpers.tpl
  • charts/topograph/tests/node-data-broker_rbac_test.yaml
  • charts/topograph/tests/node-data-broker_test.yaml
  • charts/topograph/tests/validation_test.yaml
  • charts/topograph/values.yaml
  • docs/api.md
  • docs/providers/infiniband.md
  • pkg/accelerator/accelerator.go
  • pkg/accelerator/accelerator_test.go
  • pkg/providers/infiniband/common.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/infiniband/provider_k8s_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: Greptile Review
  • GitHub Check: k8s / test
  • GitHub Check: k8s / gcp-sim
  • GitHub Check: k8s / aws-sim
  • GitHub Check: check
  • GitHub Check: govulncheck
  • GitHub Check: test
  • GitHub Check: oci-sim / slinky
🧰 Additional context used
📓 Path-based instructions (10)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Use go fmt ./... as the authoritative formatting standard for Go files; fix applicable golangci-lint warnings in code being touched.
Add the required NVIDIA copyright header and Apache 2.0 boilerplate to every new Go file.

Files:

  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/common.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/accelerator/accelerator.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/accelerator/accelerator_test.go
  • pkg/providers/infiniband/provider_bm.go
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must implement GenerateTopologyConfig with the defined signature and return *httperr.Error, not plain error, at the API boundary.
Providers discover topology and return the canonical *topology.Graph; they must not emit scheduler-specific output.
Keep network-fabric discovery and accelerator-domain discovery independently composable through pkg/accelerator, while the provider combines both into the canonical graph.
Do not read the fabric inside an engine or emit scheduler-specific output from a provider.

Files:

  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/common.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/infiniband/provider_bm.go
**/*.{go,yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

New or changed public behavior must have test coverage; run the relevant Go or Helm tests.

Files:

  • pkg/providers/infiniband/k8s.go
  • charts/topograph/tests/node-data-broker_test.yaml
  • pkg/providers/infiniband/provider_bm_test.go
  • charts/topograph/tests/validation_test.yaml
  • pkg/providers/infiniband/common.go
  • charts/topograph/tests/node-data-broker_rbac_test.yaml
  • charts/topograph/values.yaml
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/accelerator/accelerator.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/accelerator/accelerator_test.go
  • pkg/providers/infiniband/provider_bm.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/common.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/accelerator/accelerator.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/accelerator/accelerator_test.go
  • pkg/providers/infiniband/provider_bm.go
charts/topograph/**/*.yaml

📄 CodeRabbit inference engine (AGENTS.md)

Do not enable both ingress.enabled and gatewayAPI.enabled in the same Helm release.

Files:

  • charts/topograph/tests/node-data-broker_test.yaml
  • charts/topograph/tests/validation_test.yaml
  • charts/topograph/tests/node-data-broker_rbac_test.yaml
  • charts/topograph/values.yaml
charts/topograph/**/*

📄 CodeRabbit inference engine (AGENTS.md)

When changing chart templates or values, update the corresponding chart documentation and tests/snapshots as applicable; run make chart-test.

Files:

  • charts/topograph/tests/node-data-broker_test.yaml
  • charts/topograph/tests/validation_test.yaml
  • charts/topograph/tests/node-data-broker_rbac_test.yaml
  • charts/topograph/templates/_validation.tpl
  • charts/topograph/values.yaml
  • charts/topograph/templates/nodeDataBroker/_helpers.tpl
charts/topograph/**

⚙️ CodeRabbit configuration file

charts/topograph/**: - Check RBAC least privilege and Kubernetes API compatibility.

  • ingress.enabled and gatewayAPI.enabled must remain mutually exclusive.
  • HTTPRoute must contain only portable Gateway API v1 fields.
  • Flag changes where values, schema, templates, NOTES, tests,
    snapshots, documentation, or changelog become inconsistent.

Files:

  • charts/topograph/tests/node-data-broker_test.yaml
  • charts/topograph/tests/validation_test.yaml
  • charts/topograph/tests/node-data-broker_rbac_test.yaml
  • charts/topograph/templates/_validation.tpl
  • charts/topograph/values.yaml
  • charts/topograph/templates/nodeDataBroker/_helpers.tpl
CHANGELOG.md

📄 CodeRabbit inference engine (AGENTS.md)

Record applicable user-facing features, fixes, breaking changes, or Helm migrations under [Unreleased].

Files:

  • CHANGELOG.md
**/*_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/accelerator/accelerator_test.go
docs/providers/*.md

📄 CodeRabbit inference engine (AGENTS.md)

A new provider requires provider documentation covering prerequisites, credentials, parameters, operation, and verification, plus updates to the overview provider list and scenario table.

Files:

  • docs/providers/infiniband.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T17:21:12.221Z
Learning: Every commit must include a `Signed-off-by:` DCO trailer.
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T17:21:12.221Z
Learning: Before pushing, run `make qualify`; all CI checks must be green before merge.
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T17:21:12.221Z
Learning: Report suspected security vulnerabilities privately through the NVIDIA PSIRT process rather than public issues or PRs.
🪛 LanguageTool
docs/api.md

[grammar] ~79-~79: Ensure spelling is correct
Context: ...d by Kubernetes collection. Defaults to nvidia-device-plugin-daemonset. - engine: (optional) Selects the...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (15)
docs/providers/infiniband.md (1)

121-130: Separate request parameters from Helm deployment settings.

The node-data-broker settings still appear as request parameters. This repeats the existing review finding.

CHANGELOG.md (2)

11-11: Document the breaking Kubernetes migration.

The changelog still omits the migration from useGpuCliqueLabel to accelerator.source: kubernetes-label with accelerator.kubernetesLabel.key. This repeats the existing review finding.


30-30: LGTM!

pkg/accelerator/accelerator.go (1)

18-153: LGTM!

pkg/accelerator/accelerator_test.go (1)

20-163: LGTM!

pkg/providers/infiniband/k8s.go (1)

20-27: LGTM!

Also applies to: 84-127

pkg/providers/infiniband/provider_k8s_test.go (1)

17-130: LGTM!

pkg/providers/infiniband/provider_bm.go (1)

13-77: LGTM!

pkg/providers/infiniband/common.go (1)

12-12: LGTM!

Also applies to: 25-33

pkg/providers/infiniband/provider_k8s.go (1)

21-39: LGTM!

Also applies to: 65-79, 87-98, 119-132

charts/topograph/values.yaml (1)

9-21: LGTM!

charts/topograph/templates/nodeDataBroker/_helpers.tpl (1)

56-73: LGTM!

charts/topograph/templates/_validation.tpl (1)

23-56: LGTM!

charts/topograph/tests/node-data-broker_rbac_test.yaml (1)

74-82: LGTM!

Also applies to: 116-226

charts/topograph/tests/node-data-broker_test.yaml (1)

107-109: LGTM!

Also applies to: 146-187

Comment thread charts/topograph/tests/validation_test.yaml
Comment thread docs/api.md Outdated
Comment thread pkg/providers/infiniband/k8s.go Outdated
Comment thread pkg/providers/infiniband/provider_bm_test.go
Comment thread pkg/providers/infiniband/provider_bm.go
@dmitsh dmitsh changed the title fix(infiniband): query NVL partition IDs via nvidia-smi CSV fix(infiniband): make accelerator discovery pluggable Aug 11, 2026
ravisoundar
ravisoundar previously approved these changes Aug 11, 2026

@ravisoundar ravisoundar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@charts/topograph/values.yaml`:
- Around line 9-21: Remove the obsolete useGpuCliqueLabel example and any
related engine parameter documentation from the chart values comments. Ensure
the comments instead reference only the supported accelerator configuration,
including the accelerator source and kubernetesLabel settings shown in the diff.

In `@cmd/node-data-broker/main_test.go`:
- Around line 68-104: Extend TestNewNodeDataBrokerConfig with YAML cases where
accelerator is omitted and where accelerator is an empty map; load each
configuration through newNodeDataBrokerConfig, construct the broker, and call
broker.getAnnotations with a node name. Assert both calls succeed and return no
accelerator annotations, covering disabled discovery through YAML decoding and
provider-parameter forwarding.

In `@pkg/accelerator/accelerator_test.go`:
- Around line 252-277: Add negative constructor tests to
TestKubernetesNodeDiscovererWithoutCollection for the nvidia-smi path with a
non-nil Kubernetes client and nil restConfig, asserting “Kubernetes REST config
is required for nvidia-smi discovery”; also add a NewNvidiaSMIDiscoverer test
with a nil command runner, asserting “nvidia-smi command runner is required.”
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: 48722e73-6553-4cea-aaaf-68301be61a03

📥 Commits

Reviewing files that changed from the base of the PR and between 17d3827 and 1f5e07a.

⛔ Files ignored due to path filters (1)
  • charts/topograph/tests/__snapshot__/render_snapshot_test.yaml.snap is excluded by !**/*.snap
📒 Files selected for processing (20)
  • charts/topograph/templates/nodeDataBroker/configmap.yaml
  • charts/topograph/templates/nodeDataBroker/daemonset.yaml
  • charts/topograph/tests/node-data-broker_configmap_test.yaml
  • charts/topograph/tests/node-data-broker_test.yaml
  • charts/topograph/values.schema.json
  • charts/topograph/values.yaml
  • cmd/node-data-broker/main.go
  • cmd/node-data-broker/main_test.go
  • docs/providers/infiniband.md
  • pkg/accelerator/accelerator.go
  • pkg/accelerator/accelerator_test.go
  • pkg/accelerator/kubernetes.go
  • pkg/accelerator/nvidia_smi.go
  • pkg/providers/infiniband/common.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/k8s_test.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/infiniband/provider_k8s_test.go
💤 Files with no reviewable changes (2)
  • charts/topograph/values.schema.json
  • pkg/providers/infiniband/common.go
📜 Review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: Greptile Review
  • GitHub Check: check
  • GitHub Check: test
  • GitHub Check: build
  • GitHub Check: k8s / gcp-sim
  • GitHub Check: k8s / test
  • GitHub Check: k8s / aws-sim
  • GitHub Check: oci-sim / slinky
🧰 Additional context used
📓 Path-based instructions (9)
charts/topograph/templates/**/*.yaml

📄 CodeRabbit inference engine (AGENTS.md)

Do not enable both ingress.enabled and gatewayAPI.enabled in one Helm release.

Files:

  • charts/topograph/templates/nodeDataBroker/configmap.yaml
  • charts/topograph/templates/nodeDataBroker/daemonset.yaml
charts/topograph/**/*.yaml

📄 CodeRabbit inference engine (AGENTS.md)

Helm chart changes must be validated with Helm lint and helm-unittest tests; review snapshot updates before committing them.

Files:

  • charts/topograph/templates/nodeDataBroker/configmap.yaml
  • charts/topograph/tests/node-data-broker_configmap_test.yaml
  • charts/topograph/values.yaml
  • charts/topograph/tests/node-data-broker_test.yaml
  • charts/topograph/templates/nodeDataBroker/daemonset.yaml
charts/topograph/**

⚙️ CodeRabbit configuration file

charts/topograph/**: - Check RBAC least privilege and Kubernetes API compatibility.

  • ingress.enabled and gatewayAPI.enabled must remain mutually exclusive.
  • HTTPRoute must contain only portable Gateway API v1 fields.
  • Flag changes where values, schema, templates, NOTES, tests,
    snapshots, documentation, or changelog become inconsistent.

Files:

  • charts/topograph/templates/nodeDataBroker/configmap.yaml
  • charts/topograph/tests/node-data-broker_configmap_test.yaml
  • charts/topograph/values.yaml
  • charts/topograph/tests/node-data-broker_test.yaml
  • charts/topograph/templates/nodeDataBroker/daemonset.yaml
pkg/providers/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

pkg/providers/**/*.go: Providers must discover topology and return a canonical *topology.Graph; they must not emit scheduler-specific output. At the interface boundary, return *httperr.Error, not plain error.
When using ClusterTopology, populate fabric tiers closest-first, optional accelerator domain and sub-domain IDs, and call ToGraph; providers must combine fabric and accelerator discovery into the canonical graph.

Files:

  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/k8s_test.go
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./... as the authoritative formatter and fix new golangci-lint warnings in touched code.
Every new Go file must contain the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.

Files:

  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/accelerator/kubernetes.go
  • pkg/providers/infiniband/k8s.go
  • pkg/accelerator/accelerator.go
  • pkg/accelerator/nvidia_smi.go
  • pkg/accelerator/accelerator_test.go
  • cmd/node-data-broker/main.go
  • cmd/node-data-broker/main_test.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/k8s_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/accelerator/kubernetes.go
  • pkg/providers/infiniband/k8s.go
  • pkg/accelerator/accelerator.go
  • pkg/accelerator/nvidia_smi.go
  • pkg/accelerator/accelerator_test.go
  • cmd/node-data-broker/main.go
  • cmd/node-data-broker/main_test.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/k8s_test.go
**/*_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • pkg/providers/infiniband/provider_bm_test.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/accelerator/accelerator_test.go
  • cmd/node-data-broker/main_test.go
  • pkg/providers/infiniband/k8s_test.go
charts/topograph/values.yaml

📄 CodeRabbit inference engine (AGENTS.md)

When changing the chart values schema, update comments, NOTES.txt, and documentation referencing those values.

Files:

  • charts/topograph/values.yaml
docs/**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Provider, engine, API, configuration, label, and user-facing behavior changes must update the corresponding documentation; user-facing changes should also update CHANGELOG.md under [Unreleased] when applicable.

Files:

  • docs/providers/infiniband.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T18:30:53.488Z
Learning: Every commit must carry a `Signed-off-by:` trailer; GPG signing is optional.
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T18:30:53.488Z
Learning: Potential security vulnerabilities must be reported privately through NVIDIA PSIRT channels, not public issues or PRs.
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T18:30:53.488Z
Learning: Run `make qualify` before pushing, and ensure new or changed public behavior has test coverage.
🪛 YAMLlint (1.37.1)
charts/topograph/templates/nodeDataBroker/configmap.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

🔇 Additional comments (20)
docs/providers/infiniband.md (1)

121-156: Separate topology-request parameters from broker deployment settings.

accelerator.nvidiaSmi.gpuOperatorNamespace and devicePluginDaemonSet cannot reconfigure an existing node-data-broker Pod from a topology request. Document them as Helm-only broker settings. State that request-side accelerator.source: nvidia-smi requires matching broker configuration and that broker configuration changes require a restart.

charts/topograph/templates/nodeDataBroker/configmap.yaml (1)

1-14: LGTM!

charts/topograph/templates/nodeDataBroker/daemonset.yaml (1)

16-17: LGTM!

Also applies to: 41-42, 83-85, 98-101

charts/topograph/tests/node-data-broker_configmap_test.yaml (1)

8-48: LGTM!

charts/topograph/tests/node-data-broker_test.yaml (1)

80-125: LGTM!

cmd/node-data-broker/main.go (1)

26-38: 📐 Maintainability & Code Quality

Run the required Go validation.

Run go fmt ./... and fix new golangci-lint warnings in touched code before merge. Run make qualify before pushing. As per coding guidelines, “Run go fmt ./... as the authoritative formatter and fix new golangci-lint warnings in touched code.” Based on learnings, “Run make qualify before pushing.”

Sources: Coding guidelines, Learnings

pkg/providers/infiniband/k8s.go (2)

56-65: The Kubernetes nvidia-smi execution path still has no regression test.

The pod lookup, exec, and output parsing moved to kubernetesNvidiaSMIRunner.Run in pkg/accelerator/kubernetes.go. pkg/accelerator/accelerator_test.go asserts only the constructed runner fields. No test asserts the pod selection, the exec arguments, or the zero-pod and multi-pod branches. Add a test with the fake clientset for that runner.

As per path instructions, {cmd,pkg,internal}/**/*.go requires meaningful regression coverage for behavior changes.

Source: Path instructions


50-55: LGTM!

Also applies to: 66-69

pkg/providers/infiniband/provider_bm.go (2)

46-51: The accelerator discovery failure path still has no test.

pkg/providers/infiniband/provider_bm_test.go covers only LoaderBM. No test injects a failing accelerator.Discoverer into ProviderBM and asserts the 500 status and the failed to discover accelerator domains: ... message.

As per path instructions, {cmd,pkg,internal}/**/*.go requires meaningful regression coverage for behavior changes.

Source: Path instructions


21-39: LGTM!

pkg/providers/infiniband/provider_bm_test.go (1)

65-75: Assert the selected discoverer for the success cases.

The nvidia-smi case and the none case produce identical assertions. The test passes if LoaderBM always installs the none discoverer. Add an expected-discoverer field to the table and assert ProviderBM.accelerator for each success case.

As per path instructions, **/*_test.go requires assertions that fail if the behavior under test is broken.

Source: Path instructions

pkg/accelerator/accelerator.go (2)

76-102: LGTM!

Also applies to: 104-127


1-4: 📐 Maintainability & Code Quality

Use the repository-standard SPDX header.

The short NVIDIA copyright and SPDX-License-Identifier: Apache-2.0 header matches all files in pkg/accelerator. No change is required.

			> Likely an incorrect or invalid review comment.
pkg/accelerator/nvidia_smi.go (2)

58-79: LGTM!

Also applies to: 113-136


81-94: 🎯 Functional Correctness

No change required

The module and CI declare Go 1.26.5, which supports strings.Lines.

			> Likely an incorrect or invalid review comment.
pkg/accelerator/kubernetes.go (1)

23-48: LGTM!

Also applies to: 57-87

pkg/accelerator/accelerator_test.go (1)

299-328: LGTM!

Also applies to: 330-358

pkg/providers/infiniband/k8s_test.go (1)

18-41: LGTM!

pkg/providers/infiniband/provider_k8s.go (1)

28-33: LGTM!

Also applies to: 52-57, 70-74, 102-115

pkg/providers/infiniband/provider_k8s_test.go (1)

15-50: LGTM!

Comment thread charts/topograph/values.yaml
Comment thread cmd/node-data-broker/main_test.go
Comment thread pkg/accelerator/accelerator_test.go
@dmitsh
dmitsh force-pushed the ds-nvl branch 2 times, most recently from 1cf76f5 to f555835 Compare August 11, 2026 18:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@charts/topograph/tests/node-data-broker_configmap_test.yaml`:
- Around line 42-55: Extend the nodeDataBroker.providerConfig render tests with
cases for an omitted accelerator section, an empty accelerator object, and
source none. Assert each rendered node-data-broker-config.yaml excludes
gpuOperatorNamespace and devicePluginDaemonSet, while preserving the existing
nvidia-smi default assertions.

In `@cmd/node-data-broker/main_test.go`:
- Around line 138-141: Add a separate negative healthzPort fixture and assertion
in the newNodeDataBrokerConfig test, using a negative value and verifying it
returns the same “must specify a positive healthzPort” error; retain the
existing omitted-port case to cover zero.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: fe24a0a7-3018-4b80-9c90-a6536f5ba142

📥 Commits

Reviewing files that changed from the base of the PR and between 1f5e07a and f555835.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • charts/topograph/templates/nodeDataBroker/_helpers.tpl
  • charts/topograph/templates/nodeDataBroker/configmap.yaml
  • charts/topograph/tests/node-data-broker_configmap_test.yaml
  • charts/topograph/values.yaml
  • cmd/node-data-broker/main_test.go
  • docs/providers/infiniband.md
  • pkg/accelerator/kubernetes.go
📜 Review details
⏰ Context from checks skipped due to timeout. (7)
  • GitHub Check: Greptile Review
  • GitHub Check: oci-sim / slinky
  • GitHub Check: build
  • GitHub Check: test
  • GitHub Check: k8s / test
  • GitHub Check: k8s / aws-sim
  • GitHub Check: k8s / gcp-sim
🧰 Additional context used
📓 Path-based instructions (8)
charts/topograph/templates/**/*.yaml

📄 CodeRabbit inference engine (AGENTS.md)

Do not enable both ingress.enabled and gatewayAPI.enabled in the same Helm release.

Files:

  • charts/topograph/templates/nodeDataBroker/configmap.yaml
**/*.{go,yaml,yml,md}

📄 CodeRabbit inference engine (AGENTS.md)

When changing a documented contract or repository surface, update the corresponding documentation in the same change, including provider, engine, chart, API, label, configuration, and changelog documentation as applicable.

Files:

  • charts/topograph/templates/nodeDataBroker/configmap.yaml
  • charts/topograph/values.yaml
  • charts/topograph/tests/node-data-broker_configmap_test.yaml
  • CHANGELOG.md
  • docs/providers/infiniband.md
  • cmd/node-data-broker/main_test.go
  • pkg/accelerator/kubernetes.go
charts/topograph/**/*.{yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

Run Helm chart tests when changing the Topograph chart.

Files:

  • charts/topograph/templates/nodeDataBroker/configmap.yaml
  • charts/topograph/values.yaml
  • charts/topograph/tests/node-data-broker_configmap_test.yaml
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: All CI checks must be green before merge, including Go build/test/lint, Codecov, and DCO checks.
Every commit must include a Signed-off-by: DCO trailer.
Use Conventional Commits with an allowed type and include a scope and short description.
Use branch prefixes matching the change type: feat/, fix/, docs/, chore/, refactor/, or test/.
Report suspected security vulnerabilities privately through NVIDIA PSIRT rather than public issues or PRs.
Discuss changes to pkg/topology/, configuration schema, label keys, or Vertex shape before implementation.
Do not modify an AGENTS.md-described surface without updating both AGENTS.md and .claude/CLAUDE.md in the same change.
Run and review coverage checks: project target 60%, patch target 50%, with no unacceptable coverage drop.
Evaluate documentation impact for every pull request and update applicable documentation for contract or user-facing changes.
Do not skip DCO sign-off or defer it until later.

Files:

  • charts/topograph/templates/nodeDataBroker/configmap.yaml
  • charts/topograph/values.yaml
  • charts/topograph/tests/node-data-broker_configmap_test.yaml
  • CHANGELOG.md
  • docs/providers/infiniband.md
  • cmd/node-data-broker/main_test.go
  • pkg/accelerator/kubernetes.go
  • charts/topograph/templates/nodeDataBroker/_helpers.tpl
charts/topograph/**

⚙️ CodeRabbit configuration file

charts/topograph/**: - Check RBAC least privilege and Kubernetes API compatibility.

  • ingress.enabled and gatewayAPI.enabled must remain mutually exclusive.
  • HTTPRoute must contain only portable Gateway API v1 fields.
  • Flag changes where values, schema, templates, NOTES, tests,
    snapshots, documentation, or changelog become inconsistent.

Files:

  • charts/topograph/templates/nodeDataBroker/configmap.yaml
  • charts/topograph/values.yaml
  • charts/topograph/tests/node-data-broker_configmap_test.yaml
  • charts/topograph/templates/nodeDataBroker/_helpers.tpl
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; do not hand-format Go code.
Add the specified NVIDIA Apache 2.0 copyright header to every new Go file.
New or changed public behavior should be covered by tests.
Run make qualify before pushing; it performs formatting, vetting, linting, and tests.

Files:

  • cmd/node-data-broker/main_test.go
  • pkg/accelerator/kubernetes.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • cmd/node-data-broker/main_test.go
  • pkg/accelerator/kubernetes.go
**/*_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • cmd/node-data-broker/main_test.go
🪛 YAMLlint (1.37.1)
charts/topograph/templates/nodeDataBroker/configmap.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

🔇 Additional comments (6)
cmd/node-data-broker/main_test.go (1)

84-102: Cover an omitted accelerator section through the broker path.

This test covers accelerator: {}, but it does not cover a provider with no accelerator key. Add a nodeBroker.getAnnotations case with infiniband-k8s and omitted accelerator parameters. Assert that it returns only the base annotations.

docs/providers/infiniband.md (1)

121-132: Separate request parameters from broker deployment settings.

accelerator.nvidiaSmi.gpuOperatorNamespace and accelerator.nvidiaSmi.devicePluginDaemonSet configure the Helm-rendered node-data-broker ConfigMap. A topology request cannot reconfigure a running broker. Move these fields out of the request-parameter table. State that a request using nvidia-smi must align with the broker-rendered source and configuration.

pkg/accelerator/kubernetes.go (1)

20-87: LGTM!

charts/topograph/templates/nodeDataBroker/configmap.yaml (1)

1-14: LGTM!

charts/topograph/templates/nodeDataBroker/_helpers.tpl (1)

56-98: LGTM!

charts/topograph/values.yaml (1)

9-23: LGTM!

Comment thread charts/topograph/tests/node-data-broker_configmap_test.yaml
Comment thread cmd/node-data-broker/main_test.go
Signed-off-by: Dmitry Shmulevich <17212177+dmitsh@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@pkg/accelerator/accelerator_test.go`:
- Around line 1-4: Update the file header above the package declaration in
accelerator_test.go by adding the repository-standard Apache 2.0 boilerplate
immediately after the NVIDIA copyright line, while preserving the existing SPDX
identifier and copyright text.
- Around line 330-358: Extend TestParseNvidiaSMIOutput with a malformed CSV case
using an extra field such as “uuid, 7, extra”, and assert the parser returns the
expected field-count error. Ensure ParseNvidiaSMIOutput rejects rows unless they
contain exactly the ClusterUUID and CliqueId fields, while preserving existing
handling for valid and under-specified rows.
🪄 Autofix

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: ASSERTIVE

Plan: Enterprise

Run ID: 1773536f-26a0-4e12-8c24-42b49380d79f

📥 Commits

Reviewing files that changed from the base of the PR and between f555835 and faf279d.

📒 Files selected for processing (5)
  • charts/topograph/tests/node-data-broker_configmap_test.yaml
  • cmd/node-data-broker/main_test.go
  • docs/api.md
  • docs/providers/infiniband.md
  • pkg/accelerator/accelerator_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: Greptile Review
  • GitHub Check: oci-sim / slinky
  • GitHub Check: k8s / gcp-sim
  • GitHub Check: check
  • GitHub Check: build
  • GitHub Check: test
  • GitHub Check: k8s / aws-sim
  • GitHub Check: k8s / test
🧰 Additional context used
📓 Path-based instructions (7)
charts/topograph/**/*.yaml

📄 CodeRabbit inference engine (AGENTS.md)

Do not enable both ingress.enabled and gatewayAPI.enabled in the same Helm release.

Files:

  • charts/topograph/tests/node-data-broker_configmap_test.yaml
charts/topograph/**/*.{yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

charts/topograph/**/*.{yaml,yml}: Run make chart-test when changing charts/topograph/; Helm lint and helm-unittest tests must pass.
Chart changes must include appropriate updates to chart tests or snapshots when behavior changes.

Files:

  • charts/topograph/tests/node-data-broker_configmap_test.yaml
charts/topograph/**

⚙️ CodeRabbit configuration file

charts/topograph/**: - Check RBAC least privilege and Kubernetes API compatibility.

  • ingress.enabled and gatewayAPI.enabled must remain mutually exclusive.
  • HTTPRoute must contain only portable Gateway API v1 fields.
  • Flag changes where values, schema, templates, NOTES, tests,
    snapshots, documentation, or changelog become inconsistent.

Files:

  • charts/topograph/tests/node-data-broker_configmap_test.yaml
docs/providers/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Adding, changing, or removing a provider requires updating its provider documentation and the provider list and scenario table in docs/overview.md.

Files:

  • docs/providers/infiniband.md
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run go fmt ./...; Go formatting is authoritative and code should not be hand-formatted.
Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.
Changes to Go code should pass go vet, golangci-lint, and race-enabled tests.

Files:

  • cmd/node-data-broker/main_test.go
  • pkg/accelerator/accelerator_test.go
{cmd,pkg,internal}/**/*.go

⚙️ CodeRabbit configuration file

{cmd,pkg,internal}/**/*.go: Focus on correctness, robustness, and failure paths:

  • Check error handling and propagation, including whether callers
    receive enough context to diagnose failures.
  • Verify context propagation, cancellation, timeouts, resource cleanup,
    and goroutine lifecycle.
  • Look for races, deadlocks, unsafe shared state, leaks, and partial
    updates that can leave state inconsistent.
  • Check nil, empty, malformed, duplicate, boundary, and partial inputs.
  • Verify deterministic and idempotent behavior where operations may be
    retried or repeated.
  • Preserve public contracts and the architectural boundaries documented
    in AGENTS.md.
  • Flag behavior changes that lack meaningful regression coverage.

Files:

  • cmd/node-data-broker/main_test.go
  • pkg/accelerator/accelerator_test.go
**/*_test.go

⚙️ CodeRabbit configuration file

**/*_test.go: Flag missing negative, cancellation, concurrency, malformed-input,
boundary, and regression cases. Check that assertions would fail if
the behavior under test were broken.

Files:

  • cmd/node-data-broker/main_test.go
  • pkg/accelerator/accelerator_test.go
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T19:02:41.756Z
Learning: Every commit must include a `Signed-off-by:` DCO trailer.
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T19:02:41.756Z
Learning: Potential security vulnerabilities must be reported privately through NVIDIA PSIRT channels, not public issues or pull requests.
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T19:02:41.756Z
Learning: Use Conventional Commits with an allowed type such as `feat`, `fix`, `docs`, `chore`, `refactor`, `test`, `build`, or `ci`.
Learnt from: CR
Repo: NVIDIA/topograph

Timestamp: 2026-08-11T19:02:41.756Z
Learning: Breaking changes to the configuration schema, label keys, or `Vertex` shape require discussion in an issue first.
🔇 Additional comments (9)
pkg/accelerator/accelerator_test.go (2)

252-277: Cover the remaining constructor error branches.

The tests still omit the nil rest.Config case for NewKubernetesNodeDiscoverer and the nil runner case for NewNvidiaSMIDiscoverer.

Also applies to: 299-328


20-328: LGTM!

cmd/node-data-broker/main_test.go (3)

84-102: Add omitted accelerator configuration coverage.

The test covers accelerator: {} but does not cover an omitted accelerator section through the node-data-broker path.


13-82: LGTM!

Also applies to: 105-146


25-25: 📐 Maintainability & Code Quality

Do not retain TestGetExtras coverage. The getExtras function and --set option are not present, so this coverage is not applicable.

			> Likely an incorrect or invalid review comment.
docs/providers/infiniband.md (2)

121-143: Document the useGpuCliqueLabel migration.

State that the InfiniBand provider.params.useGpuCliqueLabel setting was removed. Document the replacement accelerator.source: kubernetes-label and accelerator.kubernetesLabel.key configuration.


20-20: LGTM!

Also applies to: 44-50, 65-75, 94-101, 145-170

charts/topograph/tests/node-data-broker_configmap_test.yaml (1)

8-104: LGTM!

docs/api.md (1)

75-78: LGTM!

Comment on lines +1 to +4
/*
* Copyright 2026 NVIDIA CORPORATION
* SPDX-License-Identifier: Apache-2.0
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add the required Apache 2.0 boilerplate.

Lines 1-4 include an SPDX identifier but do not include the Apache 2.0 boilerplate required for new Go files. Copy the repository-standard header below the NVIDIA copyright line.

As per coding guidelines, “Every new Go file must include the NVIDIA copyright header followed by the matching Apache 2.0 boilerplate.”

🤖 Prompt for 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.

In `@pkg/accelerator/accelerator_test.go` around lines 1 - 4, Update the file
header above the package declaration in accelerator_test.go by adding the
repository-standard Apache 2.0 boilerplate immediately after the NVIDIA
copyright line, while preserving the existing SPDX identifier and copyright
text.

Source: Coding guidelines

Comment on lines +330 to +358
func TestParseNvidiaSMIOutput(t *testing.T) {
tests := []struct {
name string
output string
partition string
err string
}{
{name: "duplicates", output: "uuid, 7\nuuid , 7\n", partition: "uuid.7"},
{name: "missing", err: "missing NVL partition ID"},
{name: "missing UUID", output: ", 7", err: "missing ClusterUUID"},
{name: "missing clique", output: "uuid, ", err: "missing CliqueId"},
{name: "malformed CSV", output: "uuid", err: `expected ClusterUUID and CliqueId CSV fields, got "uuid"`},
{name: "N/A UUID", output: "N/A, 7", err: "ClusterUUID is N/A"},
{name: "N/A clique", output: "uuid, N/A", err: "CliqueId is N/A"},
{name: "ambiguous", output: "uuid, 7\nuuid, 8", err: "ambiguous NVL partition IDs: uuid.7, uuid.8"},
}

for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
partition, err := ParseNvidiaSMIOutput(test.output)
if test.err != "" {
require.EqualError(t, err, test.err)
return
}
require.NoError(t, err)
require.Equal(t, test.partition, partition)
})
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject CSV rows with extra fields.

Add a malformed-input case such as uuid, 7, extra. The current tests only prove rejection of rows with too few fields. The parser must reject rows that do not contain exactly ClusterUUID and CliqueId.

As per path instructions, “Flag missing negative, cancellation, concurrency, malformed-input, boundary, and regression cases.”

🤖 Prompt for 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.

In `@pkg/accelerator/accelerator_test.go` around lines 330 - 358, Extend
TestParseNvidiaSMIOutput with a malformed CSV case using an extra field such as
“uuid, 7, extra”, and assert the parser returns the expected field-count error.
Ensure ParseNvidiaSMIOutput rejects rows unless they contain exactly the
ClusterUUID and CliqueId fields, while preserving existing handling for valid
and under-specified rows.

Source: Path instructions

@dmitsh
dmitsh merged commit c91d58f into main Aug 11, 2026
17 checks passed
@dmitsh
dmitsh deleted the ds-nvl branch August 11, 2026 20:09
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.

[FEA]: Make accelerator-domain discovery pluggable

2 participants