-
Notifications
You must be signed in to change notification settings - Fork 763
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
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -337,6 +337,11 @@ async def create_sandbox(self, request: CreateSandboxRequest) -> CreateSandboxRe | |
| resource_limits = {} | ||
| if request.resource_limits and request.resource_limits.root: | ||
| resource_limits = request.resource_limits.root | ||
|
|
||
| # Extract resource requests (optional, defaults to limits for Guaranteed QoS) | ||
| resource_requests = None | ||
| if request.resource_requests and request.resource_requests.root: | ||
| resource_requests = request.resource_requests.root | ||
|
|
||
| try: | ||
| egress_mode = ( | ||
|
|
@@ -379,6 +384,7 @@ async def create_sandbox(self, request: CreateSandboxRequest) -> CreateSandboxRe | |
| egress_mode=egress_mode, | ||
| volumes=request.volumes, | ||
| platform=request.platform, | ||
| resource_requests=resource_requests, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
| ) | ||
|
|
||
| logger.info( | ||
|
|
||
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.
Sandbox.createnow always forwardsresource_requests=even when the caller did not set it. Any existingSandboxesimplementation that still uses the previous signature (withoutresource_requestsand without a catch-all**kwargs) will now raiseTypeError: got an unexpected keyword argument 'resource_requests', breaking integrations that were previously compatible whenplatformwas unset.Useful? React with 👍 / 👎.