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

chore: upgrade protoc used in CI #7935

Merged
merged 5 commits into from
Apr 23, 2024
Merged

chore: upgrade protoc used in CI #7935

merged 5 commits into from
Apr 23, 2024

Conversation

hamidzr
Copy link
Member

@hamidzr hamidzr commented Sep 19, 2023

Description

protoc was upgraded a while back and the new version is not compatible with the old.
make -C proto check started fails locally when using the new version. This updates CI to use a newer version (24)
https://github.com/protocolbuffers/protobuf/releases

Test Plan

hbp ➜ d/determined git:(upgrade-protoc) ✗ make -C proto dep_check
make: Entering directory '/Users/hmd/projects/da/determined/proto'
echo "libprotoc 3.24.54" | tee /dev/stderr | \
	perl -ne '(/libprotoc (?:3?\.)?(\d+)/ && $1>=24) || \
		(print("Please install protoc version >= 24\n") && exit 1)'
libprotoc 3.24.54
make: Leaving directory '/Users/hmd/projects/da/determined/proto'
hbp ➜ d/determined git:(upgrade-protoc) ✗ make -C proto dep_check
make: Entering directory '/Users/hmd/projects/da/determined/proto'
echo "libprotoc 3.23.54" | tee /dev/stderr | \
	perl -ne '(/libprotoc (?:3?\.)?(\d+)/ && $1>=24) || \
		(print("Please install protoc version >= 24\n") && exit 1)'
libprotoc 3.23.54
Please install protoc version >= 24
make: *** [Makefile:37: dep_check] Error 1
make: Leaving directory '/Users/hmd/projects/da/determined/proto'
hbp ➜ d/determined git:(upgrade-protoc) ✗ make -C proto dep_check
make: Entering directory '/Users/hmd/projects/da/determined/proto'
echo "libprotoc 23.54" | tee /dev/stderr | \
	perl -ne '(/libprotoc (?:3?\.)?(\d+)/ && $1>=24) || \
		(print("Please install protoc version >= 24\n") && exit 1)'
libprotoc 23.54
Please install protoc version >= 24
make: *** [Makefile:37: dep_check] Error 1
make: Leaving directory '/Users/hmd/projects/da/determined/proto'
hbp ➜ d/determined git:(upgrade-protoc) ✗ make -C proto dep_check
make: Entering directory '/Users/hmd/projects/da/determined/proto'
echo "libprotoc 24.54" | tee /dev/stderr | \
	perl -ne '(/libprotoc (?:3?\.)?(\d+)/ && $1>=24) || \
		(print("Please install protoc version >= 24\n") && exit 1)'
libprotoc 24.54
make: Leaving directory '/Users/hmd/projects/da/determined/proto'
hbp ➜ d/determined git:(upgrade-protoc) ✗

Commentary (optional)

https://hpe-aiatscale.slack.com/archives/C02PV33GSN5/p1712089871140569

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

Ticket

@cla-bot cla-bot bot added the cla-signed label Sep 19, 2023
@netlify
Copy link

netlify bot commented Sep 19, 2023

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit aaae2e1
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/6627c0d15df456000889fb12
😎 Deploy Preview https://deploy-preview-7935--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dzhu
Copy link
Contributor

dzhu commented Nov 27, 2023

Will this require everyone to upgrade their local version?

@hamidzr
Copy link
Member Author

hamidzr commented Nov 28, 2023

Will this require everyone to upgrade their local version?

yes. We had a talk about this in the backend team around when it's okay to require dependency upgrades and the consensus was that as long as it's communicated we're good with it and we didn't go into more details. What do you think

Copy link
Contributor

@dzhu dzhu left a comment

Choose a reason for hiding this comment

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

Sure, just checking that it was considered at some point.

@hamidzr hamidzr enabled auto-merge (squash) December 4, 2023 19:34
@hamidzr hamidzr disabled auto-merge December 4, 2023 19:35
@hamidzr
Copy link
Member Author

hamidzr commented Dec 4, 2023

I want to update

- protobuf-compiler (>= 3.15)
but I haven't been able to pin down which specific version introduces the material change.

@hamidzr
Copy link
Member Author

hamidzr commented Apr 2, 2024

@varlogtim had set a cutoff here at >v22 so maybe we could expand it to that but since we're testing 24.3 with the ci and it's been out for a while let's just go for that?
https://github.com/protocolbuffers/protobuf/releases/tag/v24.3

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.70%. Comparing base (9f6bbc9) to head (aaae2e1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7935   +/-   ##
=======================================
  Coverage   44.70%   44.70%           
=======================================
  Files        1270     1270           
  Lines      155132   155132           
  Branches     2437     2437           
=======================================
+ Hits        69351    69352    +1     
+ Misses      85545    85544    -1     
  Partials      236      236           
Flag Coverage Δ
backend 41.57% <ø> (+<0.01%) ⬆️
harness 64.31% <ø> (ø)
web 35.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

proto/Makefile Outdated
@@ -35,8 +35,8 @@ get-deps:

build/proto.stamp: $(source_files)
protoc --version | tee /dev/stderr | \
perl -ne '(/libprotoc (?:3?\.)?(\d+)\.(?:\d+)/ && $$1>=15 && $$1<22) || \
(print("Please install protoc where version >= 3.15 and < 3.22\n") && exit 1)'
perl -ne '(/libprotoc (?:24\.)?(\d+)\.(\d+)/ && $$1>=24 && ($$1>24 || $$2>=3)) || \
Copy link
Contributor

@erikwilson erikwilson Apr 2, 2024

Choose a reason for hiding this comment

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

It looks like this regex change may not be doing what is intended. At some point protoc dropped the major version from the version number (altho v3 tags are still being created). The ?: part of the regex indicates a non-capturing* group, so the major part should not change it is just the minor and patch versions being assigned to $1 and $2. The max minor version check was dropped, does protobuf v26 also work here? edit: It also seems like we should not care about checking the patch version.

Copy link
Contributor

Choose a reason for hiding this comment

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

More info on the versioning change:
https://protobuf.dev/news/2022-05-06/, basically the major version is reserved for language specific api updates, but previously protoc would report the major version as 3. It should probably stay as 3 or >=3.

We should also make sure whatever minor version is easily installable for devs. Right now we can brew install protobuf@21, and brew install protobuf currently installs v26.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm thinking to leave it a >21 to keep it simple and the min version similar to ci?

Copy link
Contributor

Choose a reason for hiding this comment

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

personally I would prefer stability to running the latest thing, unless there is a particular reason we need to upgrade. eventually something will be mismatched between versions, causing breaking CI issues again.

Copy link
Member Author

Choose a reason for hiding this comment

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

made sure we keep allowing > 3.24.x

@hamidzr hamidzr force-pushed the upgrade-protoc branch 2 times, most recently from 076654f to e3dc47b Compare April 16, 2024 17:20
@hamidzr
Copy link
Member Author

hamidzr commented Apr 16, 2024

makes sense to wait for the unforking to happen before landing this

@hamidzr hamidzr merged commit 26c1940 into main Apr 23, 2024
86 of 98 checks passed
@hamidzr hamidzr deleted the upgrade-protoc branch April 23, 2024 15:06
hamidzr added a commit that referenced this pull request Apr 24, 2024
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.

4 participants