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

feat: less earthly runners + e2e GA runners, bb bench #5356

Merged
merged 97 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
27d8c99
upload
ludamad Mar 21, 2024
de2ba7d
scripts
ludamad Mar 21, 2024
10fec72
client ivc bench results
ludamad Mar 21, 2024
dd9c432
add build step
ludamad Mar 21, 2024
e093131
e2e
ludamad Mar 21, 2024
35e107d
typo:
ludamad Mar 21, 2024
e3cde2c
fix
ludamad Mar 21, 2024
32d6037
BENCH
ludamad Mar 21, 2024
541f5ec
build
ludamad Mar 21, 2024
337dff4
just do x86
ludamad Mar 21, 2024
caf8710
new CI
ludamad Mar 21, 2024
45e6fcb
fix paralleism
ludamad Mar 21, 2024
42c15cf
legibile
ludamad Mar 21, 2024
6b2f9de
more e2e
ludamad Mar 21, 2024
55cd5ce
solutions
ludamad Mar 21, 2024
85599f6
benches
ludamad Mar 21, 2024
e4d72f8
updates
ludamad Mar 21, 2024
945d53d
wasm
ludamad Mar 21, 2024
c2bf655
srs db
ludamad Mar 21, 2024
3256b78
wasmtime target
ludamad Mar 21, 2024
d3d99c9
firing off ci
ludamad Mar 21, 2024
ecd5202
try scaling
ludamad Mar 21, 2024
2d125b5
fix e2e
ludamad Mar 21, 2024
4201bb0
workaround
ludamad Mar 21, 2024
4ee92fd
proper sizing
ludamad Mar 21, 2024
fcb3a03
proper sizing
ludamad Mar 21, 2024
28cdf8e
not a valid size: ludamad
ludamad Mar 21, 2024
c60b039
Merge remote-tracking branch 'origin/master' into ad/bench-upload-s3
ludamad Mar 21, 2024
d3fcafe
what if we just one task
ludamad Mar 21, 2024
75c3973
try fix content hash
ludamad Mar 21, 2024
e9f08f8
fix
ludamad Mar 21, 2024
3f0553a
debug content hash
ludamad Mar 21, 2024
469b3cf
sort
ludamad Mar 21, 2024
629706e
fix content
ludamad Mar 21, 2024
4764d7e
wait groups
ludamad Mar 21, 2024
4807ac8
recover from inconsistent graph
ludamad Mar 21, 2024
e0872c9
fix script
ludamad Mar 21, 2024
ce79a1c
fix script
ludamad Mar 21, 2024
e3caee1
parse
ludamad Mar 21, 2024
409b766
try without docker registry
ludamad Mar 21, 2024
e240ba6
docker locally
ludamad Mar 21, 2024
3a11a2c
content hash [skip ci]
ludamad Mar 21, 2024
52c0b42
fix
ludamad Mar 21, 2024
d8c03ea
hashes
ludamad Mar 21, 2024
756ac2d
content hashes
ludamad Mar 21, 2024
e50fe65
up
ludamad Mar 21, 2024
94d9fc5
up
ludamad Mar 21, 2024
e7ad88d
fixes
ludamad Mar 21, 2024
373d54f
build kit output max
ludamad Mar 22, 2024
127ff76
try local docker
ludamad Mar 22, 2024
036dc3c
earthly
ludamad Mar 22, 2024
fc6536f
make
ludamad Mar 22, 2024
e3bd8d5
make
ludamad Mar 22, 2024
5af0b39
host
ludamad Mar 22, 2024
b46e081
put build in one log
ludamad Mar 22, 2024
9d88ca8
ok
ludamad Mar 22, 2024
85e54a4
docker load
ludamad Mar 22, 2024
c6cca1a
set parallelism of satellites
ludamad Mar 22, 2024
b62827d
continue
ludamad Mar 22, 2024
5b0788a
pain
ludamad Mar 22, 2024
10d6e18
fun stuff
ludamad Mar 22, 2024
e194915
Merge branch 'master' into ad/bench-upload-s3
ludamad Mar 24, 2024
9029064
try run
ludamad Mar 24, 2024
2bfda85
Merge remote-tracking branch 'origin/master' into ad/bench-upload-s3
ludamad Mar 24, 2024
bf088b3
Merge remote-tracking branch 'origin/ad/bench-upload-s3' into ad/benc…
ludamad Mar 24, 2024
23d0c36
less spam
ludamad Mar 24, 2024
76dd59c
firing off ci
ludamad Mar 24, 2024
b4672a1
docker
ludamad Mar 24, 2024
931a46a
remote cache?
ludamad Mar 24, 2024
7cf821a
fix hash
ludamad Mar 24, 2024
d1120c7
commit tagging
ludamad Mar 24, 2024
768340f
e2e
ludamad Mar 24, 2024
e0ab0bb
arm tag fixes
ludamad Mar 24, 2024
17cd401
more ignore
ludamad Mar 24, 2024
7af34c4
ignore failing
ludamad Mar 24, 2024
f0477b4
more ignore
ludamad Mar 24, 2024
6f86958
fix
ludamad Mar 24, 2024
c370845
add privileged flag
ludamad Mar 24, 2024
81c61bb
fix?
ludamad Mar 24, 2024
bb15128
fix arm
ludamad Mar 24, 2024
f03de76
Update
ludamad Mar 24, 2024
2f7e352
Merge remote-tracking branch 'origin/ad/bench-upload-s3' into ad/benc…
ludamad Mar 24, 2024
034446b
port
ludamad Mar 24, 2024
5ee90ec
fix
ludamad Mar 24, 2024
e9e68b8
Update Makefile
ludamad Mar 24, 2024
a39973b
cmake
ludamad Mar 24, 2024
b55de66
fix ctest, simplify RUN_CMAKE
ludamad Mar 24, 2024
861f67a
comment
ludamad Mar 24, 2024
7a3196e
Merge remote-tracking branch 'origin/ad/bench-upload-s3' into ad/benc…
ludamad Mar 24, 2024
1e56368
Update
ludamad Mar 24, 2024
5a1e91b
Update
ludamad Mar 24, 2024
4dcd205
more runners for trial
ludamad Mar 24, 2024
b93d0fc
Delete scripts/earthly-config.yml
ludamad Mar 24, 2024
db74c0c
up
ludamad Mar 24, 2024
1e813bf
soure
ludamad Mar 24, 2024
74e6868
find
ludamad Mar 24, 2024
ad66a25
go on for now
ludamad Mar 24, 2024
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
163 changes: 120 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ on:
workflow_dispatch: {}

