Skip to content

[container-run-create]: add support for --network none - #739

Merged
jglogan merged 4 commits into
apple:mainfrom
saehejkang:container-create-run-no-network-attached
Oct 21, 2025
Merged

[container-run-create]: add support for --network none#739
jglogan merged 4 commits into
apple:mainfrom
saehejkang:container-create-run-no-network-attached

Conversation

@saehejkang

@saehejkangsaehejkang commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Closes#386

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Comment threadSources/ContainerClient/Utility.swift Outdated
@jglogan

Copy link
Copy Markdown
Contributor

Hi @saehejkang!

I think that the preference on the issue was to define none as a reserved "network name" as you have done with your constant definition, and instead of a new --no-network flag, --network none would signify that the attachment list would be empty instead of the default.

Could you revise the PR to use --network none in place of --no-network? I'll also add review comments. Thanks again!

Comment threadSources/ContainerClient/Core/ClientNetwork.swift Outdated
Comment threadSources/ContainerClient/Flags.swift Outdated
Comment threadSources/ContainerClient/Utility.swift Outdated
@saehejkang
saehejkangforce-pushed the container-create-run-no-network-attached branch 3 times, most recently from 96a4272 to 392d5aaCompareOctober 9, 2025 07:20
@saehejkangsaehejkang changed the title [container-run-create]: add --no-network flag[container-run-create]: add support for --network noneOct 9, 2025
@saehejkang
saehejkangforce-pushed the container-create-run-no-network-attached branch from 392d5aa to ad90b43CompareOctober 9, 2025 07:50
@saehejkang
saehejkangforce-pushed the container-create-run-no-network-attached branch from ad90b43 to ab78d7aCompareOctober 10, 2025 00:40

@jgloganjglogan 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.

@saehejkang this looks great, sorry for the follow delay and sorry to trouble you with one tiny stylistic nit and then it should be good to go

I'll kick off the workflow on this one though, please check it just in case make fmt needs to be run with the little fix.

Comment threadSources/ContainerClient/Utility.swift Outdated
@jglogan
jglogan merged commit d610a85 into apple:mainOct 21, 2025
2 checks passed
@jglogan

Copy link
Copy Markdown
Contributor

@saehejkang Merged, thank you!

