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

build(grpc): update Makefile responsible for code generation #5749

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

lc525
Copy link
Member

@lc525 lc525 commented Jul 11, 2024

Allow protoc and the language-specific plugins to be installed at specific versions locally and then use those versions to generate code.

This means we no longer depend on arbitrary versions installed on the system doing the code generation, making this reproducible.

The installs happen in the apis/tools directory, if the required tools are not found. Python packages are installed in a virtual environment under apis/tools/python

In this first phase, we retain the exact same tool versions that were used to generate the existing protobuf/grpc code. We also apply the licensing headers to those generated files automatically.

Because of a previous mismatch in how those licensing headers were generated, most generated files end up with a minor whitespace difference.

[IMPORTANT]: The kotlin/java codegen for apis/mlops/v2_dataplane/v2_dataplane.proto had not been previously generated using the makefile (it seems it was generated as a one-off). This means the version of the codegen tools used was already mismatched compared to the rest. Consequently, this PR adds this code generation to the Makefile, and re-generates the code files in order to bring everything to a consistent version.

Issue(s) related to this PR:

  • INFRA-1076 - facilitate protobuf/gRPC codegen version updates

Comments for reviewer

  • Most .pb.go and .kt files have one empty line removed after the license header. This makes them consistent with the other files where automatic licensing headers are being applied.
  • Files in apis/mlops/v2_dataplane/kotlin/* are newly re-generated and contain non-whitespace differences

Allow protoc and the language-specific plugins to be installed at specific
versions locally and then use those versions to generate code.

This means we no longer depend on arbitrary versions installed on the
system doing the code generation, making this reproducible.

The installs happen in the apis/tools directory, if the required tools
are not found. Python packages are installed in a virtual environment
under apis/tools/python

In this first phase, we retain the exact same tool versions that were
used to generate the existing protobuf/grpc code. We also apply the
licensing headers to those generated files automatically.

Because of a previous mismatch in how those licensing headers were
generated, all generated files end up with a minor whitespace difference.
@lc525 lc525 requested a review from sakoush as a code owner July 11, 2024 22:41
@lc525 lc525 added the v2 label Jul 11, 2024
@lc525 lc525 changed the title build(pb, grpc): update Makefile responsible for code generation build(grpc): update Makefile responsible for code generation Jul 11, 2024
Copy link
Member

@sakoush sakoush left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for pinning these versions of protos generation, very useful moving forward.

apis/Makefile Outdated Show resolved Hide resolved
apis/Makefile Outdated Show resolved Hide resolved
The re-generation of this code did not happen via the Makefile until now,
so it was already using a different version of the protobuf/grpc codegen
plugins.
Addressing PR review comments
@lc525 lc525 merged commit dadd84a into SeldonIO:v2 Jul 12, 2024
4 checks passed
@lc525 lc525 deleted the INFRA-1076/protobuf-codegen-updates branch July 15, 2024 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants