feat: add resource_requests for Burstable QoS support(When creating a sandbox, support creating according to the strategy of low request and high limit)#669
Conversation
Add optional resourceRequests field to allow requests < limits, enabling Kubernetes Burstable QoS for better resource utilization. - OpenAPI spec: add resourceRequests to CreateSandboxRequest - SDK: Sandbox.create() accepts resource_requests param - Server: extract and pass resource_requests through to providers - Providers: use separate requests in V1ResourceRequirements - Backward compatible: defaults to limits when omitted Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9689015d88
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| response = await sandbox_service.create_sandbox( | ||
| *create_args, resource_requests=resource_requests | ||
| ) |
There was a problem hiding this comment.
Preserve old create_sandbox service signatures
Sandbox.create now always forwards resource_requests= even when the caller did not set it. Any existing Sandboxes implementation that still uses the previous signature (without resource_requests and without a catch-all **kwargs) will now raise TypeError: got an unexpected keyword argument 'resource_requests', breaking integrations that were previously compatible when platform was unset.
Useful? React with 👍 / 👎.
| egress_mode=egress_mode, | ||
| volumes=request.volumes, | ||
| platform=request.platform, | ||
| resource_requests=resource_requests, |
There was a problem hiding this comment.
Keep custom workload providers backward compatible
KubernetesSandboxService now unconditionally passes resource_requests= into create_workload. Providers registered through the documented register_provider extension point that still implement the old create_workload signature will fail sandbox creation with an unexpected-keyword TypeError, even when the API request omits resourceRequests (because None is still sent).
Useful? React with 👍 / 👎.
Summary
feat: add resource_requests for Burstable QoS support
When creating a sandbox, support creating according to the strategy of low request and high limit
Testing
Breaking Changes
Checklist