Skip to content

Commit

Permalink
remote cache. mark flakes
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad committed Apr 16, 2024
1 parent 357b8c4 commit 0d67d71
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 9 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ jobs:
concurrency_key: build-${{ github.actor }}-x86
# prepare images locally, tagged by commit hash
- name: "Build E2E Image"
if: ${{ github.ref_name == 'master' }}
timeout-minutes: 40
run: earthly ./yarn-project+export-end-to-end
run: earthly --remote-cache=AztecProtocol/ci-cache:master --push ./yarn-project+export-end-to-end
- name: "Build E2E Image"
if: ${{ github.ref_name != 'master' }}
timeout-minutes: 40
run: earthly --remote-cache=AztecProtocol/ci-cache:master --push ./yarn-project+export-end-to-end
# We base our e2e list used in e2e-x86 off the targets in ./yarn-project/end-to-end
# (Note ARM uses just 2 tests as a smoketest)
- name: Create list of end-to-end jobs
id: e2e_list
run: echo "list=$(earthly ls ./yarn-project/end-to-end | grep -v '+base' | sed 's/+//' | jq -R . | jq -cs .)" >> $GITHUB_OUTPUT
Expand Down
19 changes: 18 additions & 1 deletion barretenberg/cpp/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,19 @@ preset-release:
FROM +source
RUN cmake --preset clang16 -Bbuild && cmake --build build --target bb
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

preset-release-assert:
FROM +source
RUN cmake --preset clang16 -Bbuild && cmake --build build --target bb
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

preset-debug:
FROM +source
RUN cmake --preset clang16-dbg -Bbuild && cmake --build build --target bb
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

preset-wasm:
ARG TARGETARCH
Expand All @@ -110,8 +113,8 @@ preset-wasm:
RUN cmake --preset wasm -Bbuild && cmake --build build --target barretenberg.wasm
RUN src/wasi-sdk/bin/llvm-strip ./build/bin/barretenberg.wasm
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint
END
SAVE IMAGE --cache-hint

preset-wasm-threads:
FROM +source
Expand All @@ -120,21 +123,25 @@ preset-wasm-threads:
# TODO(https://github.com/AztecProtocol/barretenberg/issues/941) We currently do not strip barretenberg threaded wasm, for stack traces.
# RUN src/wasi-sdk/bin/llvm-strip ./build/bin/barretenberg.wasm
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

preset-gcc:
FROM +source
RUN cmake --preset gcc -Bbuild && cmake --build build
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

preset-fuzzing:
FROM +source
RUN cmake --preset fuzzing -Bbuild && cmake --build build
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

preset-clang-assert:
FROM +source
RUN cmake --preset clang16-assert -Bbuild && cmake --build build --target bb
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

# benchmarking images
# these are either fresh builds just for benching (op-count and op-count-time)
Expand All @@ -143,28 +150,33 @@ preset-op-count-bench:
FROM +source
RUN cmake --preset op-count -DCMAKE_BUILD_TYPE=RelWithAssert -Bbuild && cmake --build build --target ultra_honk_bench --target client_ivc_bench
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

preset-op-count-time-bench:
FROM +source
RUN cmake --preset op-count-time -Bbuild && cmake --build build --target ultra_honk_bench --target client_ivc_bench
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

preset-release-bench:
FROM +preset-release
RUN cmake --build build --target ultra_honk_bench --target client_ivc_bench
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

preset-wasm-bench:
FROM +preset-wasm-threads
RUN cmake --build build --target ultra_honk_bench --target client_ivc_bench
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

# test images
preset-release-assert-test:
FROM +preset-release-assert
# build all targets for tests
RUN cmake --build build
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint

