Skip to content

Commit 2153eed

Browse files
authored
Merge branch 'main' into mazdak/container-compose
2 parents 4ff54ea + 728527b commit 2153eed

File tree

16 files changed

+220
-134
lines changed

16 files changed

+220
-134
lines changed

BUILDING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ Copy the binaries to `/usr/local/bin` and `/usr/local/libexec` (requires enterin
2323
make install
2424
```
2525

26+
Or to install a release build, with better performance than the debug build:
27+
28+
```bash
29+
BUILD_CONFIGURATION=release make all test integration
30+
BUILD_CONFIGURATION=release make install
31+
```
32+
2633
## Compile protobufs
2734

2835
`container` uses gRPC to communicate to the builder virtual machine that creates images from `Dockerfile`s, and depends on specific versions of `grpc-swift` and `swift-protobuf`. If you make changes to the gRPC APIs in the [container-builder-shim](https://github.com/apple/container-builder-shim) project, install the tools and re-generate the gRPC code in this project using:

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ integration: init-block
138138
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLINetwork
139139
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIRunLifecycle
140140
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIExecCommand
141+
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLICreateCommand
141142
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIRunCommand
142143
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIImagesCommand
143144
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIRunBase

Package.resolved

Lines changed: 2 additions & 2 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import PackageDescription
2222

2323
let releaseVersion = ProcessInfo.processInfo.environment["RELEASE_VERSION"] ?? "0.0.0"
2424
let gitCommit = ProcessInfo.processInfo.environment["GIT_COMMIT"] ?? "unspecified"
25-
let scVersion = "0.4.1"
25+
let scVersion = "0.5.0"
2626
let builderShimVersion = "0.6.0"
2727

2828
let package = Package(

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ Contributions to `container` are welcomed and encouraged. Please see our [main c
6464

6565
## Project Status
6666

67-
The container project is currently under active development. Its stability, both for consuming the project as a Swift package and the `container` tool, is only guaranteed within minor versions, such as between 0.1.1 and 0.1.2. Minor version number releases may include breaking changes until we achieve a 1.0.0 release.
67+
The container project is currently under active development. Its stability, both for consuming the project as a Swift package and the `container` tool, is only guaranteed within patch versions, such as between 0.1.1 and 0.1.2. Minor version number releases may include breaking changes until we achieve a 1.0.0 release.

Sources/CLI/Application.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ struct Application: AsyncParsableCommand {
182182
return -1
183183
}
184184

185-
try await process.start(io.stdio)
185+
try await process.start()
186186
defer {
187187
try? io.close()
188188
}

Sources/CLI/Builder/BuilderStart.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,12 @@ extension ClientContainer {
245245
detach: true
246246
)
247247
defer { try? io.close() }
248-
let process = try await bootstrap()
249-
_ = try await process.start(io.stdio)
248+
249+
let process = try await bootstrap(stdio: io.stdio)
250+
_ = try await process.start()
250251
await taskManager?.finish()
251252
try io.closeAfterStart()
253+
252254
log.debug("starting BuildKit and BuildKit-shim")
253255
} catch {
254256
try? await stop()

Sources/CLI/Container/ContainerCreate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extension Application {
2929
@Argument(help: "Image name")
3030
var image: String
3131

32-
@Argument(help: "Container init process arguments")
32+
@Argument(parsing: .captureForPassthrough, help: "Container init process arguments")
3333
var arguments: [String] = []
3434

3535
@OptionGroup

Sources/CLI/Container/ContainerExec.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ extension Application {
8181

8282
let process = try await container.createProcess(
8383
id: UUID().uuidString.lowercased(),
84-
configuration: config)
84+
configuration: config,
85+
stdio: io.stdio
86+
)
8587

8688
exitCode = try await Application.handleProcess(io: io, process: process)
8789
} catch {

Sources/CLI/Container/ContainerStart.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ extension Application {
5151
progress.start()
5252

5353
let container = try await ClientContainer.get(id: containerID)
54-
let process = try await container.bootstrap()
55-
56-
progress.set(description: "Starting init process")
57-
let detach = !self.attach && !self.interactive
5854
do {
55+
let detach = !self.attach && !self.interactive
5956
let io = try ProcessIO.create(
6057
tty: container.configuration.initProcess.terminal,
6158
interactive: self.interactive,
6259
detach: detach
6360
)
61+
62+
let process = try await container.bootstrap(stdio: io.stdio)
6463
progress.finish()
64+
6565
if detach {
66-
try await process.start(io.stdio)
66+
try await process.start()
6767
defer {
6868
try? io.close()
6969
}

0 commit comments

Comments
 (0)