From 494f0aa1e48117eba5a4c3f61c4eb0543ae777a7 Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 8 May 2024 07:09:13 -0500 Subject: [PATCH 1/8] simplify via shared git action --- .github/workflows/regression-tests.yml | 83 ++++---------------------- 1 file changed, 12 insertions(+), 71 deletions(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 09bb850..8d95fcb 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -1,85 +1,26 @@ name: Regression Tests - Agglayer -'on': + +on: pull_request: types: [opened, synchronize] # Trigger on new pull requests and when existing ones are synchronized branches: - main + jobs: deploy_devnet: runs-on: ubuntu-latest + + env: + GITHUB_SHA: ${{ github.event.pull_request.head.sha }} + steps: - name: Checkout uses: actions/checkout@v4 + - name: Set up Docker uses: docker/setup-buildx-action@v1 - - name: Build agglayer image locally - run: | - cd $GITHUB_WORKSPACE # Change to the root directory of the repository - if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then - GITHUB_SHA=$(jq -r .pull_request.head.sha "$GITHUB_EVENT_PATH") - fi - echo "Containerizing and testing commit: $GITHUB_SHA" - make build - mv ./dist/agglayer . - docker build -t agglayer:local -f ./Dockerfile.release . - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - - name: Clone internal kurtosis-cdk repo - run: | - git clone https://github.com/0xPolygon/kurtosis-cdk.git - - name: Install kurtosis - run: | - echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list - sudo apt update - sudo apt install kurtosis-cli - kurtosis analytics disable - - name: Install yq - run: pip3 install yq - - name: Deploy CDK devnet on local github runner - run: | - cd kurtosis-cdk - yq -Y --in-place ".args.zkevm_agglayer_image = \"agglayer:local\"" params.yml - kurtosis run --enclave cdk-v1 --args-file params.yml . - - name: Monitor and report any potential regressions to CI logs - run: | - bake_time=30 # minutes - end_minute=$((10#$(date +'%M') + bake_time)) - - export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" - INITIAL_STATUS=$(cast rpc zkevm_verifiedBatchNumber 2>/dev/null) - incremented=false - - while [ $(date +'%M') -lt $end_minute ]; do - # Attempt to connect to the service - if STATUS=$(cast rpc zkevm_verifiedBatchNumber 2>/dev/null); then - echo "ZKEVM_VERIFIED_BATCH_NUMBER: $STATUS" - - # Check if STATUS has incremented - if [ "$STATUS" != "$INITIAL_STATUS" ]; then - incremented=true - echo "ZKEVM_VERIFIED_BATCH_NUMBER successfully incremented to $STATUS. Exiting..." - exit 0 - fi - else - echo "Failed to connect, waiting and retrying..." - sleep 60 - continue - fi - sleep 60 - done - if ! $incremented; then - echo "ZKEVM_VERIFIED_BATCH_NUMBER did not increment. This may indicate chain experienced a regression. Please investigate." - exit 1 - fi - - name: Install polycli and send transaction load for further integration tests - run: | - git clone https://github.com/maticnetwork/polygon-cli.git - cd polygon-cli - make install - export PATH="$HOME/go/bin:$PATH" - export PK="0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" - export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" - polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 5 --mode t - polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 10 --mode t - polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 10 --mode 2 + - name: Run regression tests against custom user-specified images + uses: 0xPolygon/kurtosis-cdk@v0.1.6 + with: + zkevm_agglayer: ${{ env.GITHUB_SHA }} From b2450ff3ddb8d01ea7c99432467064825ef8d831 Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 8 May 2024 16:27:20 -0500 Subject: [PATCH 2/8] test v1.0.7 with short sha --- .github/workflows/regression-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 8d95fcb..870eebf 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -2,7 +2,7 @@ name: Regression Tests - Agglayer on: pull_request: - types: [opened, synchronize] # Trigger on new pull requests and when existing ones are synchronized + types: [opened, synchronize] # Trigger on new PR's and existing ones with new commits branches: - main @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest env: - GITHUB_SHA: ${{ github.event.pull_request.head.sha }} + GITHUB_SHA: ${{ github.sha }} steps: - name: Checkout @@ -21,6 +21,6 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Run regression tests against custom user-specified images - uses: 0xPolygon/kurtosis-cdk@v0.1.6 + uses: 0xPolygon/kurtosis-cdk@v0.1.7 with: zkevm_agglayer: ${{ env.GITHUB_SHA }} From 6624c1dad544a2ff0ff9df8231840170ace6df1c Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 8 May 2024 16:51:23 -0500 Subject: [PATCH 3/8] test short sha --- .github/workflows/regression-tests.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 870eebf..9c22aae 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -9,18 +9,24 @@ on: jobs: deploy_devnet: runs-on: ubuntu-latest - - env: - GITHUB_SHA: ${{ github.sha }} - + steps: - name: Checkout uses: actions/checkout@v4 + - name: Build agglayer image locally + id: build_agglayer + run: | + if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then + GITHUB_SHA_SHORT=$(jq -r .pull_request.head.sha "$GITHUB_EVENT_PATH" | cut -c 1-7) + echo $GITHUB_SHA_SHORT + echo "::set-output name=GITHUB_SHA_SHORT::$GITHUB_SHA_SHORT" + fi + - name: Set up Docker uses: docker/setup-buildx-action@v1 - name: Run regression tests against custom user-specified images uses: 0xPolygon/kurtosis-cdk@v0.1.7 with: - zkevm_agglayer: ${{ env.GITHUB_SHA }} + zkevm_agglayer: ${{ steps.build_agglayer.outputs.GITHUB_SHA_SHORT }} From e9577fb134198653ea9c3e35549d7b8bbfc7e7db Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 8 May 2024 16:59:20 -0500 Subject: [PATCH 4/8] pls work --- .github/workflows/regression-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 9c22aae..0077c84 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -30,3 +30,5 @@ jobs: uses: 0xPolygon/kurtosis-cdk@v0.1.7 with: zkevm_agglayer: ${{ steps.build_agglayer.outputs.GITHUB_SHA_SHORT }} + kurtosis_cli: 0.89.7 + kurtosis_cdk: v0.2.0 From 51711839084d0e9cc3f5a8ecb0227dc29a2e47bb Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 8 May 2024 17:16:59 -0500 Subject: [PATCH 5/8] pin kurtosis cli version --- .github/workflows/regression-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 0077c84..b676b60 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -30,5 +30,5 @@ jobs: uses: 0xPolygon/kurtosis-cdk@v0.1.7 with: zkevm_agglayer: ${{ steps.build_agglayer.outputs.GITHUB_SHA_SHORT }} - kurtosis_cli: 0.89.7 + kurtosis_cli: 0.89.3 kurtosis_cdk: v0.2.0 From 0ff80399d26e84ae0c86960fe5f808bb3c7d7784 Mon Sep 17 00:00:00 2001 From: dan moore Date: Thu, 9 May 2024 07:50:16 -0500 Subject: [PATCH 6/8] bump version --- .github/workflows/regression-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index b676b60..bd733c0 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -27,7 +27,7 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Run regression tests against custom user-specified images - uses: 0xPolygon/kurtosis-cdk@v0.1.7 + uses: 0xPolygon/kurtosis-cdk@v0.1.8 with: zkevm_agglayer: ${{ steps.build_agglayer.outputs.GITHUB_SHA_SHORT }} kurtosis_cli: 0.89.3 From 530d981035927c9dc24590b2bb5563c012d551a0 Mon Sep 17 00:00:00 2001 From: dan moore Date: Thu, 9 May 2024 08:04:04 -0500 Subject: [PATCH 7/8] tests --- .github/workflows/regression-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index bd733c0..4104689 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -29,6 +29,5 @@ jobs: - name: Run regression tests against custom user-specified images uses: 0xPolygon/kurtosis-cdk@v0.1.8 with: - zkevm_agglayer: ${{ steps.build_agglayer.outputs.GITHUB_SHA_SHORT }} kurtosis_cli: 0.89.3 kurtosis_cdk: v0.2.0 From 123775e97b43e068fe176d1d4c6aa2e290c5ded6 Mon Sep 17 00:00:00 2001 From: dan moore Date: Thu, 9 May 2024 08:17:34 -0500 Subject: [PATCH 8/8] bump vers --- .github/workflows/regression-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 4104689..fd786df 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -27,7 +27,8 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Run regression tests against custom user-specified images - uses: 0xPolygon/kurtosis-cdk@v0.1.8 + uses: 0xPolygon/kurtosis-cdk@v0.1.9 with: + zkevm_agglayer: ${{ steps.build_agglayer.outputs.GITHUB_SHA_SHORT }} kurtosis_cli: 0.89.3 kurtosis_cdk: v0.2.0