Skip to content

Commit

Permalink
try with no cache instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad committed Jul 12, 2024
1 parent 13c98e4 commit 0eaa969
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions barretenberg/Earthfile
Original file line number Diff line number Diff line change
@@ -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 ./*
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/ts/Earthfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion boxes/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/Earthfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions noir-projects/Earthfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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 && \
Expand Down Expand Up @@ -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
9 changes: 6 additions & 3 deletions scripts/earthly-ci
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0eaa969

Please sign in to comment.