Skip to content

Commit 9cdd6b3

Browse files
feat(ci): add improved reproducibility verification script (repro-check) (#4501)
### Description Translated the `repro-check.sh` (Bash) into `repro-check` (Python), with some improvements: - All user-facing behavior should remain nearly identical, including the colors, log formatting, etc. - Support for caching of large images and `--clear` flag to delete the cache if necessary. - Support for caching the IC git repo, to reduce the strain on GitHub. - Minimize dependency on system commands, in particular no deps on curl and jq anymore. - Nicer progress bars - More standard UX (e.g. using standard logging framework instead of a custom implementation) --------- Co-authored-by: Manuel Amador <[email protected]>
1 parent f69d744 commit 9cdd6b3

File tree

4 files changed

+948
-12
lines changed

4 files changed

+948
-12
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ go_deps.bzl @dfinity/idx
8080
/ci/ @dfinity/idx
8181
/ci/src/dependencies/ @dfinity/product-security
8282
/ci/src/dependencies/resources/container_scanner_finding_failover_ignore_list_guestos.txt @dfinity/node
83+
/ci/tools/repro-check @dfinity/dre
8384
/.pre-commit-config.yaml @dfinity/idx
8485
/pre-commit/ @dfinity/idx
8586
/.mergify.yaml @dfinity/idx
@@ -300,4 +301,4 @@ Cargo.toml
300301
.gitignore
301302
stackage_snapshot.json
302303
mainnet-canister-revisions.json # this file is auto-approved by github actions, therefore we remove codeowners
303-
mainnet-icos-revisions.json
304+
mainnet-icos-revisions.json # same as above

README.adoc

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,26 +94,53 @@ To build only the binaries and canisters, use the `-b` and/or `-c` flags:
9494

9595
All built artifacts will be located in the top-level artifacts/ directory.
9696

97-
== Verifying releases
97+
== Verifying Releases
9898

99-
Each https://dashboard.internetcomputer.org/releases[release proposal] includes instructions on how to verify the build reproducibility of IC-OS update images.
99+
=== Overview
100100

101-
To verify the build reproducibility of a specific `IC OS Version Election` proposal, you can just copy the one liner below to a fresh Ubuntu VM 22.04 or higher:
101+
The Internet Computer provides a robust system for verifying the build reproducibility of IC-OS update images. Each https://dashboard.internetcomputer.org/releases[release proposal] includes detailed verification instructions.
102102

103-
$ sudo apt-get install -y curl && curl --proto '=https' --tlsv1.2 -sSLO https://raw.githubusercontent.com/dfinity/ic/master/ci/tools/repro-check.sh && chmod +x repro-check.sh && ./repro-check.sh -p <proposal>
103+
=== Prerequisites
104104

105-
If you have the repository already cloned, you can just run:
105+
* Ubuntu 22.04 or higher
106+
* Python 3.x
107+
* curl (`sudo apt install curl`)
108+
* About 100 GB of free disk space in `$HOME` (or another volume, specifed via
109+
option `--cache-dir`)
106110

107-
$ ./ci/tools/repro-check.sh -c <git revision>
111+
=== Quick Start
108112

109-
You can also verify only specific components, by specifying --guestos, --hostos, or --setupos flags:
113+
To verify an IC OS Version Election proposal:
110114

111-
$ ./ci/tools/repro-check.sh -c <git revision> --guestos
115+
[source,bash]
116+
----
117+
# Verify by proposal number
118+
curl -fsSL https://raw.githubusercontent.com/dfinity/ic/master/ci/tools/repro-check | \
119+
python3 - -p <proposal_number>
112120
113-
Verifying build reproducibility of GuestOS is sufficient for the `Revise Elected GuestOS Versions` NNS proposals.
121+
# Verify by git commit
122+
curl -fsSL https://raw.githubusercontent.com/dfinity/ic/master/ci/tools/repro-check | \
123+
python3 - -c <git-commit>
124+
----
114125

115-
For the `Revise Elected HostOS Versions` NNS proposals, you should verify the build reproducibility of HostOS images.
116-
The default behavior of the script is to verify the build reproducibility of all components.
126+
=== Component-Specific Verification
127+
128+
You can verify specific components individually:
129+
130+
[source,bash]
131+
----
132+
# Verify GuestOS only
133+
curl -fsSL https://raw.githubusercontent.com/dfinity/ic/master/ci/tools/repro-check | \
134+
python3 - -c <git-commit> --guestos
135+
136+
# Verify HostOS only
137+
curl -fsSL https://raw.githubusercontent.com/dfinity/ic/master/ci/tools/repro-check | \
138+
python3 - -c <git-commit> --hostos
139+
140+
# Verify SetupOS only
141+
curl -fsSL https://raw.githubusercontent.com/dfinity/ic/master/ci/tools/repro-check | \
142+
python3 - -c <git-commit> --setupos
143+
----
117144

118145
== Contributing
119146

0 commit comments

Comments
 (0)