Skip to content

Add CPU and memory limits to container start#2648

Merged
fnando merged 2 commits into
mainfrom
container-run-args
Jul 16, 2026
Merged

Add CPU and memory limits to container start#2648
fnando merged 2 commits into
mainfrom
container-run-args

Conversation

@fnando

@fnando fnando commented Jul 16, 2026

Copy link
Copy Markdown
Member

What

Adds --cpus and --memory flags to stellar container start, applied as resource limits on the container run command.

They live in a new shared::RunArgs group kept separate from the connection Args, 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's container both accept on run.

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/--memory are forwarded verbatim to the selected engine; the CLI does not validate the values, so an engine-specific parse error surfaces from the engine itself.

Copilot AI review requested due to automatic review settings July 16, 2026 18:58
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Jul 16, 2026
@fnando fnando self-assigned this Jul 16, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Jul 16, 2026
@fnando
fnando requested review from leighmcculloch and mootz12 July 16, 2026 19:00
@fnando
fnando enabled auto-merge (squash) July 16, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds CPU and memory limits to stellar container start.

Changes:

  • Adds reusable RunArgs for --cpus and --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.

Comment thread cmd/soroban-cli/src/commands/container/shared.rs Outdated
Comment thread FULL_HELP_DOCS.md Outdated
@fnando
fnando force-pushed the container-run-args branch from 8e85c5f to 92c0ba5 Compare July 16, 2026 19:08
@fnando
fnando merged commit dc1f933 into main Jul 16, 2026
184 of 230 checks passed
@fnando
fnando deleted the container-run-args branch July 16, 2026 23:44
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in DevX Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants