From 41f02f123addb328eef8f27f312096fdcd150c68 Mon Sep 17 00:00:00 2001 From: Igor Mandrigin Date: Tue, 11 Jun 2024 18:07:08 +0300 Subject: [PATCH] Extend the eth-bench tests with the basic bridge tests (#587) * inline the launch script * refactor to use matrix better * add sepolia endpoing * fix a typo * fix secret name for Sepolia * fix typo * use env vars * debug * fix typos, no debug * fix more typos * add bridge tests * fixups * fix typo * fix typos * fixups * add bridge tests * fix * bridge first --- .github/workflows/nightly-eth-bench.yml | 81 ++++++++++++++++++++----- 1 file changed, 67 insertions(+), 14 deletions(-) diff --git a/.github/workflows/nightly-eth-bench.yml b/.github/workflows/nightly-eth-bench.yml index cb88a6cef0d..dd0a68362c4 100644 --- a/.github/workflows/nightly-eth-bench.yml +++ b/.github/workflows/nightly-eth-bench.yml @@ -10,8 +10,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - profile: [network5] - + include: + - profile_name: "network5" + l1_ep: "https://rpc.eu-central-1.gateway.fm/v4/ethereum/non-archival/sepolia" + l2_ep: "http://34.175.214.161:8500" + bridge_ep: "http://34.175.214.161:8085" + l1_pk_secret_name: "L1_SEPOLIA_FUNDED_PRIVATE_KEY" + l2_pk_secret_name: "NETWORK5_PRIVATE_KEY" + bridge_addr: "0xb566BE17B22404BD46F389030ec5592F8ffAde12" + steps: - name: Checkout current repository uses: actions/checkout@v3 @@ -30,23 +37,69 @@ jobs: restore-keys: | ${{ runner.os }}-buildx- - - name: Set PROFILE_UPPER environment variable - run: | - echo "PROFILE_UPPER=$(echo ${{ matrix.profile }} | tr '[:lower:]' '[:upper:]')" >> $GITHUB_ENV - - - name: Set RPC_URL and PRIVATE_KEY environment variables - run: | - echo "RPC_URL=${{ secrets[format('{0}_RPC_URL', env.PROFILE_UPPER)] }}" >> $GITHUB_ENV - echo "PRIVATE_KEY=${{ secrets[format('{0}_PRIVATE_KEY', env.PROFILE_UPPER)] }}" >> $GITHUB_ENV - - name: Build and run benchmarks run: | + #!/bin/bash cd eth-bench - ./run_benchmarks.sh ${{ matrix.profile }} ${{ env.RPC_URL }} ${{ env.PRIVATE_KEY }} + + cat < ./tmp_profiles.json + { + "profiles": { + "${{ matrix.profile_name }}": { + "description": "Nightly Tests", + "node_url": "${{ matrix.l2_ep }}", + "l1_ep": "${{ matrix.l1_ep }}", + "bridge_addr": "${{ matrix.bridge_addr }}", + "bridge_ep": "${{ matrix.bridge_ep }}", + "funded_key": "${{ secrets[matrix.l2_pk_secret_name] }}", + "l1_funded_key": "${{ secrets[matrix.l1_pk_secret_name] }}" + } + } + } + EOF + + export PROFILE=${{ matrix.profile_name }} + + docker build . -t eth-bench-temp-${{ matrix.profile_name }} + + docker run --rm \ + --volume "$(pwd):/app" \ + --volume "$(pwd)/profiles.json:/app/profiles.json" \ + --volume "$(pwd)/logs:/app/logs" \ + --env PYTHONUNBUFFERED=1 \ + --env PROFILE=${PROFILE} \ + --workdir /app \ + eth-bench-temp-${{ matrix.profile_name}} \ + python bench.py -p "$PROFILE" --bridge2l2 + + docker run --rm \ + --volume "$(pwd):/app" \ + --volume "$(pwd)/profiles.json:/app/profiles.json" \ + --volume "$(pwd)/logs:/app/logs" \ + --env PYTHONUNBUFFERED=1 \ + --env PROFILE=${PROFILE} \ + --workdir /app \ + eth-bench-temp-${{ matrix.profile_name}} \ + python bench.py -p "$PROFILE" --bridge2l1 + + docker run --rm \ + --volume "$(pwd):/app" \ + --volume "$(pwd)/profiles.json:/app/profiles.json" \ + --volume "$(pwd)/logs:/app/logs" \ + --env PYTHONUNBUFFERED=1 \ + --env PROFILE=${PROFILE} \ + --workdir /app \ + eth-bench-temp-${{ matrix.profile_name}} \ + python bench.py -p "$PROFILE" -c 5 -t 12 --all --recover + + EXIT_CODE=$? + + echo "Benchmark exit code for profile ${PROFILE}: $EXIT_CODE" + exit $EXIT_CODE - name: Upload benchmark log if: always() uses: actions/upload-artifact@v3 with: - name: benchmark-log-${{ matrix.profile }} - path: ./eth-bench/bench_${{ matrix.profile }}.log + name: benchmark-log-${{ matrix.profile_name }} + path: ./eth-bench/bench_${{ matrix.profile_name }}.log