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

Use commit-timestamp in tasks in pursuit of reproducible builds #1268

Open
ralphbean opened this issue Aug 8, 2024 · 1 comment
Open

Use commit-timestamp in tasks in pursuit of reproducible builds #1268

ralphbean opened this issue Aug 8, 2024 · 1 comment

Comments

@ralphbean
Copy link
Member

There are lots of challenges to producing bit-wise reproducible builds. One of them is to get all tools all the way through the build chain to use the same time. See https://reproducible-builds.org/docs/ and in particular https://reproducible-builds.org/docs/source-date-epoch/

  • We should expose commit-timestamp as SOURCE_BUILD_EPOCH in all of our tasks. Not all tools respect that, but it is the standard environment variable that they should respect.
  • Notably, buildah doesn't respect it, but it does accept a --timestamp argument that will help produce the same bits, assuming that nothing inside the containerfile being built is not sensitive to the time.
  • We should also provide a --build-arg SOURCE_BUILD_EPOCH=$SOURCE_BUILD_EPOCH to each buildah build, so that if a containerfile accepts that as an ARG, it can take advantage of that.

Doing these things won't give us all 100% bit-wise reproducible builds, but it will close some gaps in that direction.

@ralphbean ralphbean changed the title Use commit-timestamp in buildah task in pursuit of reproducible builds Use commit-timestamp in tasks in pursuit of reproducible builds Aug 8, 2024
@pierDipi
Copy link
Contributor

pierDipi commented Dec 5, 2024

One issue we noticed that is related to not having reproducible builds is:

We have an operator repository that is aggregating other components images using the custom latest tag which eventually turns into a resolved SHA.

when a pipeline runs on push for any "other components", a task after pushing or apply-tags could fail (for whatever reason), in that case, if we re-run the pipeline, the image revision (and therefore tag) is the same, but the SHA is different which ends up invalidating the "previous SHAs" in the operator repository.

So far, I see only a few solutions:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants