-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: build mirrorbits
with Golang 1.23.0
in the image to get an arm64 binary
#18
feat: build mirrorbits
with Golang 1.23.0
in the image to get an arm64 binary
#18
Conversation
cb184cf
to
47b1d78
Compare
mirrorbits
in the image to get an arm64 binarymirrorbits
in the image to get an arm64 binary
mirrorbits
in the image to get an arm64 binarymirrorbits
in the image to get an arm64 binary
47b1d78
to
15a85d0
Compare
…ored deps + Go 1.23.0 + multi-stage fixes Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
15a85d0
to
a343ef6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the mirrorbits diff between v0.5.1 tag and the reference used in ths PR:
- The missing Go code generated by protoc has been added by etix
- The dependencies have been vendored (instead of requiring to run
govendor
) - Go modules support has been added (giving Go >= 1.11 compatibility)
- No Golang or RPC proto definition changes
mirrorbits
in the image to get an arm64 binarymirrorbits
in the image to get an arm64 binary
mirrorbits
in the image to get an arm64 binarymirrorbits
with Golang 1.23.0
in the image to get an arm64 binary
As per @timja review, it makes sense to switch to the Debian package. We initially avoided it as we wanted to stay as close as current production (mirrorbits v0.5.1 binary) as possible. Advantages of using the Debian package:
Let's update the PR |
@timja could we get your advise on the following:
I got mix feelings and not sure which one to select so a 3rd advice is interesting: Golang custom build (with maintenance pain but we can choose our own base image distribution) or Debian package (stick to unstable Debian distribution and more packages than needed)? => Good point from @lemeurherve: let's think about the upcoming official mirrorbits release (cf. etix/mirrorbits#179). We should expect them to provide binaries for both x86 and arm64. That could be an argument for using the Golang build here (instead of Debian package) |
Hmm no great option, ideally would help them finish it off in some way, e.g. send a PR for arm64 support but the project doesn't even have CI (etix/mirrorbits#173) and isn't very responsive. I've sent them feedback on the package here: etix/mirrorbits#150 (comment) I would say go with the golang one for now as there's problems with the package (unless you want to rebuild the package with fixed dependencies) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the arguments exposed above, let's go for the "custom golang build" then.
Cons:
- We have to maintain the build (at least until a new release of
mirrorbits
witharm64
support is done) - We have to manage the dependencies (both build - such as Golang version- and runtime - packages)
- We do not benefit from the Debian package go deps. security updates
Pros:
- We use the latest Golang version to build it, removing CVEs
- We do not increase the surface attack of the final image with unused packages (such as
redis-server
) - It's easy to change back to a normal mirrorbits binary
A big shoutout to @jlevesy whom helped us on this PR!
The debian package is now fixed to not require redis anymore: in case you're interested in switching to it to simplify the build |
This PR fixes the arm64 image by building
mirrorbits
binary with the correct architecture as a workaround to the absence of arm64 binary release in https://github.com/etix/mirrorbits.I wouldn't mind if this PR is refused as it's a bit convoluted, and not without potential flaws.
That would mean give up on
mirrorbits
migration to arm64 (not a big deal).Testing done
Follow-up of #17
Related to jenkins-infra/helpdesk#3837