Skip to content

DPF Service Template and Configuration Generator for Doca Weave - #4404

Merged
aadvani-nvidia merged 1 commit into
NVIDIA:mainfrom
aadvani-nvidia:astra_weave_flow_controller
Jul 31, 2026
Merged

DPF Service Template and Configuration Generator for Doca Weave#4404
aadvani-nvidia merged 1 commit into
NVIDIA:mainfrom
aadvani-nvidia:astra_weave_flow_controller

Conversation

@aadvani-nvidia

Copy link
Copy Markdown
Contributor

Add rust code generator for dpuserviceconfiguration and dpuservicetemplate files for doca-weave-dhcp-agent and doca-weave-flow-controller

Related issues

#3205

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

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

Additional Notes

dpuserviceconfiguration-doca-weave-dhcp-agent.yaml
dpuserviceconfiguration-doca-weave-flow-controller.yaml
dpuservicetemplate-doca-weave-dhcp-agent.yaml
dpuservicetemplate-doca-weave-flow-controller.yaml

@aadvani-nvidia
aadvani-nvidia requested a review from a team as a code owner July 30, 2026 19:54
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c009eed3-b16d-4088-94a9-ff84b79bbc6b

📥 Commits

Reviewing files that changed from the base of the PR and between 9d2fbf5 and 5b5767a.

📒 Files selected for processing (5)
  • crates/api-core/src/dpf_services.rs
  • crates/dpf/src/flavor.rs
  • crates/dpf/src/lib.rs
  • crates/dpf/src/sdk.rs
  • crates/dpf/src/types.rs

Summary by CodeRabbit

  • New Features
    • Added support for configuring DaemonSet resource requests (including accelerator-specific resources).
    • Updated Weave DHCP agent and flow controller Helm chart/image metadata and configuration shape.
    • Automatically render Weave DHCP networks and flow controller underlay interface mappings.
    • Increased BF4 Astra flavor capacity to 30 SFs.
    • Exposed a Kubernetes-compatible integer-or-string utility type.
  • Bug Fixes
    • Adjusted Weave-related service port configuration behavior to match expected defaults.
  • Tests
    • Expanded Weave and resource-rendering coverage, including validation of expected resource counts and generated interface lists.

Walkthrough

The PR updates weave chart and image metadata, Helm values, DHCP networks, flow-controller underlay interfaces, and DaemonSet extended resources. It also exposes IntOrString publicly and increases BF4 Astra PF_TOTAL_SF from 20 to 30.

Changes

Weave service configuration

Layer / File(s) Summary
DaemonSet resource contract
crates/dpf/src/types.rs, crates/dpf/src/sdk.rs, crates/dpf/src/lib.rs
Adds optional typed DaemonSet resource requests, propagates them into service configuration, and re-exports IntOrString.
Weave Helm rendering and validation
crates/api-core/src/dpf_services.rs
Updates weave registries and metadata, nested image values, DHCP network configuration, flow-controller underlay interfaces, bf_sf resources, DTS port configuration, and related tests.

BF4 Astra flavor

Layer / File(s) Summary
Astra service-function capacity
crates/dpf/src/flavor.rs
Changes PF_TOTAL_SF from 20 to 30 and updates its invariant test.

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

Sequence Diagram(s)

sequenceDiagram
  participant ServiceDefinition
  participant WeaveServiceBuilders
  participant HelmValues
  participant DpuServiceConfiguration
  ServiceDefinition->>WeaveServiceBuilders: provide weave metadata and service settings
  WeaveServiceBuilders->>HelmValues: render nested images, DHCP networks, and underlay interfaces
  WeaveServiceBuilders->>DpuServiceConfiguration: set DaemonSet bf_sf resources
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the DOCA Weave service template and configuration generator work.
Description check ✅ Passed The description is clearly related to the DPU service configuration and template generator 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.

🧹 Nitpick comments (2)
crates/api-core/src/dpf_services.rs (2)

88-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consolidate duplicated weave chart/image constants.

DOCA_WEAVE_DHCP_AGENT_SERVICE_HELM_NAME/_HELM_VERSION/_IMAGE_NAME/_IMAGE_TAG are byte-for-byte identical to their DOCA_WEAVE_FLOW_CONTROLLER_SERVICE_* counterparts, since both services ship from the same dpf-weave chart/image. Maintaining four duplicate pairs risks one being bumped without the other during a future version update.

♻️ Suggested consolidation
-pub const DOCA_WEAVE_DHCP_AGENT_SERVICE_HELM_NAME: &str = "dpf-weave";
-pub const DOCA_WEAVE_DHCP_AGENT_SERVICE_HELM_VERSION: &str = "v26.5.0-1f8f4e1e";
-pub const DOCA_WEAVE_DHCP_AGENT_SERVICE_IMAGE_NAME: &str = "weave-system";
-pub const DOCA_WEAVE_DHCP_AGENT_SERVICE_IMAGE_TAG: &str = "v26.5.0-f2c9f7c4-nightly";
-
-/// Weave flow (ovs) controller service definitions.
-pub const DOCA_WEAVE_FLOW_CONTROLLER_SERVICE_HELM_NAME: &str = "dpf-weave";
-pub const DOCA_WEAVE_FLOW_CONTROLLER_SERVICE_HELM_VERSION: &str = "v26.5.0-1f8f4e1e";
-pub const DOCA_WEAVE_FLOW_CONTROLLER_SERVICE_IMAGE_NAME: &str = "weave-system";
-pub const DOCA_WEAVE_FLOW_CONTROLLER_SERVICE_IMAGE_TAG: &str = "v26.5.0-f2c9f7c4-nightly";
+pub const DOCA_WEAVE_SERVICE_HELM_NAME: &str = "dpf-weave";
+pub const DOCA_WEAVE_SERVICE_HELM_VERSION: &str = "v26.5.0-1f8f4e1e";
+pub const DOCA_WEAVE_SERVICE_IMAGE_NAME: &str = "weave-system";
+pub const DOCA_WEAVE_SERVICE_IMAGE_TAG: &str = "v26.5.0-f2c9f7c4-nightly";

