feat(sandbox): add resource JSON passthrough#1340
Open
ryana wants to merge 2 commits into
Open
Conversation
Signed-off-by: Ryan Angilly <rangilly@nvidia.com>
|
All contributors have signed the DCO ✍️ ✅ |
|
🌿 Preview your docs: https://nvidia-preview-pr-1340.docs.buildwithfern.com/openshell |
Collaborator
Author
|
I have read the DCO document and I hereby sign the DCO. |
Collaborator
Author
|
recheck |
Signed-off-by: Ryan Angilly <rangilly@nvidia.com>
elezar
reviewed
May 13, 2026
Comment on lines
1556
to
1559
| gpu: bool, | ||
| gpu_count: Option<u32>, | ||
| resources_json: Option<&str>, | ||
| gpu_device: Option<&str>, |
Member
There was a problem hiding this comment.
My thinking was that we would add a ResourcesSpec type that would include all of these instead of continuously extending the list. This spec would include specific fields as well as opague config to be interpreted by the driver (a key-value map). I have some local changes to this effect, but haven't found the "correct" shape yet. Pulling in your requirements may help here.
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
Expose generic sandbox template resource passthrough in
openshell sandbox createwith--resources-json <JSON>. The CLI parses object JSON intoSandboxTemplate.resources, so callers can set CPU, memory, and extended resources without adding one flag per resource.--gpu-count COUNTremains as a convenience flag. It now injectslimits["nvidia.com/gpu"] = "<COUNT>"into the same resource struct while still marking the sandbox as GPU-intent.Related Issue
Closes #1338
Changes
--resources-json JSONtoopenshell sandbox create.--resources-json, invalid JSON, non-object JSON, and--gpu-count 0.--gpu-countso it no longer adds public or driver protobuf fields; it writesnvidia.com/gpuintoSandboxTemplate.resources.SandboxTemplate, even when no image is provided.--gpudefault.Testing
mise run pre-commitpassesAdditional validation:
cargo test -p openshell-cli parse_sandbox_resources_json -- --nocapturecargo test -p openshell-cli sandbox_create_resources_json -- --nocapturecargo test -p openshell-cli sandbox_create_gpu_count -- --nocapturecargo test -p openshell-driver-kubernetes gpu_sandbox -- --nocapturecargo test -p openshell-server build_platform_config -- --nocaptureChecklist