Skip to content

fix (dpf): Update SoftwareInventory details for the DPF ingested nodes.#3769

Merged
abvarshney-nv merged 1 commit into
NVIDIA:mainfrom
abvarshney-nv:bug_6439429
Jul 21, 2026
Merged

fix (dpf): Update SoftwareInventory details for the DPF ingested nodes.#3769
abvarshney-nv merged 1 commit into
NVIDIA:mainfrom
abvarshney-nv:bug_6439429

Conversation

@abvarshney-nv

Copy link
Copy Markdown
Contributor

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

  • 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

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

@abvarshney-nv
abvarshney-nv requested a review from a team as a code owner July 21, 2026 10:36
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Summary by CodeRabbit

  • New Features
    • When a DPF-ingested machine is updated, resolved DPU service versions are now automatically derived and published into hardware inventory.
  • Bug Fixes
    • DPU agent version detection now recognizes both legacy and carbide component naming.
    • HBN version detection now supports both doca-hbn and doca_hbn naming formats.
    • Network status/version views and “outdated” filtering/counts now use the corrected component-name matching.

Walkthrough

Changes

The 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

Layer / File(s) Summary
Service version lookup contract and implementation
crates/dpf/src/types.rs, crates/dpf/src/sdk.rs, crates/dpf/src/lib.rs, crates/machine-controller/src/dpf.rs
Adds DpuServiceVersion, resolves service versions from DPU deployment resources, and exposes the lookup through DpfOperations.
DPF-ingested inventory update
crates/api-core/src/handlers/dpu.rs
Detects DPF-ingested DPUs, builds software inventory from resolved service versions, and commits the database update.
Inventory component-name compatibility
crates/admin-cli/src/dpu/versions/cmd.rs, crates/api-web/src/dpu_versions.rs, crates/api-web/src/network_status.rs
Recognizes hyphenated and legacy component names for HBN and DPU agent version extraction.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the DPF inventory update for ingested nodes and is aligned with the main code changes.
Description check ✅ Passed The description accurately explains the API-side inventory override for DPF-ingested DPUs and matches the implemented behavior.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

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

Inline comments:
In `@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

📥 Commits

Reviewing files that changed from the base of the PR and between b20d9f4 and 6bff7ec.

📒 Files selected for processing (8)
  • crates/admin-cli/src/dpu/versions/cmd.rs
  • crates/api-core/src/handlers/dpu.rs
  • crates/api-web/src/dpu_versions.rs
  • crates/api-web/src/network_status.rs
  • crates/dpf/src/lib.rs
  • crates/dpf/src/sdk.rs
  • crates/dpf/src/types.rs
  • crates/machine-controller/src/dpf.rs

Comment thread crates/api-core/src/handlers/dpu.rs Outdated
Comment thread crates/dpf/src/sdk.rs
@github-actions

Copy link
Copy Markdown

🔍 Container Scan Summary

Service Total Critical High Medium Low Other
boot-artifacts-aarch64 3 0 0 3 0 0
boot-artifacts-x86_64 3 0 0 3 0 0
forge-admin-cli-x86_64 259 16 29 79 7 128
machine-validation-runner 538 41 117 184 15 181
machine_validation 538 41 117 184 15 181
machine_validation-aarch64 538 41 117 184 15 181
TOTAL 1879 139 380 637 52 671

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

@github-actions

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 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

📥 Commits

Reviewing files that changed from the base of the PR and between c1bce34 and 023f764.

📒 Files selected for processing (8)
  • crates/admin-cli/src/dpu/versions/cmd.rs
  • crates/api-core/src/handlers/dpu.rs
  • crates/api-web/src/dpu_versions.rs
  • crates/api-web/src/network_status.rs
  • crates/dpf/src/lib.rs
  • crates/dpf/src/sdk.rs
  • crates/dpf/src/types.rs
  • crates/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

Comment thread crates/dpf/src/types.rs
@abvarshney-nv
abvarshney-nv merged commit 2db4a74 into NVIDIA:main Jul 21, 2026
61 checks passed
@abvarshney-nv
abvarshney-nv deleted the bug_6439429 branch July 21, 2026 17:24
nv-dmendoza pushed a commit that referenced this pull request Jul 23, 2026
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>
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.

2 participants