Skip to content

Run All Benchmarks #170

Run All Benchmarks

Run All Benchmarks #170

name: Run All Benchmarks
on:
workflow_dispatch:
inputs:
chain_spec:
description: The chain spec to be used for all benchmarks. Required.
default: manta-dev
required: true
snapshot_url:
description: The chain snapshot to use for storage benchmarks. Leaving it blank will skip the storage benchmark.
default: ""
concurrency:
group: ${{ github.workflow }}-manta
env:
DEBIAN_FRONTEND: noninteractive
CHAIN_SPEC: ${{github.event.inputs.chain_spec}}
SNAPSHOT_URL: ${{github.event.inputs.snapshot_url}}
FULL_DB_FOLDER: full-db
jobs:
run-benchmarks:
timeout-minutes: 720
runs-on: runtime-large
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
- name: install sccache
env:
SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.5.3
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$SCCACHE_RELEASE_URL/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
chmod +x $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: cache sccache
uses: actions/cache@v2
continue-on-error: false
with:
path: /home/runner/.cache/sccache
key: sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
sccache-
- name: start sccache server
run: sccache --start-server
- name: init
run: |
sudo apt update
sudo apt install -y pkg-config libssl-dev protobuf-compiler build-essential clang curl llvm libudev-dev libclang-dev
protoc --version
curl -s https://sh.rustup.rs -sSf | sh -s -- -y
source ${HOME}/.cargo/env
rustup toolchain install 1.71.0
rustup default 1.71.0
rustup target add wasm32-unknown-unknown
- name: cache cargo
uses: Swatinem/rust-cache@v2
- name: init nodejs && yarn
run: |
curl -s https://deb.nodesource.com/setup_18.x | sudo bash
sudo apt install nodejs -y
node -v
sudo npm install --global yarn
yarn -v
- name: build benchmarking binary
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: /home/runner/.cache/sccache
CARGO_TERM_COLOR: always
run: |
source ${HOME}/.cargo/env
RUSTC_BOOTSTRAP=1 cargo build --profile production --features runtime-benchmarks --timings
- name: create-chainspec
run: |
${{ github.workspace }}/target/production/manta build-spec --chain $CHAIN_SPEC --disable-default-bootnode --raw > ${{ github.workspace }}/tests/data/fork.json
- name: append manta-pay and manta-sbt storage
run: |
wget -P ${{ github.workspace }}/tests/data https://manta-ops.s3.amazonaws.com/integration-tests-data/storage.json
wget -P ${{ github.workspace }}/tests/data https://mantasbt-storage.s3.amazonaws.com/mantaSbtStorage.json
cd ${{ github.workspace }}/tests
yarn install
yarn
if [[ $CHAIN_SPEC == calamari* ]];then
echo insert mantapay and mantasbt storage into calamari chain spec
node append_storage.js calamari
else
echo insert mantasbt storage into manta chain spec
node append_storage.js
fi
CHAIN_SPEC=${{ github.workspace }}/tests/data/fork.json
echo $CHAIN_SPEC
- name: stop sccache server
run: sccache --stop-server || true
- if: ${{ env.SNAPSHOT_URL == '' }}
name: run all benchmarks script without storage benchmark
run: |
./scripts/benchmarking/run_all_benchmarks.sh -b -c ${{ github.workspace }}/tests/data/fork.json
- if: ${{ env.SNAPSHOT_URL != '' }}
name: run all benchmarks script with storage benchmark
run: |
mkdir $FULL_DB_FOLDER
wget -q $SNAPSHOT_URL
tar -xf calamari.tar.gz --directory ./$FULL_DB_FOLDER
./scripts/benchmarking/run_all_benchmarks.sh -b -c ${{ github.workspace }}/tests/data/fork.json -s ./$FULL_DB_FOLDER
- if: always()
name: upload benchmarking binary
uses: actions/upload-artifact@v2
with:
name: manta
path: ./target/production/manta
- if: always()
name: upload frame weights
uses: actions/upload-artifact@v2
with:
name: frame-weights-output
path: ./scripts/benchmarking/frame-weights-output/
- if: always()
name: upload xcm weights
uses: actions/upload-artifact@v2
with:
name: xcm-weights-output
path: ./scripts/benchmarking/xcm-weights-output/
- if: always()
name: upload benchmarking errors
uses: actions/upload-artifact@v2
with:
name: benchmarks-errors
path: ./scripts/benchmarking/benchmarking_errors.txt
- if: always()
name: upload machine benchmark result
uses: actions/upload-artifact@v2
with:
name: machine-benchmark
path: ./scripts/benchmarking/machine_benchmark_result.txt
- if: always()
name: upload storage weights
uses: actions/upload-artifact@v2
with:
name: rocksdb-weights
path: ./scripts/benchmarking/rocksdb_weights.rs