jobs:
e2e:
# all the end-to-end integration tests for aztec
e2e-arm:
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
# TODO currently names are coupled to platform
strategy: { matrix: { environment: [x86, arm], test: [e2e-escrow-contract, e2e-account-contracts] } }
strategy:
matrix:
test:
- e2e-card-game
- e2e-crowdfunding-and-claim
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: ${{ matrix.test }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.environment }}
cancel-in-progress: true
group: ${{ matrix.test }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-arm
cancel-in-progress: ${{ github.ref_name != 'master' }}
steps:
- uses: earthly/actions-setup@v1
with:
Expand All @@ -29,37 +33,86 @@ jobs:

- name: Setup
working-directory: ./scripts
run: ./setup_env.sh ${{ matrix.environment }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Test
working-directory: ./yarn-project/end-to-end
run: |
# TODO put in script
if [ "${{ matrix.environment }}" == "arm" ]; then
PLATFORM=linux/arm64
elif [ "${{ matrix.environment }}" == "x86" ]; then
PLATFORM=linux/amd64
fi
earthly sat --org aztec launch --size 4xlarge --platform $PLATFORM build-${{github.actor}}-${{ matrix.environment }} || true
if [ ${{ github.ref_name }} = master ] ; then
# update the remote cache
export EARTHLY_PUSH=true
fi
# TODO need to use more SAVE IMAGE --cache-hint and explicit BUILD statements for remote-cache to work well but then it should read artifacts from master done by all runners
earthly -P --no-output --org aztec --remote-cache=aztecprotocol/cache:${{matrix.test}} --sat build-${{github.actor}}-${{ matrix.environment }} +${{ matrix.test }}
working-directory: ./yarn-project/end-to-end/
run: earthly-cloud ${{ github.actor }} arm +${{ matrix.test }}

# all the end-to-end integration tests for aztec
e2e-x86:
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
strategy:
matrix:
test:
- e2e-state-vars
- e2e-block-building
- e2e-nested-contract
- e2e-static-calls
- e2e-delegate-calls
- e2e-non-contract-account
- e2e-cross-chain-messaging
- e2e-crowdfunding-and-claim
- e2e-public-cross-chain-messaging
- e2e-public-to-private-messaging
- e2e-account-contracts
- e2e-escrow-contract
- e2e-inclusion-proofs-contract
- e2e-pending-note-hashes-contract
- e2e-ordering
- uniswap-trade-on-l1-from-l2
- integration-archiver-l1-to-l2
- integration-l1-publisher
- e2e-cli
- e2e-persistence
- e2e-browser
- e2e-card-game
- e2e-avm-simulator
- e2e-fees
- e2e-dapp-subscription
- pxe
- cli-docs-sandbox
- e2e-docs-examples
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: ${{ matrix.test }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-x86
cancel-in-progress: ${{ github.ref_name != 'master' }}
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.5

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive

- name: Setup
working-directory: ./scripts
run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Test
working-directory: ./yarn-project/end-to-end/
run: earthly-cloud ${{ github.actor }} x86 +${{ matrix.test }}

# barretenberg (prover) native tests
bb-native-tests:
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
# run for both x86_64 and arm64
# TODO currently names are coupled to platform
strategy: { matrix: { environment: [x86, arm] } }
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: bb-native-tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.environment }}
cancel-in-progress: true
group: bb-native-tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ matrix.environment }}
cancel-in-progress: ${{ github.ref_name != 'master' }}
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.5

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -68,21 +121,45 @@ jobs:

