-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Migrate off of gogo/protobuf #4422
Conversation
b518a14
to
f81a7cc
Compare
The fsutil change is in tonistiigi/fsutil#171. |
c5ad2bd
to
2979fbf
Compare
Is there a guarantee that this does not break old-new client-daemon combinations? |
Yes. gogo/protobuf didn't modify the wire protocol. Their changes are primarily around code generators to make it more Go-idiomatic and efficient. I did a similar refactorting for containerd (see containerd/containerd#6564), and it has been released as containerd 1.7.0. We haven't heard any complaints regarding the compatibility. |
2ba5d69
to
f4aa840
Compare
Seeing some test failures; are those expected?
|
No. It should be fixed in the last revision, but the PR is still work-in-progress... |
0dead12
to
d50b3b1
Compare
By fixing all golangci-lint errors, I ended up getting |
ff8e07b
to
d7e32bb
Compare
Signed-off-by: Kazuyoshi Kato <[email protected]>
Signed-off-by: Kazuyoshi Kato <[email protected]>
In google.golang.org/protobuf, an empty message and nil are interchangeable. golang/protobuf#965 Signed-off-by: Kazuyoshi Kato <[email protected]>
Signed-off-by: Kazuyoshi Kato <[email protected]>
google.golang.org/protobuf made all proto structs with a mutex to prevent copies. Signed-off-by: Kazuyoshi Kato <[email protected]>
Signed-off-by: Kazuyoshi Kato <[email protected]>
These serialized binaries can be used to test changes like moby#4422. Signed-off-by: Kazuyoshi Kato <[email protected]>
These serialized binaries can be used to test changes like moby#4422. Signed-off-by: Kazuyoshi Kato <[email protected]>
These serialized binaries can be used to test changes like moby#4422. Signed-off-by: Kazuyoshi Kato <[email protected]>
These serialized binaries can be used to test changes like moby#4422. Signed-off-by: Kazuyoshi Kato <[email protected]>
These serialized binaries can be used to test changes like moby#4422. Signed-off-by: Kazuyoshi Kato <[email protected]>
These serialized binaries can be used to test changes like moby#4422. Signed-off-by: Kazuyoshi Kato <[email protected]>
I think for this we would do micro-benchmarks for marshaling, unmarshal. If we start running containers then this would skew the timing too much. In fsutil there was also a benchmark script that maybe can be used. Maybe LLB marshal and load is a nice candidate. The biggest possible performance issue would be with the session endpoint and the context and build result transfer. This is where 100s of MB can potentially be transferred and encoded/decoded. If session uses gRPC dialer then it also uses protobuf for raw data framing. I believe previously some of these decoding could avoid allocating more memory because the |
Just wondering, coz of the movements in the codebase, we are bound to have a lot of merge conflict as we go. Is possible to split this into some self-contained chunks like perhaps sub-packages and chain the PRs? |
I did a small subset of this change locally and added some benchmarks to some of the solver ops specifically and it seems like the google protobuf will definitely cause a regression.
It seems like there now exists vtprotobuf which I'll do a quick test of to see if that is a feasible alternative. |
Some additional numbers comparing gogo protobuf with vtprotobuf:
Seems pretty easy to integrate so we might just be able to do that. |
I'd favor moving off of gogo rather than introducing another dependency. We can deal with performance issues separately from the move off of gogo. |
Superseded by #5342. |
gogo/protobuf has been deprecated since 2022. This PR uses Google's official code generators instead of gogo's.
Relates to #3119