-
Notifications
You must be signed in to change notification settings - Fork 755
feat: populate default image name #1255
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
WalkthroughThe Changes
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
Documentation and Community
|
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: 0
🧹 Nitpick comments (1)
deploy/sdk/src/dynamo/sdk/cli/build.py (1)
132-136: Improve error message accuracy.The assertion error message mentions "environment variable" but
DYNAMO_IMAGEis imported fromdynamo.sdk(line 40), not necessarily sourced from an environment variable. This could mislead users about how to resolve the issue.Consider updating the error message to be more accurate:
- assert ( - image is not None - ), "Please set DYNAMO_IMAGE environment variable or image field in service config" + assert ( + image is not None + ), "Please ensure DYNAMO_IMAGE is configured or set the image field in service config"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
deploy/sdk/src/dynamo/sdk/cli/build.py(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Validate PR title and add label
- GitHub Check: Build and Test - vllm
- GitHub Check: Mirror Repository to GitLab
🔇 Additional comments (1)
deploy/sdk/src/dynamo/sdk/cli/build.py (1)
132-143: Good implementation of fallback mechanism.The fallback logic for Docker image selection is well-implemented. Using
service.config.image or DYNAMO_IMAGEprovides a clean way to prioritize service-specific configuration while having a sensible default. The assertion ensures the system fails fast if neither option is available, which is good for debugging.
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
deploy/sdk/src/dynamo/sdk/core/protocol/interface.py(1 hunks)deploy/sdk/src/dynamo/sdk/tests/test_resources.py(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
deploy/sdk/src/dynamo/sdk/tests/test_resources.py (1)
deploy/sdk/src/dynamo/sdk/core/protocol/interface.py (2)
ServiceInterface(99-192)config(110-112)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Mirror Repository to GitLab
- GitHub Check: Build and Test - vllm
🔇 Additional comments (3)
deploy/sdk/src/dynamo/sdk/tests/test_resources.py (3)
19-19: Good addition of type annotation.Adding the
ServiceInterfaceimport and type annotation improves code clarity and enables better IDE support.
44-48: Note: PR objective discrepancy.The PR is titled "feat: populate default image name" and mentions using
DYNAMO_IMAGEenvironment variable, but the changes in these files are related to resource configuration field renaming and test enhancements. This suggests either missing files or incomplete context for the actual default image functionality.Could you confirm if there are additional files in this PR that implement the default image name functionality mentioned in the PR objectives?
Likely an incorrect or invalid review comment.
44-48:Details
✅ Verification successful
Enhanced test assertions are valuable, but verify CPU type conversion.
The enhanced test assertions that check specific resource values are much better than just checking for existence. However, there's a potential type inconsistency: the service decorator specifies
cpu: "2"(string) but the test expectscpu == 2(integer).Please verify if automatic type conversion is happening in the ResourceConfig class. Run this script to check the ResourceConfig field types:
If no automatic conversion exists, consider updating the test to match the expected type:
- assert dyn_svc.config.resources.cpu == 2 + assert dyn_svc.config.resources.cpu == "2"
🏁 Script executed:
#!/bin/bash # Description: Check ResourceConfig field definitions and any type conversion logic # Expected: Understanding of whether CPU should be string or int # Search for ResourceConfig class definition and any type conversion ast-grep --pattern 'class ResourceConfig($_): $$$' # Search for any CPU field type annotations or validation rg -A 5 -B 5 "cpu.*:" --type py rg -A 5 -B 5 "cpu.*int" --type pyLength of output: 30213
🏁 Script executed:
rg "from .*BaseModel" -n deploy/sdk/src/dynamo/sdk/core/protocol/interface.py rg "import BaseModel" -n deploy/sdk/src/dynamo/sdk/core/protocol/interface.py rg "pydantic" -n deploy/sdk/src/dynamo/sdk/core/protocol/interface.py rg -A5 -B2 "class ServiceConfig" -n deploy/sdk/src/dynamo/sdk/core/protocol/interface.pyLength of output: 646
No change needed: Pydantic auto-converts CPU string to int.
Pydantic’s BaseModel (imported in
deploy/sdk/src/dynamo/sdk/core/protocol/interface.py) will coerce"2"into anintfor thecpu: intfield, so the test’sassert dyn_svc.config.resources.cpu == 2is correct.
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller.go(2 hunks)examples/llm/configs/agg_router.yaml(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller.go (2)
deploy/cloud/operator/internal/consts/consts.go (1)
KubeLabelDynamoComponent(47-47)deploy/cloud/operator/internal/dynamo/graph.go (1)
ComponentTypePlanner(48-48)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build and Test - vllm
🔇 Additional comments (2)
examples/llm/configs/agg_router.yaml (1)
43-44: LGTM! Appropriate resource configuration.The CPU and memory resource specifications are well-sized for a VllmWorker service and follow Kubernetes resource specification standards.
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller.go (1)
1458-1460: Conditional logic implementation looks correct.The implementation properly restricts the environment argument injection to only Planner component deployments. The logic structure is sound:
- Checks for the existence of the component type label
- Compares the label value with the ComponentTypePlanner constant
- Only appends the environment argument when both conditions are met
However, this logic depends on the casing consistency issue identified in the previous comment. Ensure the label values match the constant definition.
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller.go
Show resolved
Hide resolved
5e8cb05 to
e70d2ca
Compare
e70d2ca to
4e621e7
Compare
85e1c93 to
fb588ae
Compare
|
Some of my comments from #1266 (review) apply here. |
|
I think I should raise a question that doesn't exist in the issues, about resources The current resources can only use For instance, when I want to use an L4 model gpu, I only need to set |
Details:
DYNAMO_IMAGEwhen image is not specified explicitlyWhere should the reviewer start?
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
Bug Fixes
Style
Enhancements
Tests