feat(restart): support cpu/memory resource updates on restart#1100
Open
zhangjaycee wants to merge 2 commits into
Open
feat(restart): support cpu/memory resource updates on restart#1100zhangjaycee wants to merge 2 commits into
zhangjaycee wants to merge 2 commits into
Conversation
849db0f to
35b5001
Compare
Move the inline _apply_cpu_overcommit_default from sandbox_api.py to rock/common/cpu_overcommit.py so both start and restart flows can reuse the same overcommit logic. The new function takes nacos_provider as an explicit parameter instead of reading from the module-level global.
- Add limit_cpus to SandboxRestartRequest and restart_async - Build DockerDeploymentConfig from persisted spec in restart_async, apply resource overrides, validate via validate_sandbox_spec - Reuse apply_cpu_overcommit when cpus changes without explicit limit_cpus - Simplify on_restart to receive a fully-built config instead of raw resource_overrides dict - Add _docker_update_resources (reuses _cpus/_memory) to apply resource changes to stopped containers before docker start - Add unit tests for _docker_update_resources and restart resource flows
35b5001 to
addb51f
Compare
StephenRi
reviewed
Jun 16, 2026
| from rock.deployments.config import DockerDeploymentConfig | ||
|
|
||
|
|
||
| async def apply_cpu_overcommit( |
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.
close #1099