Skip to content

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

Open
gaochunhui wants to merge 1 commit intoalibaba:mainfrom
gaochunhui:feat/resource-requests
Open

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
gaochunhui wants to merge 1 commit intoalibaba:mainfrom
gaochunhui:feat/resource-requests

Conversation

@gaochunhui
Copy link
Copy Markdown

@gaochunhui gaochunhui commented Apr 8, 2026

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

  • Not run (explain why)
  • [ √] Unit tests
  • Integration tests
  • [√ ] e2e / manual verification

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

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>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +478 to +480
response = await sandbox_service.create_sandbox(
*create_args, resource_requests=resource_requests
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants