Skip to content

Commit

Permalink
Updated containerd1.7; google.golang.org/protobuf (microsoft#1706)
Browse files Browse the repository at this point in the history
* Update containerd1.7; google.golang.org/protobuf

Update to containerd 1.7 and move to `google.golang.org/protobuf`
from `github.com/gogo/protobuf/gogoproto`.

These two changes are intertwined, since containerd 1.7 changes its
ttrpc task server definitions and protobuff generation (as well as some
other API changes).
Additionally, the task server gRPC code is imported from containerd
directly, rather than being generated here, and that code now explicitly
imports `google.golang.org/protobuf` instead of
`github.com/gogo/protobuf/gogoproto`.
Upgrading to `google.golang.org/protobuf` also requires updating
the `containerd/cgroups` dependency to v3
(`github.com/containerd/cgroups/v3/cgroup1/stats/`).

The new `protoc-gen-go-grpc` generators do not allow directives such as
`gogoproto.customname`, so the `go-fix-acronym` command is used to
update acronym customization (which is what containerd does).

Updated `Protobuild.toml` to specify new generators.

Added an `Update-Proto.ps1` script to re-generate protobuf files locally
and in GitHub CI.

Add `protobuild` and protobuff `grpc` and `ttrpc` generators to
`tools.go` so they are tracked and vendored, and can be trivially
installed via `go install`.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>

* Vendor protobuf import changes

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>

---------

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
  • Loading branch information
helsaawy authored Jul 10, 2023
1 parent eff4d9c commit d8fedfb
Show file tree
Hide file tree
Showing 24 changed files with 5,129 additions and 15,223 deletions.
3,176 changes: 712 additions & 2,464 deletions computeagent/computeagent.pb.go

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions computeagent/computeagent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ syntax = "proto3";

option go_package = "github.com/Microsoft/hcsshim/internal/computeagent;computeagent";

import weak "gogoproto/gogo.proto";
import "google/protobuf/any.proto";

service ComputeAgent{
Expand All @@ -17,7 +16,7 @@ message AssignPCIInternalRequest {
string container_id = 1;
string device_id = 2;
uint32 virtual_function_index = 3;
string nic_id = 4;
string nic_id = 4;
}

message AssignPCIInternalResponse {
Expand Down Expand Up @@ -58,6 +57,6 @@ message DeleteNICInternalResponse {}

message IovSettings {
uint32 IovOffloadWeight = 1;
uint32 QueuePairsRequested = 2;
uint32 QueuePairsRequested = 2;
uint32 InterruptModeration = 3;
}
108 changes: 108 additions & 0 deletions computeagent/computeagent_ttrpc.pb.go

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

2 changes: 1 addition & 1 deletion computeagent/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
// used for ncproxy.
package computeagent

//go:generate go run github.com/golang/mock/mockgen -source=computeagent.pb.go -package=computeagent_mock -destination=mock\computeagent_mock.pb.go
//go:generate go run github.com/golang/mock/mockgen -source=computeagent_ttrpc.pb.go -package=computeagent_mock -destination=mock\computeagent_mock.pb.go
42 changes: 21 additions & 21 deletions computeagent/mock/computeagent_mock.pb.go

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

Loading

0 comments on commit d8fedfb

Please sign in to comment.