-
Notifications
You must be signed in to change notification settings - Fork 61
docs: how to reproduce released artifacts #3451
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
Merged
+113
−13
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2a68a31
ci: test reproducability with different dependency installation methods
burgerdev e1c2262
nix: mitigate nix store optimisiation
burgerdev dd6a87a
docs: reproducible builds
burgerdev 0c7fbf7
ci: upgrade ubuntu runners for reproducible builds
burgerdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Reproduce released artifacts | ||
|
|
||
| Constellation has first-class support for [reproducible builds](https://reproducible-builds.org). | ||
| Reproducing the released artifacts is an alternative to [signature verification](verify-cli.md) that doesn't require trusting Edgeless Systems' release process. | ||
| The following sections describe how to rebuild an artifact and how Constellation ensures that the rebuild reproduces the artifacts bit-by-bit. | ||
|
|
||
| ## Build environment prerequisites | ||
|
|
||
| The build systems used by Constellation - [Bazel](https://bazel.build/) and [Nix](https://nixos.org) - are designed for deterministic, reproducible builds. | ||
| These two dependencies should be the only prerequisites for a successful build. | ||
| However, it can't be ruled out completely that peculiarities of the host affect the build result. | ||
| Thus, we recommend the following host setup for best results: | ||
|
Check warning on line 12 in docs/docs/workflows/reproducible-builds.md
|
||
|
|
||
| 1. A Linux operating system not older than v5.4. | ||
| 2. The GNU C library not older than v2.31 (avoid `musl`). | ||
| 3. GNU `coreutils` not older than v8.30 (avoid `busybox`). | ||
| 4. An `ext4` filesystem for building. | ||
| 5. AppArmor turned off. | ||
|
|
||
| This is given, for example, on an Ubuntu 22.04 system, which is also used for reproducibility tests. | ||
|
|
||
| :::note | ||
|
|
||
| To avoid any backwards-compatibility issues, the host software versions should also not be much newer than the Constellation release. | ||
|
|
||
| ::: | ||
|
|
||
| ## Run the build | ||
|
|
||
| The following instructions outline qualitatively how to reproduce a build. | ||
| Constellation implements these instructions in the [Reproducible Builds workflow](https://github.com/edgelesssys/constellation/actions/workflows/reproducible-builds.yml), which continuously tests for reproducibility. | ||
| The workflow is a good place to look up specific version numbers and build steps. | ||
|
|
||
| 1. Check out the Constellation repository at the tag corresponding to the release. | ||
|
|
||
| ```bash | ||
| git clone https://github.com/edgelesssys/constellation.git | ||
| cd constellation | ||
| git checkout v2.20.0 | ||
| ``` | ||
|
|
||
| 2. [Install the Bazel release](https://bazel.build/install) specified in `.bazelversion`. | ||
| 3. [Install Nix](https://nixos.org/download/) (any recent version should do). | ||
| 4. Run the build with `bazel build $target` for one of the following targets of interest: | ||
|
|
||
| ```data | ||
| //cli:cli_enterprise_darwin_amd64 | ||
| //cli:cli_enterprise_darwin_arm64 | ||
| //cli:cli_enterprise_linux_amd64 | ||
| //cli:cli_enterprise_linux_arm64 | ||
| //cli:cli_enterprise_windows_amd64 | ||
| ``` | ||
|
|
||
| 5. Compare the build result with the downloaded release artifact. | ||
|
|
||
| <!-- TODO(burgerdev): document reproducing images --> | ||
|
|
||
| ## Feedback | ||
|
|
||
| Reproduction failures often indicate a bug in the build system or in the build definitions. | ||
| Therefore, we're interested in any reproducibility issues you might encounter. | ||
|
Check warning on line 61 in docs/docs/workflows/reproducible-builds.md
|
||
| [Start a bug report](https://github.com/edgelesssys/constellation/issues/new/choose) and describe the details of your build environment. | ||
| Make sure to include your result binary or a [`diffoscope`](https://diffoscope.org/) report, if possible. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.