Skip to content

Commit 5f91f08

Browse files
authored
Merge branch 'main' into feat/chaos-1380-blkio-flags
2 parents 9736b24 + 7966302 commit 5f91f08

77 files changed

Lines changed: 1659 additions & 1130 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.

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ INTEGRATION_TEST_SUITES ?= \
211211
TestCLIKernelSet \
212212
TestCLIAnonymousVolumes \
213213
TestCLINotFound \
214-
TestCLINoParallelCases
214+
TestCLINoParallelCases \
215+
TestCLISystemDF
215216

216217
empty :=
217218
space := $(empty) $(empty)
@@ -254,6 +255,7 @@ coverage-integration: all
254255
echo "Starting CLI integration tests with coverage" && \
255256
{ \
256257
export CLITEST_LOG_ROOT=$(LOG_ROOT) ; \
258+
export CONTAINER_CLI_PATH=$(ROOT_DIR)/bin/container ; \
257259
$(SWIFT) test --skip-build --enable-code-coverage -c $(BUILD_CONFIGURATION) $(SWIFT_CONFIGURATION) --filter "$(INTEGRATION_FILTER)" ; \
258260
exit_code=$$? ; \
259261
cp $(COV_DATA_DIR)/*.profraw $(COVERAGE_OUTPUT_DIR)/integration/ ; \
@@ -279,6 +281,7 @@ integration: init-block
279281
echo "Starting CLI integration tests" && \
280282
{ \
281283
CLITEST_LOG_ROOT=$(LOG_ROOT) && export CLITEST_LOG_ROOT ; \
284+
CONTAINER_CLI_PATH=$(ROOT_DIR)/bin/container && export CONTAINER_CLI_PATH ; \
282285
$(SWIFT) test -c $(BUILD_CONFIGURATION) $(SWIFT_CONFIGURATION) --filter "$(INTEGRATION_FILTER)" ; \
283286
exit_code=$$? ; \
284287
echo Ensuring apiserver stopped after the CLI integration tests ; \

NOTICE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5050
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
5151
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5252

53+
**Mattt ( swift-configuration-toml )**
54+
Copyright © 2025 Mattt (https://mat.tt)
55+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
56+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
57+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
58+
5359
**Apple Inc. and the Swift Logging API project authors ( swift-log )**
5460
Copyright © 2018-2019 Apple Inc. and the Swift Logging API project authors
5561
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

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: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import PackageDescription
2323
let releaseVersion = ProcessInfo.processInfo.environment["RELEASE_VERSION"] ?? "0.0.0"
2424
let gitCommit = ProcessInfo.processInfo.environment["GIT_COMMIT"] ?? "unspecified"
2525
let builderShimVersion = "0.12.0"
26-
let scVersion = "0.33.2"
26+
let scVersion = "0.33.3"
2727

2828
let package = Package(
2929
name: "container",
@@ -34,7 +34,9 @@ let package = Package(
3434
.library(name: "ContainerAPIService", targets: ["ContainerAPIService"]),
3535
.library(name: "ContainerAPIClient", targets: ["ContainerAPIClient"]),
3636
.library(name: "ContainerImagesService", targets: ["ContainerImagesService", "ContainerImagesServiceClient"]),
37-
.library(name: "ContainerNetworkService", targets: ["ContainerNetworkService", "ContainerNetworkServiceClient"]),
37+
.library(name: "ContainerNetworkClient", targets: ["ContainerNetworkClient"]),
38+
.library(name: "ContainerNetworkServer", targets: ["ContainerNetworkServer"]),
39+
.library(name: "ContainerNetworkVmnetServer", targets: ["ContainerNetworkVmnetServer"]),
3840
.library(name: "ContainerResource", targets: ["ContainerResource"]),
3941
.library(name: "ContainerLog", targets: ["ContainerLog"]),
4042
.library(name: "ContainerPersistence", targets: ["ContainerPersistence"]),
@@ -106,7 +108,6 @@ let package = Package(
106108
"ContainerBuild",
107109
"ContainerAPIClient",
108110
"ContainerLog",
109-
"ContainerNetworkService",
110111
"ContainerPersistence",
111112
"ContainerPlugin",
112113
"ContainerResource",
@@ -166,7 +167,7 @@ let package = Package(
166167
"ContainerAPIService",
167168
"ContainerAPIClient",
168169
"ContainerLog",
169-
"ContainerNetworkService",
170+
"ContainerNetworkClient",
170171
"ContainerPersistence",
171172
"ContainerPlugin",
172173
"ContainerResource",
@@ -188,7 +189,7 @@ let package = Package(
188189
.product(name: "SystemPackage", package: "swift-system"),
189190
"CVersion",
190191
"ContainerAPIClient",
191-
"ContainerNetworkServiceClient",
192+
"ContainerNetworkClient",
192193
"ContainerPersistence",
193194
"ContainerPlugin",
194195
"ContainerResource",
@@ -291,13 +292,12 @@ let package = Package(
291292
dependencies: [
292293
.product(name: "ArgumentParser", package: "swift-argument-parser"),
293294
.product(name: "Logging", package: "swift-log"),
294-
.product(name: "Containerization", package: "containerization"),
295295
.product(name: "ContainerizationExtras", package: "containerization"),
296-
.product(name: "ContainerizationIO", package: "containerization"),
297296
.product(name: "ContainerizationOS", package: "containerization"),
298297
"ContainerLog",
299-
"ContainerNetworkService",
300-
"ContainerNetworkServiceClient",
298+
"ContainerNetworkClient",
299+
"ContainerNetworkServer",
300+
"ContainerNetworkVmnetServer",
301301
"ContainerPersistence",
302302
"ContainerPlugin",
303303
"ContainerResource",
@@ -308,36 +308,42 @@ let package = Package(
308308
exclude: ["config.toml"]
309309
),
310310
.target(
311-
name: "ContainerNetworkService",
311+
name: "ContainerNetworkClient",
312+
dependencies: [
313+
.product(name: "ContainerizationExtras", package: "containerization"),
314+
"ContainerResource",
315+
"ContainerXPC",
316+
],
317+
path: "Sources/Services/Network/Client"
318+
),
319+
.target(
320+
name: "ContainerNetworkServer",
312321
dependencies: [
313322
.product(name: "Logging", package: "swift-log"),
314-
.product(name: "Containerization", package: "containerization"),
315-
.product(name: "ContainerizationOS", package: "containerization"),
316-
"ContainerNetworkServiceClient",
317-
"ContainerPersistence",
323+
.product(name: "ContainerizationExtras", package: "containerization"),
324+
"ContainerNetworkClient",
318325
"ContainerResource",
319326
"ContainerXPC",
320327
],
321-
path: "Sources/Services/ContainerNetworkService/Server"
328+
path: "Sources/Services/Network/Server"
322329
),
323330
.testTarget(
324-
name: "ContainerNetworkServiceTests",
331+
name: "ContainerNetworkServerTests",
325332
dependencies: [
326-
.product(name: "Containerization", package: "containerization"),
327333
.product(name: "ContainerizationExtras", package: "containerization"),
328-
"ContainerNetworkService",
334+
"ContainerNetworkServer",
329335
]
330336
),
331337
.target(
332-
name: "ContainerNetworkServiceClient",
338+
name: "ContainerNetworkVmnetServer",
333339
dependencies: [
334340
.product(name: "Logging", package: "swift-log"),
335-
.product(name: "Containerization", package: "containerization"),
336-
"ContainerLog",
341+
.product(name: "ContainerizationExtras", package: "containerization"),
342+
"ContainerNetworkServer",
337343
"ContainerResource",
338344
"ContainerXPC",
339345
],
340-
path: "Sources/Services/ContainerNetworkService/Client"
346+
path: "Sources/Services/NetworkVmnet/Server"
341347
),
342348
.target(
343349
name: "ContainerRuntimeLinuxClient",
@@ -373,7 +379,7 @@ let package = Package(
373379
.product(name: "ContainerizationOS", package: "containerization"),
374380
.product(name: "ArgumentParser", package: "swift-argument-parser"),
375381
"ContainerAPIClient",
376-
"ContainerNetworkServiceClient",
382+
"ContainerNetworkClient",
377383
"ContainerOS",
378384
"ContainerPersistence",
379385
"ContainerResource",

Sources/APIServer/APIServer+Start.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import ArgumentParser
1818
import ContainerAPIClient
1919
import ContainerAPIService
2020
import ContainerLog
21-
import ContainerNetworkService
2221
import ContainerPersistence
2322
import ContainerPlugin
2423
import ContainerResource
@@ -81,7 +80,7 @@ extension APIServer {
8180
await containersService.setNetworksService(networkService)
8281
initializeHealthCheckService(log: log, routes: &routes)
8382
try initializeKernelService(log: log, routes: &routes)
84-
let volumesService = try initializeVolumeService(containersService: containersService, log: log, routes: &routes)
83+
let volumesService = try await initializeVolumeService(containersService: containersService, log: log, routes: &routes)
8584
try initializeDiskUsageService(
8685
containersService: containersService,
8786
volumesService: volumesService,
@@ -340,7 +339,7 @@ extension APIServer {
340339
ipv4Subnet: containerSystemConfig.network.subnet,
341340
ipv6Subnet: containerSystemConfig.network.subnetv6,
342341
labels: try .init([ResourceLabelKeys.role: ResourceRoleValues.builtin]),
343-
pluginInfo: NetworkPluginInfo(plugin: "container-network-vmnet")
342+
plugin: "container-network-vmnet"
344343
)
345344
_ = try await service.create(configuration: config)
346345
}
@@ -360,11 +359,11 @@ extension APIServer {
360359
containersService: ContainersService,
361360
log: Logger,
362361
routes: inout [XPCRoute: XPCServer.RouteHandler]
363-
) throws -> VolumesService {
362+
) async throws -> VolumesService {
364363
log.info("initializing volume service")
365364

366365
let resourceRoot = appRoot.appending(FilePath.Component("volumes"))
367-
let service = try VolumesService(resourceRoot: resourceRoot, containersService: containersService, log: log)
366+
let service = try await VolumesService(resourceRoot: resourceRoot, containersService: containersService, log: log)
368367
let harness = VolumesHarness(service: service, log: log)
369368

370369
routes[XPCRoute.volumeCreate] = XPCServer.route(harness.create)

Sources/ContainerCommands/Builder/BuilderStart.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,6 @@ extension Application {
266266
guard let defaultNetwork = try await networkClient.builtin else {
267267
throw ContainerizationError(.invalidState, message: "default network is not present")
268268
}
269-
guard defaultNetwork.status.phase == "running" else {
270-
throw ContainerizationError(.invalidState, message: "default network is not running")
271-
}
272269
config.networks = [
273270
AttachmentConfiguration(network: defaultNetwork.id, options: AttachmentOptions(hostname: Builder.builderContainerId))
274271
]

Sources/ContainerCommands/Container/ContainerInspect.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extension Application {
5050
)
5151
}
5252

53-
try Output.emit(Output.renderJSON(containers.map { PrintableContainer($0) }))
53+
try Output.emit(Output.renderJSON(containers.map { PrintableContainer($0) }, options: .pretty))
5454
}
5555
}
5656
}

Sources/ContainerCommands/Container/ContainerKill.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,10 @@ extension Application {
6161
containers = containerIds
6262
}
6363

64-
let signalNumber = try Signal(signal).rawValue
65-
6664
var errors: [any Error] = []
6765
for container in containers {
6866
do {
69-
try await client.kill(id: container, signal: signalNumber)
67+
try await client.kill(id: container, signal: signal)
7068
print(container)
7169
} catch {
7270
errors.append(error)

Sources/ContainerCommands/Image/ImageInspect.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extension Application {
5050
)
5151
}
5252

53-
var printable: [ImageDetail] = []
53+
var printable: [ImageResource] = []
5454
for image in result.images {
5555
guard
5656
!Utility.isInfraImage(
@@ -59,10 +59,11 @@ extension Application {
5959
initImage: containerSystemConfig.vminit.image
6060
)
6161
else { continue }
62-
printable.append(try await image.details())
62+
let resolved = try await image.resolvedManifests()
63+
printable.append(ImageResource(config: image.description, index: resolved.index, manifests: resolved.manifests))
6364
}
6465

65-
try Output.emit(Output.renderJSON(printable))
66+
try Output.emit(Output.renderJSON(printable, options: .pretty))
6667
}
6768
}
6869
}

0 commit comments

Comments
 (0)