- name: Setup
working-directory: ./scripts
run: ./setup_env.sh ${{ matrix.environment }} ${{ secrets.DOCKERHUB_PASSWORD }} ${{ secrets.BUILD_INSTANCE_SSH_KEY }}

- name: Build and test
working-directory: ./barretenberg/cpp
run: |
# TODO put in script
if [ "${{ matrix.environment }}" == "arm" ]; then
PLATFORM=linux/arm64
elif [ "${{ matrix.environment }}" == "x86" ]; then
PLATFORM=linux/amd64
fi
earthly sat --org aztec launch --size 4xlarge --platform $PLATFORM build-${{github.actor}}-${{ matrix.environment }} || true
if [ ${{ github.ref_name }} = master ] ; then
# update the remote cache
export EARTHLY_PUSH=true
fi
# TODO need to use more SAVE IMAGE --cache-hint and explicit BUILD statements for remote-cache to work well but then it should read artifacts from master done by all runners
earthly -P --no-output --org aztec --remote-cache=aztecprotocol/cache:bb-native-tests --sat build-${{github.actor}}-${{ matrix.environment }} +test
run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Test
working-directory: ./barretenberg/cpp/
run: earthly-cloud ${{ github.actor }} ${{ matrix.environment }} +test

# All benchmarks, purposefully ran sequential on a machine
# they should use parallelism within the benchmark, but only one thing should run at a time
# for accurate results
# We don't depend on 'build' as we use a different runner and will build components on the fist step that uses them.
bench:
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
# need this to match the user's bench runner
# earthly satellites can't enforce parallelism==1 so we do it through github
group: bench-${{ github.actor }}
cancel-in-progress: ${{ github.ref_name != 'master' }}
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.5

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive

- name: Setup
working-directory: ./scripts
run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Client IVC Bench
working-directory: ./barretenberg/cpp/
run: earthly-cloud-bench ${{ github.actor }} x86 +bench-client-ivc

- name: Ultrahonk Bench
working-directory: ./barretenberg/cpp/
run: earthly-cloud-bench ${{ github.actor }} x86 +bench-ultra-honk
13 changes: 6 additions & 7 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ FROM ubuntu:lunar

build-ci:
BUILD ./avm-transpiler/+build
BUILD ./barretenberg/cpp/+build-release
BUILD ./barretenberg/cpp/+preset-release
BUILD ./barretenberg/cpp/+preset-wasm
BUILD ./barretenberg/cpp/+build-gcc
BUILD ./barretenberg/cpp/+build-fuzzing
BUILD ./barretenberg/cpp/+build-clang-assert
BUILD ./barretenberg/cpp/+test-clang-format
BUILD ./barretenberg/cpp/+preset-gcc
BUILD ./barretenberg/cpp/+preset-fuzzing
BUILD ./barretenberg/cpp/+preset-clang-assert
BUILD ./barretenberg/cpp/+test-clang-format
BUILD ./boxes/+build
BUILD ./noir/+packages
BUILD ./noir/+nargo
BUILD ./noir-projects/+build
BUILD ./yarn-project/+build
BUILD +test-end-to-end
BUILD ./yarn-project/+end-to-end-minimal
BUILD ./yarn-project/+aztec

build-ci-small:
BUILD ./yarn-project/end-to-end/+e2e-escrow-contract
Expand Down
28 changes: 17 additions & 11 deletions barretenberg/cpp/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ get-wasi-sdk:
FROM aztecprotocol/cache:wasi-sdk-threads-v21.0-$TARGETARCH
SAVE ARTIFACT wasi-sdk

wasmtime:
RUN curl https://wasmtime.dev/install.sh -sSf | bash
SAVE ARTIFACT /root/.wasmtime/bin/wasmtime

source:
# cpp source
COPY --keep-ts --dir src/barretenberg src/CMakeLists.txt src
Expand All @@ -61,7 +65,7 @@ source:

