Skip to content

Commit f8ba57e

Browse files
authored
Revert "Update builder API to use grpc-swift-2. (#1309)" (#1324)
This reverts commit 5090093, restoring the grpc-swift-1 based builder API while preserving build secrets and hidden docker dir support added in a00ec5c. Signed-off-by: Eric Ernst <eric_ernst@apple.com>
1 parent 9fd15f0 commit f8ba57e

15 files changed

+1064
-1431
lines changed

Package.resolved

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

Package.swift

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,16 @@ let package = Package(
4747
.library(name: "TerminalProgress", targets: ["TerminalProgress"]),
4848
],
4949
dependencies: [
50+
.package(url: "https://github.com/Bouke/DNS.git", from: "1.2.0"),
5051
.package(url: "https://github.com/apple/containerization.git", exact: Version(stringLiteral: scVersion)),
5152
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.3.0"),
5253
.package(url: "https://github.com/apple/swift-collections.git", from: "1.2.0"),
5354
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
5455
.package(url: "https://github.com/apple/swift-nio.git", from: "2.80.0"),
55-
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.36.0"),
56-
.package(url: "https://github.com/apple/swift-system.git", from: "1.6.4"),
57-
.package(url: "https://github.com/Bouke/DNS.git", from: "1.2.0"),
58-
.package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.3.0"),
59-
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.4.4"),
60-
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.2.0"),
56+
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.29.0"),
57+
.package(url: "https://github.com/apple/swift-system.git", from: "1.4.0"),
58+
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.26.0"),
59+
.package(url: "https://github.com/orlandos-nl/DNSClient.git", from: "2.4.1"),
6160
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.20.1"),
6261
.package(url: "https://github.com/swiftlang/swift-docc-plugin.git", from: "1.1.0"),
6362
],
@@ -112,14 +111,10 @@ let package = Package(
112111
dependencies: [
113112
.product(name: "Logging", package: "swift-log"),
114113
.product(name: "NIO", package: "swift-nio"),
115-
.product(name: "NIOPosix", package: "swift-nio"),
116114
.product(name: "Containerization", package: "containerization"),
117115
.product(name: "ContainerizationArchive", package: "containerization"),
118116
.product(name: "ContainerizationOCI", package: "containerization"),
119117
.product(name: "ArgumentParser", package: "swift-argument-parser"),
120-
.product(name: "GRPCCore", package: "grpc-swift-2"),
121-
.product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"),
122-
.product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"),
123118
"ContainerAPIClient",
124119
]
125120
),
@@ -138,9 +133,7 @@ let package = Package(
138133
.product(name: "ContainerizationExtras", package: "containerization"),
139134
.product(name: "ContainerizationOS", package: "containerization"),
140135
.product(name: "ContainerizationEXT4", package: "containerization"),
141-
.product(name: "GRPCCore", package: "grpc-swift-2"),
142-
.product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"),
143-
.product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"),
136+
.product(name: "GRPC", package: "grpc-swift"),
144137
.product(name: "Logging", package: "swift-log"),
145138
"ContainerAPIService",
146139
"ContainerAPIClient",
@@ -307,9 +300,7 @@ let package = Package(
307300
dependencies: [
308301
.product(name: "ArgumentParser", package: "swift-argument-parser"),
309302
.product(name: "Logging", package: "swift-log"),
310-
.product(name: "GRPCCore", package: "grpc-swift-2"),
311-
.product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"),
312-
.product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"),
303+
.product(name: "GRPC", package: "grpc-swift"),
313304
.product(name: "Containerization", package: "containerization"),
314305
"ContainerLog",
315306
"ContainerPlugin",
@@ -436,6 +427,7 @@ let package = Package(
436427
dependencies: [
437428
.product(name: "NIOCore", package: "swift-nio"),
438429
.product(name: "NIOPosix", package: "swift-nio"),
430+
.product(name: "DNSClient", package: "DNSClient"),
439431
.product(name: "DNS", package: "DNS"),
440432
.product(name: "Logging", package: "swift-log"),
441433
.product(name: "ContainerizationOS", package: "containerization"),

Protobuf.Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $(PROTOC):
3737
.PHONY: protoc-gen-swift
3838
protoc-gen-swift:
3939
@$(SWIFT) build --product protoc-gen-swift
40-
@$(SWIFT) build --product protoc-gen-grpc-swift-2
40+
@$(SWIFT) build --product protoc-gen-grpc-swift
4141

4242
.PHONY: protos
4343
protos: $(PROTOC) protoc-gen-swift
@@ -47,7 +47,7 @@ protos: $(PROTOC) protoc-gen-swift
4747
cd $(LOCAL_DIR) && git clone --branch $(BUILDER_SHIM_VERSION) --depth 1 $(BUILDER_SHIM_REPO); \
4848
fi
4949
@$(PROTOC) $(LOCAL_DIR)/container-builder-shim/pkg/api/Builder.proto \
50-
--plugin=protoc-gen-grpc-swift=$(BUILD_BIN_DIR)/protoc-gen-grpc-swift-2 \
50+
--plugin=protoc-gen-grpc-swift=$(BUILD_BIN_DIR)/protoc-gen-grpc-swift \
5151
--plugin=protoc-gen-swift=$(BUILD_BIN_DIR)/protoc-gen-swift \
5252
--proto_path=$(LOCAL_DIR)/container-builder-shim/pkg/api \
5353
--grpc-swift_out="Sources/ContainerBuild" \

Sources/ContainerBuild/BuildAPI+Extensions.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ public typealias ClientStream = Com_Apple_Container_Build_V1_ClientStream
2424
public typealias ServerStream = Com_Apple_Container_Build_V1_ServerStream
2525
public typealias ImageTransfer = Com_Apple_Container_Build_V1_ImageTransfer
2626
public typealias BuildTransfer = Com_Apple_Container_Build_V1_BuildTransfer
27+
public typealias BuilderClient = Com_Apple_Container_Build_V1_BuilderNIOClient
28+
public typealias BuilderClientAsync = Com_Apple_Container_Build_V1_BuilderAsyncClient
29+
public typealias BuilderClientProtocol = Com_Apple_Container_Build_V1_BuilderClientProtocol
30+
public typealias BuilderClientAsyncProtocol = Com_Apple_Container_Build_V1_BuilderAsyncClient
2731

2832
extension BuildTransfer {
2933
func stage() -> String? {

Sources/ContainerBuild/BuildFSSync.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import ContainerizationArchive
2020
import ContainerizationOCI
2121
import CryptoKit
2222
import Foundation
23-
import GRPCCore
23+
import GRPC
2424

2525
actor BuildFSSync: BuildPipelineHandler {
2626
let contextDir: URL

Sources/ContainerBuild/BuildImageResolver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import ContainerAPIClient
1818
import Containerization
1919
import ContainerizationOCI
2020
import Foundation
21-
import GRPCCore
21+
import GRPC
2222
import Logging
2323
import TerminalProgress
2424

Sources/ContainerBuild/BuildPipelineHandler.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//===----------------------------------------------------------------------===//
1616

1717
import Foundation
18-
import GRPCCore
18+
import GRPC
1919
import NIO
2020

2121
protocol BuildPipelineHandler: Sendable {
@@ -35,10 +35,10 @@ public actor BuildPipeline {
3535
]
3636
}
3737

38-
public func run<S: AsyncSequence & Sendable>(
38+
public func run(
3939
sender: AsyncStream<ClientStream>.Continuation,
40-
receiver: S
41-
) async throws where S.Element == ServerStream {
40+
receiver: GRPCAsyncResponseStream<ServerStream>
41+
) async throws {
4242
defer { sender.finish() }
4343
try await untilFirstError { group in
4444
for try await packet in receiver {

Sources/ContainerBuild/BuildRemoteContentProxy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Containerization
1919
import ContainerizationArchive
2020
import ContainerizationOCI
2121
import Foundation
22-
import GRPCCore
22+
import GRPC
2323

2424
struct BuildRemoteContentProxy: BuildPipelineHandler {
2525
let local: ContentStore

Sources/ContainerBuild/BuildStdio.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import ContainerizationOS
1818
import Foundation
19-
import GRPCCore
19+
import GRPC
2020
import NIO
2121

2222
actor BuildStdio: BuildPipelineHandler {

0 commit comments

Comments
 (0)