-
Notifications
You must be signed in to change notification settings - Fork 690
fix: replace hard coded dynamo namespace with env var #3048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughIntroduces an environment-driven namespace (DYN_NAMESPACE) to construct default Dynamo endpoints across multiple modules and examples. Replaces hard-coded dyn://dynamo... defaults with dyn://{DYN_NAMESPACE}.... Downstream defaults are updated where applicable. No changes to argument parsing APIs or runtime logic beyond default value computation. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Env as Environment
participant App as CLI/App
participant Parser as Args Parser
User->>App: Run without --endpoint
App->>Env: Read DYN_NAMESPACE (default "dynamo")
Env-->>App: Namespace value
App->>Parser: Request defaults
Parser-->>App: Build endpoint: dyn://{DYN_NAMESPACE}.<service>.generate
App-->>User: Use computed default endpoint
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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. Comment Pre-merge checks❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (2)
lib/bindings/python/examples/hello_world/server_sglang_static.py (1)
16-26: LGTM — dynamic endpoint default added. Minor doc tweak suggested.The inline usage comment still shows dyn://dynamo.backend.generate. Consider changing it to dyn://$DYN_NAMESPACE.backend.generate (or “dyn://...”) to avoid confusion.
components/backends/sglang/src/dynamo/sglang/args.py (1)
153-154: Avoid duplicate env reads; use the module-level DYN_NAMESPACE.- namespace = os.environ.get("DYN_NAMESPACE", "dynamo") + namespace = DYN_NAMESPACEMultiple other files also read DYN_NAMESPACE directly (examples/multimodal/, lib/bindings/python/examples/, components/backends//src/dynamo/); consider unifying them repo-wide for consistency.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
components/backends/llama_cpp/src/dynamo/llama_cpp/main.py(2 hunks)components/backends/sglang/src/dynamo/sglang/args.py(1 hunks)examples/multimodal/components/encode_worker.py(1 hunks)examples/multimodal/components/processor.py(1 hunks)examples/multimodal/components/video_encode_worker.py(1 hunks)examples/multimodal/utils/args.py(1 hunks)lib/bindings/python/examples/hello_world/server_sglang.py(2 hunks)lib/bindings/python/examples/hello_world/server_sglang_static.py(2 hunks)lib/bindings/python/examples/hello_world/server_sglang_tok.py(2 hunks)lib/bindings/python/examples/hello_world/server_vllm.py(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-01T13:55:03.940Z
Learnt from: nnshah1
PR: ai-dynamo/dynamo#1444
File: tests/fault_tolerance/utils/metrics.py:30-32
Timestamp: 2025-07-01T13:55:03.940Z
Learning: The `dynamo_worker()` decorator in the dynamo codebase returns a wrapper that automatically injects the `runtime` parameter before calling the wrapped function. This means callers only need to provide the non-runtime parameters, while the decorator handles injecting the runtime argument automatically. For example, a function with signature `async def get_metrics(runtime, log_dir)` decorated with `dynamo_worker()` can be called as `get_metrics(log_dir)` because the decorator wrapper injects the runtime parameter.
Applied to files:
lib/bindings/python/examples/hello_world/server_sglang_static.py
⏰ 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 - dynamo
🔇 Additional comments (7)
examples/multimodal/components/video_encode_worker.py (1)
220-223: LGTM — defaults now namespace-aware.Dynamic defaults for both endpoint and downstream-endpoint look correct and consistent with the PR intent.
examples/multimodal/components/encode_worker.py (1)
179-182: LGTM — endpoint defaults derive from DYN_NAMESPACE.Matches the pattern used elsewhere; no issues spotted.
examples/multimodal/utils/args.py (1)
32-34: LGTM — centralized DEFAULT_ENDPOINT is namespace-aware.No functional concerns.
lib/bindings/python/examples/hello_world/server_sglang_tok.py (1)
25-25: LGTM — endpoint default is now tied to DYN_NAMESPACE.Change is minimal and consistent.
Also applies to: 38-39
components/backends/llama_cpp/src/dynamo/llama_cpp/main.py (1)
8-8: LGTM — backend default endpoint now respects DYN_NAMESPACE.Matches other backends/examples; no issues.
Also applies to: 21-22
lib/bindings/python/examples/hello_world/server_sglang.py (1)
24-24: LGTM — environment-driven default endpoint.Consistent with the rest of the PR.
Also applies to: 34-35
lib/bindings/python/examples/hello_world/server_vllm.py (1)
32-32: Import addition looks good.
osis required for the env var; no issues.
b9a4298 to
abc4443
Compare
abc4443 to
c4d8318
Compare
c4d8318 to
eaa423a
Compare
8463d2e to
25683ac
Compare
Signed-off-by: Biswa Panda <biswa.panda@gmail.com>
25683ac to
7736826
Compare
|
/ok to test 7736826 |
indrajit96
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Signed-off-by: Biswa Panda <biswa.panda@gmail.com>
Signed-off-by: Biswa Panda <biswa.panda@gmail.com> Signed-off-by: Kristen Kelleher <kkelleher@nvidia.com>
Overview:
We have hard coded dynamo namespaces in examples.
Replace them with env var
DYN_NAMESPACEcloses:
Summary by CodeRabbit