@jgloganjglogan added the next Must-have items for current and next milestone label Oct 21, 2025
@jgloganjglogan added this to the 2025-10 milestone Oct 21, 2025
@jgloganjglogan added the network Issues and features associated with networking and DNS. label Oct 21, 2025
0xEDU pushed a commit to 0xEDU/container that referenced this pull request Oct 21, 2025
saehejkang added a commit to saehejkang/container that referenced this pull request Oct 28, 2025
@saehejkang
saehejkang deleted the container-create-run-no-network-attached branch October 30, 2025 04:40
chrisgeo added a commit to full-chaos/container that referenced this pull request May 24, 2026
Two changes addressing review feedback from
apple/containerization#739 and
apple#1512 (comment):
1. Adopt the new `Containerization.LinuxBlockIO` wrapper added in
containerization PR apple#739 (pin advanced to 3d009df). The wire format in
`ContainerConfiguration.Resources.blockIO` stays as the Codable
`ContainerizationOCI.LinuxBlockIO`; `RuntimeService.configureContainer`
converts to the wrapper at the boundary via the new
`toContainerizationBlockIO` helper.
2. Replace the six separate `--blkio-*` / `--device-*` flags with a
single repeatable `--blkio` flag using key=value[,key=value] syntax,
per apple#1512 (comment):
--blkio weight=500
--blkio device=/dev/sda,weight=700,leaf-weight=300
--blkio device=/dev/sda,read-bps=1048576,write-bps=1048576
--blkio device=/dev/sda,read-iops=1000,write-iops=1000
Device values accept either an absolute host path (resolved via stat(2))
or a literal `<major>:<minor>`. Parser rejects unknown keys, conflicting
global weights, and global-only keys appearing on device-less specs.
Tests cover the combined spec, major:minor literal, invalid-weight,
unknown-key, and global-only-on-device-spec error paths.
chrisgeo added a commit to full-chaos/container that referenced this pull request May 27, 2026
Two changes addressing review feedback from
apple/containerization#739 and
apple#1512 (comment):
1. Adopt the new `Containerization.LinuxBlockIO` wrapper added in
containerization PR apple#739 (pin advanced to 3d009df). The wire format in
`ContainerConfiguration.Resources.blockIO` stays as the Codable
`ContainerizationOCI.LinuxBlockIO`; `RuntimeService.configureContainer`
converts to the wrapper at the boundary via the new
`toContainerizationBlockIO` helper.
2. Replace the six separate `--blkio-*` / `--device-*` flags with a
single repeatable `--blkio` flag using key=value[,key=value] syntax,
per apple#1512 (comment):
--blkio weight=500
--blkio device=/dev/sda,weight=700,leaf-weight=300
--blkio device=/dev/sda,read-bps=1048576,write-bps=1048576
--blkio device=/dev/sda,read-iops=1000,write-iops=1000
Device values accept either an absolute host path (resolved via stat(2))
or a literal `<major>:<minor>`. Parser rejects unknown keys, conflicting
global weights, and global-only keys appearing on device-less specs.
Tests cover the combined spec, major:minor literal, invalid-weight,
unknown-key, and global-only-on-device-spec error paths.
chrisgeo added a commit to full-chaos/container that referenced this pull request May 27, 2026
…imeData
Addresses jglogan review feedback on PR apple#1595:
1. Move `blockIO` field out of the cross-platform
`ContainerConfiguration.Resources` and into the Linux-specific
`LinuxRuntimeData`. The CLI now encodes `LinuxRuntimeData(blockIO: …)`
into the opaque `RuntimeConfiguration.runtimeData` field, and the
Linux runtime decodes it inside `configureContainer` before applying
the OCI `LinuxBlockIO` to `czConfig.blockIO`. Keeps OS-specific
options out of the generic container config type.
2. Move the `--blkio` flag from `Flags.Resource` to `Flags.Management`
and simplify its help to a single line pointing at the command
reference, in the spirit of the existing generic options pattern.
The structured key=value parsing/validation in `Parser.blockIO` is
unchanged.
3. `Parser.resources` no longer takes `blkio`; `Parser.blockIO` stays
public and is now invoked by `ContainerRun` / `ContainerCreate`
directly. Tests rewritten to exercise `Parser.blockIO` directly.
`swift build` clean; `swift test --filter ParserTest` 105 tests pass,
`RuntimeConfiguration` tests pass, `container run --help` shows
`--blkio` under MANAGEMENT OPTIONS.
Deferred (per PR body): Package.swift / Package.resolved still pin
containerization to apple/containerization#739's branch because that
upstream PR is still open. Those will revert to apple/containerization
at merge time, once apple#739 lands.
chrisgeo added a commit to full-chaos/container that referenced this pull request May 28, 2026
The branch pin to full-chaos/containerization@feat/chaos-1380-blkio-runtime
was a temporary measure while apple/containerization#739 was in flight.
Revert to the upstream pin so this PR can be merged independently of apple#739.
Note: the runtime plumbing in RuntimeService.swift still references
Containerization.LinuxBlockIO and czConfig.blockIO, which only exist on
the apple#739 branch. The build will be temporarily broken until apple#739 lands
upstream and the pin is bumped to whatever release contains it.
chrisgeo added a commit to full-chaos/container that referenced this pull request May 29, 2026
Two changes addressing review feedback from
apple/containerization#739 and
apple#1512 (comment):
1. Adopt the new `Containerization.LinuxBlockIO` wrapper added in
containerization PR apple#739 (pin advanced to 3d009df). The wire format in
`ContainerConfiguration.Resources.blockIO` stays as the Codable
`ContainerizationOCI.LinuxBlockIO`; `RuntimeService.configureContainer`
converts to the wrapper at the boundary via the new
`toContainerizationBlockIO` helper.
2. Replace the six separate `--blkio-*` / `--device-*` flags with a
single repeatable `--blkio` flag using key=value[,key=value] syntax,
per apple#1512 (comment):
--blkio weight=500
--blkio device=/dev/sda,weight=700,leaf-weight=300
--blkio device=/dev/sda,read-bps=1048576,write-bps=1048576
--blkio device=/dev/sda,read-iops=1000,write-iops=1000
Device values accept either an absolute host path (resolved via stat(2))
or a literal `<major>:<minor>`. Parser rejects unknown keys, conflicting
global weights, and global-only keys appearing on device-less specs.
Tests cover the combined spec, major:minor literal, invalid-weight,
unknown-key, and global-only-on-device-spec error paths.
chrisgeo added a commit to full-chaos/container that referenced this pull request May 29, 2026
…imeData
Addresses jglogan review feedback on PR apple#1595:
1. Move `blockIO` field out of the cross-platform
`ContainerConfiguration.Resources` and into the Linux-specific
`LinuxRuntimeData`. The CLI now encodes `LinuxRuntimeData(blockIO: …)`
into the opaque `RuntimeConfiguration.runtimeData` field, and the
Linux runtime decodes it inside `configureContainer` before applying
the OCI `LinuxBlockIO` to `czConfig.blockIO`. Keeps OS-specific
options out of the generic container config type.
2. Move the `--blkio` flag from `Flags.Resource` to `Flags.Management`
and simplify its help to a single line pointing at the command
reference, in the spirit of the existing generic options pattern.
The structured key=value parsing/validation in `Parser.blockIO` is
unchanged.
3. `Parser.resources` no longer takes `blkio`; `Parser.blockIO` stays
public and is now invoked by `ContainerRun` / `ContainerCreate`
directly. Tests rewritten to exercise `Parser.blockIO` directly.
`swift build` clean; `swift test --filter ParserTest` 105 tests pass,
`RuntimeConfiguration` tests pass, `container run --help` shows
`--blkio` under MANAGEMENT OPTIONS.
Deferred (per PR body): Package.swift / Package.resolved still pin
containerization to apple/containerization#739's branch because that
upstream PR is still open. Those will revert to apple/containerization
at merge time, once apple#739 lands.
chrisgeo added a commit to full-chaos/container that referenced this pull request May 29, 2026
The branch pin to full-chaos/containerization@feat/chaos-1380-blkio-runtime
was a temporary measure while apple/containerization#739 was in flight.
Revert to the upstream pin so this PR can be merged independently of apple#739.
Note: the runtime plumbing in RuntimeService.swift still references
Containerization.LinuxBlockIO and czConfig.blockIO, which only exist on
the apple#739 branch. The build will be temporarily broken until apple#739 lands
upstream and the pin is bumped to whatever release contains it.
chrisgeo added a commit to full-chaos/container that referenced this pull request Jun 17, 2026
Two changes addressing review feedback from
apple/containerization#739 and
apple#1512 (comment):
1. Adopt the new `Containerization.LinuxBlockIO` wrapper added in
containerization PR apple#739 (pin advanced to 3d009df). The wire format in
`ContainerConfiguration.Resources.blockIO` stays as the Codable
`ContainerizationOCI.LinuxBlockIO`; `RuntimeService.configureContainer`
converts to the wrapper at the boundary via the new
`toContainerizationBlockIO` helper.
2. Replace the six separate `--blkio-*` / `--device-*` flags with a
single repeatable `--blkio` flag using key=value[,key=value] syntax,
per apple#1512 (comment):
--blkio weight=500
--blkio device=/dev/sda,weight=700,leaf-weight=300
--blkio device=/dev/sda,read-bps=1048576,write-bps=1048576
--blkio device=/dev/sda,read-iops=1000,write-iops=1000
Device values accept either an absolute host path (resolved via stat(2))
or a literal `<major>:<minor>`. Parser rejects unknown keys, conflicting
global weights, and global-only keys appearing on device-less specs.
Tests cover the combined spec, major:minor literal, invalid-weight,
unknown-key, and global-only-on-device-spec error paths.
chrisgeo added a commit to full-chaos/container that referenced this pull request Jun 17, 2026
…imeData
Addresses jglogan review feedback on PR apple#1595:
1. Move `blockIO` field out of the cross-platform
`ContainerConfiguration.Resources` and into the Linux-specific
`LinuxRuntimeData`. The CLI now encodes `LinuxRuntimeData(blockIO: …)`
into the opaque `RuntimeConfiguration.runtimeData` field, and the
Linux runtime decodes it inside `configureContainer` before applying
the OCI `LinuxBlockIO` to `czConfig.blockIO`. Keeps OS-specific
options out of the generic container config type.
2. Move the `--blkio` flag from `Flags.Resource` to `Flags.Management`
and simplify its help to a single line pointing at the command
reference, in the spirit of the existing generic options pattern.
The structured key=value parsing/validation in `Parser.blockIO` is
unchanged.
3. `Parser.resources` no longer takes `blkio`; `Parser.blockIO` stays
public and is now invoked by `ContainerRun` / `ContainerCreate`
directly. Tests rewritten to exercise `Parser.blockIO` directly.
`swift build` clean; `swift test --filter ParserTest` 105 tests pass,
`RuntimeConfiguration` tests pass, `container run --help` shows
`--blkio` under MANAGEMENT OPTIONS.
Deferred (per PR body): Package.swift / Package.resolved still pin
containerization to apple/containerization#739's branch because that
upstream PR is still open. Those will revert to apple/containerization
at merge time, once apple#739 lands.
chrisgeo added a commit to full-chaos/container that referenced this pull request Jun 17, 2026
The branch pin to full-chaos/containerization@feat/chaos-1380-blkio-runtime
was a temporary measure while apple/containerization#739 was in flight.
Revert to the upstream pin so this PR can be merged independently of apple#739.
Note: the runtime plumbing in RuntimeService.swift still references
Containerization.LinuxBlockIO and czConfig.blockIO, which only exist on
the apple#739 branch. The build will be temporarily broken until apple#739 lands
upstream and the pin is bumped to whatever release contains it.
chrisgeo added a commit to full-chaos/container that referenced this pull request Aug 28, 2026
Two changes addressing review feedback from
apple/containerization#739 and
apple#1512 (comment):
1. Adopt the new `Containerization.LinuxBlockIO` wrapper added in
containerization PR apple#739 (pin advanced to 3d009df). The wire format in
`ContainerConfiguration.Resources.blockIO` stays as the Codable
`ContainerizationOCI.LinuxBlockIO`; `RuntimeService.configureContainer`
converts to the wrapper at the boundary via the new
`toContainerizationBlockIO` helper.
2. Replace the six separate `--blkio-*` / `--device-*` flags with a
single repeatable `--blkio` flag using key=value[,key=value] syntax,
per apple#1512 (comment):
--blkio weight=500
--blkio device=/dev/sda,weight=700,leaf-weight=300
--blkio device=/dev/sda,read-bps=1048576,write-bps=1048576
--blkio device=/dev/sda,read-iops=1000,write-iops=1000
Device values accept either an absolute host path (resolved via stat(2))
or a literal `<major>:<minor>`. Parser rejects unknown keys, conflicting
global weights, and global-only keys appearing on device-less specs.
Tests cover the combined spec, major:minor literal, invalid-weight,
unknown-key, and global-only-on-device-spec error paths.
chrisgeo added a commit to full-chaos/container that referenced this pull request Aug 28, 2026
…imeData
Addresses jglogan review feedback on PR apple#1595:
1. Move `blockIO` field out of the cross-platform
`ContainerConfiguration.Resources` and into the Linux-specific
`LinuxRuntimeData`. The CLI now encodes `LinuxRuntimeData(blockIO: …)`
into the opaque `RuntimeConfiguration.runtimeData` field, and the
Linux runtime decodes it inside `configureContainer` before applying
the OCI `LinuxBlockIO` to `czConfig.blockIO`. Keeps OS-specific
options out of the generic container config type.
2. Move the `--blkio` flag from `Flags.Resource` to `Flags.Management`
and simplify its help to a single line pointing at the command
reference, in the spirit of the existing generic options pattern.
The structured key=value parsing/validation in `Parser.blockIO` is
unchanged.
3. `Parser.resources` no longer takes `blkio`; `Parser.blockIO` stays
public and is now invoked by `ContainerRun` / `ContainerCreate`
directly. Tests rewritten to exercise `Parser.blockIO` directly.
`swift build` clean; `swift test --filter ParserTest` 105 tests pass,
`RuntimeConfiguration` tests pass, `container run --help` shows
`--blkio` under MANAGEMENT OPTIONS.
Deferred (per PR body): Package.swift / Package.resolved still pin
containerization to apple/containerization#739's branch because that
upstream PR is still open. Those will revert to apple/containerization
at merge time, once apple#739 lands.
chrisgeo added a commit to full-chaos/container that referenced this pull request Aug 28, 2026
The branch pin to full-chaos/containerization@feat/chaos-1380-blkio-runtime
was a temporary measure while apple/containerization#739 was in flight.
Revert to the upstream pin so this PR can be merged independently of apple#739.
Note: the runtime plumbing in RuntimeService.swift still references
Containerization.LinuxBlockIO and czConfig.blockIO, which only exist on
the apple#739 branch. The build will be temporarily broken until apple#739 lands
upstream and the pin is bumped to whatever release contains it.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

networkIssues and features associated with networking and DNS.nextMust-have items for current and next milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Request]: Add option to create/run a container that has no network attachment.

3 participants

@saehejkang@jglogan@katiewasnothere