Skip to content

Commit 3e116dd

Browse files
committed
squash commits
1 parent 40e1778 commit 3e116dd

313 files changed

Lines changed: 7757 additions & 1808 deletions

File tree

Some content is hidden

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

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
groups:
8+
github-actions:
9+
patterns:
10+
- "*"
11+
commit-message:
12+
prefix: "ci"

.github/labeler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cli:
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- 'Sources/CLI/**'
5+
- 'Sources/ContainerCommands/**'

.github/workflows/common.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
name: Build and test the project
1717
if: github.repository == 'apple/container'
1818
timeout-minutes: 60
19-
runs-on: [self-hosted, macos, sequoia, ARM64]
19+
runs-on: [self-hosted, macos, tahoe, ARM64]
2020
permissions:
2121
contents: read
2222
packages: read
2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
2626
with:
2727
fetch-depth: 0
2828

@@ -73,19 +73,23 @@ jobs:
7373
APP_ROOT=$(mktemp -d -p "${RUNNER_TEMP}")
7474
trap 'rm -rf "${APP_ROOT}"; echo Removing data directory ${APP_ROOT}' EXIT
7575
echo "Created data directory ${APP_ROOT}"
76+
export NO_PROXY="${NO_PROXY},192.168.0.0/16,fe80::/10"
77+
echo NO_PROXY=${NO_PROXY}
78+
export no_proxy="${no_proxy},192.168.0.0/16,fe80::/10"
79+
echo no_proxy=${no_proxy}
7680
make APP_ROOT="${APP_ROOT}" test install-kernel integration
7781
env:
7882
DEVELOPER_DIR: "/Applications/Xcode-latest.app/Contents/Developer"
7983

8084
- name: Save documentation artifact
81-
uses: actions/upload-artifact@v4
85+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
8286
with:
8387
name: api-docs
8488
path: "./_site.tgz"
8589
retention-days: 14
8690

8791
- name: Save package artifacts
88-
uses: actions/upload-artifact@v4
92+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
8993
with:
9094
name: container-package
9195
path: ${{ github.workspace }}/outputs
@@ -102,7 +106,7 @@ jobs:
102106
uses: actions/configure-pages@v5
103107

104108
- name: Download a single artifact
105-
uses: actions/download-artifact@v4
109+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
106110
with:
107111
name: api-docs
108112

@@ -111,6 +115,6 @@ jobs:
111115
tar xfz _site.tgz
112116
113117
- name: Upload Artifact
114-
uses: actions/upload-pages-artifact@v3
118+
uses: actions/upload-pages-artifact@v4
115119
with:
116120
path: "./_site"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: PR Label Analysis
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
analyze:
12+
name: Analyze PR for labeling
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Save PR metadata
17+
run: |
18+
mkdir -p ./pr-metadata
19+
echo "${{ github.event.pull_request.number }}" > ./pr-metadata/pr-number.txt
20+
21+
- name: Upload PR metadata as artifact
22+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
23+
with:
24+
name: pr-metadata-${{ github.event.pull_request.number }}
25+
path: pr-metadata/
26+
retention-days: 1
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: PR Label Apply
2+
3+
on:
4+
workflow_run:
5+
workflows: ["PR Label Analysis"]
6+
types:
7+
- completed
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
apply-labels:
14+
name: Apply labels to PR
15+
runs-on: ubuntu-latest
16+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
17+
permissions:
18+
contents: read
19+
pull-requests: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
24+
25+
- name: Download PR metadata artifact
26+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
27+
with:
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
run-id: ${{ github.event.workflow_run.id }}
30+
pattern: pr-metadata-*
31+
merge-multiple: false
32+
continue-on-error: true
33+
id: download-artifact
34+
35+
- name: Read PR number
36+
id: pr-number
37+
run: |
38+
METADATA_DIR=$(find . -type d -name "pr-metadata-*" 2>/dev/null | head -n 1)
39+
40+
if [ -z "$METADATA_DIR" ]; then
41+
echo "No metadata found"
42+
exit 1
43+
fi
44+
45+
PR_NUMBER=$(cat "${METADATA_DIR}/pr-number.txt")
46+
echo "number=${PR_NUMBER}" >> $GITHUB_OUTPUT
47+
echo "PR Number: ${PR_NUMBER}"
48+
49+
- name: Apply labels using labeler
50+
uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6
51+
with:
52+
pr-number: ${{ steps.pr-number.outputs.number }}
53+
repo-token: ${{ secrets.GITHUB_TOKEN }}
54+
configuration-path: .github/labeler.yml
55+
sync-labels: true

.github/workflows/release-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
pages: write
3333
steps:
3434
- name: Download artifacts
35-
uses: actions/download-artifact@v4
35+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
3636
with:
3737
path: outputs
3838

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
pages: write
3333
steps:
3434
- name: Download artifacts
35-
uses: actions/download-artifact@v4
35+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
3636
with:
3737
path: outputs
3838

.spi.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ builder:
33
configs:
44
-
55
documentation_targets:
6+
- ContainerAPIService
7+
- ContainerAPIClient
68
- ContainerSandboxService
9+
- ContainerSandboxServiceClient
710
- ContainerNetworkService
11+
- ContainerNetworkServiceClient
812
- ContainerImagesService
9-
- ContainerClient
13+
- ContainerImagesServiceClient
14+
- ContainerResource
1015
- ContainerLog
1116
- ContainerPlugin
1217
- ContainerXPC

