Skip to content

Commit 8b42fec

Browse files
committed
Upgrade to GRPC V2
No real notable API changes. The largest change code wise is in Vminitd. The connection loop is setup immediately in the new API by calling runConnections() on the client, and this blocks until either the task it's running on is cancelled or beginGracefulShutdown is called. Because of this, either we'd have to modify our API to have VirtualMachineAgent implementations call some run() method, or we just put runConnections in an internal task on Vminitd. I went for the latter approach as it's simpler.
1 parent ce0963f commit 8b42fec

12 files changed

Lines changed: 6760 additions & 3476 deletions

Package.resolved

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

Package.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ let package = Package(
4040
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.3.0"),
4141
.package(url: "https://github.com/apple/swift-collections.git", from: "1.1.4"),
4242
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"),
43+
.package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.1.0"),
44+
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.2.0"),
45+
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"),
4346
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.26.0"),
44-
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.29.0"),
47+
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.32.0"),
4548
.package(url: "https://github.com/apple/swift-nio.git", from: "2.80.0"),
4649
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.20.1"),
4750
.package(url: "https://github.com/apple/swift-system.git", from: "1.4.0"),
@@ -56,8 +59,10 @@ let package = Package(
5659
name: "Containerization",
5760
dependencies: [
5861
.product(name: "Logging", package: "swift-log"),
59-
.product(name: "GRPC", package: "grpc-swift"),
6062
.product(name: "SystemPackage", package: "swift-system"),
63+
.product(name: "GRPCCore", package: "grpc-swift-2"),
64+
.product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"),
65+
.product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"),
6166
.product(name: "_NIOFileSystem", package: "swift-nio"),
6267
"ContainerizationOCI",
6368
"ContainerizationOS",

Protobuf.Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ $(PROTOC):
3333
.PHONY: protoc-gen-swift
3434
protoc-gen-swift:
3535
@$(SWIFT) build --product protoc-gen-swift
36-
@$(SWIFT) build --product protoc-gen-grpc-swift
36+
@$(SWIFT) build --product protoc-gen-grpc-swift-2
3737

3838
.PHONY: protos
3939
protos: $(PROTOC) protoc-gen-swift
4040
@echo Generating protocol buffers source code...
4141
@$(PROTOC) Sources/Containerization/SandboxContext/SandboxContext.proto \
42-
--plugin=protoc-gen-grpc-swift=$(BUILD_BIN_DIR)/protoc-gen-grpc-swift \
42+
--plugin=protoc-gen-grpc-swift=$(BUILD_BIN_DIR)/protoc-gen-grpc-swift-2 \
4343
--plugin=protoc-gen-swift=$(BUILD_BIN_DIR)/protoc-gen-swift \
4444
--proto_path=Sources/Containerization/SandboxContext \
4545
--grpc-swift_out="Sources/Containerization/SandboxContext" \

0 commit comments

Comments
 (0)