Skip to content

Commit 38ba7a3

Browse files
Merge branch 'main' into fix/image-push-tests-permissions
2 parents 351d7a0 + 28b97f2 commit 38ba7a3

File tree

69 files changed

+1219
-831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1219
-831
lines changed

.github/ISSUE_TEMPLATE/01-bug.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Bug report
22
description: File a bug report.
33
title: "[Bug]: "
4-
labels: ["bug", "triage"]
4+
type: "Bug"
55
body:
66
- type: markdown
77
attributes:
@@ -34,7 +34,7 @@ body:
3434
- type: textarea
3535
id: expected
3636
attributes:
37-
label: Expected Behavior
37+
label: Expected behavior
3838
description: A concise description of what you expected to happen.
3939
validations:
4040
required: true

.github/ISSUE_TEMPLATE/02-feature.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Feature or enhancement request
22
description: File a request for a feature or enhancement
33
title: "[Request]: "
4-
labels: ["feature", "triage"]
4+
type: "Feature"
55
body:
66
- type: markdown
77
attributes:

.github/workflows/containerization-build-template.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,83 +15,86 @@ on:
1515
jobs:
1616
buildAndTest:
1717
name: Build and Test repo
18+
if: github.repository == 'apple/containerization'
1819
timeout-minutes: 60
1920
runs-on: [self-hosted, macos, sequoia, ARM64]
2021
permissions:
2122
contents: read
2223
packages: write
24+
env:
25+
DEVELOPER_DIR: "/Applications/Xcode_26.b1.app/Contents/Developer"
26+
2327
steps:
2428
- name: Checkout repository
2529
uses: actions/checkout@v4
2630
with:
2731
fetch-depth: 0
32+
2833
- name: Activate Swiftly
2934
run: |
3035
source /opt/swiftly/env.sh
3136
cat /opt/swiftly/env.sh
37+
3238
- name: Check formatting
3339
run: |
3440
./scripts/install-hawkeye.sh
3541
make fmt
3642
git diff
3743
if ! git diff --quiet ; then echo the following files require formatting or license headers: ; git diff --name-only ; false ; fi
38-
env:
39-
DEVELOPER_DIR: "/Applications/Xcode_26.b1.app/Contents/Developer"
44+
4045
- name: Check protobufs
4146
run: |
4247
make protos
4348
if ! git diff --quiet ; then echo the following files require formatting or license headers: ; git diff --name-only ; false ; fi
44-
env:
45-
DEVELOPER_DIR: "/Applications/Xcode_26.b1.app/Contents/Developer"
46-
CURRENT_SDK: y
49+
4750
- name: Make containerization and docs
4851
run: |
4952
make clean containerization docs
5053
tar cfz _site.tgz _site
51-
env:
52-
DEVELOPER_DIR: "/Applications/Xcode_26.b1.app/Contents/Developer"
53-
CURRENT_SDK: y
54+
5455
- name: Make vminitd image
5556
run: |
5657
source /opt/swiftly/env.sh
5758
make -C vminitd swift linux-sdk
5859
make init
59-
env:
60-
CURRENT_SDK: y
60+
6161
- name: Test containerization
6262
run: |
6363
make fetch-default-kernel
6464
make test integration
6565
env:
66-
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
REGISTRY_TOKEN: ${{ github.token }}
6767
REGISTRY_USERNAME: ${{ github.actor }}
68-
DEVELOPER_DIR: "/Applications/Xcode_26.b1.app/Contents/Developer"
69-
CURRENT_SDK: y
68+
7069
- name: Push vminitd image
7170
if: ${{ inputs.release }}
7271
run: |
7372
bin/cctl images tag vminit:latest ghcr.io/apple/containerization/vminit:${{ inputs.version }}
7473
bin/cctl images push ghcr.io/apple/containerization/vminit:${{ inputs.version }}
7574
env:
76-
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
REGISTRY_TOKEN: ${{ github.token }}
7776
REGISTRY_USERNAME: ${{ github.actor }}
7877
REGISTRY_HOST: ghcr.io
78+
7979
- name: Create image tar
80-
if: ${{ inputs.release }} != true
80+
if: ${{ !inputs.release }}
8181
run: |
8282
bin/cctl images save vminit:latest -o vminit.tar
83+
8384
- name: Save vminit artifact
84-
if: ${{ inputs.release }} != true
85+
if: ${{ !inputs.release }}
8586
uses: actions/upload-artifact@v4
8687
with:
8788
name: vminit
8889
path: vminit.tar
90+
8991
- name: Save documentation artifact
9092
uses: actions/upload-artifact@v4
9193
with:
9294
name: api-docs
9395
path: "./_site.tgz"
9496
retention-days: 14
97+
9598
uploadPages:
9699
# Separate upload step required because upload-pages-artifact needs
97100
# gtar which is not on the macOS runner.
@@ -103,13 +106,16 @@ jobs:
103106
steps:
104107
- name: Setup Pages
105108
uses: actions/configure-pages@v5
109+
106110
- name: Download a single artifact
107111
uses: actions/download-artifact@v4
108112
with:
109113
name: api-docs
114+
110115
- name: Add API docs to documentation
111116
run: |
112117
tar xfz _site.tgz
118+
113119
- name: Upload Artifact
114120
uses: actions/upload-pages-artifact@v3
115121
with:

.spi.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ version: 1
22
builder:
33
configs:
44
- documentation_targets: [Containerization, ContainerizationEXT4, ContainerizationOS, ContainerizationOCI, ContainerizationNetlink, ContainerizationIO, ContainerizationExtras, ContainerizationArchive, SendableProperty]
5+
swift_version: '6.2'

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.2-snapshot
1+
6.2-snapshot-2025-06-25

CONTRIBUTORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ John Logan (jglogan)
1616
Kathryn Baldauf (katiewasnothere)
1717
Madhu Venugopal (mavenugo)
1818
Michael Crosby (crosbymichael)
19+
Nandha Reddy (nandsha)
1920
Sidhartha Mani (wlan0)
2021
Tanweer Noor (tanweernoor)
2122
Ximena Perez Diaz (ximenanperez)

Makefile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BUILD_CONFIGURATION ?= debug
1919
# Commonly used locations
2020
SWIFT := "/usr/bin/swift"
2121
ROOT_DIR := $(shell git rev-parse --show-toplevel)
22-
BUILD_BIN_DIR := $(shell $(SWIFT) build -c $(BUILD_CONFIGURATION) --show-bin-path)
22+
BUILD_BIN_DIR = $(shell $(SWIFT) build -c $(BUILD_CONFIGURATION) --show-bin-path)
2323

2424
# Variables for libarchive integration
2525
LIBARCHIVE_UPSTREAM_REPO := https://github.com/libarchive/libarchive
@@ -54,7 +54,7 @@ containerization:
5454
@codesign --force --sign - --timestamp=none --entitlements=signing/vz.entitlements bin/containerization-integration
5555

5656
.PHONY: init
57-
init: vminitd
57+
init: containerization vminitd
5858
@echo Creating init.ext4...
5959
@rm -f bin/init.rootfs.tar.gz bin/init.block
6060
@./bin/cctl rootfs create --vminitd vminitd/bin/vminitd --labels org.opencontainers.image.source=https://github.com/apple/containerization --vmexec vminitd/bin/vmexec bin/init.rootfs.tar.gz vminit:latest
@@ -106,7 +106,7 @@ ifeq (,$(wildcard bin/vmlinux))
106106
endif
107107

108108
.PHONY: fmt
109-
fmt: swift-fmt update-licenses
109+
fmt: swift-fmt update-licenses
110110

111111
.PHONY: swift-fmt
112112
SWIFT_SRC = $(shell find . -type f -name '*.swift' -not -path "*/.*" -not -path "*.pb.swift" -not -path "*.grpc.swift" -not -path "*/checkouts/*")
@@ -135,12 +135,10 @@ serve-docs:
135135
@python3 -m http.server --bind 127.0.0.1 --directory ./_serve
136136