.swift-format-nolint

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"fileScopedDeclarationPrivacy" : {
3+
"accessLevel" : "private"
4+
},
5+
"indentation" : {
6+
"spaces" : 4
7+
},
8+
"indentConditionalCompilationBlocks" : false,
9+
"indentSwitchCaseLabels" : false,
10+
"lineBreakAroundMultilineExpressionChainComponents" : false,
11+
"lineBreakBeforeControlFlowKeywords" : false,
12+
"lineBreakBeforeEachArgument" : false,
13+
"lineBreakBeforeEachGenericRequirement" : false,
14+
"lineLength" : 180,
15+
"maximumBlankLines" : 1,
16+
"multiElementCollectionTrailingCommas" : true,
17+
"noAssignmentInExpressions" : {
18+
"allowedFunctions" : [
19+
"XCTAssertNoThrow"
20+
]
21+
},
22+
"prioritizeKeepingFunctionOutputTogether" : false,
23+
"respectsExistingLineBreaks" : true,
24+
"rules" : {
25+
"AllPublicDeclarationsHaveDocumentation" : false,
26+
"AlwaysUseLowerCamelCase" : false,
27+
"AmbiguousTrailingClosureOverload" : false,
28+
"BeginDocumentationCommentWithOneLineSummary" : false,
29+
"DoNotUseSemicolons" : true,
30+
"DontRepeatTypeInStaticProperties" : false,
31+
"FileScopedDeclarationPrivacy" : false,
32+
"FullyIndirectEnum" : false,
33+
"GroupNumericLiterals" : false,
34+
"IdentifiersMustBeASCII" : false,
35+
"NeverForceUnwrap" : false,
36+
"NeverUseForceTry" : false,
37+
"NeverUseImplicitlyUnwrappedOptionals" : false,
38+
"NoAccessLevelOnExtensionDeclaration" : false,
39+
"NoAssignmentInExpressions" : false,
40+
"NoBlockComments" : false,
41+
"NoCasesWithOnlyFallthrough" : false,
42+
"NoEmptyTrailingClosureParentheses" : true,
43+
"NoLabelsInCasePatterns" : false,
44+
"NoLeadingUnderscores" : false,
45+
"NoParensAroundConditions" : true,
46+
"NoPlaygroundLiterals" : false,
47+
"NoVoidReturnOnFunctionSignature" : true,
48+
"OmitExplicitReturns" : false,
49+
"OneCasePerLine" : true,
50+
"OneVariableDeclarationPerLine" : true,
51+
"OnlyOneTrailingClosureArgument" : false,
52+
"OrderedImports" : true,
53+
"ReplaceForEachWithForLoop" : false,
54+
"ReturnVoidInsteadOfEmptyTuple" : false,
55+
"TypeNamesShouldBeCapitalized" : false,
56+
"UseEarlyExits" : false,
57+
"UseLetInEveryBoundCaseVariable" : false,
58+
"UseShorthandTypeNames" : true,
59+
"UseSingleLinePropertyGetter" : true,
60+
"UseSynthesizedInitializer" : false,
61+
"UseTripleSlashForDocumentationComments" : true,
62+
"UseWhereClausesInForLoops" : false,
63+
"ValidateDocumentationComments" : false
64+
},
65+
"spacesAroundRangeFormationOperators" : false,
66+
"tabWidth" : 2,
67+
"version" : 1
68+
}

BUILDING.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,20 @@ to prepare your build environment.
7171
> ```swift
7272
> .package(path: "../containerization"),
7373
> ```
74-
5. Build `container`.
74+
75+
5. If you want `container` to use any changes you made in the `vminit` subproject of Containerization, update the system property to use the locally built init filesystem image:
76+
77+
```bash
78+
container system property set image.init vminit:latest
79+
```
80+
81+
6. Build `container`.
7582

7683
```
7784
make clean all
7885
```
7986

80-
6. Restart the `container` services.
87+
7. Restart the `container` services.
8188

8289
```
8390
bin/container system stop
@@ -86,22 +93,32 @@ to prepare your build environment.
8693

8794
To revert to using the Containerization dependency from your `Package.swift`:
8895

89-
1. Use the Swift package manager to restore the normal `containerization` dependency and update your `Package.resolved` file. If you are using Xcode, revert your `Package.swift` change instead of using `swift package unedit`.
96+
1. If you were using the local init filesystem, revert the system property to its default value:
97+
98+
```bash
99+
container system property clear image.init
100+
```
101+
102+
2. Use the Swift package manager to restore the normal `containerization` dependency and update your `Package.resolved` file. If you are using Xcode, revert your `Package.swift` change instead of using `swift package unedit`.
90103

91104
```bash
92105
/usr/bin/swift package unedit containerization
93106
/usr/bin/swift package update containerization
94107
```
95108

96-
2. Rebuild `container`.
109+
3. Rebuild `container`.
97110

98111
```bash
99112
make clean all
100113
```
101114

102-
3. Restart the `container` services.
115+
4. Restart the `container` services.
103116

104117
```bash
105118
bin/container system stop
106119
bin/container system start
107120
```
121+
122+
## Pre-commit hook
123+
124+
Run `make pre-commit` to install a pre-commit hook that ensures that your changes have correct formatting and license headers when you run `git commit`.

0 commit comments

Comments
 (0)