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

Remove google.golang.org/protobuf dependency from model & storage APIs #4917

Merged

Conversation

akagami-harsh
Copy link
Member

@akagami-harsh akagami-harsh commented Nov 3, 2023

Which problem is this PR solving?

Description of the changes

  • using google.golang.org/protobuf in place of github.com/golang/protobuf
  • github.com/golang/protobuf is not completely removed it is still being used as an indirect dependency

How was this change tested?

  • make test

Checklist

Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
@akagami-harsh akagami-harsh requested a review from a team as a code owner November 3, 2023 13:49
Copy link

codecov bot commented Nov 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

see 2 files with indirect coverage changes

📢 Thoughts on this report? Let us know!

@akagami-harsh akagami-harsh marked this pull request as draft November 3, 2023 14:03
@mmorel-35
Copy link
Contributor

mmorel-35 commented Nov 3, 2023

Hi @akagami-harsh ,
You might need to promote Docker-protobuf to use google.golang.org/protobuf first, I created a PR for that jaegertracing/docker-protobuf#28
Maybe @yurishkuro can confirm that process ?

@mmorel-35
Copy link
Contributor

@akagami-harsh ,
Can you update link to jaeger-idl last commit, it uses protoc-gen-go from google.golang.org. Let’s see if that fixes things .

Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
@akagami-harsh
Copy link
Member Author

@akagami-harsh , Can you update link to jaeger-idl last commit,

how can i do that?

@yurishkuro
Copy link
Member

I don't think we need to bump idl sub module because the schemas have not changed. How are you regenerating the types? You need to bump the version of the proto image in the Makefile first.

Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
@akagami-harsh
Copy link
Member Author

How are you regenerating the types?.

As a newcomer to protocol buffers, I've attempted to regenerate it manually using protoc

@yurishkuro
Copy link
Member

please use the make target to generate types, not some manual method

Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
@akagami-harsh
Copy link
Member Author

used make proto to generate types but it was throwing this error

protoc-gen-go: unable to determine Go import path for "storage_test.proto"
Please specify either:
      • a "go_package" option in the .proto source file, or
      • a "M" argument on the command line.

after altering the Makefile and *_test.protos . make proto ran successfully, but github.com/golang/protobuf is still present, can you please review it and give some pointers how can i further fix it

@yurishkuro
Copy link
Member

I see that the old package is still imported in only one file

grep -rn "github.com/golang/protobuf/proto" .
./proto-gen/api_v3/query_service.pb.gw.go:17:	"github.com/golang/protobuf/proto"

And that file is generated by protoc-gen-grpc-gateway plugin, which probably also needs to be updated in our protobuf Docker image

@yurishkuro
Copy link
Member

https://github.com/grpc-ecosystem/grpc-gateway - latest version is 2.18, but our Docker file is using GRPC_GATEWAY_VERSION=1.16.0

@mmorel-35
Copy link
Contributor

Hi @yurishkuro ,
I propose jaegertracing/docker-protobuf#29
I couldn't use 2.18 as it requires Go 1.18 and the image needs Go 1.17 yet.

While consulting grpc-gateway, I saw that they are using buf . Do you know this ? Would it be a good idea to use it instead of docker-protobuf or adapt docker-protobuf to rely on it ?

@yurishkuro
Copy link
Member

Is there an issue with bumping Go version?

Alternatively, can we do a smaller bump of gateway, enough to remove the old dep but not to the latest version?

I don't have enough data about buf. As I mentioned, otlp is using gogo currently.

@mmorel-35
Copy link
Contributor

Taking a more recent version than go 1.17.3 in docker-protobuf will require to upgrade alpine version then it leads to upgrade grpc which is failing then

@yurishkuro
Copy link
Member

but we're on the latest grpc version in the main repo, why would that one fail? Also, how much of a dependency is between alpine and grpc?

@mmorel-35
Copy link
Contributor

mmorel-35 commented Nov 5, 2023

I mean the grpc version in the dockerfile of docker-protobuf.
It is 1.35.0 while there is a 1.59.2 yet.

In dockerfile of docker-protobuf. There is a use of golang:golang:${GO_VERSION}-alpine${ALPINE_VERSION} but not every couple of go and alpine version.
Golang 1.17.3 is the last for alpine 3.13

@yurishkuro
Copy link
Member

I think it's worth trying to upgrade everything.

@yurishkuro
Copy link
Member

yurishkuro commented Nov 5, 2023

We may want to add a dependabot to that repo - although not sure it will work on a shell script with variables

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to merge this, as it's an incremental improvement for the primary code paths.

@yurishkuro yurishkuro marked this pull request as ready for review November 8, 2023 15:58
@yurishkuro yurishkuro changed the title Migrate to google.golang.org/protobuf Remove google.golang.org/protobuf dependency from model & storage APIs Nov 8, 2023
@yurishkuro yurishkuro enabled auto-merge (squash) November 8, 2023 15:59
@yurishkuro yurishkuro merged commit d12476f into jaegertracing:main Nov 8, 2023
35 checks passed
@akagami-harsh akagami-harsh deleted the migrate-to-google-protobuf branch November 26, 2023 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants