Skip to content

CLI: Initialize shm-size and configure stop-signal#40385

Open
AmelBawa-msft wants to merge 15 commits intomasterfrom
user/amelbawa/shm-retarget
Open

CLI: Initialize shm-size and configure stop-signal#40385
AmelBawa-msft wants to merge 15 commits intomasterfrom
user/amelbawa/shm-retarget

Conversation

@AmelBawa-msft
Copy link
Copy Markdown
Contributor

Summary of the Pull Request

  • Added --shm-size and --stop-signal options to container create and container run
  • Input validation
  • E2E tests for both options on create and run, including verifying the shm mount size inside the container.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI review requested due to automatic review settings May 1, 2026 20:07
@AmelBawa-msft AmelBawa-msft requested a review from a team as a code owner May 1, 2026 20:07
Comment thread src/windows/wslc/services/ContainerModel.h
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for configuring container /dev/shm size and default stop signal via the wslc CLI, wiring these options through argument parsing/validation into the container create request, and covering the behavior with E2E tests.

Changes:

  • Add --shm-size and --stop-signal to container create and container run, including argument validation.
  • Propagate shm-size into the Docker create request HostConfig.ShmSize and stop-signal into CreateContainer.StopSignal.
  • Add E2E coverage for valid/invalid shm-size and stop-signal, and update help/usage text expectations.

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/windows/wslc/e2e/WSLCE2EContainerStopTests.cpp Updates expected help output for container stop signal option.
test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp Adds E2E tests for --stop-signal and --shm-size, plus help text expectations.
test/windows/wslc/e2e/WSLCE2EContainerKillTests.cpp Updates expected help output for container kill signal option.
test/windows/wslc/e2e/WSLCE2EContainerCreateTests.cpp Adds E2E tests for --stop-signal and --shm-size, plus help text expectations.
src/windows/wslcsession/WSLCContainer.cpp Sets HostConfig.ShmSize when provided in container options.
src/windows/wslc/tasks/ContainerTasks.cpp Parses --stop-signal and --shm-size into container options.
src/windows/wslc/services/ContainerService.cpp Applies stop-signal and shm-size settings to the container launcher.
src/windows/wslc/services/ContainerModel.h Adds StopSignal/ShmSize to container options and changes stop default signal to “none”.
src/windows/wslc/commands/ContainerStopCommand.cpp Updates stop command arg description (removes hard-coded default from description).
src/windows/wslc/commands/ContainerRunCommand.cpp Registers new CLI args for run (--shm-size, --stop-signal).
src/windows/wslc/commands/ContainerCreateCommand.cpp Registers new CLI args for create (--shm-size, --stop-signal).
src/windows/wslc/arguments/ArgumentValidation.h Declares memory-size validation helpers.
src/windows/wslc/arguments/ArgumentValidation.cpp Implements memory-size validation and hooks it up to argument parsing.
src/windows/wslc/arguments/ArgumentDefinitions.h Adds shm-size and stop-signal argument definitions; updates signal description usage.
src/windows/inc/docker_schema.h Adds HostConfig.ShmSize to Docker create schema serialization.
src/windows/common/WSLCContainerLauncher.h Adds shm-size setter/state to launcher.
src/windows/common/WSLCContainerLauncher.cpp Plumbs shm-size into the container options passed to session create.
localization/strings/en-US/Resources.resw Adds new --shm-size/--stop-signal descriptions and invalid memory-size error; updates signal description text.
localization/strings/en-GB/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/de-DE/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/cs-CZ/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/da-DK/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/es-ES/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/fi-FI/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/fr-FR/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/hu-HU/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/it-IT/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/ja-JP/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/ko-KR/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/nb-NO/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/nl-NL/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/pl-PL/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/pt-BR/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/pt-PT/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/ru-RU/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/sv-SE/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/tr-TR/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/zh-CN/Resources.resw Updates signal description translation to remove default placeholder.
localization/strings/zh-TW/Resources.resw Updates signal description translation to remove default placeholder.

Comment thread src/windows/wslc/arguments/ArgumentValidation.cpp
Comment thread localization/strings/en-US/Resources.resw Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 1, 2026 20:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds container CLI support for configuring /dev/shm size and container stop behavior via --shm-size and --stop-signal, wiring these options through the Windows CLI/service layer into the Docker create request, and extending E2E coverage.

