Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select chains to benchmark in the benchmarking CI #677

Merged
merged 3 commits into from
Jul 1, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 32 additions & 11 deletions .github/workflows/benchmark-runtime-weights.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ name: Benchmark runtime weights
on:
workflow_dispatch:
inputs:
chain:
type: choice
description: The chain whose runtime is benchmarked, all = rococo+litmus+litentry
options:
- all
- litmus
- litentry
- rococo
litentry:
type: boolean
description: The litentry will be benchmarked
Kailai-Wang marked this conversation as resolved.
Show resolved Hide resolved
required: true
default: true
litmus:
type: boolean
description: The litmus will be benchmarked
required: true
default: true
rococo:
type: boolean
description: The rococo will be benchmarked
required: true
default: true
pallets:
description: pallets to benchmark, * for all, or comma listed (e.g. frame-system,pallet-proxy)
default: "*"
Expand All @@ -24,6 +31,20 @@ jobs:
build-and-benchmark:
runs-on: self-hosted
steps:
- name: Set env
run: |
chain=""
if [ "${{ github.event.inputs.litmus }}" = "true" ]; then
chain="$chain litmus"
fi
if [ "${{ github.event.inputs.litentry }}" = "true" ]; then
chain="$chain litentry"
fi
if [ "${{ github.event.inputs.rococo }}" = "true" ]; then
chain="$chain rococo"
fi
echo "CHAIN=$chain" >> $GITHUB_ENV
Kailai-Wang marked this conversation as resolved.
Show resolved Hide resolved

- name: Checkout codes on ${{ github.ref }}
uses: actions/checkout@v3
with:
Expand All @@ -42,12 +63,12 @@ jobs:
[ -z "$(docker images --filter=dangling=true -q)" ] || docker rmi -f $(docker images --filter=dangling=true -q)

# exit status should propagate through ssh
- name: Remotely benchmark pallets ${{ github.event.inputs.pallets }} for ${{ github.event.inputs.chain }}
- name: Remotely benchmark pallets ${{ github.event.inputs.pallets }} for ${{ env.CHAIN }}
timeout-minutes: 240
run: |
# prepend the asterisk with \ to go through ssh
arg="${{ github.event.inputs.pallets }}"
chain="${{ github.event.inputs.chain }}"
chain="${{ env.CHAIN }}"
if [ "$arg" = "*" ]; then
arg="\\$arg";
fi
Kailai-Wang marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -77,7 +98,7 @@ jobs:
It updates the weights files under `runtime/*/src/weights/*.rs` after running benchmarks on the remote machine: ${{ env.REMOTE_HOST }}

Pallets: "${{ github.event.inputs.pallets }}"
Chain: "${{ github.event.inputs.chain }}" [all = rococo,litmus,litentry]
Chain: "${{ env.CHAIN }}"
Github action run: https://github.com/litentry/litentry-parachain/actions/runs/${{ github.run_id }}
labels: |
S1-pleasereview
Expand Down