-
Notifications
You must be signed in to change notification settings - Fork 571
178 lines (156 loc) · 6.31 KB
/
Copy pathbenchmarks.yml
File metadata and controls
178 lines (156 loc) · 6.31 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: Header and RPC Benchmarks
on:
# push:
# branches:
# - main
# - develop
# pull_request:
# branches:
# - main
# - develop
workflow_dispatch:
env:
CARGO_SCCACHE_COMMIT: bed5571c
jobs:
benchmarks_iai:
runs-on: [self-hosted, reference]
env:
SKIP_WASM_BUILD: true
RUST_BACKTRACE: full
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
~/.cache/
~/.cargo/bin/sccache*
key: ${{ runner.OS }}-cache-iai-${{ env.CARGO_SCCACHE_COMMIT }}-v1
- name: Install system dependencies
# We force to reinstall `valgrind` because `codspeed` replaces that binary and the output
# of `valgrind.codspeed` generates a
run: |
sudo apt-get update
sudo apt remove -y valgrind
sudo apt-get install -y build-essential pkg-config libssl-dev valgrind git clang curl libssl-dev protobuf-compiler unzip python3-pip
- name: Setup Rust toolchain
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.75.0
source "$HOME/.cargo/env"
rustup show
- name: Set PATH for cargo
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo "SCCACHE_DIR=${HOME}/.cache/sccache" >> $GITHUB_ENV
- name: SCCache
run: |
# We altered the path to avoid old actions to overwrite it
if [ ! -f ~/.cargo/bin/sccache ]; then
rustup run stable cargo install sccache \
--git https://github.com/purestake/sccache.git \
--rev $CARGO_SCCACHE_COMMIT \
--force --no-default-features --features=dist-client
fi
if [[ -z `pgrep sccache` ]]; then
chmod +x ~/.cargo/bin/sccache
sccache --start-server
fi
sccache -s
echo "RUSTC_WRAPPER=${HOME}/.cargo/bin/sccache" >> $GITHUB_ENV
- name: Run Header Generation Benchmarks on IAI
run: |
cargo uninstall --locked cargo-codspeed | true
which valgrind
sudo dpkg -S `which valgrind`
valgrind --version
mkdir -p ~/.cache/iai/
cargo +1.75.0 bench -p da-runtime --bench header_kate_commitment_iai | tee ~/.cache/iai/header_gen_bench_iai.txt || true
find ./runtime/target/iai -type f
- name: Header Generation Regression Checks on IAI
uses: fmiguelgarcia/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
tool: 'rustIai'
# Where the output from the benchmark tool is stored
output-file-path: ~/.cache/iai/header_gen_bench_iai.txt
# Where the previous data file is stored
external-data-json-path: ~/.cache/iai/benchmark-data-iai.json
save-data-file: true
# Workflow will fail when an alert happens at 15% degradation
fail-on-alert: true
alert-threshold: '115%'
# Upload the updated cache file for the next job by actions/cache
github-token: ${{ secrets.GITHUB_TOKEN }}
# Enable alert commit comment
comment-on-alert: true
# Mention @rhysd in the commit comment
alert-comment-cc-users: '@prabal-banerjee,@jakubcech,@vthunder,@kroos47,@Leouarz,@markopoloparadox'
comment-always: true
summary-always: true
benchmarks_cri:
runs-on: [self-hosted, reference]
env:
SKIP_WASM_BUILD: true
RUST_BACKTRACE: full
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
~/.cache/
~/.cargo/bin/sccache*
key: ${{ runner.OS }}-cache-cri-${{ env.CARGO_SCCACHE_COMMIT }}-v1
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libssl-dev valgrind git clang curl libssl-dev protobuf-compiler unzip python3-pip
- name: Setup Rust toolchain
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.75.0
source "$HOME/.cargo/env"
rustup show
- name: Set PATH for cargo
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo "SCCACHE_DIR=${HOME}/.cache/sccache" >> $GITHUB_ENV
- name: SCCache
run: |
# We altered the path to avoid old actions to overwrite it
if [ ! -f ~/.cargo/bin/sccache ]; then
rustup run stable cargo install sccache \
--git https://github.com/purestake/sccache.git \
--rev $CARGO_SCCACHE_COMMIT \
--force --no-default-features --features=dist-client
fi
if [[ -z `pgrep sccache` ]]; then
chmod +x ~/.cargo/bin/sccache
sccache --start-server
fi
sccache -s
echo "RUSTC_WRAPPER=${HOME}/.cargo/bin/sccache" >> $GITHUB_ENV
- name: Run Header Generation Benchmarks on Criterion
run: |
mkdir -p ~/.cache/cri/
cargo +1.75.0 bench -p da-runtime --bench header_kate_commitment_cri -- --color never --noplot --output-format bencher | tee ~/.cache/cri/header_gen_bench_cri.txt || true
- name: Header Generation Regression Checks on Criterion
uses: fmiguelgarcia/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
tool: 'cargo'
# Where the output from the benchmark tool is stored
output-file-path: ~/.cache/cri/header_gen_bench_cri.txt
# Where the previous data file is stored
external-data-json-path: ~/.cache/cri/benchmark-data-cri.json
save-data-file: true
# Workflow will fail when an alert happens at 15% degradation
fail-on-alert: true
alert-threshold: '115%'
# Upload the updated cache file for the next job by actions/cache
github-token: ${{ secrets.GITHUB_TOKEN }}
# Enable alert commit comment
comment-on-alert: true
# Mention @rhysd in the commit comment
alert-comment-cc-users: '@prabal-banerjee,@jakubcech,@vthunder,@kroos47,@Leouarz,@markopoloparadox'
comment-always: true
summary-always: true
- name: Display SCCache Stats
run: sccache --show-stats