137137
.PHONY: docs
138-
docs: _site
139-
140-
_site:
138+
docs:
141139
@echo Updating API documentation...
142-
rm -rf $@
143-
@scripts/make-docs.sh $@ containerization
140+
@rm -rf _site
141+
@scripts/make-docs.sh _site containerization
144142

145143
.PHONY: cleancontent
146144
cleancontent:

Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ import CompilerPluginSupport
2121
import Foundation
2222
import PackageDescription
2323

24-
let settings: [SwiftSetting]
25-
if ProcessInfo.processInfo.environment["CURRENT_SDK"] != nil {
26-
// TODO: Remove this compile condition when the updated macOS SDK is available publicly
27-
settings = [.define("CURRENT_SDK")]
28-
} else {
29-
settings = []
30-
}
31-
3224
let package = Package(
3325
name: "containerization",
3426
platforms: [.macOS("15")],
@@ -77,8 +69,7 @@ let package = Package(
7769
],
7870
exclude: [
7971
"../Containerization/SandboxContext/SandboxContext.proto"
80-
],
81-
swiftSettings: settings
72+
]
8273
),
8374
.executableTarget(
8475
name: "cctl",

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
The Containerization package allows applications to use Linux containers.
44
Containerization is written in [Swift](https://www.swift.org) and uses [Virtualization.framework](https://developer.apple.com/documentation/virtualization) on Apple silicon.
55

6+
> **Looking for command line binaries for running containers?**\
7+
> They are available in the dedicated [apple/container](https://github.com/apple/container) repository.
8+
69
Containerization provides APIs to:
710

811
- [Manage OCI images](./Sources/ContainerizationOCI/).
@@ -23,7 +26,7 @@ Containerization executes each Linux container inside of its own lightweight vir
2326
[vminitd](/vminitd) is a small init system, which is a subproject within Containerization.
2427
`vminitd` is spawned as the initial process inside of the virtual machine and provides a GRPC API over vsock.
2528
The API allows the runtime environment to be configured and containerized processes to be launched.
26-
`vminitd` provides I/O, signals, and events to the calling process when a process is ran.
29+
`vminitd` provides I/O, signals, and events to the calling process when a process is run.
2730

2831
## Requirements
2932

@@ -59,9 +62,9 @@ While this configuration will work for the majority of workloads we understand t
5962
To solve this Containerization provides first class APIs to use different kernel configurations and versions on a per container basis.
6063
This enables containers to be developed and validated across different kernel versions.
6164

62-
See the [README](/kernel/README.md) in the kernel directory for instruction on how to compile the optimized kernel.
65+
See the [README](/kernel/README.md) in the kernel directory for instructions on how to compile the optimized kernel.
6366

64-
### Pre-build Kernel
67+
### Pre-built Kernel
6568

6669
If you wish to consume a pre-built kernel it must have `VIRTIO` drivers compiled into the kernel, not as modules.
6770

@@ -71,6 +74,13 @@ A kernel image named `vmlinux.container` can be found in the `/opt/kata/share/ka
7174

7275
## Prepare to build package
7376

77+
Install the recommended version of Xcode.
78+
79+
Set the active developer directory to the installed Xcode (replace `<PATH_TO_XCODE>`):
80+
```bash
81+
sudo xcode-select -s <PATH_TO_XCODE>
82+
```
83+
7484
Install [Swiftly](https://github.com/swiftlang/swiftly), [Swift](https://www.swift.org), and [Static Linux SDK](https://www.swift.org/documentation/articles/static-linux-getting-started.html):
7585

7686
```bash
@@ -143,7 +153,7 @@ make serve-docs
143153
Preview the documentation by running in another terminal:
144154

145155
```bash
146-
open http://localhost:8000/documentation/
156+
open http://localhost:8000/containerization/documentation/
147157
```
148158

149159
## Contributing

0 commit comments

Comments
 (0)