preset-release-assert-all:
FROM +source
RUN cmake --preset clang16 -DCMAKE_BUILD_TYPE=RelWithAssert && cmake --build --preset clang16
DO +RUN_CMAKE --configure="--preset clang16 -DCMAKE_BUILD_TYPE=RelWithAssert" --build=""
SAVE ARTIFACT bin

preset-release:
Expand Down Expand Up @@ -132,7 +136,7 @@ test:
BUILD +test-clang-format
FROM +preset-release-assert-all
COPY --dir ./srs_db/+build/. srs_db
RUN cd build && GTEST_COLOR=1 ctest -j$(nproc) --output-on-failure
RUN GTEST_COLOR=1 ctest -j$(nproc) --output-on-failure

# Functions
RUN_CMAKE:
Expand All @@ -159,33 +163,35 @@ BENCH_RELEASE:
ARG target
ARG args
FROM +preset-release
DO +BUILD --configure="--preset clang16" --build="--target $target"
COPY --dir ./srs_db/+build/. srs_db
RUN cd build && ./bin/$target $args
DO +RUN_CMAKE --configure="--preset clang16" --build="--target $target"
COPY --dir ./srs_db/+build/. ../srs_db
RUN ./bin/$target $args

BENCH_OP_COUNT_TIME:
FUNCTION
ARG target
ARG args
FROM +preset-op-count-time
DO +RUN_CMAKE --configure="--preset op-count-time" --build="--target $target"
COPY --dir ./srs_db:+build/. srs_db
RUN cd build && ./bin/$target $args
COPY --dir ./srs_db:+build/. ../srs_db
RUN ./bin/$target $args

BENCH_OP_COUNT:
FUNCTION
ARG target
ARG args
FROM +preset-op-count
DO +RUN_CMAKE --configure="--preset op-count" --build="--target $target"
COPY --dir ./srs_db/+build/. srs_db
RUN cd build && ./bin/$target $args
COPY --dir ./srs_db/+build/. ../srs_db
RUN ./bin/$target $args

BENCH_WASM:
FUNCTION
ARG target
ARG args
FROM +preset-wasm
DO +RUN_CMAKE --configure="--preset wasm-threads" --build="--target $target"
COPY --dir ./srs_db/+build/. srs_db
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can use some rethinking, but punting that

RUN cd build && ~/.wasmtime/bin/wasmtime run --env HARDWARE_CONCURRENCY=8 -Wthreads=y -Sthreads=y --dir=.. ./bin/$target $args
COPY --dir ./srs_db/+build/. ../srs_db
# install
COPY +wasmtime/wasmtime /usr/bin/wasmtime
RUN wasmtime run --env HARDWARE_CONCURRENCY=8 -Wthreads=y -Sthreads=y --dir=.. ./bin/$target $args
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

earthly script deleted in favour of github actions

31 changes: 0 additions & 31 deletions scripts/earthly

This file was deleted.

16 changes: 16 additions & 0 deletions scripts/earthly-cloud
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -eux

USERNAME=$1
ARCH=$2

shift 2

if [ "$ARCH" == "arm" ]; then
PLATFORM=linux/arm64
elif [ "$ARCH" == "x86" ]; then
PLATFORM=linux/amd64
fi
earthly sat --org aztec launch --size 2xlarge --platform $PLATFORM build-$USERNAME-$ARCH || true
earthly -P --no-output --org aztec --remote-cache=aztecprotocol/cache:bb-native-tests --sat build-$USERNAME-$ARCH $@
16 changes: 16 additions & 0 deletions scripts/earthly-cloud-bench
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -eux

USERNAME=$1
ARCH=$2

shift 2

if [ "$ARCH" == "arm" ]; then
PLATFORM=linux/arm64
elif [ "$ARCH" == "x86" ]; then
PLATFORM=linux/amd64
fi
earthly sat --org aztec launch --size 2xlarge --platform $PLATFORM bench-$USERNAME-$ARCH || true
earthly -P --no-output --org aztec --remote-cache=aztecprotocol/cache:bb-native-tests --sat bench-$USERNAME-$ARCH $@
3 changes: 0 additions & 3 deletions scripts/earthly-config.yml

This file was deleted.

5 changes: 2 additions & 3 deletions scripts/earthly-timed
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#!/usr/bin/env bash
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace

Expand Down Expand Up @@ -49,7 +48,7 @@ for arg in "$@"; do
fi
done
if [ $INTERACTIVE = true ] ; then
$(dirname $0)/earthly $@
earthly $@
else
$(dirname $0)/earthly $@ 2>&1 | add_timestamps >&2
earthly $@ 2>&1 | add_timestamps >&2
fi
Loading
Loading