Skip to content

Commit

Permalink
chore(CI): remove end-to-end/Earthfile (#9364)
Browse files Browse the repository at this point in the history
Fixes #9221
  • Loading branch information
spypsy authored Oct 28, 2024
1 parent e50303d commit 2823cbb
Show file tree
Hide file tree
Showing 13 changed files with 287 additions and 355 deletions.
4 changes: 4 additions & 0 deletions .github/ci-setup-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ runs:
# TODO reconsider how jq gets into image
- name: Setup jq
uses: dcarbone/install-jq-action@v2.1.0
- name: Setup yq
uses: dcarbone/install-yq-action@v1.1.1
with:
version: v4.44.3

- name: Setup Earthly
uses: earthly/actions-setup@v1
Expand Down
10 changes: 10 additions & 0 deletions .github/ensure-tester/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ runs:
" || true
fi
- name: Setup yq
shell: bash
run: |
set -x
scripts/run_on_tester "
wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64 -O ./yq
chmod +x ./yq
sudo mv ./yq /usr/bin/yq
"
- name: Ensure Tester Cleanup
uses: gacts/run-and-post-run@v1
with:
Expand Down
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
32 changes: 21 additions & 11 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 @@ -172,6 +172,7 @@ jobs:
LABELS=""
fi
echo Labels: $LABELS
echo "list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")"
echo "list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT
- name: Create list of bench end-to-end jobs
id: bench_list
Expand All @@ -197,24 +198,26 @@ 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/ci/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 }}
./scripts/e2e_test.sh ${{ matrix.test }}
# all the benchmarking end-to-end integration tests for aztec (not required to merge)
bench-e2e:
Expand All @@ -229,13 +232,18 @@ 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/ci/select_runner.sh ${{ matrix.test }})
echo "type=$runner" >> $GITHUB_OUTPUT
- name: Setup and Test
uses: ./.github/ensure-tester-with-images
env:
USERNAME: ${{ needs.configure.outputs.username }}
timeout-minutes: 45
with:
runner_type: ${{ contains(matrix.test, 'prover') && '64core-tester-x86' || '16core-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
Expand All @@ -248,7 +256,9 @@ 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 }}
./scripts/e2e_test.sh ${{ matrix.test }}
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 Expand Up @@ -584,7 +594,7 @@ jobs:

yarn-project-formatting:
needs: [build, configure]
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
runs-on: ${{ needs.configure.outputs.username }}-x86
steps:
- uses: actions/checkout@v4
Expand All @@ -598,7 +608,7 @@ jobs:

yarn-project-test:
needs: [build, configure]
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
runs-on: ${{ needs.configure.outputs.username }}-x86
steps:
- uses: actions/checkout@v4
Expand All @@ -613,7 +623,7 @@ jobs:
prover-client-test:
needs: [build, configure]
runs-on: ${{ needs.configure.outputs.username }}-x86
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master'
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
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
60 changes: 34 additions & 26 deletions scripts/ci/get_e2e_jobs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,60 @@ cd "$(dirname "$0")"/../..
BRANCH=$1
LABELS=$2

# Function to parse YAML and extract test names
get_test_names() {
yq e '.tests | keys | .[]' yarn-project/end-to-end/scripts/e2e_test_config.yml
}

# Read the full list from the YAML file
full_list=$(get_test_names)

# 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-prover-coordination"
"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_prover_coordination"
"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(" ")'
19 changes: 19 additions & 0 deletions scripts/ci/select_runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Check if the test requires a prover
requires_prover() {
local test_name=$1
[[ $test_name == *"prover"* ]]
}

test_name=$1

if requires_prover "$test_name"; then
echo "64core-tester-x86"
else
if [[ $test_name == *"bench"* ]]; then
echo "16core-tester-x86"
else
echo "8core-tester-x86"
fi
fi
Loading

0 comments on commit 2823cbb

Please sign in to comment.