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

Use docker environment to build the actors reproducibly #865

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ target
*.wasm
.idea/
**/.DS_Store
output/builtin-actors.car
output/*
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM rust:1.63.0-buster

# Install dependencies
RUN apt-get update && apt-get install --no-install-recommends -y build-essential clang

WORKDIR /usr/src/builtin-actors

COPY . .

# Grab the correct toolchain
RUN make deps-build

ENTRYPOINT ["/bin/bash", "-c"]
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +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 -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

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-builder
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 -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 -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 -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 -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 -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.
Expand Down