673 Commits
Author SHA1 Message Date
J LoganandGitHub 5973b9cc62 Finalize Makefile for integration test rework. (#1878)
- Part of #1833.
- Replace old targets with new ones.
- Try increased parallelism after test tweaks in #1857.
- Exclude test files from coverage analysis.
1.1.0
2026-07-01 18:25:34 -07:00
Kathryn BaldaufandGitHub 4a79060595 Ensure test filenames match test suite names and each file has a single suite defined (#1877)
This PR cleans up some of the new IntegrationTests files to ensure that
each file has a single test suite defined within it and the name of the
file matches the name of the test suite.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-07-01 16:03:03 -07:00
J LoganandGitHub 69a2505aeb Migrates container run integration tests. (#1857)
- Part of #1833.
2026-07-01 13:23:16 -07:00
J LoganandGitHub 9bd3c47345 Migrates container create, run-lifecycle, exec, remove, copy. (#1844)
- Part of #1833.
2026-06-30 17:37:51 -07:00
J LoganandGitHub 88ab3192f9 Migrate image, volume and miscellaneous system tests. (#1868)
- Part of #1833.
- Distributes fixture extensions for images and containers added as part
of previous builder PR to more sensible locations.
2026-06-30 15:25:16 -07:00
Kathryn BaldaufandGitHub 811abf75bf Add checksum validation to hawkeye installation (#1869)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-06-30 11:08:49 -07:00
J LoganandGitHub 586fa07d2a Migrate registry tests to new test support types. (#1845)
- Part of #1833.
2026-06-30 10:40:26 -07:00
J LoganandGitHub d29e6edd5e Migrates network integration tests. (#1858)
- Part of #1833.
2026-06-30 10:00:34 -07:00
J LoganandGitHub 3842977f4a Migrate basic system tests to new test support types. (#1841)
- Part of #1833.
2026-06-29 16:40:06 -07:00
J LoganandGitHub c37c405bbd Migrates container machine tests. (#1856)
- Part of #1833.
2026-06-29 15:58:19 -07:00
J LoganandGitHub 6317a832d4 Adds build fixture and migrates build CLI tests. (#1848)
- Part of #1833.
- Also changes test directory names to include test ID so that they are
easily identifiable.
2026-06-29 12:12:31 -07:00
Kathryn BaldaufandGitHub c34d340a60 Update containerization import to 0.35.0 (#1842)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-06-26 15:35:36 -07:00
J LoganandGitHub be3b1f20c4 Migrate some container tests, remove concurrent demo tests. (#1840)
- Part of #1833.
- Tweaks `ContainerFixture.withContainer()` to support the legacy
`longRun()` pattern without boilerplate.
2026-06-26 14:17:18 -07:00
J LoganandGitHub 649164d9e2 Enhanced test fixtures for integration tests. (#1834)
- Part of #1833.
- Adds `ContainerFixture` with scoped resource lifecycle and cleanup in
place of implementation inheritance for test support functions. The
fixture also handles resource prefixing and uses a more ergonomic
`CommandResult` in place of a tuple for return values.
- `ImageWarmup` suite pre-pulls well-known images, and
`copyWarmupImage()` tags test-local refs, keeping the canonical image
store untouched.
- Three-phase `integration-new`: warmup, followed by concurrent tests
(managed by the swift test
`--experimental-maximum-parallelization-width` flag), followed by
serialized tests.
- `coverage-new` merges unit + integration-new profraw, replacing
`coverage` in CI as a migration progress indicator.
- Updates GH workflow so non-coverage invokes both the `integration` and
`integration-new` Makefile targets, while coverage runs invoke the
`coverage-new` target.
2026-06-26 12:00:44 -07:00
aa7fef3d1d Route container image save reference list to stderr in stdout mode (#1804)
- Fixes #1801.
- When `container image save` runs without `--output`,
  stdout carries the OCI tar archive. The command writes 
  the archive bytes to stdout and then `print(reference)`s
  each saved image reference to stdout afterward,
  appending non-archive text after the tar EOF marker,
  which will cause strict tar/OCI consumers to fail.
- This routes the saved-reference list to stderr in the
  no-`--output` branch, so stdout contains only archive
  bytes. When saving to a file via `--output`, stdout is
  free, so the references continue to print to stdout
  exactly as before.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:04:30 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
27acdbe2f8 ci: bump the github-actions group across 1 directory with 2 updates (#1792)
- Updates `actions/checkout` from 6.0.3 to 7.0.0
- Updates `softprops/action-gh-release` from 3.0.0 to 3.0.1

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-25 21:44:11 -07:00
SEPURI-SAI-KRISHNAandGitHub 0b6c79f3d3 fix: propagate error from createDirectory in system start (#1785)
- `SystemStart` used `try!` when creating the apiserver
  data directory. File system operations can fail for
  legitimate reasons: insufficient permissions, disk full,
  read-only volume. Crashing the process in these cases
  gives the user no actionable error message.
- Replaced with `try` so the error propagates up and is
  surfaced cleanly.
2026-06-25 21:38:40 -07:00
Hugo, CY LAUandGitHub 0c95007763 perf(parser): add collection capacity hints to known-size loops (#1791)
- For result sets with known sizes, it's more efficient
  to supply the size as a capacity hint.
2026-06-25 19:42:37 -07:00
Bhavesh VarmaandGitHub af71f87408 Remove duplicate release workflow that double-builds and races on every tag (#1781)
- Closes #1755.
2026-06-25 17:48:11 -07:00
J LoganandGitHub 4a6084cc95 Remove network variant computation from API server. (#1814)
- Closes #1812.
- The network plugin is the source of truth for the variant, if any,
that applies to the network. Resolving a missing variant configuration
option in the API server can create a situation where the variant the
runtime uses for interface selection is incorrect.
- Adds serial suites trait to tests to see whether it helps current CI
issues.

## Type of Change
- [x] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
Fixes a flaw in our interface strategy logic.

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2026-06-25 14:06:45 -07:00
SEPURI-SAI-KRISHNAandGitHub 137b3bdaf0 Fix/exec empty arguments crash (#1783)
- `swift-argument-parser` enforces that `arguments` is
  non-empty before `run()` is invoked, so the force-unwrap
  of `arguments.first!` is not reachable in practice. However,
  the guard makes the invariant explicit in the code itself,
  removes reliance on ArgumentParser's implicit
  enforcement, and would satisfy force-unwrap lint rules
  if enabled in the future.
2026-06-25 12:40:39 -07:00
J LoganandGitHub 984c4c2c5a Disable flaky CLI test temporarily. (#1828)
- PRs are backed up. We need to rework the CLI tests
  to shorten test time and fix conflicts between tests.

## Testing
- [ ] Tested locally
- [x] Added/updated tests
- [ ] Added/updated docs
2026-06-25 08:42:01 -07:00
Bhavesh VarmaandGitHub 1d70dd6ab9 Log the graceful-stop error instead of silently discarding it in gracefulStopContainer (#1782)
- Closes #1756.
- `RuntimeService.gracefulStopContainer(_:signal:timeout:)`
  wraps the graceful-stop attempt in `do { … } catch {}`. The
  empty catch silently discards any thrown error before falling
  through to the unconditional `lc.stop()`. It is the only catch
  in this file that does not log; every other one uses
  `self.log.error(…, metadata: ["error": "\(error)"])`.
- This adds a single log line matching that convention, so
  a failed graceful stop (and the resulting fall-through to a
  forced VM shutdown) is more diagnosable. The intentional
  fall-through to `lc.stop()` is unchanged.
2026-06-23 10:46:00 -07:00
SEPURI-SAI-KRISHNAandGitHub 5e125d8e2a fix: remove force-unwrap on session dictionary in DefaultNetworkService (#1787)
- Instead of using force-unwrap to append to a list-valued
  dictionary entry that should always exist, assign the value
  with a default fallback and append to the (non-optional)
  result.
2026-06-23 09:52:05 -07:00
SEPURI-SAI-KRISHNAandGitHub 0e3651b4f1 fix: replace try! with try? for stdout/stderr writes in ProcessIO (#1784)
- In `ProcessIO.swift`, the readability handlers for stdout and stderr
  used `try!` when writing data to the output file handles. This would
  cause crashes If the pipe is broken such that the force-try executes.
- Changed to handle a failed write similarly to an EOF.
2026-06-23 09:38:43 -07:00
09489cba45 fix(cp): resolve relative host paths against current directory (#1741)
Fixes #1738

`container cp` fails when the host source path is relative (e.g.
`container cp file foo:/root/`), because `NSString.standardizingPath`
only canonicalizes paths but does not make them absolute. The unchanged
relative path is then interpreted as `/file` (root-absolute) by
`URL(fileURLWithPath:)` on the runtime side.

Fixed by resolving relative paths against the current working directory
before use, matching the pattern already used by `container export`,
`container image save`, and `container image load`.

The same fix was also applied to the copy-out destination path (line
68), which had the same issue.

## Type of Change

- [x] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context

`container cp file foo:/root/` fails with `"copyIn: source not found
'/file'"` because the relative path `file` is never expanded to an
absolute path. Using `$PWD/file` works, but relative paths should work
too — every other command in the codebase handles this correctly.

## Testing

- [x] Tested locally — builds and all existing tests pass
- [ ] Added/updated tests
- [ ] Added/updated docs

---------

Co-authored-by: jwhur <57657645+JaewonHur@users.noreply.github.com>
2026-06-22 11:54:00 -07:00
Saehej KangandGitHub 3b47905c0d [package]: bump containerization to 0.34.0 (#1774) 2026-06-20 18:24:30 -07:00
Marek SapotaandGitHub 37d463e537 Fix CLITest when run in xcode (#1775)
- Adds needed `MachineAPIClient` dependency
  to CLITests.
2026-06-20 12:01:53 -07:00
J LoganandGitHub 888582b4c8 Propagate permissions for all host-to-container socket mounts. (#1751)
- Closes #1750.
- Applies permission code used for the `--ssh` mount to all
host-to-container socket mounts.
- Adds a user option to the `doExec` test support function.
- Updates the `testRunCommandUnixSocketMount` to install `nc` in the
test container, and check the socket permission, and check the mounted
socket using `nc` as the guest user.
2026-06-18 11:45:24 -07:00
22e90e0eab Pin xcode swift version in CI to 6.3 (#1746)
CI runners moved to the Xcode developer beta as the default, but macOS
builds are failing with a conflicting options error for
-warnings-as-errors and -suppress-warnings. Matches
https://github.com/apple/containerization/pull/771

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
Co-authored-by: J Logan <john_logan@apple.com>
2026-06-18 10:12:56 -07:00
Michael CrosbyandGitHub c4a22389ac add container machine nested virt (#1742)
This also includes custom kernels for container machine. Its required
with nested virt as CONFIG_KVM needs to be enabled.

---------

Signed-off-by: michael_crosby <michael_crosby@apple.com>
2026-06-18 06:53:21 -07:00
Charlie LeandGitHub b34cf390a6 Fix duplicate "(default: 3)" in --max-concurrent-downloads help text (#1725)
Remove manually specified default value from help string since
ArgumentParser already appends it automatically from the property's
default value.

Signed-off-by: Charlie Le <charlie_le@apple.com>
2026-06-16 14:13:59 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
babddafd98 ci: bump actions/checkout from 6.0.2 to 6.0.3 in the github-actions group across 1 directory (#1640)
-Bumps the github-actions group with 1 update in the / directory:
  [actions/checkout](https://github.com/actions/checkout).
- Updates `actions/checkout` from 6.0.2 to 6.0.3

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-15 10:44:37 -07:00
Kathryn BaldaufandGitHub c8b4fd73a1 Always update default network with system configuration values (#1686)
Closes https://github.com/apple/container/issues/1677.
2026-06-11 11:42:21 -07:00
J LoganandGitHub 6508acea81 Adds container machine example. (#1676)
- Closes #1675.
- Illustrates how to create a container machine image that you can use
with the Visual Studio Code remote developement SSH plugin.
2026-06-09 15:51:25 -07:00
Michael CrosbyandGitHub 7063196268 add standalone container machine document (#1674)
Signed-off-by: michael_crosby <michael_crosby@apple.com>
Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2026-06-09 13:09:39 -07:00
Dmitry KovbaandGitHub 187e9cb591 Bump containerization to 0.33.4 (#1650)
Bumps containerization to `0.33.4`.
2026-06-09 11:32:00 -07:00
J LoganandGitHub ee848e3ebf Add backward compat for ContainerConfig cpuOverhead. (#1665)
1.0 data migration requirement
1.0.0
2026-06-08 15:02:18 -07:00
b2994ac369 Add container machine for managing persistent Linux VMs (#1662)
## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
`container` runs each workload in an ephemeral VM, so there's no
built-in way to keep a persistent Linux environment you can log into and
work in. `container machine` adds one.

A container machine is a lightweight, persistent, and integrated Linux
environments that feel like an extension of your Mac, created from
standard OCI images with a familiar UX. The login user matches your host
account with passwordless `sudo`, your home directory is mounted inside
the VM, and each machine keeps its filesystem and runs the image's own
init system (such as`systemd` or `openrc`).

```bash
container machine create alpine:3.22 --name my-machine
container machine run -n my-machine # interactive shell
container machine set -n my-machine cpus=4 memory=8G
```

Subcommands: `create`, `run`, `list` (`ls`), `inspect`, `set`,
`set-default`, `logs`, `stop`, `delete` (`rm`); `m` aliases `machine`.
Docs added to `docs/command-reference.md` (Machine Management) and
`docs/how-to.md` ("Use container machines").

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs

Signed-off-by: Raj Aryan Singh <rajaryan_singh@apple.com>
Co-authored-by: Jaewon Hur <jaewon_hur@apple.com>
Co-authored-by: John Logan <john_logan@apple.com>
Co-authored-by: Michael Crosby <michael_crosby@apple.com>
Co-authored-by: Eric Ernst <eric_ernst@apple.com>
Co-authored-by: Danny Canter <danny_canter@apple.com>
2026-06-08 11:38:49 -07:00
RajandGitHub 1b5576312f Increase CI timeout to 75 minutes (#1663)
## Type of Change
- [x] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
Increase CI timeout to 75 minutes

## Testing
- [ ] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2026-06-08 11:36:20 -07:00
AJ EmoryandGitHub 847a004eac Conform containers to ManagedResource (#1656)
- Closes #1651 
- Adds ManagedContainer that conforms to Managed Resource
2026-06-05 17:27:56 -07:00
Kathryn BaldaufandGitHub d855978113 Remove duplicated image name in image JSON output (#1655)
https://github.com/apple/container/pull/1652 rearranged the JSON output
for image resources and included a duplicate "name" field. After further
discussion, we've decided to remove the duplicate field.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-06-05 15:11:06 -07:00
J LoganandGitHub 90cc3c15af Omit hash scheme from image.id. (#1658)
- Closes #1657.
- Also reduces `trimDigest()` output to 12 characters and gets rid of
the trailing ellipsis.
2026-06-05 14:43:20 -07:00
Saehej KangandGitHub 1f4b47061e [images]: fix image load/save to use FilePathOps utility (#1590)
- Relates to apple/containerization#744.
- Use the new `FilePathOps` utility functions.
2026-06-05 09:28:08 -07:00
Harshit Singh BhandariandGitHub 79f797b879 Auto-install hawkeye in ensure-hawkeye-exists.sh (#1644)
- Fixes #1642.
- The `ensure-hawkeye-exists.sh` now actually
  ensures that hawkeye is installed. If it is not
  installed, the script informs that the installation
  uses `curl | sh` and asks the user to confirm
  before proceeding.
- Automated workflows can bypass the prompt
  by invoking the script with the `-y`/`--auto-install`
  option, or by setting the environment variable
  `HAWKEYE_AUTO_INSTALL=1`.
- Export HAWKEYE_AUTO_INSTALL=1  in every
  Git workflow job that runs make check, to
  ensure license/format checks don't stall.
2026-06-05 09:04:05 -07:00
RajandGitHub 48cb23e3b7 Update command ref and how to docs (#1654)
- Closes #1534.
- Updates `command-reference.md` docs to reflect current
  state, and `how-to.md` to the latest images.
2026-06-05 08:36:52 -07:00
RajandGitHub 822b47b877 Fix --format yaml and toml output (#1653)
- Closes #1528.
- Several commands (`builder status`, `image list`,
  `stats`, `system df`, `system status`) advertised
  `--format yaml` and `--format toml` but only handled
  `json`, and every other format fell through to the
  table. With this PR, we now route them through one
  shared renderer with an exhaustive switch over the
  format enum, so a missing format would now be a
  compile error, and not just fail silently.
- Since TOML has no top level array, TOML output
  now wraps list payloads under an `items` key,
  because otherwise it was returning nothing for lists.
- `stats` now prints one static result for machine
  readable formats instead of opening its live table
  view.
- `builder status` now returns an empty list for
  json/yaml/toml when no builder is running, instead 
  of the unparseable "builder is not running" text.
  The table view keeps the message.
- with `--quiet` and no builder it now exits 0 with
  no output, earlier it exited non-zero.
2026-06-05 08:32:12 -07:00
Kathryn BaldaufandGitHub 1d0d43668d Rearrange shape of JSON output for images (#1652)
- This PR changes the shape of the JSON
  output for image resources to align closer with
  `VolumeResource` and `NetworkResource`.
  This includes adding `creationDate` in the
  `configuration` section of the image output.
- This PR additionally cleans up some of the logic
  around the `ImageResource` struct construction.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-06-05 08:09:53 -07:00
Kathryn BaldaufandGitHub f81dcbf3f9 [Actions] Use commit sha for imported gh actions (#1649)
This PR updates the GitHub workflows to ensure all imported actions are
referenced by commit SHA.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-06-04 15:07:44 -07:00
Harshit Singh BhandariandGitHub 8bf87e8890 Make pre-commit hook installation and execution work in git worktrees (#1643)
- Closes #1641.
- This PR replaces the existing hook pathname computation
  for `make pre-commit` with `git rev-parse --git-path hooks/...`,
  which resolves to the shared hooks directory in both the main
  checkout and any worktree.
2026-06-04 14:59:12 -07:00