Skip to content

Conversation

julienmancuso
Copy link
Contributor

@julienmancuso julienmancuso commented Jul 8, 2025

Overview:

remove DYN_DEPLOYMENT_CONFIG in examples

Summary by CodeRabbit

  • Chores

    • Updated default service port from 3000 to 8000 across the platform for consistency.
    • Standardized test code and configurations to reference the new port via a shared constant.
  • Documentation

    • Deployment examples updated to remove inline environment variables for deployment configuration.
    • Added file-based configuration loading (-f ./configs/*.yaml) to service command-line arguments in deployment examples.
    • Updated deployment resource names for clarity and consistency.

Copy link
Contributor

coderabbitai bot commented Jul 8, 2025

Walkthrough

The constant DynamoServicePort was updated from 3000 to 8000 in the codebase. All test files and deployment YAMLs that previously used the hardcoded port 3000 were refactored to use the updated constant or to reflect the new port. Additionally, deployment YAMLs were modified to remove the DYN_DEPLOYMENT_CONFIG environment variable and instead supply configuration via new command-line arguments referencing YAML config files.

Changes

Files/Paths Change Summary
deploy/cloud/operator/internal/consts/consts.go Changed DynamoServicePort constant value from 3000 to 8000.
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller_test.go
deploy/cloud/operator/internal/dynamo/graph_test.go
Replaced hardcoded port 3000 with commonconsts.DynamoServicePort in tests; updated test expectations and imports accordingly.
examples/vllm_v1/deploy/agg.yaml
examples/vllm_v1/deploy/disagg.yaml
examples/vllm_v1/deploy/disagg_planner.yaml
Removed DYN_DEPLOYMENT_CONFIG env var; added -f ./configs/*.yaml arguments to service containers; updated resource names where applicable.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ServiceContainer
    participant ConfigFile

    User ->> ServiceContainer: Deploys container
    ServiceContainer ->> ConfigFile: Reads ./configs/{agg,disagg,disagg_planner}.yaml via -f argument
    ServiceContainer ->> ServiceContainer: Starts service on port 8000 (DynamoServicePort)
Loading

Possibly related PRs

  • ai-dynamo/dynamo#1365: Adds getter/setter methods and logic for managing the deployment config environment variable and overrides deployment specs, which is related to the way configuration is handled in deployments.

Poem

A port once three-thousand, now eight-thousand strong,
Configs in files, not envs, where they belong.
YAMLs refactored, constants aligned,
Rabbits rejoice! The code is refined.
With every hop, deployments run true—
🐇 Here’s to clean ports and configs anew!


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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: 3

🧹 Nitpick comments (3)
examples/vllm_v1/deploy/agg.yaml (1)

46-48: Same duplication pattern as disagg.yaml

Consider the same anchor/refactor here to avoid six separate copies of:

-f
./configs/agg.yaml

Also applies to: 73-75, 102-104

deploy/cloud/operator/internal/dynamo/graph_test.go (2)

517-519: Avoid hand-rolled JSON with fmt.Sprintf; use map + encoding/json for robustness.

Manually interpolating numbers into a raw JSON string is brittle (missing escapes, key ordering differences, etc.). Encoding a map prevents these issues and keeps the expectation stable if the constant changes type. Example:

-Value: fmt.Sprintf(`{"service1":{"ServiceArgs":{"Resources":{"CPU":"2","GPU":"2","Memory":"2Gi"},"Workers":2},"port":%d}}`, commonconsts.DynamoServicePort),
+Value: func() string {
+    payload := map[string]any{
+        "service1": map[string]any{
+            "port": commonconsts.DynamoServicePort,
+            "ServiceArgs": map[string]any{
+                "Workers":   2,
+                "Resources": map[string]string{"CPU": "2", "GPU": "2", "Memory": "2Gi"},
+            },
+        },
+    }
+    b, _ := json.Marshal(payload) // safe in tests
+    return string(b)
+}(),

This keeps the test readable and eliminates JSON-formatting edge cases.


796-800: Duplication hint: factor helper for repeated JSON expectations.

The fmt.Sprintf(…) pattern appears in several test cases; extracting a small helper (e.g. buildFrontendCfg(port int) string) would DRY the test code and make changes cheaper.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5f5dd2 and f97283d.

📒 Files selected for processing (6)
  • deploy/cloud/operator/internal/consts/consts.go (1 hunks)
  • deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller_test.go (4 hunks)
  • deploy/cloud/operator/internal/dynamo/graph_test.go (4 hunks)
  • examples/vllm_v1/deploy/agg.yaml (4 hunks)
  • examples/vllm_v1/deploy/disagg.yaml (4 hunks)
  • examples/vllm_v1/deploy/disagg_planner.yaml (6 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: julienmancuso
PR: ai-dynamo/dynamo#1365
File: deploy/cloud/operator/api/v1alpha1/dynamocomponentdeployment_types.go:171-178
Timestamp: 2025-06-04T13:09:53.416Z
Learning: The `DYN_DEPLOYMENT_CONFIG` environment variable (commonconsts.DynamoDeploymentConfigEnvVar) in the Dynamo operator will never be set via ValueFrom (secrets/config maps), only via direct Value assignment. The GetDynamoDeploymentConfig method correctly only checks env.Value for this specific environment variable.
Learnt from: julienmancuso
PR: ai-dynamo/dynamo#1474
File: deploy/cloud/operator/internal/controller/dynamocomponent_controller.go:1308-1312
Timestamp: 2025-06-11T21:29:28.650Z
Learning: User julienmancuso expects replies in English; avoid switching languages unless explicitly requested.
deploy/cloud/operator/internal/consts/consts.go (2)
Learnt from: julienmancuso
PR: ai-dynamo/dynamo#1365
File: deploy/cloud/operator/api/v1alpha1/dynamocomponentdeployment_types.go:171-178
Timestamp: 2025-06-04T13:09:53.416Z
Learning: The `DYN_DEPLOYMENT_CONFIG` environment variable (commonconsts.DynamoDeploymentConfigEnvVar) in the Dynamo operator will never be set via ValueFrom (secrets/config maps), only via direct Value assignment. The GetDynamoDeploymentConfig method correctly only checks env.Value for this specific environment variable.
Learnt from: julienmancuso
PR: ai-dynamo/dynamo#1474
File: deploy/cloud/operator/internal/controller/dynamocomponent_controller.go:1302-1306
Timestamp: 2025-06-11T21:18:00.425Z
Learning: In the Dynamo operator, the project’s preferred security posture is to set a Pod-level `PodSecurityContext` with `runAsUser`, `runAsGroup`, and `fsGroup` all set to `1000`, and then selectively override the user at the individual container level (e.g., `RunAsUser: 0` for Kaniko) when root is required.
examples/vllm_v1/deploy/disagg.yaml (2)
Learnt from: julienmancuso
PR: ai-dynamo/dynamo#1365
File: deploy/cloud/operator/api/v1alpha1/dynamocomponentdeployment_types.go:171-178
Timestamp: 2025-06-04T13:09:53.416Z
Learning: The `DYN_DEPLOYMENT_CONFIG` environment variable (commonconsts.DynamoDeploymentConfigEnvVar) in the Dynamo operator will never be set via ValueFrom (secrets/config maps), only via direct Value assignment. The GetDynamoDeploymentConfig method correctly only checks env.Value for this specific environment variable.
Learnt from: nnshah1
PR: ai-dynamo/dynamo#1444
File: tests/fault_tolerance/configs/agg_tp_1_dp_8.yaml:31-38
Timestamp: 2025-07-01T15:33:53.262Z
Learning: In fault tolerance test configurations, the `resources` section under `ServiceArgs` specifies resources per individual worker, not total resources for all workers. So `workers: 8` with `gpu: '1'` means 8 workers × 1 GPU each = 8 GPUs total.
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller_test.go (1)
Learnt from: julienmancuso
PR: ai-dynamo/dynamo#1365
File: deploy/cloud/operator/api/v1alpha1/dynamocomponentdeployment_types.go:171-178
Timestamp: 2025-06-04T13:09:53.416Z
Learning: The `DYN_DEPLOYMENT_CONFIG` environment variable (commonconsts.DynamoDeploymentConfigEnvVar) in the Dynamo operator will never be set via ValueFrom (secrets/config maps), only via direct Value assignment. The GetDynamoDeploymentConfig method correctly only checks env.Value for this specific environment variable.
examples/vllm_v1/deploy/disagg_planner.yaml (2)
Learnt from: julienmancuso
PR: ai-dynamo/dynamo#1365
File: deploy/cloud/operator/api/v1alpha1/dynamocomponentdeployment_types.go:171-178
Timestamp: 2025-06-04T13:09:53.416Z
Learning: The `DYN_DEPLOYMENT_CONFIG` environment variable (commonconsts.DynamoDeploymentConfigEnvVar) in the Dynamo operator will never be set via ValueFrom (secrets/config maps), only via direct Value assignment. The GetDynamoDeploymentConfig method correctly only checks env.Value for this specific environment variable.
Learnt from: nnshah1
PR: ai-dynamo/dynamo#1444
File: tests/fault_tolerance/configs/agg_tp_1_dp_8.yaml:31-38
Timestamp: 2025-07-01T15:33:53.262Z
Learning: In fault tolerance test configurations, the `resources` section under `ServiceArgs` specifies resources per individual worker, not total resources for all workers. So `workers: 8` with `gpu: '1'` means 8 workers × 1 GPU each = 8 GPUs total.
examples/vllm_v1/deploy/agg.yaml (1)
Learnt from: nnshah1
PR: ai-dynamo/dynamo#1444
File: tests/fault_tolerance/configs/agg_tp_1_dp_8.yaml:31-38
Timestamp: 2025-07-01T15:33:53.262Z
Learning: In fault tolerance test configurations, the `resources` section under `ServiceArgs` specifies resources per individual worker, not total resources for all workers. So `workers: 8` with `gpu: '1'` means 8 workers × 1 GPU each = 8 GPUs total.
deploy/cloud/operator/internal/dynamo/graph_test.go (2)
Learnt from: julienmancuso
PR: ai-dynamo/dynamo#1365
File: deploy/cloud/operator/api/v1alpha1/dynamocomponentdeployment_types.go:171-178
Timestamp: 2025-06-04T13:09:53.416Z
Learning: The `DYN_DEPLOYMENT_CONFIG` environment variable (commonconsts.DynamoDeploymentConfigEnvVar) in the Dynamo operator will never be set via ValueFrom (secrets/config maps), only via direct Value assignment. The GetDynamoDeploymentConfig method correctly only checks env.Value for this specific environment variable.
Learnt from: GuanLuo
PR: ai-dynamo/dynamo#1371
File: examples/llm/benchmarks/vllm_multinode_setup.sh:18-25
Timestamp: 2025-06-05T01:46:15.509Z
Learning: In multi-node setups with head/worker architecture, the head node typically doesn't need environment variables pointing to its own services (like NATS_SERVER, ETCD_ENDPOINTS) because local processes can access them via localhost. Only worker nodes need these environment variables to connect to the head node's external IP address.
🧬 Code Graph Analysis (2)
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller_test.go (1)
deploy/cloud/operator/internal/consts/consts.go (1)
  • DynamoServicePort (9-9)
deploy/cloud/operator/internal/dynamo/graph_test.go (1)
deploy/cloud/operator/internal/consts/consts.go (1)
  • DynamoServicePort (9-9)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build and Test - vllm
🔇 Additional comments (3)
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller_test.go (1)

311-312: 👍 Port constant used correctly in tests

Tests now rely exclusively on commonconsts.DynamoServicePort; this prevents future port drift. No further action required.

Also applies to: 468-469, 901-902, 953-956

deploy/cloud/operator/internal/dynamo/graph_test.go (2)

22-23: Import addition is correct and necessary.

fmt is actually used later in the file for the dynamic JSON expectations, so the new import is required and introduces no side-effects.


774-777: Good switch to constant-driven expectation.

The test now derives want from commonconsts.DynamoServicePort; this removes a magic number and de-couples the test from future port changes.

Copy link
Contributor

@biswapanda biswapanda left a comment

Choose a reason for hiding this comment

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

PR LGTM

for future PR: can we make this entry port configurable?

@julienmancuso julienmancuso merged commit a604c7f into main Jul 9, 2025
10 of 11 checks passed
@julienmancuso julienmancuso deleted the jsm/dep-210 branch July 9, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants