326 Commits

Author SHA1 Message Date
Yibo Zhuang dcbc7bf71d Use string representation for CIDR and IPAddress types (#458)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
This change adds extension to the CIDR and IPAddress types to implement
custom encode/decode functions for `Codable` conformance to use their
string representation as the output from encode and input to decode.
This would make the output from encoding this type (e.g. JSON) more
human-readable rather than using the internal integer representation.
0.18.0
2025-12-20 17:11:36 -08:00
J Logan 528f635521 Make IPv6 integer representation public. (#456)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
- We did this for IPv4 so we could bit bash addresses, but forgot to
make the corresponding change for IPv6.
0.17.1
2025-12-19 13:06:09 -08:00
Yibo Zhuang 5ac406601e Add custom decoder to Linux struct for optional fields (#455)
Allows decoding of minimal OCI specs with empty linux objects by
providing default values for missing fields. Also added unit test to
ensure that empty Linux struct {} works correctly with the fix.
2025-12-19 01:28:02 -08:00
Yibo Zhuang 8865bc95f2 Make IP/CIDR types conform to Codable (#454)
These types can benefit from swift's automatic
synthesis as the properties already conform to Codable. This will give
some flexibility for clients using these types to not have to add
extension and implement the encoding / decoding separately.
2025-12-19 11:07:07 +05:30
Salman Chishti 57d6e0b499 Upgrade GitHub Actions to latest versions (#451)
## Summary

Upgrade GitHub Actions to their latest versions for improved features,
bug fixes, and security updates.

## Changes

| Action | Old Version(s) | New Version | Release | Files |
|--------|---------------|-------------|---------|-------|
| `actions/upload-pages-artifact` |
[`v3`](https://github.com/actions/upload-pages-artifact/releases/tag/v3)
|
[`v4`](https://github.com/actions/upload-pages-artifact/releases/tag/v4)
|
[Release](https://github.com/actions/upload-pages-artifact/releases/tag/v4)
| containerization-build-template.yml |

## Why upgrade?

Keeping GitHub Actions up to date ensures:
- **Security**: Latest security patches and fixes
- **Features**: Access to new functionality and improvements
- **Compatibility**: Better support for current GitHub features
- **Performance**: Optimizations and efficiency improvements

### Security Note

Actions that were previously pinned to commit SHAs remain pinned to SHAs
(updated to the latest release SHA) to maintain the security benefits of
immutable references.

### Testing

These changes only affect CI/CD workflow configurations and should not
impact application functionality. The workflows should be tested by
running them on a branch before merging.
2025-12-16 23:19:18 -08:00
Salman Chishti d6109d70cf Upgrade GitHub Actions for Node 24 compatibility (#452)
## Summary

Upgrade GitHub Actions to their latest versions to ensure compatibility
with Node 24, as Node 20 will reach end-of-life in April 2026.

## Changes

| Action | New Version | Release |
|--------|-------------|---------|
| `actions/checkout` |
[`8e8c483`](https://github.com/actions/checkout/commit/8e8c483db84b4bee98b60c0593521ed34d9990e8)
(v6) | [Release](https://github.com/actions/checkout/releases/tag/v6) |
| `actions/upload-artifact` |
[`b7c566a`](https://github.com/actions/upload-artifact/commit/b7c566a772e6b6bfb58ed0dc250532a479d7789f)
(v6) |
[Release](https://github.com/actions/upload-artifact/releases/tag/v6) |
| `actions/download-artifact` |
[`37930b1`](https://github.com/actions/download-artifact/commit/37930b1c2abaa49bbe596cd826c3c89aef350131)
(v7) |
[Release](https://github.com/actions/download-artifact/releases/tag/v7)
|

## Context

Per [GitHub's
announcement](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/),
Node 20 is being deprecated and runners will begin using Node 24 by
default starting March 4th, 2026.

### Why this matters

- **Node 20 EOL**: April 2026
- **Node 24 default**: March 4th, 2026
- **Action**: Update to latest action versions that support Node 24

### Security Note

All actions are pinned to commit SHAs for security, with version tags
noted in comments for reference.

### Testing

These changes only affect CI/CD workflow configurations and should not
impact application functionality.
2025-12-16 23:18:58 -08:00
J Logan 9ba8267afb Use typesafe IP/CIDR parameters everywhere. (#448)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
- Closes #445.
- Adopts refined IPv4 and IPv6 types developed
  by Agam Dua <agamdua@users.noreply.github.com>.
- For type safety and clarity, use IP and CIDR types
  where we were previously using String.

Co-authored-by: Agam Dua <agamdua@users.noreply.github.com>
0.17.0
2025-12-16 09:58:44 -03:00
Danny Canter 68694942ec Command: Pass the right flags to /dev/null (#449) 2025-12-12 11:55:01 -08:00
J Logan 6d548a0e49 Match Mount default cache/sync to container defaults. (#446)
- Use `cache=auto`, `sync=fsync` as default everywhere.
2025-12-11 19:47:02 -03:00
Danny Canter 7962dae643 Add capabilities support (#444)
Closes https://github.com/apple/containerization/issues/442

This adds capabilities support to LinuxContainer via a new surface in
ContainerizationOS + some C wrappers.
2025-12-11 15:07:17 -05:00
Dmitry Kovba 96d37e2e21 Fix multi-sentence error messages (#443)
Fixes multi-sentence error messages, where they start from a lowercased
letter.
2025-12-09 12:32:09 -08:00
Danny Canter e8aff29be3 Cgroup2Manager: Fix cgroup deletions (#439)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
If there's any nested cgroups in the one we made for the container
(commonly seen for systemd images) removeItem didn't seem to be having a
grand time, even though it states it should do recursive removals. Lets
roll our own, and have a small EBUSY/EAGAIN retry loop as well. This
fixes LinuxContainer.stop() for any containers with nested cgs.

Context: https://github.com/apple/container/issues/928
0.16.2
2025-12-09 14:47:38 -03:00
Dmitry Kovba bb0cd39177 Lowercase error messages (#440)
For consistency, all error messages are lowercased.
2025-12-09 05:38:48 -08:00
Kathryn Baldauf d473f89ccb Rename CONTRIBUTORS to MAINTAINERS and update list to current state (#435)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
We'd like a way for people to know who they can ping for help on PRs and
issues, but we want to avoid being automatically assigned to PRs via
something like CODEOWNERS. Instead, we've opted to list the maintainers
of the project in a new MAINTAINERS file.

We opted to change from CONTRIBUTORS to MAINTAINERS since we believe
that contributors are already acknowledged via the `Contributors` tab on
GitHub and in the release notes we make for each new release.

In the future, the MAINTAINERS file can be extended to include
additional maintainers and past maintainers can continue to be
recognized for their work.
0.16.1
2025-12-06 17:54:17 -08:00
Danny Canter d0b43df9b5 EXT4: Remove advertising inline data (#438) 2025-12-06 13:45:36 -08:00
Danny Canter 2d27ef6deb LinuxPod: Wire up pid namespace sharing (#434)
In a prior change I'd added a way for vminitd to double as a simple
pause container. This change wires this up by adding a new bool to the
pod config to ask for pid ns sharing.
2025-12-05 10:42:50 -05:00
Danny Canter c45fef7278 Vminitd: Add pause command (#418)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
Due to us supporting a pod type now, and pid ns sharing being quite a
common thing for pods, lets add a pause container like command to
vminitd to eventually enable pid ns sharing between containers in our
variant of a pod.

This changes vminitd slightly to have pause and init (default) commands
as it seemed simpler than creating a whole new binary to include in the
guest image.
0.16.0
2025-12-02 15:52:32 -05:00
Danny Canter 5c190dc4a8 Integration: multipleConcurrentProcesses adjustments (#424)
Remove the prints (To me they're just noise) and stop SIGKILL'ing
the init process and just stop the container.
2025-12-02 10:59:13 -05:00
Danny Canter 1254352d68 vminitd: Turn ProcessSupervisor into a class (#433)
Really no reason for this to be an actor, and we're seeing runtime
errors seemingly because of it.
2025-12-02 10:43:14 -05:00
Danny Canter 27947cda9c VirtualMachineInstance: Remove stopListen (#412) 2025-12-01 09:40:20 -08:00
Danny Canter 0e8a779f03 README: Adjust required version numbers (#432)
macOS and Xcode 26 are both released now, no need to still list beta.
2025-12-01 11:15:39 -05:00
GAUTAM RAJU 031cd72e2a Implement pdeathSignal handling in Runc (#431)
Add support for parent death signal (pdeathSignal) to ensure child
processes receive a signal when the parent process dies. This addresses
the FIXME comment in Runc.execute().

## Changes
- Add pdeathSignal field to exec_command_attrs C struct
- Implement prctl(PR_SET_PDEATHSIG) in child process handler (Linux
only)
- Expose pdeathSignal through Command.Attrs Swift API
- Wire up pdeathSignal in Runc.execute() to remove FIXME

## Implementation Details
The implementation uses Linux-specific prctl() to set the parent death
signal, ensuring proper cleanup when parent processes terminate. The
feature is conditionally compiled for Linux only, maintaining
compatibility with other platforms.
2025-12-01 02:35:09 -08:00
Danny Canter 4a8f945f87 vminitd: Add memory threshold monitoring (#427)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
Add a small bit of logic to monitor if vminitd goes over a (somewhat
arbitrary) memory threshold. On average, when running one container it
seems to hover around 25MiB, so this is mostly to catch cases where it's
exceeding a limit we don't deem normal.
0.15.1
2025-11-21 14:54:13 -08:00
Raj 35ebe365ba Add calculateOrphanedBlobsSize() to calculate the size of orphaned blobs (#428)
Adds `calculateOrphanedBlobsSize()` to calculate the size of orphaned
blobs, will need this to include them under size and reclaimable space
for images in the `container system df` command so it matches up with
what `container image prune` frees up on disk.
2025-11-21 14:50:28 -08:00
Danny Canter 836b699a91 Wire up experimental OCI runtime support (#416) 2025-11-21 12:16:58 -08:00
Raj 860139bd1a Fix ImageStore.prune() behavior to actually remove images (#420)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
- Fixes #417.

Rename `_prune()` to `cleanupOrphanedBlobs()` to clarify what it
actually does, and remove `prune()` method as we'll do all that logic in
container directly.
0.15.0
2025-11-20 15:22:54 -08:00
Danny Canter 14f56e4a53 Scripts: Add a script to find kernel panics (#422)
Adds a simple script to find kernel panics in the integration serial
console logs. We're tracking down one related to Swift's Mutex.
2025-11-20 12:02:57 -08:00
Danny Canter 79d7e398c1 vminitd client: Remove connection backoff (#423)
For the constructor we're using where we pass an already connected
socket, I'm not sure this even does anything, and if it does that's a
bug I'd rather just avoid altogether.

Also gets rid of the unused constructor we have to pass in a UDS.
2025-11-20 12:00:56 -08:00
RahulThennarasu f31d2005b5 ManagedProcess: Capture vmexec stderr and convert to Containerization Error (#411)
Fixes #277

When vmexec fails, it logs to stderr and exits with code 1. Previously,
the error details were lost. This change captures stderr and converts it
into a proper ContainerizationError.

Signed-off-by: Rahul Thennarasu <rahulthennarasu07@gmail.com>
2025-11-19 23:56:09 -08:00
Kathryn Baldauf 86f5051fe6 Fix compiler errors in socket types when building with glibc (#421)
* on glibc, swift expects that the msg_controllen is type Int
* on glibc, socket shutdown options should be an Int32

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-11-19 17:36:38 -08:00
Danny Canter 747ea996c8 vminitd: sync(2) in server error path (#413)
Release containerization / deployDocs (push) Has been cancelled
Release containerization / Publish release (push) Has been cancelled
Release containerization / containerization (push) Successful in 1s
0.14.0
2025-11-17 10:38:10 -08:00
Danny Canter 85a3544750 LinuxContainer: "Harden" stop (#388) 2025-11-16 14:13:41 -08:00
RahulThennarasu 4d47c58a3d Fix: Allow OCI archives without manifest annotations (#397)
Fixes #369

Per the OCI Image Spec, manifest descriptor annotations are optional.
Previously, archives without annotations would fail to import with
"Failed to import image".

**Changes:**
- Modified `getImageReferencefromDescriptor` to return digest-based
references (`untagged@sha256:...`) when annotations are missing
- Removed guard that skipped manifests without annotations
- Added test case with `scratch_no_annotations.tar`

**Testing:**
All 167 tests pass, including new test for images without annotations.
2025-11-15 00:32:15 -03:00
Danny Canter 4c761d50c6 Add new FileHandle option for serial console output (#410)
Taking in a filehandle gives the user quite a bit more freedom on how to
handle boot log output. They can set up a kqueue watch on it and
redirect output somewhere else etc etc. The implementation for this has
us take in a new BootLog type that has two options:

1. .file, which is analogous to what we had prior. Just provide a URL
and a true by default append field.
2. .fileHandle which is the new addition. Can pass any fd that is
writable, and the VMM should write serial console output to it.
2025-11-14 10:40:32 -08:00
Danny Canter b501931267 Integration: Actually run testContainerStopIdempotency (#409)
We (I) forgot to add it :)
2025-11-13 14:37:42 -08:00
Danny Canter c8549315ed LinuxContainer: Keep reference to vended execs (#408)
This change is aimed at making forgetting to call .delete() on a
LinuxProcess less destructive than it can be. Because Virt.framework
invalidates any vsock fds it vended if the vm is stopped, trying to
perform some operations on the grpc client through any of the process
methods could trigger an ebadf, which NIO asserts on. This keeps a
reference to the execs and deletes all of them for you once the
container dies. I still think leaving .delete a public method is useful
as otherwise the stdio fds are left open, but cleanup should occur all
in one place now if you don't care about this.

This additionally:

1. Fixes two of our tests that forgot to delete() an exec.
2. Adds two new tests to verify that process.delete() is now idempotent,
and we don't need to call delete().
2025-11-13 02:13:09 -08:00
Danny Canter 322a724024 VZVirtualMachineInstance: Remove tracking agent conns (#403)
This was added to try and see if it alleviated the infrequent ebadf nio
panics, but they still occur, so back to the drawing board :)
2025-11-12 14:37:04 -08:00
Ihor Dvoretskyi 6b8fe3b43f Update example documentation (#406)
- Added README.md for examples directory to provide an overview and
instructions.
- Updated ctr-example README.md with clearer build and run instructions.
- Improved lab.md with a dynamic command to fetch the latest kernel.

Signed-off-by: Ihor Dvoretskyi <ihor@linux.com>
2025-11-12 14:30:01 -08:00
Raj 3ef0002a46 docs: add guidelines for AI contributions (#407)
Adds AI Contribution guidelines to `CONTRIBUTING.md`.
2025-11-12 14:09:24 -08:00
Dmitry Kovba b94be374ae Set the default PATH and fix the bug in retrieving the PATH value (#383)
- We're already setting the default `HOME` and `TERM`. Setting the
default `PATH` as well seems reasonable.
- This PR also fixes the bug in retrieving the `PATH` value (`PATH=` has
to be removed, and `=` should be allowed in folder names).
2025-11-12 15:48:02 -03:00
J Logan 6bf00ad796 Make socket proxy logging less chatty. (#405)
- Move data transfers to trace level.
- Move shutdown errors to warning.
- Only log listen, connect, and cleanup at info.
2025-11-12 09:45:30 -08:00
Danny Canter 01437a44a2 Vminitd: Sync(2) on shutdown (#400) 2025-11-12 09:39:46 -08:00
Danny Canter bbe9ebd8fa TimeSyncer: Amend some bits (#404) 2025-11-12 09:39:26 -08:00
Danny Canter a31abd73a4 Vminitd: Remove unused method (#401) 2025-11-12 09:39:00 -08:00
Danny Canter 8a9b0deb82 LinuxProcess: Swap from logging in delete (#386)
This changes LinuxProcess to not just log errors but return them.
2025-11-11 14:42:41 -08:00
Danny Canter cfe4fd77cb Socket: Return Int32 and not FileHandle for uds receives (#398)
Gives more flexibility. The caller doesn't need to carry around this
FileHandle object if they don't really need it.
2025-11-10 15:48:06 -08:00
Kathryn Baldauf 055b697037 Update the cp kernel command to not use quotes (#396)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-11-10 14:07:13 -05:00
Kathryn Baldauf 0061af6d81 Update ctr-example (#395)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-11-10 12:11:56 -05:00
Eric Ernst 13e6de0169 Update lab.md (#393) 2025-11-10 11:25:39 -05:00
Eric Ernst 6f2eb093aa Create lab.md (#392) 2025-11-10 10:31:43 -05:00