diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a01ce9d01a..02ee4253c10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -587,7 +587,7 @@ jobs: concurrency_key: boxes-${{ github.event.pull_request.user.login || github.actor }}-build - name: Build working-directory: ./boxes - timeout-minutes: 20 + timeout-minutes: 40 run: earthly-ci +export-boxes boxes-test: @@ -609,7 +609,7 @@ jobs: concurrency_key: boxes-${{ github.event.pull_request.user.login || github.actor }}-x86-${{ matrix.box }}-${{ matrix.browser }} - name: Box test working-directory: ./boxes - timeout-minutes: 10 + timeout-minutes: 40 run: earthly-ci -P --no-output +test --box=${{ matrix.box }} --browser=${{ matrix.browser }} --mode=cache protocol-circuits-gates-report: diff --git a/barretenberg/Earthfile b/barretenberg/Earthfile index b10de708342..2c3b9a9a129 100644 --- a/barretenberg/Earthfile +++ b/barretenberg/Earthfile @@ -1,13 +1,13 @@ VERSION 0.8 acir-tests: - FROM ../build-images+build + FROM ../build-images+from-registry WORKDIR /usr/src/barretenberg COPY ./acir_tests . SAVE ARTIFACT ./* sol: - FROM ../build-images+build + FROM ../build-images+from-registry WORKDIR /usr/src/barretenberg COPY ./sol . SAVE ARTIFACT ./* diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index 555b05e9b9b..f340432b505 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -7,7 +7,7 @@ wasmtime: SAVE ARTIFACT /root/.wasmtime/bin/wasmtime source: - FROM ../../build-images+build + FROM ../../build-images+from-registry WORKDIR /usr/src/barretenberg # cpp source COPY --dir src/barretenberg src/CMakeLists.txt src diff --git a/barretenberg/ts/Earthfile b/barretenberg/ts/Earthfile index 3cebf04974c..b18e91f9039 100644 --- a/barretenberg/ts/Earthfile +++ b/barretenberg/ts/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -FROM ../../build-images+build +FROM ../../build-images+from-registry WORKDIR /usr/src/barretenberg/ts-build # minimum files to download yarn packages diff --git a/boxes/Earthfile b/boxes/Earthfile index 928cea77719..0ceeb51ce4d 100644 --- a/boxes/Earthfile +++ b/boxes/Earthfile @@ -7,7 +7,7 @@ deps: # use the build image to build the project so that nargo has access to the same libc # later on, once everything is built and we don't need nargo, copy to a debian based image # that's supported by playwright - FROM ../build-images+build + FROM ../build-images+from-registry # copy the aztec yarn workspace, needed to resolve portal dependencies COPY ../yarn-project+build-dev/usr/src /usr/src diff --git a/l1-contracts/Earthfile b/l1-contracts/Earthfile index 5e1e559be62..9ad5d1000f6 100644 --- a/l1-contracts/Earthfile +++ b/l1-contracts/Earthfile @@ -1,7 +1,7 @@ VERSION 0.8 build: - FROM ../build-images+build + FROM ../build-images+from-registry WORKDIR /usr/src/l1-contracts COPY --dir lib src terraform test *.json *.toml *.sh . #RUN git init && git add . && yarn lint && yarn slither && yarn slither-has-diff diff --git a/noir-projects/Earthfile b/noir-projects/Earthfile index c5a24bd0a85..f1b254c3dfc 100644 --- a/noir-projects/Earthfile +++ b/noir-projects/Earthfile @@ -1,7 +1,7 @@ VERSION 0.8 source: - FROM ../build-images+build + FROM ../build-images+from-registry # Install nargo COPY ../noir/+nargo/nargo /usr/bin/nargo @@ -24,7 +24,7 @@ build-contracts: RUN cd noir-contracts && NARGO=nargo TRANSPILER=avm-transpiler ./bootstrap.sh SAVE ARTIFACT noir-contracts - + build-protocol-circuits: LOCALLY LET bb_source_hash = $(cd .. && git ls-tree -r HEAD | grep 'barretenberg/cpp' | awk '{print $3}' | git hash-object --stdin) @@ -38,10 +38,10 @@ build: FROM +source BUILD +build-contracts BUILD +build-protocol-circuits - + COPY +build-contracts/noir-contracts ./noir-contracts COPY +build-protocol-circuits/noir-protocol-circuits ./noir-protocol-circuits - + SAVE ARTIFACT aztec-nr SAVE ARTIFACT noir-contracts SAVE ARTIFACT noir-protocol-circuits @@ -55,7 +55,7 @@ test: COPY +build/. /usr/src/noir-projects RUN cd /usr/src/noir-projects/noir-protocol-circuits && nargo test --silence-warnings - + RUN cd /usr/src/yarn-project/txe && yarn start & \ # Wait for TXE to initialize sleep 5 && \ @@ -91,5 +91,5 @@ gates-report: ENV BB_BIN /usr/src/barretenberg/cpp/build/bin/bb RUN ./gates_report.sh - + SAVE ARTIFACT ./noir-protocol-circuits/gates_report.json gates_report.json diff --git a/scripts/earthly-ci b/scripts/earthly-ci index 21acafe80db..77ec0f0cc5a 100755 --- a/scripts/earthly-ci +++ b/scripts/earthly-ci @@ -34,6 +34,10 @@ function wipe_non_cache_docker_state { } EARTHLY_ARGS="--secret AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-} --secret AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-} --secret AZTEC_BOT_COMMENTER_GITHUB_TOKEN=${AZTEC_BOT_GITHUB_TOKEN:-}" +if "$INCONSISTENT_GRAPH_STATE_COUNT" -ge 3 ; then + echo "Trying earthly build with no cache, this will take longer but is very unlikely to not hit the graph edge bug." + export EARTHLY_NO_CACHE=1 +fi # Handle earthly commands and retries while [ $ATTEMPT_COUNT -lt $MAX_ATTEMPTS ]; do @@ -48,11 +52,10 @@ while [ $ATTEMPT_COUNT -lt $MAX_ATTEMPTS ]; do if grep 'failed to get edge: inconsistent graph state' $OUTPUT_FILE >/dev/null || grep 'failed to get state for index' $OUTPUT_FILE >/dev/null ; then INCONSISTENT_GRAPH_STATE_COUNT=$((INCONSISTENT_GRAPH_STATE_COUNT + 1)) if [ "$INCONSISTENT_GRAPH_STATE_COUNT" -ge 3 ]; then - echo "Unable to recover from 'inconsistent graph state' or 'failed to get state for index'. Trying 'earthly prune' and starting again." - earthly prune + echo "Unable to recover from 'inconsistent graph state' or 'failed to get state for index'. Starting again with no cache." else echo "Got 'inconsistent graph state' or 'failed to get state for index'. Retrying once." - sleep 5 + sleep 20 fi elif grep 'Error: pull ping error: pull ping response' $OUTPUT_FILE >/dev/null; then echo "Got 'Error: pull ping error: pull ping response', intermittent failure when writing out images to docker. If this persists, try 'systemctl restart docker' on the spot instance." diff --git a/yarn-project/Earthfile b/yarn-project/Earthfile index 220f8292c8e..feb74419c30 100644 --- a/yarn-project/Earthfile +++ b/yarn-project/Earthfile @@ -4,7 +4,7 @@ deps: LOCALLY LET packages = $(git ls-files "**/package*.json" package*.json) LET tsconfigs = $(git ls-files "**/tsconfig*.json" tsconfig*.json) - FROM ../build-images+build + FROM ../build-images+from-registry # copy bb, bb-js and noir-packages COPY ../barretenberg/cpp/+preset-release/bin /usr/src/barretenberg/cpp/build/ COPY ../barretenberg/ts/+build/build /usr/src/barretenberg/ts @@ -231,7 +231,7 @@ end-to-end-prod: SAVE ARTIFACT /usr/src /usr/src anvil: - FROM ../build-images+build + FROM ../build-images+from-registry SAVE ARTIFACT /opt/foundry/bin/anvil end-to-end-base: