-
Notifications
You must be signed in to change notification settings - Fork 119
146 lines (146 loc) · 5.58 KB
/
run_all_benchmarks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
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.74.0
rustup default 1.74.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@v4
with:
name: manta
path: ./target/production/manta
- if: always()
name: upload frame weights
uses: actions/upload-artifact@v4
with:
name: frame-weights-output
path: ./scripts/benchmarking/frame-weights-output/
- if: always()
name: upload xcm weights
uses: actions/upload-artifact@v4
with:
name: xcm-weights-output
path: ./scripts/benchmarking/xcm-weights-output/
- if: always()
name: upload benchmarking errors
uses: actions/upload-artifact@v4
with:
name: benchmarks-errors
path: ./scripts/benchmarking/benchmarking_errors.txt
- if: always()
name: upload machine benchmark result
uses: actions/upload-artifact@v4
with:
name: machine-benchmark
path: ./scripts/benchmarking/machine_benchmark_result.txt
- if: always()
name: upload storage weights
uses: actions/upload-artifact@v4
with:
name: rocksdb-weights
path: ./scripts/benchmarking/rocksdb_weights.rs