-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
420b3f0
commit 959e8b1
Showing
1 changed file
with
76 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,91 @@ | ||
name: REGRESSION TESTER - AGGLAYER | ||
on: | ||
'on': | ||
workflow_dispatch: | ||
inputs: | ||
zkevm_agglayer_commit_id: | ||
description: '0xPolygon/agglayer (commit id)' | ||
required: true | ||
description: 0xPolygon/agglayer (commit id) | ||
required: false | ||
default: b9d79c6 | ||
bake_time: | ||
description: 'bake time (minutes)' | ||
required: true | ||
|
||
description: bake time (minutes) | ||
required: false | ||
default: 30 | ||
jobs: | ||
deploy_devnet: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.before }} | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: '${{ github.event.before }}' | ||
- name: Set up Docker | ||
uses: docker/setup-buildx-action@v1 | ||
- 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 | ||
cd kurtosis-cdk | ||
git checkout dan/jit_containers | ||
- name: Clone and build agglayer | ||
run: | | ||
git clone https://github.com/0xPolygon/agglayer.git | ||
cd agglayer | ||
git checkout "${{ github.event.inputs.zkevm_agglayer_commit_id }}" | ||
docker compose -f docker/docker-compose.yaml build --no-cache agglayer | ||
- 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 | ||
- name: Run kurtosis agent in background | ||
run: | | ||
kurtosis gateway & # Run cmd in background | ||
- name: Deploy CDK devnet on local github runner | ||
run: | | ||
cd kurtosis-cdk | ||
kurtosis engine restart | ||
kurtosis run --enclave cdk-v1 --args-file params.yml . | ||
- name: Monitor and report any potential regressions to CI logs | ||
run: > | ||
bake_time="${{ github.event.inputs.bake_time }}" | ||
end_minute=$(( $(date +'%M') + bake_time)) | ||
- name: Set up Docker | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 | ||
http-rpc)" | ||
- name: Clone internal kurtosis-cdk repo | ||
run: | | ||
git clone https://github.com/0xPolygon/kurtosis-cdk.git | ||
cd kurtosis-cdk | ||
git checkout dan/jit_containers | ||
INITIAL_STATUS=$(cast rpc zkevm_verifiedBatchNumber 2>/dev/null) | ||
- name: Clone and build agglayer | ||
run: | | ||
git clone https://github.com/0xPolygon/agglayer.git | ||
cd agglayer | ||
git checkout "${{ github.event.inputs.zkevm_agglayer_commit_id }}" | ||
docker compose -f docker/docker-compose.yaml build --no-cache agglayer | ||
sleep 10 | ||
incremented=false | ||
- 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 | ||
- name: Run kurtosis agent in background | ||
run: | | ||
kurtosis gateway & # Run cmd in background | ||
sleep 10 | ||
- name: Deploy CDK devnet on local github runner | ||
run: | | ||
cd kurtosis-cdk | ||
kurtosis engine restart | ||
kurtosis run --enclave cdk-v1 --args-file params.yml . | ||
- name: Monitor and report any potential regressions to CI logs | ||
run: | | ||
bake_time="${{ github.event.inputs.bake_time }}" | ||
end_minute=$(( $(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 | ||
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 | ||
fi | ||
else | ||
echo "Failed to connect, waiting and retrying..." | ||
sleep 30 | ||
continue | ||
fi | ||
else | ||
echo "Failed to connect, waiting and retrying..." | ||
sleep 60 | ||
continue | ||
sleep 30 | ||
done | ||
if ! $incremented; then | ||
echo "ZKEVM_VERIFIED_BATCH_NUMBER did not increment. This may indicate chain experienced a regression. Please investigate." | ||
exit 1 | ||
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: Finally, remove all devnet resources locally | ||
run: | | ||
cd kurtosis-cdk | ||
kurtosis clean -a | ||
- name: Finally, remove all devnet resources locally | ||
run: | | ||
cd kurtosis-cdk | ||
kurtosis clean -a |