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

chore(CI): remove end-to-end/Earthfile #9364

Merged
merged 27 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions .github/workflows/ci-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
- master
- '*/*arm-build'
- "*/*arm-build"
workflow_dispatch:
inputs: {}
concurrency:
Expand Down Expand Up @@ -101,8 +101,9 @@ jobs:
# prepare images locally, tagged by commit hash
- name: "Build E2E Image"
timeout-minutes: 40
working-directory: ./yarn-project/end-to-end
run: |
earthly-ci ./yarn-project/end-to-end+uniswap-trade-on-l1-from-l2
./scripts/e2e_compose_test.sh uniswap_trade_on_l1_from_l2.test.ts

rerun-check:
runs-on: ubuntu-20.04
Expand Down
50 changes: 43 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- master
- provernet
- '*/ci-push*'
- "*/ci-push*"
pull_request:
types:
- opened
Expand Down Expand Up @@ -170,6 +170,7 @@ jobs:
fi
echo Labels: $LABELS
echo "list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT
echo "compose_list=$(./scripts/ci/get_e2e_compose_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT
- name: Create list of bench end-to-end jobs
id: bench_list
run: |
Expand All @@ -194,24 +195,53 @@ jobs:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: Determine runner type
id: runner_type
run: |
runner=$(./scripts/select_runner.sh ${{ matrix.test }})
echo "type=$runner" >> $GITHUB_OUTPUT
- name: Setup and Test
timeout-minutes: 40
uses: ./.github/ensure-tester-with-images
env:
USERNAME: ${{ needs.configure.outputs.username }}
with:
runner_type: ${{ contains(matrix.test, 'prover') && '64core-tester-x86' || '8core-tester-x86' }}
runner_type: ${{ steps.runner_type.outputs.type }}
builder_type: builder-x86
# these are copied to the tester and expected by the earthly command below
# if they fail to copy, it will try to build them on the tester and fail
builder_images_to_copy: aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
# command to produce the images in case they don't exist
builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images
run: |
set -eux
cd ./yarn-project/end-to-end/
export FORCE_COLOR=1
../../scripts/earthly-ci -P --no-output +${{ matrix.test }}

# Handle env vars for certain tests
if [[ "$matrix.test" == *"fake_proofs"* ]]; then
export FAKE_PROOFS=1
fi
if [[ "$matrix.test" == *"prover_full"* ]]; then
export HARDWARE_CONCURRENCY=32
fi

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was thinking that we wouldn't need conditions here but instead have the commands listed in the test definition txt file

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, as in move this conditional logic inside e2e_test.sh?

Copy link
Member Author

Choose a reason for hiding this comment

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

or just extend e2e_test_list to an object format where we define specific env vars & start command ig

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally the script would let people run these locally as well, but a txt format works

Copy link
Collaborator

Choose a reason for hiding this comment

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

one example is a shell script that has a switch statement for each case and also lists each case / each enabled case on demand. We could combine the bench script with it

# Handle special cases for network tests
if [[ "$matrix.test" == *"kind_network"* ]]; then
if [[ "$matrix.test" == *"smoke"* ]]; then
NAMESPACE=smoke
elif [[ "$matrix.test" == *"transfer"* ]]; then
NAMESPACE=transfer
fi
if [[ "$matrix.test" == *"4epochs"* ]]; then
RUN NAMESPACE=$NAMESPACE FRESH_INSTALL=true VALUES_FILE=$-default.yaml ./scripts/network_test.sh ./src/spartan/4epochs.test.ts || true
else
RUN NAMESPACE=$NAMESPACE FRESH_INSTALL=true VALUES_FILE=$-default.yaml ./scripts/network_test.sh ./src/spartan/smoke.test.ts
fi
# Handle tests that need to be run with e2e_compose_test script
elif grep -qF "$matrix.test" yarn-project/end-to-end/scripts/compose_e2e_test_list; then
./scripts/e2e_compose_test.sh ${{ matrix.test }}
else
# Default case
./scripts/e2e_test.sh ${{ matrix.test }}
fi

# all the benchmarking end-to-end integration tests for aztec (not required to merge)
bench-e2e:
Expand Down Expand Up @@ -245,7 +275,13 @@ jobs:
cd ./yarn-project/end-to-end/
export FORCE_COLOR=1
export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}"
../../scripts/earthly-ci --exec-stats -P --no-output +${{ matrix.test }}
export COMPOSE_FILE=scripts/docker-compose-no-sandbox.yml
export DEBUG="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees"
export HARDWARE_CONCURRENCY=32
./scripts/e2e_compose_test.sh ${{ matrix.test }}

# redundant, but just to be explicit:
earthly-ci +UPLOAD_LOGS --PULL_REQUEST=${{ github.event.pull_request.number }} --BRANCH=${{ github.ref_name }} --COMMIT_HASH=${{ env.GIT_COMMIT }}

acir-bench:
runs-on: ubuntu-20.04
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/nightly-kind-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ jobs:
set -eux
./spartan/scripts/setup_local_k8s.sh
export FORCE_COLOR=1
export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}"
./scripts/earthly-ci --exec-stats -P --no-output ./yarn-project/end-to-end/+kind-network-transfer --values-file=${{ matrix.values_file }}
NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${{ matrix.values_file }} ./scripts/network_test.sh ./src/spartan/transfer.test.ts || true

success-check:
runs-on: ubuntu-20.04
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/sepolia-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ jobs:
set -eux
cd ./yarn-project/end-to-end/
export FORCE_COLOR=1
../../scripts/earthly-ci -P --no-output +e2e-public-testnet \
--SEQ_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_SEQ_PRIVATE_KEY }} \
--PROVER_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_PROVER_PRIVATE_KEY }} \
--ETHEREUM_HOST="https://sepolia.infura.io/v3/${{ secrets.SEPOLIA_API_KEY }}" \
--L1_CHAIN_ID=${{ env.L1_CHAIN_ID }}
SEQ_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_SEQ_PRIVATE_KEY }} \
PROVER_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_PROVER_PRIVATE_KEY }} \
ETHEREUM_HOST="https://sepolia.infura.io/v3/${{ secrets.SEPOLIA_API_KEY }}" \
L1_CHAIN_ID=${{ env.L1_CHAIN_ID }} \
./scripts/e2e_test_public_testnet.sh ./src/public-testnet

success-check:
runs-on: ubuntu-20.04
Expand Down
5 changes: 1 addition & 4 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ build:
# yarn-project has the entry point to Aztec
BUILD ./yarn-project/+build

test-end-to-end:
BUILD ./yarn-project/end-to-end+e2e-tests

release-meta:
COPY .release-please-manifest.json /usr/src/.release-please-manifest.json
SAVE ARTIFACT /usr/src /usr/src
Expand All @@ -46,7 +43,7 @@ UPLOAD_LOGS:
ENV BRANCH=$BRANCH
ENV COMMIT_HASH=$COMMIT_HASH
RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log

base-log-uploader:
# Install awscli on a fresh ubuntu, and copy the repo "scripts" folder, which we'll use to upload logs
# Note that we cannot do this LOCALLY because Earthly does not support using secrets locally
Expand Down
53 changes: 53 additions & 0 deletions scripts/ci/get_e2e_compose_jobs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
set -eu

# Enter repo root.
cd "$(dirname "$0")"/../..

BRANCH=$1
LABELS=$2

# Read the full list from the file
full_list=$(cat yarn-project/end-to-end/scripts/full_e2e_test_list)

# Define that need the compose_test script to run
compose_list=(
e2e_sandbox_example
uniswap_trade_on_l1_from_l2
integration_l1_publisher
e2e_browser
pxe
e2e_docs_examples
guides/writing_an_account_contract
guides/dapp_testing
sample-dapp/ci/index.test.mjs
sample-dapp/index.test.mjs
guides/up_quick_start
)

# Add labels from input to the allow_list
IFS=',' read -r -a input_labels <<<"$LABELS"
allow_list+=("${input_labels[@]}")

# Generate full list of targets, excluding specific entries, on one line
test_list=$(echo "${full_list[@]}" | grep -v 'base' | grep -v 'bench' | grep -v "network" | grep -v 'devnet' | xargs echo)

# # If branch is master or allow_list contains 'e2e-all', return full list
if [[ "$BRANCH" == "master" ]] || [[ " ${allow_list[@]} " =~ "e2e-all" ]]; then
# print as JSON list
echo "$test_list" | jq -Rc 'split(" ")'
exit 0
fi

# # Filter the test_list to include only items in the allow_list
filtered_list=()
for item in $test_list; do
for allowed in "${allow_list[@]}"; do
if [[ "$item" == "$allowed" ]]; then
filtered_list+=("$item")
fi
done
done

# # Print the filtered list in JSON format
echo ${filtered_list[@]} | jq -Rc 'split(" ")'
53 changes: 28 additions & 25 deletions scripts/ci/get_e2e_jobs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,54 @@ cd "$(dirname "$0")"/../..
BRANCH=$1
LABELS=$2

# Read the full list from the file
full_list=$(cat yarn-project/end-to-end/scripts/full_e2e_test_list)

