Build CLI for arm64 Linux (and Alpine)#1442
Build CLI for arm64 Linux (and Alpine)#1442Steven Gagniere (sgagniere) merged 34 commits intomainfrom
Conversation
…he switch/replace library builds
…o fix an error causing tags to not show up)
|
https://confluentinc.atlassian.net/wiki/spaces/Foundations/pages/2610299218/How+to+Build+the+CLI+with+confluent-kafka-go+for+All+Platforms |
aa2173b to
04a1abc
Compare
0de2fd3 to
b362f61
Compare
8b5ceec to
388cc9d
Compare
…repeated os/arch combinations
388cc9d to
2acc431
Compare
…ne to upload the checksum file to gh release
This reverts commit 9969c7a.
Co-authored-by: Brian Strauch <bstrauch@confluent.io>
|
Do these changes still make the release significantly slower? If yes, about how much? |
Nope. Aside from the unavoidable slowness of having to upload and release 2 additional binaries, compiling linux glibc arm64 version is now down to about the same time as the rest (so anywhere from a few seconds to a minute depending on your luck), down from 12+ minutes in the last iteration. |
| main: cmd/confluent/main.go | ||
| flags: | ||
| - -mod=readonly | ||
| - -mod=vendor |
There was a problem hiding this comment.
Do you mind explaining why this was changed?
There was a problem hiding this comment.
Originally I did this because I had issues getting my github credentials to work on the arm64 image, but I went back and updated this amd64 file too because it feels slightly cleaner.
This way, we download all the dependencies before we copy into the image instead of downloading them in the image, and that way we don't need to copy our netrc into the cli directory and into the image.
… the local image and try to pull if the local image doesn't match your architecture
Checklist
What
Modified the build and release scripts + makefiles to support Linux (using glibc) and Alpine (using musl libc) arm64 versions.
GOOS=linux GOARCH=arm64 make cross-build.brew install filosottile/musl-cross/musl-cross --with-aarch64(orreinstallif you've already installed the non-aarch64 version; this command installs both)v1.9.3-RC3ofconfluent-kafka-goalready contains all library files that we need, the make targetsswitch-librdkafka-arm64andrestore-librdkafka-amd64have been removed.References
https://confluentinc.atlassian.net/browse/INIT-1251
Test & Review
makeGOARCH=arm64 make cross-buildGOOS=linux make cross-buildGOOS=linux GOARCH=arm64 make cross-buildGOOS=windows make cross-buildbuild_linux_glibc.shscript.confluent kafka topic produceandconfluent kafka topic consumecommands in CentOS and Alpine arm64 image to test the new supported versions.