-
Notifications
You must be signed in to change notification settings - Fork 867
feat: Add docker reproducible builds #6799
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
base: unstable
Are you sure you want to change the base?
Conversation
This is fantastic, thank you! We have an open issue for repro builds here that we can close once this PR is merged: To get the merge train rolling can you please:
Thanks! |
Hey @michaelsproul, thanks for the quick response! |
No worries, thanks! I'll do some testing and we can merge this soon! |
I have adjusted the dockerfile to support both architectures (x86_64 and aarch64) and verified the reproducible build for both targets. |
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.
I have tested this on x86_64 machines and it works, producing the same sha256sum
hash on the Lighthouse binary. A make build-reproducible-x86_64
, followed by extracting the binary file, and sha256sum
on the binary file will result it:
a5838aebbe5ceaf2a9202c50c433f0c8d615551c32927de71d6df9a29eb76a5f lighthouse
A rebuilding gives the same hash.
A minor comment as below
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.
LGTM. We can include this in our v7.0.0 release.
Will flashbots handle reproducible builds/releases?
I got a segfault building the aarch64 image on x86_64. I guess that's expected? The build is intended to run on aarch64 I'm guessing? |
I tried building it directly on a native arm machine because on x86_64 it took more than 16hours and didn't finish. So I had to terminate the build manually and re-run it again on an Azure native Arm VM. |
Optimally, there would be a github action in your release.yaml workflow that on each tag release, it generates a reproducibly built container and pushes it to a public registry like ghcr or dockerhub. |
All required checks have passed and there are no merge conflicts. This pull request may now be ready for another review. |
Hi @MoeMahhouk, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time. |
Issue Addressed
Which issue # does this PR address?
This PR addresses reproducible builds. The current dockerfile builds the lighthouse binary but not reproducibly.
You can verify that by following these steps:
You will notice that each one of the binaries has a different checksum upon each build. This is critical for systems that depends on requiring reproducible builds, such as running lighthouse in confidential computing, like Intel TDX.
Proposed Changes
This PR adds a new build profile as well as a Dockerfile.reproducible that enables building the lighthouse binary reproducibly.
By following the steps I listed above, you will be able to verify that the resulted binary has the same hash upon several subsequent builds for the same version.
How to test it:
Additional Info
We at Flashbots are using Lighthouse as CL client in our BuilderNet TDX image and I am currently working on a containerized approach which would require the container image to be reproducibly buildable for verification purposes.
This would facilitate a way to make it work. I would also appreciate it, if you could extend CI pipeline with a new target that generates a reproducible image on each release if that's ok.
Thanks a lot and I'm looking forward for your feedback