Skip to content

Commit

Permalink
ci: fix perf light workflow (#2780)
Browse files Browse the repository at this point in the history
  • Loading branch information
canepat authored Mar 8, 2025
1 parent d4eeb4a commit 92439b2
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 31 deletions.
62 changes: 31 additions & 31 deletions .github/actions/perf-common-steps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ description: Common steps for running Silkworm performance tests

inputs:
activation_mode:
description: 'Activation mode for performance tests (full,light)'
default: 'light'
description: 'Activation mode for performance tests (full/light)'
required: true
measure_erigon:
description: 'Flag indicating if Erigon RPCDaemon must be measured or not (true/false)'
required: true

runs:
using: "composite"

steps:
- name: Checkout Silkworm repository
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: "0"

- name: Checkout RPC Tests Repository & Install Requirements
shell: bash
run: |
Expand Down Expand Up @@ -57,6 +54,7 @@ runs:
echo "SILKWORM_RPC_DAEMON_PID=$SILKWORM_RPC_DAEMON_PID" >> $GITHUB_ENV
- name: Run Erigon RpcDaemon
if: ${{ inputs.measure_erigon == 'true' }}
shell: bash
run: |
$ERIGON_DIR/rpcdaemon --datadir $ERIGON_DATA_DIR --http.api admin,debug,eth,parity,erigon,trace,web3,txpool,ots,net --verbosity 1 &
Expand All @@ -79,13 +77,18 @@ runs:
mkdir -p $RPC_PAST_TEST_DIR/mainnet_bin
run_perf () {
servers=("silkworm" "erigon")
for i in 1 2
servers=("silkworm")
if [[ "${{ inputs.measure_erigon }}" == "true" ]]; then
servers+=("erigon")
fi
num_servers=${#servers[@]}
for (( i=1; i<=num_servers; i++ ))
do
network=$1
method=$2
pattern=$3
sequence=$4
repetitions=$3
pattern=$4
sequence=$5
# clean temporary area
cd ${{runner.workspace}}/rpc-tests/perf
Expand All @@ -95,7 +98,7 @@ runs:
--test-type "$method" \
--pattern-file pattern/"$network"/"$pattern".tar \
--test-sequence "$sequence" \
--repetitions 5 \
--repetitions $repetitions \
--silk-dir ${{runner.workspace}}/silkworm \
--erigon-dir $ERIGON_DATA_DIR \
--test-mode $i \
Expand Down Expand Up @@ -163,25 +166,22 @@ runs:
}
# Launch the RPC performance test runner
failed_test= 0
if [[ ${{ inputs.activation_mode }}" == "light" ]]; then
# Lightweight mode: narrower API coverage, shorter sequences
run_perf mainnet eth_call stress_test_eth_call_20M 100:30,1000:20,10000:20,20000:20
run_perf mainnet eth_getLogs stress_test_eth_getLogs_15M 100:30,1000:20,10000:20
run_perf mainnet eth_getBalance stress_test_eth_getBalance_15M 100:30,1000:20,10000:20
run_perf mainnet eth_getBlockByHash stress_test_eth_getBlockByHash_14M 100:30,1000:20
run_perf mainnet eth_getTransactionByHash stress_test_eth_getTransactionByHash_13M 100:30,1000:20,10000:20
run_perf mainnet eth_getTransactionReceipt stress_test_eth_getTransactionReceipt_14M 100:30
failed_test=0
if [[ "${{ inputs.activation_mode }}" == "light" ]]; then
# Lightweight mode: narrower API coverage, less repetitions, shorter sequences
run_perf mainnet eth_call 3 stress_test_eth_call_20M 100:30,1000:20
run_perf mainnet eth_getLogs 3 stress_test_eth_getLogs_15M 100:30,1000:20
run_perf mainnet eth_getBlockByHash 3 stress_test_eth_getBlockByHash_14M 100:30,1000:20
else
# Full mode: wider API coverage, longer sequences
run_perf mainnet eth_call stress_test_eth_call_20M 1:1,100:30,1000:20,10000:20,20000:20
run_perf mainnet eth_getLogs stress_test_eth_getLogs_15M 1:1,100:30,1000:20,10000:20,20000:20
run_perf mainnet eth_getBalance stress_test_eth_getBalance_15M 1:1,100:30,1000:20,10000:20,20000:20
run_perf mainnet eth_getBlockByHash stress_test_eth_getBlockByHash_14M 1:1,100:30,1000:20,10000:20
run_perf mainnet eth_getBlockByNumber stress_test_eth_getBlockByNumber_13M 1:1,100:30,1000:20,5000:20
run_perf mainnet eth_getTransactionByHash stress_test_eth_getTransactionByHash_13M 1:1,100:30,1000:20,10000:20
run_perf mainnet eth_getTransactionReceipt stress_test_eth_getTransactionReceipt_14M 1:1,100:30,1000:20,5000:20,10000:20,20000:20
run_perf mainnet eth_createAccessList stress_test_eth_createAccessList_16M 1:1,100:30,1000:20,10000:20,20000:20
# Full mode: wider API coverage, more repetitions, longer sequences
run_perf mainnet eth_call 5 stress_test_eth_call_20M 1:1,100:30,1000:20,10000:20,20000:20
run_perf mainnet eth_getLogs 5 stress_test_eth_getLogs_15M 1:1,100:30,1000:20,10000:20,20000:20
run_perf mainnet eth_getBalance 5 stress_test_eth_getBalance_15M 1:1,100:30,1000:20,10000:20,20000:20
run_perf mainnet eth_getBlockByHash 5 stress_test_eth_getBlockByHash_14M 1:1,100:30,1000:20,10000:20
run_perf mainnet eth_getBlockByNumber 5 stress_test_eth_getBlockByNumber_13M 1:1,100:30,1000:20,5000:20
run_perf mainnet eth_getTransactionByHash 5 stress_test_eth_getTransactionByHash_13M 1:1,100:30,1000:20,10000:20
# run_perf mainnet eth_getTransactionReceipt 5 stress_test_eth_getTransactionReceipt_14M 1:1,100:30,1000:20,5000:20,10000:20,20000:20
run_perf mainnet eth_createAccessList 5 stress_test_eth_createAccessList_16M 1:1,100:30,1000:20,10000:20,20000:20
fi
if [ $failed_test -eq 0 ]; then
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/rpc-performance-tests-light.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: QA - RPC Performance Tests Light

on:
workflow_dispatch:
inputs:
measure_erigon:
description: 'Measure Erigon RPCDaemon'
type: boolean
default: false
pull_request:
branches:
- master
Expand All @@ -21,6 +26,12 @@ jobs:
ERIGON_QA_PATH: /opt/erigon-qa

steps:
- name: Checkout Silkworm repository
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: "0"
- uses: ./.github/actions/perf-common-steps
with:
activation_mode: light
measure_erigon: ${{github.event.inputs.measure_erigon}}
6 changes: 6 additions & 0 deletions .github/workflows/rpc-performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
ERIGON_QA_PATH: /opt/erigon-qa

steps:
- name: Checkout Silkworm repository
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: "0"
- uses: ./.github/actions/perf-common-steps
with:
activation_mode: full
measure_erigon: true

0 comments on commit 92439b2

Please # to comment.