CLI: Initialize shm-size and configure stop-signal#40385
CLI: Initialize shm-size and configure stop-signal#40385AmelBawa-msft wants to merge 15 commits intomasterfrom
Conversation
There was a problem hiding this comment.
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-sizeand--stop-signaltocontainer createandcontainer run, including argument validation. - Propagate shm-size into the Docker create request
HostConfig.ShmSizeand stop-signal intoCreateContainer.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. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…soft/wsl into user/amelbawa/shm-retarget
There was a problem hiding this comment.
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-sizeand--stop-signaltocontainer createandcontainer run, including argument validation. - Plumb
ShmSizeinto the DockerHostConfigJSON request and forwardStopSignalinto 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. |
benhillis
left a comment
There was a problem hiding this comment.
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. |
…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.
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>
Summary of the Pull Request
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed