-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use docker environment to build the actors reproducibly (#1606)
* Basic docker build environment. * Dockerfile: Run scripts by default. * Add makefile rule for dockerized build. * Tweak Dockerfile * Add make *-repro commands for all networks * Switch to reproducible build in github actions * Remove -it from reproducible docker run commands * git ignore everything in output * Update rust image and specify a index digest. * remove the deps-build target * don't try to install anything else We should try to use the exact image from dockerhub. This means updating rust will require two steps, but that's not a huge deal IMO. * do install the rust toolchain before copying This lets us take advantage of docker layers. * Make a clean checkout of the repo This means it isn't possible to reproducibly build a dirty repo but... nobody wants to do that anyways. It does mean that the reproducible build won't be affected by other files in the tree. * Minor improvements to repro builds with Docker (#1607) * exclude `target` (mine was >40G when I first ran this, not needed for a container build) * extract common variables in Makefile * restore missing `all-bundles` target * make `.PHONY` readable * Chown after the fact instead of adding a user to the container This works with both rootless and root docker/podman modes. Otherwise, when running in rootless mode, the outer user's UID gets mapped to a temporary UID on the outside, leading to permissions issues when writing to the output directory. --------- Co-authored-by: David Himmelstrup <lemmih@gmail.com> Co-authored-by: Ian Davis <jungziege@gmail.com> Co-authored-by: Rod Vagg <rod@vagg.org>
- Loading branch information
1 parent
9b779d0
commit 5aad41b
Showing
7 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
target/ |
This file contains 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 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 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 |
---|---|---|
|
@@ -4,4 +4,4 @@ target | |
.idea/ | ||
.vscode/ | ||
**/.DS_Store | ||
output/*.car | ||
output/* |
This file contains 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,15 @@ | ||
FROM rust:1.81.0-bookworm@sha256:7b7f7ae5e49819e708369d49925360bde2af4f1962842e75a14af17342f08262 | ||
|
||
WORKDIR /usr/src/builtin-actors | ||
|
||
# Install the compiler. Unfortunately, the rust docker container doesn't actually contain the rust | ||
# compiler... | ||
COPY ./rust-toolchain.toml . | ||
RUN rustup show | ||
|
||
# Then checkout a clean copy of the repo. | ||
RUN --mount=type=bind,rw,target=/tmp/repo \ | ||
echo "Building $(git -C /tmp/repo rev-parse HEAD)" && \ | ||
git --git-dir /tmp/repo/.git --work-tree . checkout -f HEAD | ||
|
||
ENTRYPOINT ["./scripts/docker-entrypoint.sh"] |
This file contains 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 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,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -n "$1" ]]; then | ||
SUFFIX="-$1" | ||
else | ||
SUFFIX="" | ||
fi | ||
|
||
make "bundle${SUFFIX}" | ||
install -o "$(stat -c '%u' /output)" -g "$(stat -c '%g' /output)" \ | ||
-m 0644 \ | ||
-t "/output" "output/builtin-actors${SUFFIX}.car" |