Skip to content

refactor(providers): share Kubernetes accelerator discovery - #462

Merged
dmitsh merged 1 commit into
mainfrom
ds-dra
Aug 12, 2026
Merged

refactor(providers): share Kubernetes accelerator discovery#462
dmitsh merged 1 commit into
mainfrom
ds-dra

Conversation

@dmitsh

@dmitsh dmitsh commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Reuse node selector parsing, Kubernetes target resolution, accelerator
assignment conversion, and base node annotations across the DRA and
InfiniBand providers.

Allow DRA to use the shared kubernetes-label accelerator configuration
while preserving nvidia.com/gpu.clique as its legacy default.

closes #461

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

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • DRA accelerator discovery now supports configurable Kubernetes node labels.
    • DRA defaults to nvidia.com/gpu.clique when no accelerator configuration is provided.
    • Added node-selector support for accelerator topology discovery.
    • Shared accelerator discovery behavior is now available across supported providers.
  • Bug Fixes

    • Added validation for unsupported accelerator sources and incomplete label configurations.
    • Improved handling of nodes with missing or unmapped accelerator information.
  • Documentation

    • Updated API, provider, Helm, and node-label documentation with configuration details and behavior.

Walkthrough

DRA now supports configurable Kubernetes-label accelerator discovery with a default label. Shared Kubernetes helpers handle node selectors, canonical targets, domain assignments, and topology maps. InfiniBand providers use these helpers. Validation, examples, tests, and documentation reflect the configuration.

Changes

Shared Kubernetes discovery integration

Layer / File(s) Summary
Shared discovery foundation
internal/k8s/..., pkg/accelerator/...
Added node-list decoding, Kubernetes node-to-target conversion, domain discovery, and shared topology mapping helpers with tests.
DRA accelerator configuration and topology
pkg/providers/dra/...
DRA supports Kubernetes-label discovery, defaults to nvidia.com/gpu.clique, and delegates topology generation to shared helpers.
InfiniBand shared-helper integration
pkg/providers/infiniband/...
InfiniBand providers use shared discovery, annotation, target, domain-map, and node-list helpers.
Configuration validation and documentation
charts/topograph/..., docs/..., demos/dra-slinky/..., tests/ci/..., CHANGELOG.md, pkg/topology/...
Added DRA validation, configuration examples, documentation, test coverage, and removal of topology.KeyNvidiaGPUClique.
Demo build support
demos/oci-sim-slinky/demo.sh
The demo builds the kwok-nodes target before cluster creation.

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

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant DRAProvider
  participant KubernetesAPI
  participant DiscoverKubernetesDomains
  participant AcceleratorDiscoverer
  Client->>DRAProvider: Request topology
  DRAProvider->>KubernetesAPI: List nodes using node selector
  DRAProvider->>DiscoverKubernetesDomains: Discover domains from nodes and instances
  DiscoverKubernetesDomains->>AcceleratorDiscoverer: Discover assignments from targets
  AcceleratorDiscoverer-->>DRAProvider: Return accelerator domain map
  DRAProvider-->>Client: Return topology or gateway error
Loading

Possibly related PRs

  • NVIDIA/topograph#456 — Modifies Kubernetes accelerator topology label configuration and label documentation.
  • NVIDIA/topograph#457 — Extends the shared accelerator-discovery architecture with DRA Kubernetes-label discovery.
  • NVIDIA/topograph#460 — Configures accelerator-domain discovery through Kubernetes node labels.

Suggested reviewers: ravisoundar

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The demo script change that builds the kwok-nodes target is not related to the linked accelerator-discovery objectives. Remove the unrelated demo script change, or document a direct dependency on the accelerator-discovery refactor.
Docstring Coverage ⚠️ Warning Docstring coverage is 35.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: sharing Kubernetes accelerator discovery across providers.
Description check ✅ Passed The description directly explains the shared discovery refactor and DRA configuration changes.
Linked Issues check ✅ Passed The changes implement the shared discovery pipeline, DRA configuration and defaults, validation, documentation, and related tests required by [#461].
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ds-dra

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 consolidates Kubernetes accelerator discovery and identity mapping across the DRA and InfiniBand providers while allowing DRA’s accelerator label to be configured.

  • Adds shared node-selector, target-resolution, assignment-conversion, and base-annotation helpers.
  • Preserves nvidia.com/gpu.clique as DRA’s default when accelerator configuration is omitted.
  • Extends Helm validation, tests, examples, and documentation for DRA label configuration.
  • Removes the exported topology.KeyNvidiaGPUClique constant as a documented breaking API change.

Confidence Score: 5/5

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

No blocking failure remains.

Important Files Changed

Filename Overview
pkg/accelerator/kubernetes.go Adds shared Kubernetes node identity resolution and accelerator-domain conversion used by multiple providers.
pkg/accelerator/accelerator.go Adds reusable label-section construction, presence inspection, target conversion, and assignment-to-domain conversion.
pkg/providers/dra/provider.go Migrates DRA to shared accelerator discovery with a configurable label and legacy default.
pkg/providers/infiniband/provider_k8s.go Replaces provider-local accelerator target construction with shared canonical Kubernetes resolution.
internal/k8s/utils.go Centralizes decoding of provider node selectors into Kubernetes list options.
charts/topograph/templates/_validation.tpl Extends accelerator configuration validation to DRA and restricts it to Kubernetes-label discovery.
pkg/topology/topology.go Removes the exported GPU clique label constant as documented in the changelog.

Sequence Diagram

sequenceDiagram
    participant Engine
    participant Provider as DRA / InfiniBand-K8s
    participant Kubernetes
    participant Resolver as Shared accelerator resolver
    Engine->>Provider: GenerateTopologyConfig(instances)
    Provider->>Kubernetes: List nodes(nodeSelector)
    Kubernetes-->>Provider: Selected Node objects
    Provider->>Resolver: DiscoverKubernetesDomains(nodes, instances)
    Resolver->>Resolver: Resolve annotated region/instance identities
    Resolver->>Resolver: Read configured accelerator label
    Resolver-->>Provider: Canonical DomainMap
    Provider-->>Engine: topology.Graph
Loading

Reviews (5): Last reviewed commit: "refactor(providers): share Kubernetes ac..." | Re-trigger Greptile

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.05263% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.12%. Comparing base (8468abe) to head (b888067).
⚠️ Report is 53 commits behind head on main.

Files with missing lines Patch % Lines
pkg/providers/dra/provider.go 37.93% 15 Missing and 3 partials ⚠️
pkg/accelerator/kubernetes.go 81.08% 4 Missing and 3 partials ⚠️
pkg/providers/infiniband/provider_k8s.go 0.00% 4 Missing ⚠️
pkg/accelerator/accelerator.go 94.11% 1 Missing and 1 partial ⚠️
pkg/providers/infiniband/provider_bm.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #462      +/-   ##
==========================================
+ Coverage   72.15%   77.12%   +4.96%     
==========================================
  Files          89       99      +10     
  Lines        5689     7200    +1511     
==========================================
+ Hits         4105     5553    +1448     
+ Misses       1382     1358      -24     
- Partials      202      289      +87     

☔ 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.

@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/validation_test.yaml`:
- Around line 125-134: Add positive validation cases in the chart tests for an
omitted provider.params.accelerator preserving the nvidia.com/gpu.clique default
and for source kubernetes-label with kubernetesLabel.key passing validation. Run
the Helm chart tests and review any snapshot changes before committing.

In `@docs/providers/dra.md`:
- Around line 64-66: Rewrite the Helm configuration sentence near the
`provider.params` discussion to explicitly state that the chart manages the
Topograph configuration and topology request payload, so neither needs to be
supplied separately; avoid the ambiguous “they” pronoun.
🪄 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: a5eb2176-ddac-41fa-831c-df550514361e

📥 Commits

Reviewing files that changed from the base of the PR and between adf0dc8 and 9fb2338.

📒 Files selected for processing (23)
  • CHANGELOG.md
  • charts/topograph/templates/_validation.tpl
  • charts/topograph/tests/validation_test.yaml
  • charts/topograph/values.yaml
  • demos/dra-slinky/values.dra-slinky.kwok.yaml
  • docs/api.md
  • docs/overview.md
  • docs/providers/dra.md
  • docs/reference/node-labels.md
  • internal/k8s/utils.go
  • internal/k8s/utils_test.go
  • pkg/accelerator/accelerator.go
  • pkg/accelerator/accelerator_test.go
  • pkg/accelerator/kubernetes.go
  • pkg/providers/dra/provider.go
  • pkg/providers/dra/provider_test.go
  • pkg/providers/infiniband/bm.go
  • pkg/providers/infiniband/bm_test.go
  • pkg/providers/infiniband/k8s.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • tests/ci/values.slinky-dra-block.yaml
💤 Files with no reviewable changes (2)
  • pkg/providers/infiniband/bm.go
  • pkg/providers/infiniband/bm_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: oci-sim / slinky
  • GitHub Check: test
  • GitHub Check: check
  • GitHub Check: k8s / aws-sim
  • GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (11)
CHANGELOG.md

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • CHANGELOG.md
**/*

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

  • CHANGELOG.md
  • charts/topograph/tests/validation_test.yaml
  • docs/api.md
  • charts/topograph/values.yaml
  • docs/reference/node-labels.md
  • demos/dra-slinky/values.dra-slinky.kwok.yaml
  • charts/topograph/templates/_validation.tpl
  • pkg/providers/infiniband/k8s.go
  • internal/k8s/utils_test.go
  • tests/ci/values.slinky-dra-block.yaml
  • pkg/providers/infiniband/provider_bm.go
  • docs/overview.md
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/accelerator/accelerator.go
  • pkg/providers/dra/provider_test.go
  • pkg/accelerator/accelerator_test.go
  • pkg/accelerator/kubernetes.go
  • pkg/providers/infiniband/provider_k8s.go
  • docs/providers/dra.md
  • pkg/providers/dra/provider.go
  • internal/k8s/utils.go
charts/topograph/**/*.yaml

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • charts/topograph/tests/validation_test.yaml
  • charts/topograph/values.yaml
charts/topograph/tests/**/*.{yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

Run Helm chart tests when changing charts/topograph/; review snapshot changes before committing updates.

Files:

  • charts/topograph/tests/validation_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/validation_test.yaml
  • charts/topograph/values.yaml
  • charts/topograph/templates/_validation.tpl
**/*.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/k8s.go
  • internal/k8s/utils_test.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/accelerator/accelerator.go
  • pkg/providers/dra/provider_test.go
  • pkg/accelerator/accelerator_test.go
  • pkg/accelerator/kubernetes.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/dra/provider.go
  • internal/k8s/utils.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/k8s.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/providers/dra/provider_test.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/dra/provider.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
  • internal/k8s/utils_test.go
  • pkg/providers/infiniband/provider_bm.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/accelerator/accelerator.go
  • pkg/providers/dra/provider_test.go
  • pkg/accelerator/accelerator_test.go
  • pkg/accelerator/kubernetes.go
  • pkg/providers/infiniband/provider_k8s.go
  • pkg/providers/dra/provider.go
  • internal/k8s/utils.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • internal/k8s/utils_test.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/providers/dra/provider_test.go
  • pkg/accelerator/accelerator_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:

  • internal/k8s/utils_test.go
  • pkg/providers/infiniband/provider_k8s_test.go
  • pkg/providers/dra/provider_test.go
  • pkg/accelerator/accelerator_test.go
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/dra.md
pkg/providers/*/provider.go

📄 CodeRabbit inference engine (AGENTS.md)

A provider must expose func NamedLoader() (string, providers.Loader) and be registered in pkg/registry/registry.go.

Files:

  • pkg/providers/dra/provider.go
🪛 LanguageTool
docs/providers/dra.md

[grammar] ~64-~64: Ensure spelling is correct
Context: ...provider.params`. The chart manages the Topograph configuration and topology request payl...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (20)
internal/k8s/utils.go (1)

24-44: LGTM!

internal/k8s/utils_test.go (1)

13-13: LGTM!

Also applies to: 85-120

pkg/accelerator/accelerator.go (1)

53-70: LGTM!

Also applies to: 184-213, 227-235

pkg/accelerator/kubernetes.go (1)

13-20: LGTM!

Also applies to: 22-84

pkg/accelerator/accelerator_test.go (1)

14-15: LGTM!

Also applies to: 213-273

pkg/providers/dra/provider.go (1)

19-19: LGTM!

Also applies to: 31-117

pkg/providers/dra/provider_test.go (1)

12-18: LGTM!

Also applies to: 20-100

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

51-51: LGTM!

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

46-51: LGTM!

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

30-35: LGTM!

Also applies to: 37-92

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

9-25: LGTM!

CHANGELOG.md (1)

11-11: LGTM!

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

32-32: LGTM!

Also applies to: 52-52, 64-67

charts/topograph/values.yaml (1)

11-19: LGTM!

demos/dra-slinky/values.dra-slinky.kwok.yaml (1)

4-7: LGTM!

docs/api.md (1)

75-77: LGTM!

docs/overview.md (1)

43-43: LGTM!

Also applies to: 69-69

docs/providers/dra.md (1)

3-5: LGTM!

Also applies to: 29-32, 36-58, 62-63, 67-83, 108-114

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

65-65: LGTM!

tests/ci/values.slinky-dra-block.yaml (1)

6-9: LGTM!

Comment on lines +125 to +134
- it: rejects a DRA label accelerator source without a key
set:
provider:
name: dra
params:
accelerator:
source: kubernetes-label
asserts:
- failedTemplate:
errorMessage: "provider.params.accelerator.kubernetesLabel.key must be set for source kubernetes-label"

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 | 🔵 Trivial | ⚡ Quick win

Add positive DRA validation coverage and run the chart tests.

These tests cover only rejection paths. Add or verify cases for omitted provider.params.accelerator, which must preserve the nvidia.com/gpu.clique default, and explicit source: kubernetes-label with kubernetesLabel.key, which must pass.

As per coding guidelines, “Run Helm chart tests when changing charts/topograph/; review snapshot changes before committing updates.”

Also applies to: 136-145

🤖 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 `@charts/topograph/tests/validation_test.yaml` around lines 125 - 134, Add
positive validation cases in the chart tests for an omitted
provider.params.accelerator preserving the nvidia.com/gpu.clique default and for
source kubernetes-label with kubernetesLabel.key passing validation. Run the
Helm chart tests and review any snapshot changes before committing.

Source: Coding guidelines

Comment thread docs/providers/dra.md Outdated
@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: 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/providers/dra/provider_test.go`:
- Around line 36-40: Extend the unsupported-source table in the provider test to
include accelerator.SourceNvidiaSMI, asserting the same `dra provider supports
only accelerator source "kubernetes-label"` error as the existing SourceNone
case. Keep the test focused on rejecting non-label accelerator sources.

In `@pkg/providers/dra/provider.go`:
- Around line 24-28: The exported dra.DomainLabel API removal must be documented
or kept source-compatible. In pkg/providers/dra/provider.go lines 24-28, retain
DomainLabel as a deprecated alias to defaultDomainLabel if compatibility is
required; in CHANGELOG.md line 74, under [Unreleased], explicitly document the
removal of dra.DomainLabel and state that DRA defaults to nvidia.com/gpu.clique.
🪄 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: 3cd779d9-0876-44d7-b087-5ecd448f24c7

📥 Commits

Reviewing files that changed from the base of the PR and between 9fb2338 and e60f3b4.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • pkg/providers/dra/provider.go
  • pkg/providers/dra/provider_test.go
  • pkg/topology/graph_test.go
  • pkg/topology/topology.go
💤 Files with no reviewable changes (1)
  • pkg/topology/topology.go
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: Greptile Review
  • GitHub Check: check
  • GitHub Check: govulncheck
  • GitHub Check: build
  • GitHub Check: Fern Check
🧰 Additional context used
📓 Path-based instructions (8)
**/*.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/topology/graph_test.go
  • pkg/providers/dra/provider_test.go
  • pkg/providers/dra/provider.go
pkg/topology/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

Do not change Graph, the Vertex tree, or topology constants casually; changes require discussion because every provider and engine depends on them.

Files:

  • pkg/topology/graph_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • pkg/topology/graph_test.go
  • pkg/providers/dra/provider_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/topology/graph_test.go
  • pkg/providers/dra/provider_test.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/topology/graph_test.go
  • CHANGELOG.md
  • pkg/providers/dra/provider_test.go
  • pkg/providers/dra/provider.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/topology/graph_test.go
  • pkg/providers/dra/provider_test.go
  • pkg/providers/dra/provider.go
CHANGELOG.md

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • CHANGELOG.md
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/dra/provider_test.go
  • pkg/providers/dra/provider.go
pkg/providers/*/provider.go

📄 CodeRabbit inference engine (AGENTS.md)

A provider must expose func NamedLoader() (string, providers.Loader) and be registered in pkg/registry/registry.go.

Files:

  • pkg/providers/dra/provider.go
🔇 Additional comments (3)
pkg/providers/dra/provider.go (1)

19-22: LGTM!

Also applies to: 30-117

pkg/providers/dra/provider_test.go (1)

12-35: LGTM!

Also applies to: 43-100

pkg/topology/graph_test.go (1)

237-253: LGTM!

Comment thread pkg/providers/dra/provider_test.go
Comment thread pkg/providers/dra/provider.go
@dmitsh
dmitsh force-pushed the ds-dra branch 2 times, most recently from b888067 to a46b4ef Compare August 12, 2026 00:25
Signed-off-by: Dmitry Shmulevich <17212177+dmitsh@users.noreply.github.com>
@dmitsh
dmitsh merged commit dea0a93 into main Aug 12, 2026
13 of 14 checks passed
@dmitsh
dmitsh deleted the ds-dra branch August 12, 2026 00:30

@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 `@docs/providers/dra.md`:
- Around line 64-66: Update the DRA provider documentation to describe
provider.params.accelerator as optional only as a complete object, while stating
that when present it must include both accelerator.source and
accelerator.kubernetesLabel.key. Remove wording that implies the source label or
nodeSelector fields are independently optional, and keep the existing guidance
that the chart manages the related Topograph configuration and topology request
payload.
🪄 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: 7f3c81ed-50c7-4f4e-acf9-9b296c10f7f5

📥 Commits

Reviewing files that changed from the base of the PR and between b888067 and ac0f917.

📒 Files selected for processing (1)
  • docs/providers/dra.md
📜 Review details
⏰ Context from checks skipped due to timeout. (9)
  • GitHub Check: Greptile Review
  • GitHub Check: k8s / aws-sim
  • GitHub Check: k8s / gcp-sim
  • GitHub Check: check
  • GitHub Check: k8s / test
  • GitHub Check: build
  • GitHub Check: test
  • GitHub Check: oci-sim / slinky
  • GitHub Check: govulncheck
🧰 Additional context used
📓 Path-based instructions (2)
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/dra.md
**/*

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

  • docs/providers/dra.md
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/topograph PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-08T10:57:01.397Z
Learning: Applies to pkg/engines/k8s/**/*.go : Do not invent Kubernetes label keys in provider code; use canonical graph values and the configured closest-first `fabricLabels` and fixed accelerator sub-domain key.
📚 Learning: 2026-08-08T10:57:01.397Z
Learnt from: CR
Repo: NVIDIA/topograph PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-08T10:57:01.397Z
Learning: Applies to **/* : 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.

Applied to files:

  • docs/providers/dra.md
📚 Learning: 2026-08-08T10:57:01.397Z
Learnt from: CR
Repo: NVIDIA/topograph PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-08T10:57:01.397Z
Learning: Applies to pkg/engines/k8s/**/*.go : Do not invent Kubernetes label keys in provider code; use canonical graph values and the configured closest-first `fabricLabels` and fixed accelerator sub-domain key.

Applied to files:

  • docs/providers/dra.md
📚 Learning: 2026-08-08T10:57:01.397Z
Learnt from: CR
Repo: NVIDIA/topograph PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-08T10:57:01.397Z
Learning: Applies to docs/providers/**/*.md : Provider additions or changes require the corresponding provider documentation, including prerequisites, credentials, parameters, operation, and verification.

Applied to files:

  • docs/providers/dra.md
📚 Learning: 2026-08-08T10:57:01.397Z
Learnt from: CR
Repo: NVIDIA/topograph PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-08T10:57:01.397Z
Learning: Applies to pkg/providers/**/*.go : Providers discover topology and return the canonical `topology.Graph`; they must not emit scheduler-specific output.

Applied to files:

  • docs/providers/dra.md
📚 Learning: 2026-08-08T10:57:01.397Z
Learnt from: CR
Repo: NVIDIA/topograph PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-08T10:57:01.397Z
Learning: Applies to pkg/providers/**/*.go : When using `ClusterTopology`, populate fabric tiers closest-first, preserve optional accelerator domain and sub-domain fields, and call `ToGraph`.

Applied to files:

  • docs/providers/dra.md
🪛 LanguageTool
docs/providers/dra.md

[grammar] ~64-~64: Ensure spelling is correct
Context: ...provider.params. The chart manages the Topograph configuration and topology request payl...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (1)
docs/providers/dra.md (1)

3-5: LGTM!

Also applies to: 29-32, 36-44, 56-58, 80-82, 108-112

Comment thread docs/providers/dra.md
Comment on lines +64 to +66
source label and `nodeSelector` under `provider.params`. The chart manages the
Topograph configuration and topology request payload, so you do not need to
supply either one separately.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Describe the optional configuration accurately.

Line 64 calls this an “optional source label.” provider.params.accelerator is optional, but DRA requires both accelerator.source and accelerator.kubernetesLabel.key when that object is present. Users can otherwise treat these fields as independently optional and submit a configuration that Helm rejects.

Proposed wording
-Set the optional source label and `nodeSelector` under `provider.params`.
+Set the optional accelerator configuration and `nodeSelector` under `provider.params`.

Cross-file evidence: charts/topograph/templates/_validation.tpl:43-67 requires the accelerator source and Kubernetes label key for this DRA configuration.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
source label and `nodeSelector` under `provider.params`. The chart manages the
Topograph configuration and topology request payload, so you do not need to
supply either one separately.
Set the optional accelerator configuration and `nodeSelector` under `provider.params`. The chart manages the
Topograph configuration and topology request payload, so you do not need to
supply either one separately.
🧰 Tools
🪛 LanguageTool

[grammar] ~64-~64: Ensure spelling is correct
Context: ...provider.params. The chart manages the Topograph configuration and topology request payl...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 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 `@docs/providers/dra.md` around lines 64 - 66, Update the DRA provider
documentation to describe provider.params.accelerator as optional only as a
complete object, while stating that when present it must include both
accelerator.source and accelerator.kubernetesLabel.key. Remove wording that
implies the source label or nodeSelector fields are independently optional, and
keep the existing guidance that the chart manages the related Topograph
configuration and topology request payload.

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]: Refactor providers to share Kubernetes accelerator discovery between DRA and InfiniBand

1 participant