Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

ci: gomu gomu no gatling workflow integration #1101

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fc80491
ci: gomu gomu no gatling workflow integration
dbejarano820 Sep 17, 2023
4e6d9d5
workflow rename
dbejarano820 Sep 17, 2023
3386bec
benchmark config and madara command in workflow
dbejarano820 Sep 19, 2023
2343153
workflow tweak
dbejarano820 Sep 19, 2023
5c6e645
changelog update
dbejarano820 Sep 20, 2023
e1b9938
tweak
dbejarano820 Sep 20, 2023
6042a5d
restructure ci
d-roak Sep 20, 2023
a659487
Merge branch 'main' into gomu-gomu-no-gatling-integration
d-roak Sep 20, 2023
28cbcfb
rm inexistent tests-coverage
d-roak Sep 20, 2023
e0cbc8b
prettier lint
dbejarano820 Sep 20, 2023
d2842c0
database fix
dbejarano820 Sep 20, 2023
db2467d
run madara in background workflow
dbejarano820 Sep 20, 2023
79effcc
Merge branch 'main' into gomu-gomu-no-gatling-integration
d-roak Sep 22, 2023
5042c7c
cargolock
dbejarano820 Sep 23, 2023
bfa3bb7
config path tweak
dbejarano820 Sep 23, 2023
d2b04b9
config path tweak
dbejarano820 Sep 23, 2023
04117ef
add absolute path
d-roak Sep 23, 2023
7e48051
revert path for benchmark config; correct contract paths
d-roak Sep 23, 2023
d8dc351
run on gh managed machine; kill madara after benchmark
d-roak Sep 23, 2023
0c9dc31
fix merge conflict
d-roak Oct 12, 2023
e531a46
add setup; change bootstrap and shutdown of madara
d-roak Oct 12, 2023
6a9bd1e
Merge branch 'main' into gomu-gomu-no-gatling-integration
d-roak Oct 16, 2023
5528cfa
prettier
d-roak Oct 18, 2023
24fee9b
change cache retrieval in benchmark action
d-roak Oct 18, 2023
ec111c1
change contracts paths
d-roak Oct 19, 2023
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
99 changes: 14 additions & 85 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,98 +7,27 @@ on:

jobs:
benchmark:
runs-on: [self-hosted, linux, benchmark]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
clean: false
- name: Build tests and install benchmark projects
run: |-
cd tests
npm clean-install
npm run build
cd ../benchmarking
npm i
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
path: target/release/madara
key:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
fail-on-cache-miss: true
- name: Run benchmark
run: |
cd benchmarking
npm run test:ci
- name: Compare result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: "customBiggerIsBetter"
output-file-path: ./benchmarking/reports/metrics.json
alert-threshold: "120%"
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-alert: true
summary-always: ${{ github.ref == 'refs/heads/main' }}
comment-always: false
comment-on-alert: false
auto-push: ${{ github.ref == 'refs/heads/main' }}

benchmark-with-state-root:
runs-on: [self-hosted, linux, benchmark]
steps:
- uses: actions/checkout@v3
with:
clean: false
- name: Build tests and install benchmark projects
run: |-
cd tests
npm clean-install
npm run build
cd ../benchmarking
npm i
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
fail-on-cache-miss: true
restore-keys: |
${{ runner.os }}-cargo
- name: Setup rust toolchain
if: steps.cache.outputs.cache-hit != 'true'
run: rustup show
- name: Setup build deps
run: |
sudo apt-get update
sudo apt-get install -y clang llvm libudev-dev protobuf-compiler
- name: Build the project
run: |
cargo build --release --workspace
- name: Run benchmark
- name: Setup Madara
run: target/release/madara setup --chain=dev --from-remote
- name: Run Madara in background
id: madara
run: |
cd benchmarking
npm run test:ci-state-root:erc20
- name: Compare result
uses: benchmark-action/github-action-benchmark@v1
target/release/madara --dev &
echo "RUN_PID=$\!" >> "$GITHUB_OUTPUT"
while ! echo exit | nc localhost 9944; do sleep 1; done
- name: Run Gomu Gomu no Gatling Action
uses: keep-starknet-strange/gomu-gomu-no-gatling/.github/actions@main
with:
tool: "customBiggerIsBetter"
output-file-path: ./benchmarking/reports/metrics-state-root.json
alert-threshold: "120%"
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-alert: true
summary-always: ${{ github.ref == 'refs/heads/main' }}
comment-always: false
comment-on-alert: false
benchmark-data-dir-path: "dev/bench-with-state-root"
auto-push: ${{ github.ref == 'refs/heads/main' }}
config_path: "benchmark.yml"
dbejarano820 marked this conversation as resolved.
Show resolved Hide resolved
- name: Stop Madara
run: kill "${{ steps.madara.outputs.RUN_PID }}"
16 changes: 4 additions & 12 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,7 @@ jobs:
uses: ./.github/workflows/starknet-rpc-tests.yml
needs: madara_commands

# https://github.com/keep-starknet-strange/madara/issues/1097
# benchmark:
# name: Run benchmarks
# uses: ./.github/workflows/benchmarks.yml
# needs: [rust_build, tests]
# permissions:
# # deployments permission to deploy GitHub pages website
# deployments: write
# # contents permission to update benchmark contents in gh-pages branch
# contents: write
# # post on the pull-request page
# pull-requests: write
benchmark:
name: Run benchmarks
uses: ./.github/workflows/benchmarks.yml
needs: madara_commands
18 changes: 5 additions & 13 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,14 @@ jobs:
uses: ./.github/workflows/starknet-rpc-tests.yml
needs: madara_commands

# https://github.com/keep-starknet-strange/madara/issues/1097
# benchmark:
# name: Run benchmarks
# uses: ./.github/workflows/benchmarks.yml
# needs: [rust_build, tests]
# permissions:
# # deployments permission to deploy GitHub pages website
# deployments: write
# # contents permission to update benchmark contents in gh-pages branch
# contents: write
# # post on the pull-request page
# pull-requests: write
benchmark:
name: Run benchmarks
uses: ./.github/workflows/benchmarks.yml
needs: madara_commands

rustdoc:
name: Deploy docs to GitHub Pages
uses: ./.github/workflows/rustdoc.yml
needs: linters_cargo
needs: benchmark
permissions:
contents: write
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
- chore: cairo-contracts compilation scripts & docs are updated, cairo_0
contracts recompiled
- chore: rebase of core deps and 0.12.1
- ci: add gomu gomu no gatling pr benchmark workflow
d-roak marked this conversation as resolved.
Show resolved Hide resolved

## v0.1.0

Expand Down
28 changes: 28 additions & 0 deletions benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
rpc:
url: "http://localhost:9944"

setup:
erc20_contract:
v0: configs/genesis-assets/ERC20.json

erc721_contract:
v0: configs/genesis-assets/ERC721.json

account_contract:
v0: configs/genesis-assets/OpenzeppelinAccount.json

fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
num_accounts: 3

run:
num_erc20_transfers: 1200
num_erc721_mints: 1200

report:
num_blocks: 4
reports_dir: "reports"

deployer:
salt: 1
address: "0x0000000000000000000000000000000000000000000000000000000000000002"
signing_key: "0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d"
Loading