Changes:

  • Add --shm-size and --stop-signal to container create and container run, including argument validation.
  • Plumb ShmSize into the Docker HostConfig JSON request and forward StopSignal into container create.
  • Add E2E tests for valid/invalid stop-signal and shm-size on both create and run; update help text expectations.

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/windows/wslc/e2e/WSLCE2EContainerStopTests.cpp Updates expected help text for container stop signal option.
test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp Adds E2E tests for --stop-signal and --shm-size on container run; updates help output expectations.
test/windows/wslc/e2e/WSLCE2EContainerKillTests.cpp Updates expected help text for container kill signal option.
test/windows/wslc/e2e/WSLCE2EContainerCreateTests.cpp Adds E2E tests for --stop-signal and --shm-size on container create; updates help output expectations.
src/windows/wslcsession/WSLCContainer.cpp Sets Docker HostConfig.ShmSize when requested.
src/windows/wslc/tasks/ContainerTasks.cpp Parses --stop-signal / --shm-size into ContainerOptions.
src/windows/wslc/services/ContainerService.cpp Applies StopSignal and ShmSize to the container launcher for create/run.
src/windows/wslc/services/ContainerModel.h Extends ContainerOptions and adjusts stop options default signal behavior.
src/windows/wslc/commands/ContainerStopCommand.cpp Updates signal argument description (no longer embeds a fixed default).
src/windows/wslc/commands/ContainerRunCommand.cpp Adds --shm-size and --stop-signal arguments to container run.
src/windows/wslc/commands/ContainerCreateCommand.cpp Adds --shm-size and --stop-signal arguments to container create.
src/windows/wslc/arguments/ArgumentValidation.h Declares memory-size validation/parsing helpers.
src/windows/wslc/arguments/ArgumentValidation.cpp Implements memory-size validation/parsing and wires validation for new args.
src/windows/wslc/arguments/ArgumentDefinitions.h Defines the new CLI arguments and updates --signal description source.
src/windows/inc/docker_schema.h Adds HostConfig.ShmSize to the Docker JSON schema.
src/windows/common/WSLCContainerLauncher.h Adds shm-size setter/state to container launcher.
src/windows/common/WSLCContainerLauncher.cpp Forwards shm-size into container creation options.
localization/strings/en-US/Resources.resw Adds new strings for --shm-size/--stop-signal and memory-size error; updates signal arg text.
localization/strings/en-GB/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/de-DE/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/da-DK/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/cs-CZ/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/es-ES/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/fi-FI/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/fr-FR/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/hu-HU/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/it-IT/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/ja-JP/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/ko-KR/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/nb-NO/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/nl-NL/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/pl-PL/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/pt-BR/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/pt-PT/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/ru-RU/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/sv-SE/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/tr-TR/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/zh-CN/Resources.resw Updates signal arg text to remove embedded default.
localization/strings/zh-TW/Resources.resw Updates signal arg text to remove embedded default.

Comment thread src/windows/wslc/services/ContainerModel.h Outdated
Comment thread src/windows/wslc/arguments/ArgumentDefinitions.h
Comment thread localization/strings/cs-CZ/Resources.resw
Comment thread src/windows/wslc/arguments/ArgumentValidation.cpp Outdated
Copy link
Copy Markdown
Member

@benhillis benhillis left a comment

Choose a reason for hiding this comment

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

Looks like you picked up a bunch of localization changes in the merge.

@AmelBawa-msft
Copy link
Copy Markdown
Contributor Author

AmelBawa-msft commented May 1, 2026

Looks like you picked up a bunch of localization changes in the merge.

@benhillis I modified an existing localized string that previously accepted an argument, but it no longer does. Without updating the corresponding entries in the other localization files, the project would fail to build. After discussing this offline with @OneBlue, I’ll remove the entire entry for now so the localization can be reapplied later.

Comment thread src/windows/wslc/arguments/ArgumentValidation.cpp Outdated
Copilot AI review requested due to automatic review settings May 1, 2026 22:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.

Comment thread src/windows/common/WSLCContainerLauncher.cpp
Comment thread localization/strings/en-US/Resources.resw
Copilot AI and others added 3 commits May 1, 2026 22:12
…ArgDescription from non-en-US resw files

Agent-Logs-Url: https://github.com/microsoft/WSL/sessions/18b17574-a958-4927-8ce9-10f3a054a4e7

Co-authored-by: AmelBawa-msft <104940545+AmelBawa-msft@users.noreply.github.com>
…e SignalArgDescription from non-en-US resw files"

This reverts commit 66e2760.
Copilot AI review requested due to automatic review settings May 1, 2026 22:16
@AmelBawa-msft AmelBawa-msft review requested due to automatic review settings May 1, 2026 22:16
Copilot AI review requested due to automatic review settings May 1, 2026 22:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 39 out of 40 changed files in this pull request and generated 2 comments.

Comment thread src/windows/wslc/arguments/ArgumentValidation.cpp
Comment thread localization/strings/en-GB/Resources.resw
@AmelBawa-msft AmelBawa-msft requested review from OneBlue and benhillis May 5, 2026 18:49
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.

5 participants