Move scripts used in CI to the new location (#5198)

* Move CI scripts and update references

* Update paths in .gitlab-ci.yml

* Removed outdated entries from CODEOWNERS
This commit is contained in:
Sergejs Kostjucenko
2022-04-26 08:39:31 +03:00
committed by GitHub
parent 9a840bb12a
commit 631a5db536
61 changed files with 46 additions and 48 deletions
+54
View File
@@ -0,0 +1,54 @@
#!/bin/bash
set -e
# Runs all benchmarks for all pallets, for a given runtime, provided by $1
# Should be run on a reference machine to gain accurate benchmarks
# current reference machine: https://github.com/paritytech/substrate/pull/5848
runtime="$1"
echo "[+] Running all benchmarks for $runtime"
cargo +nightly build --profile production --locked --features=runtime-benchmarks
./target/production/polkadot benchmark pallet \
--chain "${runtime}-dev" \
--list |\
tail -n+2 |\
cut -d',' -f1 |\
uniq > "${runtime}_pallets"
# For each pallet found in the previous command, run benches on each function
while read -r line; do
pallet="$(echo "$line" | cut -d' ' -f1)";
echo "Runtime: $runtime. Pallet: $pallet";
# '!' has the side effect of bypassing errexit / set -e
! ./target/production/polkadot benchmark pallet \
--chain="${runtime}-dev" \
--steps=50 \
--repeat=20 \
--pallet="$pallet" \
--extrinsic="*" \
--execution=wasm \
--wasm-execution=compiled \
--heap-pages=4096 \
--header=./file_header.txt \
--output="./runtime/${runtime}/src/weights/${pallet/::/_}.rs"
done < "${runtime}_pallets"
rm "${runtime}_pallets"
# Benchmark base weights
! ./target/production/polkadot benchmark overhead \
--chain="${runtime}-dev" \
--execution=wasm \
--wasm-execution=compiled \
--weight-path="runtime/${runtime}/constants/src/weights/" \
--warmup=10 \
--repeat=100
# This true makes sure that $? is 0 instead of
# carrying over a failure which would otherwise cause
# the whole CI job to abort.
true