# Sent to the bench runner using a earthly --push +bench-binaries
# then we can run earthly +bench-ultra-honk --bench_mode=cache
Expand All @@ -177,6 +189,10 @@ bench-binaries:
FROM aztecprotocol/bb-bench-binaries:$TARGETARCH-$EARTHLY_GIT_HASH
SAVE ARTIFACT ./*
ELSE
BUILD +preset-op-count-time-bench # activates cache-hint
BUILD +preset-op-count-bench # activates cache-hint
BUILD +preset-release-bench # activates cache-hint
BUILD +preset-wasm-bench # activates cache-hint
FROM scratch
COPY +preset-op-count-time-bench/bin/*_bench op-count-time/bin/
COPY +preset-op-count-bench/bin/*_bench op-count/bin/
Expand Down Expand Up @@ -237,6 +253,7 @@ test-clang-format:
test:
ARG hardware_concurrency=""
BUILD +test-clang-format
BUILD +test-binaries # for cache-hint
BUILD ./srs_db/+build # prefetch
FROM +source
COPY --dir +test-binaries/build build
Expand Down
2 changes: 1 addition & 1 deletion noir/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nargo:
RUN echo CONTENT HASH $COMMIT_HASH | tee .content-hash
SAVE ARTIFACT /usr/src/noir-repo/target/release/nargo nargo
SAVE ARTIFACT /usr/src/noir-repo/target/release/acvm acvm
SAVE IMAGE aztecprotocol/nargo
SAVE IMAGE --cache-hint aztecprotocol/nargo

packages:
BUILD ../barretenberg/ts/+build # prefetch
Expand Down
15 changes: 10 additions & 5 deletions yarn-project/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
VERSION 0.8

deps:
# Prefetch targets to not wait for +deps, and activate --cache-hint's (only done through BUILD).
BUILD ../barretenberg/ts/+build
BUILD ../noir/+packages/packages
LOCALLY
LET packages = $(git ls-files "**/package*.json" package*.json)
LET tsconfigs = $(git ls-files "**/tsconfig*.json" tsconfig*.json)
Expand Down Expand Up @@ -29,7 +32,7 @@ deps:
RUN ln -s /usr/src/yarn-project/node_modules /usr/src/node_modules

build:
# Prefetch targets to not wait for +deps.
# Prefetch targets to not wait for +deps, and activate --cache-hint's (only done through BUILD).
BUILD ../barretenberg/cpp/+preset-release
BUILD ../noir/+nargo
BUILD ../noir-projects/+build
Expand Down Expand Up @@ -72,6 +75,8 @@ end-to-end-prod:
SAVE ARTIFACT /usr/src /usr/src

end-to-end:
# BUILD activates --cache-hint
BUILD ../foundry/+build
FROM node:18.19.1-slim
RUN apt-get update && apt-get install jq chromium netcat-openbsd -y
ENV CHROME_BIN="/usr/bin/chromium"
Expand All @@ -87,14 +92,14 @@ all:

# for use with yarn-project/end-to-end and its e2e_mode=cache option
export-end-to-end:
# Prefetch targets to build in parallel.
# Prefetch targets to build in parallel and activate --cache-hint.
BUILD +end-to-end
BUILD +aztec
ARG EARTHLY_GIT_HASH
# pushes the foundry image to local docker images
FROM ../foundry/+build
SAVE IMAGE aztecprotocol/foundry-nightly-de33b6af53005037b463318d2628b5cfcaf3991:latest
SAVE IMAGE --cache-hint aztecprotocol/foundry-nightly-de33b6af53005037b463318d2628b5cfcaf3991:latest
FROM +end-to-end
SAVE IMAGE aztecprotocol/end-to-end:$EARTHLY_GIT_HASH
SAVE IMAGE --cache-hint aztecprotocol/end-to-end:$EARTHLY_GIT_HASH
FROM +aztec
SAVE IMAGE aztecprotocol/aztec:$EARTHLY_GIT_HASH
SAVE IMAGE --cache-hint aztecprotocol/aztec:$EARTHLY_GIT_HASH

0 comments on commit 0d67d71

Please sign in to comment.