Skip to content
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

Merged
merged 2 commits into from Aug 5, 2020
Merged

Conversation

rolinh
Copy link
Member

@rolinh rolinh commented Aug 4, 2020

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 deprecated naming package.") that in turn breaks go.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 of grpc-go which breaks the API.

@rolinh rolinh added release-note/misc This PR makes changes that have no direct user impact. sig/hubble Impacts hubble server or relay labels Aug 4, 2020
@rolinh rolinh requested review from a team as code owners August 4, 2020 13:10
@rolinh rolinh requested a review from a team August 4, 2020 13:10
@rolinh rolinh requested review from a team as code owners August 4, 2020 13:10
@rolinh
Copy link
Member Author

rolinh commented Aug 4, 2020

test-me-please

@coveralls
Copy link

coveralls commented Aug 4, 2020

Coverage Status

Coverage increased (+0.03%) to 36.895% when pulling 421b8ce on pr/rolinh/update-protogen into 9606ff5 on master.

go.mod Show resolved Hide resolved
@rolinh
Copy link
Member Author

rolinh commented Aug 4, 2020

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.

@rolinh rolinh marked this pull request as draft August 4, 2020 15:53
@rolinh rolinh marked this pull request as ready for review August 4, 2020 15:53
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>
@tklauser
Copy link
Member

tklauser commented Aug 5, 2020

test-me-please

@tklauser
Copy link
Member

tklauser commented Aug 5, 2020

retest-net-next

Edit: previous failure https://jenkins.cilium.io/job/Cilium-PR-K8s-1.12-net-next/129/

@tklauser
Copy link
Member

tklauser commented Aug 5, 2020

retest-runtime

Edit: vm provisioning failure https://jenkins.cilium.io/job/Cilium-PR-Runtime-4.9/1457/

@tklauser
Copy link
Member

tklauser commented Aug 5, 2020

retest-gke

@rolinh
Copy link
Member Author

rolinh commented Aug 5, 2020

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Aug 5, 2020
@aanm aanm merged commit f9d33cd into master Aug 5, 2020
@aanm aanm deleted the pr/rolinh/update-protogen branch August 5, 2020 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact. sig/hubble Impacts hubble server or relay
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants