Add CPU and memory limits to container start#2648
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CPU and memory limits to stellar container start.
Changes:
- Adds reusable
RunArgsfor--cpusand--memory. - Forwards limits to the selected container engine.
- Updates help documentation and integration tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
FULL_HELP_DOCS.md |
Documents resource-limit flags. |
cmd/soroban-cli/src/commands/container/start.rs |
Applies limits to container runs. |
cmd/soroban-cli/src/commands/container/shared.rs |
Defines resource-limit arguments. |
cmd/crates/soroban-test/tests/it/container.rs |
Tests Docker flag forwarding. |
fnando
force-pushed
the
container-run-args
branch
from
July 16, 2026 19:08
8e85c5f to
92c0ba5
Compare
leighmcculloch
approved these changes
Jul 16, 2026
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.
What
Adds
--cpusand--memoryflags tostellar container start, applied as resource limits on the containerruncommand.They live in a new
shared::RunArgsgroup kept separate from the connectionArgs, so commands that only act on an existing container (stop,logs) don't advertise flags they'd ignore. Both values pass through unparsed, which docker and Apple'scontainerboth accept onrun.Why
Lets users cap the CPU and memory a local network container consumes, rather than letting it use the host's full resources.
Known limitations
--cpus/--memoryare forwarded verbatim to the selected engine; the CLI does not validate the values, so an engine-specific parse error surfaces from the engine itself.