fix (dpf): Update SoftwareInventory details for the DPF ingested nodes.#3769
Conversation
Summary by CodeRabbit
WalkthroughChangesThe DPF SDK resolves per-service versions from DPU deployment resources. DPF-ingested inventory reports use those versions to update database inventory, while API and CLI lookups accept current and legacy component names. DPF inventory integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Agent
participant APIHandler
participant DpfSdk
participant Database
Agent->>APIHandler: submit inventory report
APIHandler->>Database: load DPU machine
APIHandler->>DpfSdk: resolve service versions
DpfSdk-->>APIHandler: return service versions
APIHandler->>Database: persist generated inventory
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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 `@crates/api-core/src/handlers/dpu.rs`:
- Around line 816-866: Update the DPU inventory handler around the `api.dpf_sdk`
and `machine.dpf.used_for_ingestion` checks so ingestion status is determined
independently of SDK availability. For ingestion-enabled machines, require
`api.dpf_sdk` and return an appropriate error when it is unavailable; do not
continue to the agent-inventory processing path. Preserve the existing operator
service-version update and transaction handling when the SDK is available.
In `@crates/dpf/src/sdk.rs`:
- Around line 2042-2047: Update the deployment-entry handling around
DpuServiceTemplateRepository::get so a missing referenced service template
returns DpfError::NotFound or InvalidState instead of continuing. Preserve the
existing successful template-processing path, ensuring the deployment report
fails and retains the prior inventory when the referenced CR is absent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 7c849ba8-5257-4bb8-acad-78e749b35d48
📒 Files selected for processing (8)
crates/admin-cli/src/dpu/versions/cmd.rscrates/api-core/src/handlers/dpu.rscrates/api-web/src/dpu_versions.rscrates/api-web/src/network_status.rscrates/dpf/src/lib.rscrates/dpf/src/sdk.rscrates/dpf/src/types.rscrates/machine-controller/src/dpf.rs
6bff7ec to
41e265b
Compare
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
41e265b to
c1bce34
Compare
|
🌿 Preview your docs: https://nvidia-preview-pull-request-3769.docs.buildwithfern.com/infra-controller |
c1bce34 to
023f764
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/dpf/src/types.rs`:
- Line 480: Update the documentation for the name field in the relevant DPF type
to state that DpfSdk::get_service_versions_for_dpu populates it from the
DPUDeployment.spec.services map key, rather than from a DPUServiceTemplate
field.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: fbef88e7-8fcd-4b97-a259-3b7c46889649
📒 Files selected for processing (8)
crates/admin-cli/src/dpu/versions/cmd.rscrates/api-core/src/handlers/dpu.rscrates/api-web/src/dpu_versions.rscrates/api-web/src/network_status.rscrates/dpf/src/lib.rscrates/dpf/src/sdk.rscrates/dpf/src/types.rscrates/machine-controller/src/dpf.rs
🚧 Files skipped from review as they are similar to previous changes (6)
- crates/dpf/src/lib.rs
- crates/api-web/src/network_status.rs
- crates/api-web/src/dpu_versions.rs
- crates/dpf/src/sdk.rs
- crates/machine-controller/src/dpf.rs
- crates/api-core/src/handlers/dpu.rs
Backport of three fixes from main to `release/v2.0`: | PR | Title | |---|---| | #3769 | fix (dpf): Update SoftwareInventory details for the DPF ingested nodes | | #3779 | fix: Use states to manage reboot operation to avoid race condition | | #3781 | fix: Add URL in SoftwareInventory in UI/cli | ### Backport notes Two v2.0 compatibility fixups were needed (not present in the original PRs): - `BlueFieldSoftwareParams` and `DpuDeploymentType` removed from dpf import lists — these types were introduced after v2.0 by #3361 and #3084 and do not exist on this branch. - `Machine.dpf.used_for_ingestion` used instead of `Machine.config.dpf.used_for_ingestion` — the `Machine` struct layout differs between main and v2.0. ## Related issues #3769, #3779, #3781 ## Type of Change - [x] **Add** - New feature or capability - [ ] **Change** - Changes in existing functionality - [ ] **Fix** - Bug fixes - [ ] **Remove** - Removed features or deprecated functionality - [ ] **Internal** - Internal changes (refactoring, tests, docs, etc.) ## Breaking Changes - [ ] **This PR contains breaking changes** ## Testing - [x] Unit tests added/updated - [ ] Integration tests added/updated - [ ] Manual testing performed - [ ] No testing required (docs, internal refactor, etc.) ## Additional Notes --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
In DPF mode the agent runs containerized and cannot enumerate the services managed by the DPF operator, so agent_reported_inventory was always empty for DPF-ingested DPUs. Service versions (HBN, DTS, DHCP, etc.) were therefore never surfaced in the UI or admin CLI.
Fix this by intercepting the agent's hourly inventory report on the API server side: when a DPU was ingested via DPF, read the currently deployed service versions directly from the DPF operator (DPUDeployment → DPUServiceTemplate CRs) and store those in the DB instead of the agent's reported data. This keeps displayed versions accurate after upgrades without any changes to the agent.
Related issues
Type of Change
Breaking Changes
Testing
Additional Notes