From b7c8a06027ff2cc51eef5876f7fa8a8fda3f0a66 Mon Sep 17 00:00:00 2001 From: Chih Cheng Liang Date: Mon, 24 Jul 2023 10:03:04 +0200 Subject: [PATCH] Remove the prover bench from Halo2 CI script (#1538) ### Description The CI script was introduced in #330 but was rarely used recently. The CI script must work with the branch named "[halo2benchmarking](https://github.com/privacy-scaling-explorations/zkevm-circuits/tree/halo2benchmarking)", which is long gone. We remove the related scripts to simplify the codebase. --- .github/proverCiScripts/deployToProver.sh | 12 ---- .github/proverCiScripts/execBench.sh | 56 ------------------- .github/proverCiScripts/getSysstat.sh | 10 ---- .../proverCiScripts/injectHalo2Revision.sh | 16 ------ .github/proverCiScripts/prepareProver.sh | 11 ---- .github/proverCiScripts/rsSysstat.sh | 14 ----- .github/workflows/ProverBenchFromHalo2.yml | 45 --------------- 7 files changed, 164 deletions(-) delete mode 100755 .github/proverCiScripts/deployToProver.sh delete mode 100755 .github/proverCiScripts/execBench.sh delete mode 100755 .github/proverCiScripts/getSysstat.sh delete mode 100755 .github/proverCiScripts/injectHalo2Revision.sh delete mode 100755 .github/proverCiScripts/prepareProver.sh delete mode 100755 .github/proverCiScripts/rsSysstat.sh delete mode 100644 .github/workflows/ProverBenchFromHalo2.yml diff --git a/.github/proverCiScripts/deployToProver.sh b/.github/proverCiScripts/deployToProver.sh deleted file mode 100755 index 4bb4a52572..0000000000 --- a/.github/proverCiScripts/deployToProver.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -#set -e -#set -x - -prnumber=$1 -base_dir="/home/ubuntu/CI_Prover_Benches/" -target_dir="$base_dir"PR"$1" - -source_dir=$2 - -cd $source_dir && scp -r * prover:$target_dir - diff --git a/.github/proverCiScripts/execBench.sh b/.github/proverCiScripts/execBench.sh deleted file mode 100755 index 1753991a49..0000000000 --- a/.github/proverCiScripts/execBench.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -set -e -#set -x - -prnumber=$1 -base_dir="/home/ubuntu/CI_Prover_Benches/" -target_dir="$base_dir"PR"$1" -k=$2 -circuit=$(echo $3 | awk '{ print $2 }' | tr '[:upper:]' '[:lower:]') -printf -v _date '%(%Y-%m-%d_%H:%M:%S)T' -1 - -case $circuit in - "all") - echo "To be implemented" - exit 1 - ;; - "evm") - run_suffix="evm_circuit_prover" - ;; - "keccak") - run_suffix="keccak_round" - ;; - "state") - run_suffix="state_circuit_prover" - ;; - "tx") - run_suffix="tx_circuit_prover" - ;; - "super") - run_suffix="super_circuit_prover" - ;; - "bytecode") - run_suffix="bytecode_circuit_prover" - ;; - "pi") - run_suffix="pi_circuit_prover" - ;; - "exp") - run_suffix="exp_circuit_prover" - ;; - "copy") - run_suffix="copy_circuit_prover" - ;; - *) - echo "No proper value" - exit 1 - ;; -esac - -cd $target_dir; -logfile=$_date--${circuit}_bench-$k.proverlog - -export RUST_BACKTRACE=1 -DEGREE=$k ~/.cargo/bin/cargo test --profile bench bench_${run_suffix} -p circuit-benchmarks --features benches -- --nocapture > "$target_dir/$logfile" 2>&1 - -exit 0 diff --git a/.github/proverCiScripts/getSysstat.sh b/.github/proverCiScripts/getSysstat.sh deleted file mode 100755 index 565a2525b8..0000000000 --- a/.github/proverCiScripts/getSysstat.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e -#set -x - -prnumber=$1 -base_dir="/home/ubuntu/CI_Prover_Benches/" -target_dir="$base_dir"PR"$prnumber" - -logfile=$(ls $target_dir | grep proverlog | xargs -n 1 basename) -tail -12 $target_dir/$logfile diff --git a/.github/proverCiScripts/injectHalo2Revision.sh b/.github/proverCiScripts/injectHalo2Revision.sh deleted file mode 100755 index dd2f313e47..0000000000 --- a/.github/proverCiScripts/injectHalo2Revision.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -#set -e -#set -x - -prnumber=$1 -base_dir="/home/ubuntu/CI_Prover_Benches/" -target_dir="$base_dir"PR"$1" - -_revision=$2 - -oldrev=$(egrep halo2.*rev $target_dir/Cargo.toml | awk -F\" '{ print $4 }') - -for i in `find $target_dir -type f -name 'Cargo.toml'` -do - sed -i "s/$oldrev/$_revision/g" $i -done diff --git a/.github/proverCiScripts/prepareProver.sh b/.github/proverCiScripts/prepareProver.sh deleted file mode 100755 index df6ed66f07..0000000000 --- a/.github/proverCiScripts/prepareProver.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -#set -e -#set -x - -prnumber=$1 -base_dir="/home/ubuntu/CI_Prover_Benches/" -target_dir="$base_dir"PR"$1" -source_dir=$2 - -mkdir -p $target_dir - diff --git a/.github/proverCiScripts/rsSysstat.sh b/.github/proverCiScripts/rsSysstat.sh deleted file mode 100755 index 4bb9f6b1cc..0000000000 --- a/.github/proverCiScripts/rsSysstat.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -e -#set -x - -sudo systemctl stop sysstat.service -sudo rm -rf /var/log/sysstat/* -sudo rm -f sar.stats -sudo rm -rf cpu.stats -sudo rm -rf mem.stats - -sleep 10 - -sudo systemctl start sysstat.service - diff --git a/.github/workflows/ProverBenchFromHalo2.yml b/.github/workflows/ProverBenchFromHalo2.yml deleted file mode 100644 index 4f5d2691de..0000000000 --- a/.github/workflows/ProverBenchFromHalo2.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Prover Bench on halo2 PR -on: - workflow_dispatch: - inputs: - event-type: - required: true - type: string - ghuser: - required: true - type: string - revision: - required: true - type: string - halo2pr: - required: true - type: string -jobs: - Exec-ProverBench-on-halo2-PR: - runs-on: pse-runner - env: - GH_USER: ${{ github.event.inputs.ghuser }} - HALO2PR: ${{ github.event.inputs.halo2pr }} - steps: - - run: echo "halo2 PR ${{ env.HALO2PR }} submitted by ${{ env.GH_USER }}" - - run: echo "Running prover benchmarking due to ${{ github.event.inputs.event-type }}." - - uses: actions/checkout@v2 - with: - ref: 'halo2benchmarking' - - run: .github/proverCiScripts/wakeUpProver.sh - shell: bash - - run: | - ssh prover "bash -s" -- < .github/proverCiScripts/rsSysstat.sh - - run: | - ssh prover "bash -s" -- < .github/proverCiScripts/prepareProver.sh "${{ github.event.inputs.halo2pr }}[halo2]" "${{ github.workspace }}" - - run: .github/proverCiScripts/deployToProver.sh "${{ github.event.inputs.halo2pr }}[halo2]" "${{ github.workspace }}" - shell: bash - - run: | - ssh prover "bash -s" -- < .github/proverCiScripts/injectHalo2Revision.sh "${{ github.event.inputs.halo2pr }}[halo2]" "${{ github.event.inputs.revision }}" - - run: | - ssh prover "bash -s" -- < .github/proverCiScripts/execBench.sh "${{ github.event.inputs.halo2pr }}[halo2]" 19 - shell: bash - - run: | - ssh prover "bash -s" -- < .github/proverCiScripts/getSysstat.sh "${{ github.event.inputs.halo2pr }}[halo2]" - - run: .github/proverCiScripts/shutdownProver.sh - shell: bash