New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update protobuf and gRPC related dependencies #12767
Conversation
test-me-please |
All CI tests passed but somehow the GA tests didn't trigger. I'll mark this PR as draft and back to see if that works (I can't trigger them manually). EDIT: OK this didn't work. I'll try pushing something. |
This update requires non-trivial changes to the way we generate files from `proto` definitions: - Replace `github.com/golang/protobuf/protoc-gen-go` with `google.golang.org/grpc/cmd/protoc-gen-go-grpc`. The former is deprecated as it is an internal implementation of `protoc-gen-go`. For more information, see [0]. Note that this package is still imported by the following plugin that we use: `github.com/envoyproxy/protoc-gen-validate`. I have bumped the version to the latest one (v0.4.0) but there is no version nor PR yet that update the import path for this one so a warning is still being issued when we generate the files from the `proto` definitions. - All `proto` files now need to specify `option go_package`. - Update the Makefile to use the `paths=source_relative`. This allows removing the `RAW_GO_MAPPINGS` definition and it works fine with the new `go_package` option. Without this change, the files would be generated to a folder named after the `go_package` option relative to the `Makefile` (eg: `./github.com/cilium/cilium/api/v1/flow`). - Use new `go-grpc_out` option with `protoc`. This generates the gRPC realted Go code using the `protoc-gen-go-grpc` plugin. The `go_out` option does not generate gRPC related Go code anymore. [0]: golang/protobuf#1104 (comment) Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Changes from ba6565ff6bf66e200842c7e6ab7112caa845d98a require to re-generate protbuf related files. Note that to register services using the methods generated by `protoc-gen-go-grpc`, the service implementations must embed the corresponding `Unimplemented<ServiceName>Server` for future compatibility. This is a behavior change from the grpc code generator previously included with `protoc-gen-go`. One could optionally restore the old behavior by passing the option `requireUnimplementedServers=false` when generating files but this is not recommended. The 3 structs which implement the observer and peer services now embed the respective `Unimplemented<ServiceName>Server` structs. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
41ef486
to
421b8ce
Compare
test-me-please |
retest-net-next Edit: previous failure https://jenkins.cilium.io/job/Cilium-PR-K8s-1.12-net-next/129/ |
retest-runtime Edit: vm provisioning failure https://jenkins.cilium.io/job/Cilium-PR-Runtime-4.9/1457/ |
retest-gke |
retest-runtime |
See commits for details.
Note: I wanted to bump
grpc-go
to v1.31.0 but I can't due to a breaking change introduced in v1.30.0 ("Remove the deprecatednaming
package.") that in turn breaksgo.etcd.io/etcd
(see etcd-io/etcd#12124 for details).There's a PR opened for etcd to upgrade
grpc-go
(etcd-io/etcd#12155) but it's stalled due to other breaking changes introduced in a minor version ofgrpc-go
which breaks the API.