Skip to content

Conversation

qimcis
Copy link
Contributor

@qimcis qimcis commented Aug 18, 2025

Overview:

Fixes inconsistency in namespace environment variable usage across components. The K8s operator injects DYN_NAMESPACE for all containers, but some components were still expecting DYNAMO_NAMESPACE.

Details:

  • Updated vLLM backend to use DYN_NAMESPACE instead of DYNAMO_NAMESPACE
  • Updated SLA planner defaults to use DYN_NAMESPACE instead of DYNAMO_NAMESPACE
  • Updated deployment YAML files to consistently use DYN_NAMESPACE environment variable

Where should the reviewer start?

components/backends/vllm/src/dynamo/vllm/args.py
components/planner/src/dynamo/planner/defaults.py
deploy/cloud/operator/internal/dynamo/component_common.go

Related Issues:

Summary by CodeRabbit

  • Chores

    • Standardized environment variable for namespace from DYNAMO_NAMESPACE to DYN_NAMESPACE across planner and backend deployments.
    • Preserved default values; no behavioral changes for users relying on defaults.
    • Planner and vLLM components now derive endpoints and metrics configuration from the updated variable.
  • Migration Notes

    • If you set DYNAMO_NAMESPACE previously, update your environment/configuration to use DYN_NAMESPACE instead.

Copy link

copy-pr-bot bot commented Aug 18, 2025

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.

Copy link

👋 Hi qimcis! 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 fix labels Aug 18, 2025
Copy link
Contributor

coderabbitai bot commented Aug 18, 2025

Walkthrough

Renamed the environment variable DYNAMO_NAMESPACE to DYN_NAMESPACE across deployment manifests and code. Updates affect sglang and vllm disagg_planner YAMLs, vllm args for endpoint namespace resolution, and planner defaults for namespace-derived configuration. Default values remain the same; no other logic or configuration changes.

Changes

Cohort / File(s) Summary of Changes
Deployment manifests (namespace env var rename)
components/backends/sglang/deploy/disagg_planner.yaml, components/backends/vllm/deploy/disagg_planner.yaml
Renamed env var DYNAMO_NAMESPACE → DYN_NAMESPACE; preserved values (“dynamo” for sglang, “vllm-disagg-planner” for vllm).
vLLM runtime namespace sourcing
components/backends/vllm/src/dynamo/vllm/args.py
Updated namespace source from env DYNAMO_NAMESPACE to DYN_NAMESPACE; default remains “dynamo”; affects dyn:// endpoint construction.
Planner defaults (namespace sourcing)
components/planner/src/dynamo/planner/defaults.py
SLAPlannerDefaults.namespace now reads DYN_NAMESPACE (default “vllm-disagg-planner”); impacts computed Prometheus endpoint.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A nibble of names in fields of conf,
DYNAMO to DYN—so sleek, so swonf.
Endpoints hop where namespaces lead,
Carrots of config meet every need.
I twitch my nose, deploy and grin—
Small rename, big win. 🥕🐇

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

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

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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: 0

🧹 Nitpick comments (4)
components/backends/vllm/src/dynamo/vllm/args.py (3)

116-116: Add backward-compatible fallback to DYNAMO_NAMESPACE (with deprecation warning).

Prevents breakage if any deployment still sets DYNAMO_NAMESPACE. Safe to remove later after one release.

Apply this diff:

-    namespace = os.environ.get("DYN_NAMESPACE", "dynamo")
+    namespace = os.environ.get("DYN_NAMESPACE") or os.environ.get("DYNAMO_NAMESPACE") or "dynamo"
+    if "DYNAMO_NAMESPACE" in os.environ and "DYN_NAMESPACE" not in os.environ:
+        logger.warning("DYNAMO_NAMESPACE is deprecated; please set DYN_NAMESPACE instead.")

118-123: Don’t override a user-provided --endpoint.

Only synthesize the endpoint from DYN_NAMESPACE when the user hasn’t explicitly passed --endpoint.

Apply this diff:

-    if args.is_prefill_worker:
-        args.endpoint = f"dyn://{namespace}.prefill.generate"
-    else:
-        # For decode workers, also use the provided namespace instead of hardcoded "dynamo"
-        args.endpoint = f"dyn://{namespace}.backend.generate"
+    if "--endpoint" not in sys.argv:
+        if args.is_prefill_worker:
+            args.endpoint = f"dyn://{namespace}.prefill.generate"
+        else:
+            # For decode workers, also use the provided namespace instead of hardcoded "dynamo"
+            args.endpoint = f"dyn://{namespace}.backend.generate"

72-75: Clarify the help text to reference DYN_NAMESPACE.

Minor clarity tweak so users know where the namespace comes from.

Apply this diff:

-        help="Enable prefill functionality for this worker. Uses the provided namespace to construct dyn://namespace.prefill.generate",
+        help="Enable prefill functionality for this worker. Uses DYN_NAMESPACE to construct dyn://<namespace>.prefill.generate",
components/planner/src/dynamo/planner/defaults.py (1)

72-76: Planner defaults: add fallback to DYNAMO_NAMESPACE (deprecate) to ease rollout.

If any deployments still set the old var, this keeps behavior intact while warning. The endpoint string will then correctly derive from the resolved namespace.

Apply this diff:

 class SLAPlannerDefaults(BasePlannerDefaults):
     port = os.environ.get("DYNAMO_PORT", "8000")
-    namespace = os.environ.get("DYN_NAMESPACE", "vllm-disagg-planner")
+    namespace = os.environ.get("DYN_NAMESPACE") or os.environ.get("DYNAMO_NAMESPACE") or "vllm-disagg-planner"
+    if "DYNAMO_NAMESPACE" in os.environ and "DYN_NAMESPACE" not in os.environ:
+        logger.warning("DYNAMO_NAMESPACE is deprecated; please set DYN_NAMESPACE instead.")
     prometheus_endpoint = _get_default_prometheus_endpoint(port, namespace)
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d177cdf and 8628ed1.

📒 Files selected for processing (4)
  • components/backends/sglang/deploy/disagg_planner.yaml (1 hunks)
  • components/backends/vllm/deploy/disagg_planner.yaml (1 hunks)
  • components/backends/vllm/src/dynamo/vllm/args.py (1 hunks)
  • components/planner/src/dynamo/planner/defaults.py (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 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.
📚 Learning: 2025-06-04T13:09:53.416Z
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.

Applied to files:

  • components/backends/sglang/deploy/disagg_planner.yaml
⏰ 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). (4)
  • GitHub Check: Build and Test - dynamo
  • GitHub Check: pre-merge-rust (lib/runtime/examples)
  • GitHub Check: pre-merge-rust (lib/bindings/python)
  • GitHub Check: pre-merge-rust (.)
🔇 Additional comments (2)
components/backends/vllm/deploy/disagg_planner.yaml (1)

16-17: DYN_NAMESPACE rename confirmed; no DYNAMO_NAMESPACE stragglers found

  • Searched code, YAML, Python, and Go files—no occurrences of DYNAMO_NAMESPACE remain.
  • All environment-variable usages now reference DYN_NAMESPACE as intended.
components/backends/sglang/deploy/disagg_planner.yaml (1)

14-15: Rename to DYN_NAMESPACE looks correct for sglang as well.

This aligns with the operator’s injected env var and other code changes.

Reuse the repo-wide sweep script in my earlier comment to ensure there are no remaining DYNAMO_NAMESPACE references in sglang pathways.

@@ -11,7 +11,7 @@ spec:
envs:
- name: DYNAMO_SERVICE_CONFIG
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are looking for consistency, should we update all the DYNAMO_ envs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that it'd be a good change, l can go ahead and update all of them!

@@ -71,7 +71,7 @@ def _get_default_prometheus_endpoint(port: str, namespace: str):

class SLAPlannerDefaults(BasePlannerDefaults):
port = os.environ.get("DYNAMO_PORT", "8000")
Copy link
Contributor

Choose a reason for hiding this comment

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

DYN_PORT?

@qimcis qimcis requested a review from ryanolson August 19, 2025 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-contribution Pull request is from an external contributor fix size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants