Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Upgrade vminitd API to use grpc-swift-2.
- No real notable API changes. The largest change
  code-wise is in Vminitd. The connection loop is
  set up 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. This change uses
  the latter approach as it's simpler.
- Updated dependencies to pick up latest protobuf
  and grpc-swift-2 fixes.
- ClientBootstrap.withConnectedSocket(fd).wait()
  registers the vsock fd with epoll/kqueue immediately.
  vminitd sends its HTTP/2 SETTINGS frame right away
  upon accepting the connection, so those bytes can
  arrive on the fd — and be read by NIO — before the
  gRPC pipeline is installed. With a bare pipeline,
  NIO has nowhere to send the bytes and discards them.
- Buffer until ClientConnectionHandler is in the
  pipeline so it can process the SETTINGS frame and
  fire .ready, then schedule delivery of the buffered
  data with assumeIsolatedUnsafeUnchecked().execute.

Co-authored-by: Danny Canter <danny_canter@apple.com>
  • Loading branch information
jglogan and dcantah committed Mar 12, 2026
commit 477ea7db778ccb60831e6455dcafe53a3783c0ee
56 changes: 37 additions & 19 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@ let package = Package(
.executable(name: "cctl", targets: ["cctl"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.3.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.10.1"),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.7.0"),
.package(url: "https://github.com/apple/swift-collections.git", from: "1.1.4"),
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"),
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.26.0"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.29.0"),
.package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.3.0"),
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "2.4.4"),
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.2.0"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.36.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.80.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.36.0"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.20.1"),
.package(url: "https://github.com/apple/swift-system.git", from: "1.4.0"),
.package(url: "https://github.com/apple/swift-system.git", from: "1.6.4"),
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.36.0"),
.package(url: "https://github.com/facebook/zstd.git", exact: "1.5.7"),
],
targets: [
Expand All @@ -57,8 +59,10 @@ let package = Package(
name: "Containerization",
dependencies: [
.product(name: "Logging", package: "swift-log"),
.product(name: "GRPC", package: "grpc-swift"),
.product(name: "SystemPackage", package: "swift-system"),
.product(name: "GRPCCore", package: "grpc-swift-2"),
.product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"),
.product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"),
.product(name: "_NIOFileSystem", package: "swift-nio"),
"ContainerizationArchive",
"ContainerizationOCI",
Expand Down
4 changes: 2 additions & 2 deletions Protobuf.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ $(PROTOC):
.PHONY: protoc-gen-swift
protoc-gen-swift:
@$(SWIFT) build --product protoc-gen-swift
@$(SWIFT) build --product protoc-gen-grpc-swift
@$(SWIFT) build --product protoc-gen-grpc-swift-2

.PHONY: protos
protos: $(PROTOC) protoc-gen-swift
@echo Generating protocol buffers source code...
@$(PROTOC) Sources/Containerization/SandboxContext/SandboxContext.proto \
--plugin=protoc-gen-grpc-swift=$(BUILD_BIN_DIR)/protoc-gen-grpc-swift \
--plugin=protoc-gen-grpc-swift=$(BUILD_BIN_DIR)/protoc-gen-grpc-swift-2 \
--plugin=protoc-gen-swift=$(BUILD_BIN_DIR)/protoc-gen-swift \
--proto_path=Sources/Containerization/SandboxContext \
--grpc-swift_out="Sources/Containerization/SandboxContext" \
Expand Down
Loading
Loading