Then reference the shared constants from both default_doca_weave_dhcp_agent_service and default_doca_weave_flow_controller_service.

🤖 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/api-core/src/dpf_services.rs` around lines 88 - 97, Consolidate the
identical DHCP agent and flow controller weave chart/image constants in
dpf_services.rs into one shared set, then update
default_doca_weave_dhcp_agent_service and
default_doca_weave_flow_controller_service to reference those shared constants.
Remove the duplicated DOCA_WEAVE_DHCP_AGENT_SERVICE_* or
DOCA_WEAVE_FLOW_CONTROLLER_SERVICE_* definitions while preserving the existing
values and service configuration behavior.

585-629: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Duplicated port-name data between DHCP networks and underlay ports.

WEAVE_DHCP_AGENT_NETWORKS and WEAVE_FLOW_CONTROLLER_UNDERLAY_PORTS both enumerate the same 8 switch-port names (r0swpln0r3swpln1), but in different orders and as two independently maintained arrays. If the port topology is ever updated, editing one list without the other would silently produce a mismatched DHCP/underlay configuration with no compile-time or test signal, since the two are not derived from a shared source.

Consider deriving both from a single canonical WEAVE_ASTRA_PORTS list (or pairing PCI address directly with the port in one source array) so the DHCP networks and underlay interfaces can never drift apart.

🤖 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/api-core/src/dpf_services.rs` around lines 585 - 629, Consolidate the
duplicated switch-port definitions used by weave_dhcp_agent_networks and
weave_flow_controller_underlay_interfaces into one canonical WEAVE_ASTRA_PORTS
source, pairing each port with its PCI address or otherwise deriving both
configurations from the same entries. Update both helper functions to consume
that shared source while preserving their existing generated field values and
output behavior.
🤖 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.

Nitpick comments:
In `@crates/api-core/src/dpf_services.rs`:
- Around line 88-97: Consolidate the identical DHCP agent and flow controller
weave chart/image constants in dpf_services.rs into one shared set, then update
default_doca_weave_dhcp_agent_service and
default_doca_weave_flow_controller_service to reference those shared constants.
Remove the duplicated DOCA_WEAVE_DHCP_AGENT_SERVICE_* or
DOCA_WEAVE_FLOW_CONTROLLER_SERVICE_* definitions while preserving the existing
values and service configuration behavior.
- Around line 585-629: Consolidate the duplicated switch-port definitions used
by weave_dhcp_agent_networks and weave_flow_controller_underlay_interfaces into
one canonical WEAVE_ASTRA_PORTS source, pairing each port with its PCI address
or otherwise deriving both configurations from the same entries. Update both
helper functions to consume that shared source while preserving their existing
generated field values and output behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 96f539dd-cda6-4e2b-98b9-6f07970b14de

📥 Commits

Reviewing files that changed from the base of the PR and between 6996cc2 and 9d2fbf5.

📒 Files selected for processing (5)
  • crates/api-core/src/dpf_services.rs
  • crates/dpf/src/flavor.rs
  • crates/dpf/src/lib.rs
  • crates/dpf/src/sdk.rs
  • crates/dpf/src/types.rs

Comment thread crates/api-core/src/dpf_services.rs
Signed-off-by: aadvani <aadvani@nvidia.com>
@aadvani-nvidia
aadvani-nvidia force-pushed the astra_weave_flow_controller branch from 9d2fbf5 to 5b5767a Compare July 30, 2026 20:19
@github-actions

Copy link
Copy Markdown

@aadvani-nvidia
aadvani-nvidia merged commit 9f2a546 into NVIDIA:main Jul 31, 2026
64 checks passed
polarweasel pushed a commit to polarweasel/infra-controller that referenced this pull request Jul 31, 2026
…IA#4404)

Add rust code generator for dpuserviceconfiguration and
dpuservicetemplate files for doca-weave-dhcp-agent and
doca-weave-flow-controller

## Related issues
NVIDIA#3205

## 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

[dpuserviceconfiguration-doca-weave-dhcp-agent.yaml](https://github.com/user-attachments/files/30560955/dpuserviceconfiguration-doca-weave-dhcp-agent.yaml)

[dpuserviceconfiguration-doca-weave-flow-controller.yaml](https://github.com/user-attachments/files/30560962/dpuserviceconfiguration-doca-weave-flow-controller.yaml)

[dpuservicetemplate-doca-weave-dhcp-agent.yaml](https://github.com/user-attachments/files/30560971/dpuservicetemplate-doca-weave-dhcp-agent.yaml)

[dpuservicetemplate-doca-weave-flow-controller.yaml](https://github.com/user-attachments/files/30561054/dpuservicetemplate-doca-weave-flow-controller.yaml)

Signed-off-by: aadvani <aadvani@nvidia.com>
Signed-off-by: Alex Ball <aball@nvidia.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.

3 participants