Skip to content

fix: Ensure scalingAdapter is included in generated DGD for autoscaling#7660

Open
AsadShahid04 wants to merge 1 commit intoai-dynamo:mainfrom
AsadShahid04:inf-62-dgdr-scaling-adapter
Open

fix: Ensure scalingAdapter is included in generated DGD for autoscaling#7660
AsadShahid04 wants to merge 1 commit intoai-dynamo:mainfrom
AsadShahid04:inf-62-dgdr-scaling-adapter

Conversation

@AsadShahid04
Copy link
Copy Markdown
Contributor

@AsadShahid04 AsadShahid04 commented Mar 26, 2026

  • Add scalingAdapter to generated DynamoGraphDeployment when planner is present
  • Checks for planner components and enables scaling adapter automatically
  • Fixes issue where DGDR with AI Configurator generates incomplete DGD spec
  • Ensures DGDSAs (DynamoGraph Deployment Scaling Adapters) can be created

Fixes #6491

Summary by CodeRabbit

  • New Features
    • Scaling adapter is now automatically enabled for deployments with specific component configurations, streamlining setup and ensuring proper scaling functionality initialization without manual configuration.

@AsadShahid04 AsadShahid04 requested a review from a team as a code owner March 26, 2026 09:53
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Mar 26, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the fix label Mar 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

👋 Hi AsadShahid04! Thank you for contributing to ai-dynamo/dynamo.

Just a reminder: The NVIDIA Test Github Validation CI runs an essential subset of the testing framework to quickly catch errors.Your PR reviewers may elect to test the changes comprehensively before approving your changes.

🚀

@github-actions github-actions Bot added external-contribution Pull request is from an external contributor deployment::k8s Relates to dynamo deployment in kubernetes labels Mar 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 26, 2026

Walkthrough

The PR modifies the DynamoGraphDeploymentRequest controller to automatically initialize the ScalingAdapter field in generated DynamoGraphDeployment resources when components with planners are present, addressing a bug where the adapter object was missing and preventing scaling adapters from being created.

Changes

Cohort / File(s) Summary
Scaling Adapter Initialization
deploy/operator/internal/controller/dynamographdeploymentrequest_controller.go
Added conditional logic in generateDGDSpec to initialize dgd.Spec.ScalingAdapter to {Enabled: true} when shouldEnableScalingAdapter returns true. Added new helper method shouldEnableScalingAdapter that checks if DGD has non-nil Spec.Components with at least one component containing a non-nil Planner.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: ensuring scalingAdapter is included in generated DGD for autoscaling functionality.
Description check ✅ Passed The description covers the main changes, references the fixed issue (#6491), and explains the problem being addressed. While it doesn't strictly follow the template structure, it contains sufficient detail about what was changed and why.
Linked Issues check ✅ Passed The pull request successfully addresses issue #6491 by adding logic to automatically enable scalingAdapter when planner components are detected, which enables DGDSAs creation for autoscaling.
Out of Scope Changes check ✅ Passed All changes are directly related to the stated objective: adding scalingAdapter logic to the DynamoGraphDeploymentRequest controller for autoscaling support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In
`@deploy/operator/internal/controller/dynamographdeploymentrequest_controller.go`:
- Around line 1656-1662: The current check only initializes
dgd.Spec.ScalingAdapter when it's nil, but misses the case when ScalingAdapter
exists with Enabled: false; update the logic in the r.shouldEnableScalingAdapter
handling to also set dgd.Spec.ScalingAdapter.Enabled = true when
dgd.Spec.ScalingAdapter != nil && dgd.Spec.ScalingAdapter.Enabled == false, and
still create a new &dgdv1alpha1.ScalingAdapter{Enabled: true} when nil; keep the
existing logger.Info call (or adjust message) so the controller logs that
scalingAdapter was enabled on the generated DGD for autoscaling support; target
the block referencing r.shouldEnableScalingAdapter, dgd.Spec.ScalingAdapter, and
the ScalingAdapter.Enabled 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: Pro

Run ID: fb63d100-7519-4877-868b-449456112e7d

📥 Commits

Reviewing files that changed from the base of the PR and between 06f1701 and 017700b.

📒 Files selected for processing (1)
  • deploy/operator/internal/controller/dynamographdeploymentrequest_controller.go

Comment thread deploy/operator/internal/controller/dynamographdeploymentrequest_controller.go Outdated
AsadShahid04 pushed a commit to AsadShahid04/dynamo that referenced this pull request Mar 26, 2026
- Update shouldEnableScalingAdapter check to handle both nil and disabled cases
- When ScalingAdapter is nil, create new one with Enabled: true
- When ScalingAdapter exists but Enabled is false, set Enabled to true
- Expand docstring on shouldEnableScalingAdapter for clarity
- Add appropriate logger.Info messages for both scenarios

Addresses CodeRabbit review feedback for PR ai-dynamo#7660

Signed-off-by: Asad Shahid <asad.shahid04@gmail.com>
AsadShahid04 pushed a commit to AsadShahid04/dynamo that referenced this pull request Mar 26, 2026
- Update shouldEnableScalingAdapter check to handle both nil and disabled cases
- When ScalingAdapter is nil, create new one with Enabled: true
- When ScalingAdapter exists but Enabled is false, set Enabled to true
- Expand docstring on shouldEnableScalingAdapter for clarity
- Add appropriate logger.Info messages for both scenarios

Addresses CodeRabbit review feedback for PR ai-dynamo#7660

Signed-off-by: Asad Shahid <asad.shahid04@gmail.com>
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Mar 26, 2026
- Handle case where ScalingAdapter exists with Enabled=false
- Enables ScalingAdapter when planner components are present
- Improves logging to reflect when adapter is enabled
- Fixes issue where DGDR with AI Configurator generates incomplete DGD spec

Fixes ai-dynamo#6491

Signed-off-by: Asad Shahid <asad.shahid@berkeley.edu>
@AsadShahid04 AsadShahid04 force-pushed the inf-62-dgdr-scaling-adapter branch from ab53cf7 to 784603e Compare March 26, 2026 21:47
@pull-request-size pull-request-size Bot added size/S and removed size/M labels Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deployment::k8s Relates to dynamo deployment in kubernetes external-contribution Pull request is from an external contributor fix size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: DGDR controller generates DGD with scalingAdapter object missing

1 participant