# Define the jobs that will run on every PR
allow_list=(
"e2e-2-pxes"
"e2e-authwit"
"e2e-avm-simulator"
"e2e-block-building"
"e2e-cross-chain-messaging"
"e2e-deploy-contract"
"e2e-fees"
"e2e-fees-gas-estimation"
"e2e-fees-private-payments"
"e2e-max-block-number"
"e2e-nested-contract"
"e2e-ordering"
"e2e-static-calls"
"integration-l1-publisher"
"e2e-cheat-codes"
"e2e-prover-fake-proofs"
"e2e-lending-contract"
"kind-network-smoke"
"e2e_2_pxes"
"e2e_authwit"
"e2e_avm_simulator"
"e2e_block_building"
"e2e_cross_chain_messaging"
"e2e_deploy_contract"
"e2e_fees"
"e2e_fees_gas_estimation"
"e2e_fees_private_payments"
"e2e_max_block_number"
"e2e_nested_contract"
"e2e_ordering"
"e2e_static_calls"
"integration_l1_publisher"
"e2e_cheat_codes"
"e2e_prover_fake_proofs"
"e2e_lending_contract"
"kind_network_smoke"
)

# Add labels from input to the allow_list
IFS=',' read -r -a input_labels <<< "$LABELS"
IFS=',' read -r -a input_labels <<<"$LABELS"
allow_list+=("${input_labels[@]}")

# Generate full list of targets, excluding specific entries, on one line
full_list=$(earthly ls ./yarn-project/end-to-end | grep -v '+base' | grep -v '+bench' | grep -v "+network" | grep -v 'devnet' | sed 's/+//' | xargs echo)
test_list=$(echo "${full_list[@]}" | grep -v 'base' | grep -v 'bench' | grep -v "network" | grep -v 'devnet' | xargs echo)

# If branch is master or allow_list contains 'e2e-all', return full list
# # If branch is master or allow_list contains 'e2e-all', return full list
if [[ "$BRANCH" == "master" ]] || [[ " ${allow_list[@]} " =~ "e2e-all" ]]; then
# print as JSON list
echo "$full_list" | jq -Rc 'split(" ")'
echo "$test_list" | jq -Rc 'split(" ")'
exit 0
fi

# Filter the full_list to include only items in the allow_list
# # Filter the test_list to include only items in the allow_list
filtered_list=()
for item in $full_list; do
for item in $test_list; do
for allowed in "${allow_list[@]}"; do
if [[ "$item" == "$allowed" ]]; then
filtered_list+=("$item")
fi
done
done

# Print the filtered list in JSON format
# # Print the filtered list in JSON format
echo ${filtered_list[@]} | jq -Rc 'split(" ")'
59 changes: 59 additions & 0 deletions scripts/ci/old_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash
set -eu

# Enter repo root.
cd "$(dirname "$0")"/../..

BRANCH=$1
LABELS=$2

# Define the jobs that will run on every PR
allow_list=(
"e2e-2-pxes"
"e2e-authwit"
"e2e-avm-simulator"
"e2e-block-building"
"e2e-cross-chain-messaging"
"e2e-deploy-contract"
"e2e-fees"
"e2e-fees-gas-estimation"
"e2e-fees-private-payments"
"e2e-max-block-number"
"e2e-nested-contract"
"e2e-ordering"
"e2e-static-calls"
"integration-l1-publisher"
"e2e-cheat-codes"
"e2e-prover-fake-proofs"
"e2e-lending-contract"
"kind-network-smoke"
)

# Add labels from input to the allow_list
IFS=',' read -r -a input_labels <<<"$LABELS"
allow_list+=("${input_labels[@]}")

# Generate full list of targets, excluding specific entries, on one line
full_list=$(earthly ls ./yarn-project/end-to-end | grep -v '+base' | grep -v '+bench' | grep -v "+network" | grep -v 'devnet' | sed 's/+//' | xargs echo)

echo "Full list: $full_list"

# If branch is master or allow_list contains 'e2e-all', return full list
if [[ "$BRANCH" == "master" ]] || [[ " ${allow_list[@]} " =~ "e2e-all" ]]; then
# print as JSON list
echo "$full_list" | jq -Rc 'split(" ")'
exit 0
fi

# Filter the full_list to include only items in the allow_list
filtered_list=()
for item in $full_list; do
for allowed in "${allow_list[@]}"; do
if [[ "$item" == "$allowed" ]]; then
filtered_list+=("$item")
fi
done
done

# Print the filtered list in JSON format
echo ${filtered_list[@]} | jq -Rc 'split(" ")'
15 changes: 15 additions & 0 deletions scripts/ci/select_runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Check if the test requires a prover
requires_prover() {
local test_name=$1
Copy link
Collaborator

Choose a reason for hiding this comment

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

this ideally would be encapsulated in the same shell script that runs the things, but nbd

Copy link
Member Author

Choose a reason for hiding this comment

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

Wasn't sure on how to do this. The result of select_runner is used to start the machine on which e2e_test.sh is then run on.

[[ $test_name == *"prover"* ]]
}

test_name=$1

if requires_prover "$test_name"; then
echo "64core-tester-x86"
else
echo "8core-tester-x86"
fi
Loading
Loading