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

Reproducible/deterministic bundles #2132

Closed
zregvart opened this issue Sep 22, 2023 · 0 comments · Fixed by #2133
Closed

Reproducible/deterministic bundles #2132

zregvart opened this issue Sep 22, 2023 · 0 comments · Fixed by #2133
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@zregvart
Copy link
Contributor

Feature request

Currently if I run tkn bundle push with the same set files I will get two different images (different layer and manifest digests). This is due to the bundle builder setting the time to the current time and because I might specify different ordering when providing the files.
It would be beneficial for caching and provenance to have the option to build the bundle that is reproducible, i.e. deterministic based on the inputs.

I propose adding a command line parameter (e.g. --ctime) to set the created at time and to sort the layers of the manifest based on their digest by default. I think this should lead to reproducible/deterministic bundle builds.

Happy to contribute a pull request for this.

Use case

Some argumentation for reproducible builds can be found on https://reproducible-builds.org/. It would also be useful for caching that the image is unchanged unless the files composing the image have changed.

UI Example

For example if I run:

$ tkn bundle push -f one.yaml -f two.yaml registry.io/repository/bundle:latest --ctime 1970-01-01
$ tkn bundle push -f two.yaml -f one.yaml registry.io/repository/bundle:latest --ctime 1970-01-01

The registry.io/repository/bundle:latest would be unchanged by the second invocation.

@zregvart zregvart added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant