Commit Graph
64 Commits
Author SHA1 Message Date
Danny Canter 7320f8360e VZVirtualMachineInstance: Adjust silent success behavior of nested virt (#88)
Fixes #85

The virtualization bool on LinuxContainer mostly just forwards to
VZVirtualMachineInstance which today would silently take your boolean
and do nothing if the underlying platform doesn't have support for it.
This is (to me) arguably worse than erroring, as it gives the client a
false security that the setting is on, and they should have virt
capabilities in the container/guest now.

This change makes it so that we throw a ContainerizationError for this
case, with a code of .unsupported so it's checkable by a user if they
want more information on the "why".
2025-06-11 11:39:39 -04:00
Dmitry Kovba bc1032e218 Require having Xcode 26 beta (#84)
This PR requires installing Xcode 26 beta until we resolve
https://github.com/apple/containerization/issues/66.
2025-06-11 10:43:52 -04:00
Dmitry Kovba 61379dcf65 Update availability checks to macOS 26 (#80)
This PR updates availability checks for macOS 16 to macOS 26.
2025-06-11 10:42:25 -04:00
Noritaka Kobayashi 69827b55d2 refactor: remove extraneous "break" (#76)
remove extraneous "break"
2025-06-10 21:36:42 -07:00
Spencer King 6d18db68ff docs: Avoid using Latin abbreviations in documentation (#81)
Remove Latin abbreviations from the documentation in accordance with the
[Apple Style Guide](https://help.apple.com/applestyleguide/). This
change does not impact any abbreviations used in code comments since
those are not covered by the style guide.
2025-06-10 21:36:18 -07:00
Iceman 5258424e36 Fetch without chunking in parallel (#75)
## Issue

When pulling images, the download speed appears to be slower compared to
Docker.
I found that parallel chunk generation was being performed during the
layer download process.
While individual chunks allow parallel download operations, the overall
process remains sequential between chunks.
This results less performance when chunks contain both small and large
layers mixed together.

## Changes

Discontinued chunk-based segmentation to enable more efficient parallel
downloads.

## Results(in my local env)

| image | layers | old | new |
| ---|---|---|---|
| node:latest | 12 | 1m15s | 1m10s |
| ghcr.io/norio-nomura/swift_discord_bot:main | 54 |  2m45s | 2m30s |

<details>
<summary>raw terminal log</summary>

```
❯ rm -rf ~/Library/Application\ Support/com.apple.containerization && time bin/cctl_old images pull docker.io/library/node:latest
image pulled
bin/cctl_old images pull docker.io/library/node:latest  42.37s user 6.60s system 64% cpu 1:15.94 total

❯ rm -rf ~/Library/Application\ Support/com.apple.containerization && time bin/cctl_new images pull docker.io/library/node:latest
image pulled
bin/cctl_new images pull docker.io/library/node:latest  42.27s user 6.72s system 69% cpu 1:10.58 total

❯ rm -rf ~/Library/Application\ Support/com.apple.containerization && time bin/cctl_old images pull docker.io/library/node:latest
image pulled
bin/cctl_old images pull docker.io/library/node:latest  45.65s user 7.36s system 70% cpu 1:15.64 total

❯ rm -rf ~/Library/Application\ Support/com.apple.containerization && time bin/cctl_new images pull docker.io/library/node:latest
image pulled
bin/cctl_new images pull docker.io/library/node:latest  39.76s user 6.32s system 65% cpu 1:10.50 total

❯ rm -rf ~/Library/Application\ Support/com.apple.containerization && time bin/cctl_old images pull docker.io/library/node:latest
image pulled
bin/cctl_old images pull docker.io/library/node:latest  42.47s user 6.75s system 65% cpu 1:14.72 total

❯ rm -rf ~/Library/Application\ Support/com.apple.containerization && time bin/cctl_new images pull docker.io/library/node:latest
image pulled
bin/cctl_new images pull docker.io/library/node:latest  42.28s user 6.65s system 69% cpu 1:09.93 total

❯ rm -rf ~/Library/Application\ Support/com.apple.containerization && time bin/cctl_new images pull ghcr.io/norio-nomura/swift_discord_bot:main
image pulled
bin/cctl_new images pull ghcr.io/norio-nomura/swift_discord_bot:main  103.83s user 18.71s system 81% cpu 2:30.02 total

❯ rm -rf ~/Library/Application\ Support/com.apple.containerization && time bin/cctl_old images pull ghcr.io/norio-nomura/swift_discord_bot:main
image pulled
bin/cctl_old images pull ghcr.io/norio-nomura/swift_discord_bot:main  120.79s user 20.70s system 85% cpu 2:45.26 total
```
</details>


<details>
<summary>patch for download only</summary>

```diff
diff --git a/Sources/cctl/ImageCommand.swift b/Sources/cctl/ImageCommand.swift
index 84c5218..4aa4bb8 100644
--- a/Sources/cctl/ImageCommand.swift
+++ b/Sources/cctl/ImageCommand.swift
@@ -127,6 +127,7 @@ extension Application {
                 }
 
                 print("image pulled")
+                return
 
                 let tempDir = FileManager.default.uniqueTemporaryDirectory(create: true)
                 if let platform {
```
</details>
2025-06-10 21:26:36 -07:00
Dmitry Kovba 4ad3c996f0 Update the names of Xcode, macOS, and Apple silicon (#83)
This PR updates the names of Xcode and macOS to the official names used
in https://developer.apple.com/download/applications/. Also, it fixes
the capitalization in "Apple silicon".
2025-06-10 18:03:25 -07:00
Satyam Singh 5240d36464 fix: quote inputs and improve shell conditionals for safety (#68)
This PR improves **safety and consistency** of the GitHub Actions
workflow (build-test-images.yml) file by:
  - Using **[[ ... ]]** **instea**d of **[ ... ]** for conditionals.
- Adding **double quotes** around inputs and refs to **avoid**
evaluation issues.

This helps prevent bugs in **shell parsing**, especially with **empty or
misinterpreted** input values.


@katiewasnothere @wlan0
2025-06-10 13:54:48 -07:00
Aviram HassanandDanny Canter 6216c6eee8 clarified linux/amd64 images support (#77)
#70 Made it clearer as I wasn't sure if the API allows us to run x64
binaries or also run such Docker images.

---------

Signed-off-by: Aviram Hassan <aviramyhassan@gmail.com>
Co-authored-by: Danny Canter <danny_canter@apple.com>
2025-06-10 15:56:18 -04:00
Danny Canter d1a8fae1af Add links in README to the various products (#73) 2025-06-10 09:48:31 -07:00
Danny Canter de304aae3d Vminitd: Adjust guest agent logs (#72)
There was a couple spots where the wrong rpc was listed in the log, as
well as most of them not logging the containerID along with the process
ID.
2025-06-10 12:12:44 -04:00
Noritaka Kobayashi 4181e50775 refactor: fix typos (#64)
fix typos
2025-06-10 08:19:50 -07:00
34celsius 8a92500f8c docs: Fix typo and broken nested list in kernel/README.md (#57)
This change fixes a broken nested list and updates the phrase "light
weight" for consistency with
https://github.com/apple/containerization/pull/50.
2025-06-10 03:21:40 -07:00
Riya Amemiya 918fb7e252 Fix grammar: "speed of which" → "speed at which" in CONTRIBUTING.md (#67)
## Summary
Corrects a grammatical error in CONTRIBUTING.md line 36.

## Change
**Line 36**: `speed of which` → `speed at which`

The preposition "of" is incorrect when connecting the noun "speed" with
the relative pronoun "which". Standard English requires "at" (e.g., "the
speed at which", "the rate at which").

**Before:**
```
This will greatly help the priority setting and speed of which maintainers can get to your issue.
```

**After:**
```
This will greatly help the priority setting and speed at which maintainers can get to your issue.
```
2025-06-10 01:29:33 -07:00
Kei Kamikawa cbb1ee4cff Removed unused linux-config-aarch64 file (#62)
I think it is config-arm64 that you are using, so I have created a PR to
avoid confusion.
If you don't need it, please let me know so that I can Close it.
2025-06-09 17:55:11 -07:00
J Logan cd175a7972 Adds API link to README. (#61) 2025-06-09 17:35:36 -07:00
Kathryn Baldauf 73596530fe Remove image push tests (#55)
This removes two image push tests. We cannot have the CI push to our
ghcr registry since external users do not have write access for pushing
the image. We will explore a better solution.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-09 17:28:24 -07:00
Kathryn Baldauf 2923b33836 Allow building docs from main (#53)
We eventually only want to support building docs from release branches
and tags, however, while we're working to initially set up the docs, we
may have some churn. So we want to be able to publish from main during
that churn.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-09 16:40:22 -07:00
The Alchemist 91db40d99c Update README.md with minor correction (#50)
Not to be pedantic, but "light weight" is usually considered to be one
word.
2025-06-09 15:29:42 -07:00
J Logan 4981faadef Adds base path for GitHub Pages publishing. (#48) 2025-06-09 15:07:50 -07:00
Danny Canter 66e991ac05 Clarify source stability (#45) 2025-06-09 11:38:25 -07:00
J Logan 56c06be9a9 Fine-tune build requirements. (#44) 2025-06-09 10:49:37 -07:00
Madhu Venugopalandmadhu a595d0cca5 Updating latest macOS and Xcode versions (#43)
Co-authored-by: madhu <mvenugopal@apple.com>
2025-06-09 10:40:43 -07:00
Eric Ernst eade0a7a4d docs: add a baseline contributors.txt (#42)
Add initial contributors.txt for the project
2025-06-09 09:42:57 -07:00
Eric Ernst 8d094935af README: split prep, build and test directions into own sections (#41)
If we split this out, it'll be easier to point developers at specific
parts for setting up their build environment, versus building and
testing.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2025-06-08 22:31:32 -07:00
J Logan e285dc0dd4 Set MTU to 1280 for containers. (#38)
- Needed for alpine containers in some instances.
- This should be configurable. Hardcoding in linkSet for now.
2025-06-08 21:02:23 -07:00
Eric Ernst 3fd2c220a2 docs: update version description (#40)
Let's just be consistent and use 15 instead of Sequoia
2025-06-08 17:51:53 -07:00
Eric Ernst 52072340f2 docs: drop contributors.txt (#39)
We'll have authors in original commit, and we don't need this to start.
2025-06-08 16:26:42 -07:00
Kathryn Baldauf 0338c07283 Only allow docs publish on tags or release branches (#32)
Matches same changes on container
https://github.com/apple/container/pull/30

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-08 10:12:38 -07:00
Madhu Venugopalandmadhu b222b947bc Fixed typo in Contributors file (#37)
Co-authored-by: madhu <mvenugopal@apple.com>
2025-06-08 10:10:32 -07:00
Danny Canter 117324e300 Integration: Add a multi-exec output test (#34)
Add a test similar to the concurrent exec test, except supply stdout.

Signed-off-by: Danny Canter <danny_canter@apple.com>
2025-06-08 02:07:51 -07:00
Danny Canter fef518e1c3 LinuxProcess: Resource adjustments (#33)
- The kqueue handlers for stdio didn't have logic to exit on zero byte
reads.
- The agent wasn't getting closed explicitly in .delete()
- In LinuxContainer we should call delete just for sanity, if for
nothing more than ensuring the agent vsock fd is closed.

Signed-off-by: Danny Canter <danny_canter@apple.com>
2025-06-08 02:07:23 -07:00
Aditya Ramani 0bd526053c Add executable name to exec error (#36)
Signed-off-by: Aditya Ramani <a_ramani@apple.com>
2025-06-07 22:47:45 -07:00
Madhu Venugopal 9c1b08d3e7 Update README.md (#35)
Fixed minor typo
2025-06-07 12:13:42 -07:00
Paris 39f5d05bff Update CONTRIBUTORS.txt (#31)
adding GH handles
2025-06-06 21:46:08 -07:00
Aditya Ramani 5f29918ecb Add docs for ContainerizationArchive (#28)
Also removes some dead code.

Signed-off-by: Aditya Ramani <a_ramani@apple.com>
2025-06-06 16:29:11 -07:00
Michael Crosby 9959810656 separate fetch-default-kernel make target (#27)
Signed-off-by: michael crosby <michael_crosby@apple.com>
2025-06-06 15:05:24 -07:00
Dmitry Kovba 8013608979 Resolve a compilation error and warnings in make test (#29) 2025-06-06 14:41:41 -07:00
Patrice Jaton ca3c94a0b6 Update documentations. (#26)
Some updates to the documentation:

* Replace code-of-conduct with organization one.
* Cleanup `CONTRIBUTING.md`, `README.md` and `SECURITY.md` markdown.
* Remove `.txt` extension from `LICENSE` for consistency across repos.
2025-06-06 10:52:03 -07:00
Danny Canter fc4a124173 Continue documenting public surface (#25)
Signed-off-by: Danny Canter <danny_canter@apple.com>
2025-06-06 10:34:19 -04:00
Kathryn Baldauf 46260fd6a6 Move permissions in release and add id-token (#24)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-05 20:28:08 -07:00
Joseph Heck 19778a2bf3 community file updates (#23)
community file updates
2025-06-05 16:16:48 -07:00
Dmitry Kovba 4eba0fa572 Add documentation for netlink (#21) 2025-06-05 16:16:47 -07:00
Danny Canter 9ac3874008 UnixSocketConfiguration: Change from/to to source/destination (#22)
This is something I forgot to update ages ago. The field names, while
they do make sense, were different than the constructor names that
eventually set the fields themselves. This is kind of awkward, and I'd
much rather fix this now while it's much easier.

We'll need to update `container` after this

Signed-off-by: Danny Canter <danny_canter@apple.com>
2025-06-05 16:16:45 -07:00
Michael Crosby 3d5b3404df add rotating allocator for UInt32 (#11)
This creates an allocator based on a FIFO that will allocate through the
range before reusing previously released allocations.

Signed-off-by: michael crosby <michael_crosby@apple.com>
2025-06-05 16:16:43 -07:00
Aditya Ramani c2e22192d4 Fix compiler warning in LocalOCILayoutClient (#19)
Resolves the warning
```
LocalOCILayoutClient.swift:87:37: warning: capture of non-sendable type 'T.AsyncIterator.Type' in an isolated closure
 87 |             for try await buffer in input {
    |                                     `- warning: capture of non-sendable type 'T.AsyncIterator.Type' in an isolated closure
 88 |                 wrote += buffer.readableBytes
 89 |                 try buffer.withUnsafeReadableBytes { pointer in
```

Signed-off-by: Aditya Ramani <a_ramani@apple.com>
2025-06-05 16:16:32 -07:00
Kathryn Baldauf 8ecbd124e3 Fix refs parsing in gh action (#20)
Remove erroneous quotes when checking for wildcard match in GitHub
action

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-05 16:16:22 -07:00
Danny Canter f49f668936 Updates to license headers (#17)
- Capitalize containerization.
- Wrap "All rights reserved" to a new line.

Signed-off-by: Danny Canter <danny_canter@apple.com>
2025-06-05 16:16:22 -07:00
Kathryn Baldauf 816a959ada Add id token for deploying docs (#18)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-05 16:16:21 -07:00
Sidhartha Mani 1aba17e0d0 EXT4Reader documentation update (#16)
Signed-off-by: Sidhartha Mani <sidhartha_mani@apple.com>
2025-06-05 16:16:20 -07:00