From 54fa46290833ae7bc1fd583c2c680a3794bcd946 Mon Sep 17 00:00:00 2001 From: David Himmelstrup Date: Tue, 23 Aug 2022 14:25:13 +0200 Subject: [PATCH 1/8] Basic docker build environment. --- Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..92ce41865 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM rust:1-buster AS build-env + +# Install dependencies +RUN apt-get update && apt-get install --no-install-recommends -y build-essential clang + +WORKDIR /usr/src/builtin-actors + +# Grab the correct toolchain +RUN rustup toolchain install nightly && rustup target add wasm32-unknown-unknown + +ENTRYPOINT ["/bin/bash"] From 730a3ec5d9f80a425e69850377b553840239f924 Mon Sep 17 00:00:00 2001 From: David Himmelstrup Date: Tue, 23 Aug 2022 16:07:26 +0200 Subject: [PATCH 2/8] Dockerfile: Run scripts by default. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 92ce41865..a29cca324 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ WORKDIR /usr/src/builtin-actors # Grab the correct toolchain RUN rustup toolchain install nightly && rustup target add wasm32-unknown-unknown -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/bin/bash", "-c"] From 19ccb5743bb8e5cbfa9b084430aa16ba6ef8b55a Mon Sep 17 00:00:00 2001 From: David Himmelstrup Date: Tue, 23 Aug 2022 16:15:50 +0200 Subject: [PATCH 3/8] Add makefile rule for dockerized build. --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index db5a24dee..a7daa4c5b 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,9 @@ all-bundles: bundle-mainnet bundle-caterpillarnet bundle-butterflynet bundle-cal bundle-mainnet: deps-build BUILD_FIL_NETWORK=mainnet cargo run -- -o output/builtin-actors-mainnet.car +bundle-mainnet-repro: + docker run --rm -it -v `pwd`:/usr/src/builtin-actors -v `pwd`/output:/usr/src/builtin-actors/output:rshared builtin-actors "make bundle-mainnet" + bundle-caterpillarnet: deps-build BUILD_FIL_NETWORK=caterpillarnet cargo run -- -o output/builtin-actors-caterpillarnet.car From c9dc7e72122919bb58d3e210c6ccc1f7223818fd Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Mon, 21 Nov 2022 17:31:25 +0000 Subject: [PATCH 4/8] Tweak Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a29cca324..af129f697 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1-buster AS build-env +FROM rust:1.63.0-buster # Install dependencies RUN apt-get update && apt-get install --no-install-recommends -y build-essential clang @@ -6,6 +6,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y build-essential WORKDIR /usr/src/builtin-actors # Grab the correct toolchain -RUN rustup toolchain install nightly && rustup target add wasm32-unknown-unknown +RUN rustup target add wasm32-unknown-unknown ENTRYPOINT ["/bin/bash", "-c"] From c4a7afe91666e3547c545efec5335b7b62f32be1 Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Tue, 22 Nov 2022 14:04:35 +0000 Subject: [PATCH 5/8] Add make *-repro commands for all networks --- Dockerfile | 4 +++- Makefile | 27 +++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index af129f697..da19b3b9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,9 @@ RUN apt-get update && apt-get install --no-install-recommends -y build-essential WORKDIR /usr/src/builtin-actors +COPY . . + # Grab the correct toolchain -RUN rustup target add wasm32-unknown-unknown +RUN make deps-build ENTRYPOINT ["/bin/bash", "-c"] diff --git a/Makefile b/Makefile index a7daa4c5b..35628b4b0 100644 --- a/Makefile +++ b/Makefile @@ -40,35 +40,58 @@ set-version: check-clean deps-release check publish: cargo workspaces publish --from-git +docker-builder: + docker build . -t builtin-actors-builder + # Create a bundle in a deterministic location bundle: deps-build cargo run -- -o output/builtin-actors.car +bundle-repro: docker-builder + docker run --rm -e BUILD_FIL_NETWORK -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle" + # Create all canonical network bundles all-bundles: bundle-mainnet bundle-caterpillarnet bundle-butterflynet bundle-calibrationnet bundle-devnet bundle-testing bundle-testing +all-bundles-repro: bundle-mainnet-repro bundle-caterpillarnet-repro bundle-butterflynet-repro bundle-calibrationnet-repro bundle-devnet-repro bundle-testing-repro + bundle-mainnet: deps-build BUILD_FIL_NETWORK=mainnet cargo run -- -o output/builtin-actors-mainnet.car -bundle-mainnet-repro: - docker run --rm -it -v `pwd`:/usr/src/builtin-actors -v `pwd`/output:/usr/src/builtin-actors/output:rshared builtin-actors "make bundle-mainnet" +bundle-mainnet-repro: docker-builder + docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-mainnet" bundle-caterpillarnet: deps-build BUILD_FIL_NETWORK=caterpillarnet cargo run -- -o output/builtin-actors-caterpillarnet.car +bundle-caterpillarnet-repro: docker-builder + docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-caterpillarnet" + bundle-butterflynet: deps-build BUILD_FIL_NETWORK=butterflynet cargo run -- -o output/builtin-actors-butterflynet.car +bundle-butterflynet-repro: docker-builder + docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-butterflynet" + bundle-calibrationnet: deps-build BUILD_FIL_NETWORK=calibrationnet cargo run -- -o output/builtin-actors-calibrationnet.car +bundle-calibrationnet-repro: docker-builder + docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-calibrationnet" + bundle-devnet: deps-build BUILD_FIL_NETWORK=devnet cargo run -- -o output/builtin-actors-devnet.car +bundle-devnet-repro: docker-builder + docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-devnet" + bundle-testing: deps-build BUILD_FIL_NETWORK=testing cargo run -- -o output/builtin-actors-testing.car BUILD_FIL_NETWORK=testing-fake-proofs cargo run -- -o output/builtin-actors-testing-fake-proofs.car +bundle-testing-repro: docker-builder + docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-testing" + .PHONY: all-bundles bundle-mainnet bundle-caterpillarnet bundle-butterflynet bundle-calibrationnet bundle-devnet bundle-testing # Check if the working tree is clean. From bf240251b9cac55fe9272282daba425bfa298789 Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Tue, 22 Nov 2022 14:06:23 +0000 Subject: [PATCH 6/8] Switch to reproducible build in github actions --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e36cb97a6..829271268 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: env: BUILD_FIL_NETWORK: ${{ matrix.network }} run: | - cargo run --locked -- -o output/builtin-actors.car + make bundle-repro coverage: runs-on: ubuntu-latest env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 36326fcc7..8c8baa533 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: env: BUILD_FIL_NETWORK: ${{ matrix.network }} run: | - cargo run --locked -- -o output/builtin-actors.car + make bundle-repro - name: Publishing release and uploading bundle to GitHub env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 9dbd579904f2028a77d9fcb781ff830331a4041e Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Tue, 22 Nov 2022 14:17:17 +0000 Subject: [PATCH 7/8] Remove -it from reproducible docker run commands --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 35628b4b0..ed28fea49 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ bundle: deps-build cargo run -- -o output/builtin-actors.car bundle-repro: docker-builder - docker run --rm -e BUILD_FIL_NETWORK -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle" + docker run -e BUILD_FIL_NETWORK --rm -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle" # Create all canonical network bundles all-bundles: bundle-mainnet bundle-caterpillarnet bundle-butterflynet bundle-calibrationnet bundle-devnet bundle-testing bundle-testing @@ -59,38 +59,38 @@ bundle-mainnet: deps-build BUILD_FIL_NETWORK=mainnet cargo run -- -o output/builtin-actors-mainnet.car bundle-mainnet-repro: docker-builder - docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-mainnet" + docker run --rm -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-mainnet" bundle-caterpillarnet: deps-build BUILD_FIL_NETWORK=caterpillarnet cargo run -- -o output/builtin-actors-caterpillarnet.car bundle-caterpillarnet-repro: docker-builder - docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-caterpillarnet" + docker run --rm -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-caterpillarnet" bundle-butterflynet: deps-build BUILD_FIL_NETWORK=butterflynet cargo run -- -o output/builtin-actors-butterflynet.car bundle-butterflynet-repro: docker-builder - docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-butterflynet" + docker run --rm -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-butterflynet" bundle-calibrationnet: deps-build BUILD_FIL_NETWORK=calibrationnet cargo run -- -o output/builtin-actors-calibrationnet.car bundle-calibrationnet-repro: docker-builder - docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-calibrationnet" + docker run --rm -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-calibrationnet" bundle-devnet: deps-build BUILD_FIL_NETWORK=devnet cargo run -- -o output/builtin-actors-devnet.car bundle-devnet-repro: docker-builder - docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-devnet" + docker run --rm -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-devnet" bundle-testing: deps-build BUILD_FIL_NETWORK=testing cargo run -- -o output/builtin-actors-testing.car BUILD_FIL_NETWORK=testing-fake-proofs cargo run -- -o output/builtin-actors-testing-fake-proofs.car bundle-testing-repro: docker-builder - docker run --rm -it -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-testing" + docker run --rm -v `pwd`/output:/usr/src/builtin-actors/output builtin-actors-builder "make bundle-testing" .PHONY: all-bundles bundle-mainnet bundle-caterpillarnet bundle-butterflynet bundle-calibrationnet bundle-devnet bundle-testing From ff5db683e67a0aa43851ac0d00a2b4b061e0b6d9 Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Tue, 22 Nov 2022 14:26:53 +0000 Subject: [PATCH 8/8] git ignore everything in output --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 609dd565a..bc38af81d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ target *.wasm .idea/ **/.DS_Store -output/builtin-actors.car +output/*