Skip to content

bug: dpf: Fix for Bf4 mandatory services overwriting bf3 services.#3404

Open
abvarshney-nv wants to merge 1 commit into
NVIDIA:mainfrom
abvarshney-nv:manadatory_services_bug
Open

bug: dpf: Fix for Bf4 mandatory services overwriting bf3 services.#3404
abvarshney-nv wants to merge 1 commit into
NVIDIA:mainfrom
abvarshney-nv:manadatory_services_bug

Conversation

@abvarshney-nv

Copy link
Copy Markdown
Contributor

Suffix DPUServiceTemplate/Configuration/NAD CR names (and the deployment's references to them) per deployment so BF3 and BF4 no longer clobber each other's Helm values/version in the shared namespace. BF3 keeps its original unsuffixed names (no rename/orphaning); only BF4 is suffixed.

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 11, 2026 10:17
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Summary by CodeRabbit

  • New Features

    • Added deployment-specific naming for service and network attachment resources on non-BF3 deployments.
    • Updated generated deployment references to use the correct per-deployment resource names.
    • Preserved logical service names and deployment service-map keys for consistency.
    • Corrected network references to point to the matching deployment-specific resources.
  • Bug Fixes

    • Improved resource isolation across multiple deployment types.

Walkthrough

Changes

Per-deployment CR naming

Layer / File(s) Summary
Suffix-aware resource builders
crates/dpf/src/sdk.rs
Adds deployment suffix and naming helpers, applies suffixes to service template, service configuration, and NAD CR names, and remaps configuration network references.
Deployment wiring and references
crates/dpf/src/sdk.rs
Computes deployment suffixes, propagates them through builders, and preserves logical service-map keys while updating resource references.
Regression and suffix behavior tests
crates/dpf/src/sdk.rs
Updates existing builder calls and verifies distinct BF3 and BF4 naming behavior.

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

Sequence Diagram(s)

sequenceDiagram
  participant DeploymentInitialization
  participant ResourceBuilders
  participant DPUDeployment
  participant KubernetesResources
  DeploymentInitialization->>ResourceBuilders: compute and pass deployment suffix
  ResourceBuilders->>KubernetesResources: create suffixed service and NAD CRs
  ResourceBuilders->>DPUDeployment: provide suffixed service references
  DPUDeployment->>KubernetesResources: retain logical service-map keys
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main fix: preventing BF4 mandatory services from overwriting BF3 services.
Description check ✅ Passed The description clearly explains the suffixing change and its BF3/BF4 impact, matching the code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/dpf/src/sdk.rs (1)

608-641: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Disambiguate live version lookup

get_dpf_service_versions matches live templates with deployment_service_name only. BF3 and BF4 now share that logical name, while only metadata.name is suffixed, so the first find(...) hit can report the wrong live_helm_version / live_docker_image_tag depending on list order. Match by cr_name or add a deployment discriminator.

🤖 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 `@crates/dpf/src/sdk.rs` around lines 608 - 641, The live-template lookup in
get_dpf_service_versions must disambiguate services that share
deployment_service_name. Match each template using its suffixed
metadata.name/cr_name derived from the service name and suffix, or apply an
equivalent deployment discriminator, so live_helm_version and
live_docker_image_tag come from the correct template regardless of list order.
🧹 Nitpick comments (1)
crates/dpf/src/sdk.rs (1)

781-791: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Prefer a parameters struct over #[allow(clippy::too_many_arguments)].

Adding suffix tips build_deployment past Clippy's argument threshold, and the fix here is to silence the lint. The house style is to avoid broad #[allow(...)]; a positional argument list of this size is also error-prone at the call sites (e.g. it is easy to transpose flavor_name/namespace). Consider grouping the inputs into a DeploymentParams struct (constructed with named fields), which removes the lint, restores compile-time clarity, and reads better than eight positional arguments.

As per coding guidelines: "Avoid using #[allow(...)] unless you have a strong reason to do so" and "If you have a large struct with lots of required fields ... consider splitting it into two types."

🤖 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 `@crates/dpf/src/sdk.rs` around lines 781 - 791, Replace the positional
arguments of build_deployment with a DeploymentParams struct containing the
required deployment inputs, including suffix, and remove the
#[allow(clippy::too_many_arguments)] attribute. Update all callers to construct
DeploymentParams using named fields, preserving the existing deployment behavior
and value mappings.

Source: Coding guidelines

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

Outside diff comments:
In `@crates/dpf/src/sdk.rs`:
- Around line 608-641: The live-template lookup in get_dpf_service_versions must
disambiguate services that share deployment_service_name. Match each template
using its suffixed metadata.name/cr_name derived from the service name and
suffix, or apply an equivalent deployment discriminator, so live_helm_version
and live_docker_image_tag come from the correct template regardless of list
order.

---

Nitpick comments:
In `@crates/dpf/src/sdk.rs`:
- Around line 781-791: Replace the positional arguments of build_deployment with
a DeploymentParams struct containing the required deployment inputs, including
suffix, and remove the #[allow(clippy::too_many_arguments)] attribute. Update
all callers to construct DeploymentParams using named fields, preserving the
existing deployment behavior and value mappings.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5c30d5f8-af4f-4b3d-992b-11ef84ded62a

📥 Commits

Reviewing files that changed from the base of the PR and between 76357e2 and 6c20fca.

📒 Files selected for processing (1)
  • 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 271 13 34 91 7 126
machine-validation-runner 804 40 237 296 36 195
machine_validation 804 40 237 296 36 195
machine_validation-aarch64 804 40 237 296 36 195
nvmetal-carbide 804 40 237 296 36 195
TOTAL 3493 173 982 1281 151 906

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

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.

1 participant