feat(cli): add CPU/memory resource limit flags to sandbox create#1063
Open
nvshridhar wants to merge 1 commit intoNVIDIA:mainfrom
Open
feat(cli): add CPU/memory resource limit flags to sandbox create#1063nvshridhar wants to merge 1 commit intoNVIDIA:mainfrom
nvshridhar wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
Add four new optional CLI flags to openshell sandbox create: --cpu-request, --cpu-limit, --memory-request, --memory-limit These map to Kubernetes resource requests/limits via the existing DriverResourceRequirements proto fields and K8s driver. When omitted, behavior is unchanged (default K8s resource allocations). Includes ResourceArgs struct, prost_types::Struct serialization, unit tests, and integration test updates. Closes NVIDIA#1003 Signed-off-by: Shridhar Damale <sdamale@nvidia.com> Made-with: Cursor
|
Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text: I have read the DCO document and I hereby sign the DCO. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot. |
Author
|
I have read the DCO document and I hereby sign the DCO. |
Author
|
rcheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add four optional CLI flags (
--cpu-request,--cpu-limit,--memory-request,--memory-limit) toopenshell sandbox create. These map to Kubernetes resource requests/limits via the existingDriverResourceRequirementsproto fields and K8s driver. When omitted, behavior is unchanged.Related Issue
Closes #1003
Changes
crates/openshell-cli/src/main.rs: 4 new Clap args underRESOURCE FLAGShelp heading, threaded through tosandbox_createandsandbox_create_with_bootstrapcrates/openshell-cli/src/run.rs: NewResourceArgsstruct withto_resources_struct()that builds theprost_types::Structshape expected by the gateway server. FixedSandboxTemplateconstruction to create a template when resources are specified even without a custom imagecrates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs: Updated 5 call sites with&run::ResourceArgs::default()to match new function signaturesTesting
cargo check -p openshell-cli --testspasses (lib + all integration tests)kubectl describe pod, confirmed memory OOM at limit (exit 137), confirmed CPU throttle with 4 coresKnown limitation
No client-side validation of K8s quantity strings or request-vs-limit ordering. Invalid values are rejected by the K8s API server at pod creation time with a clear error. Client-side parsing of K8s quantities (millicores, binary suffixes) is out of scope for this PR.
Checklist
Made with Cursor