Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 4248-refactor-tests…
Browse files Browse the repository at this point in the history
…-improve-ux-of-runtime-heuristics-tests
  • Loading branch information
Lazark0x committed Nov 26, 2024
2 parents b82d24a + de47744 commit 5994ee6
Show file tree
Hide file tree
Showing 178 changed files with 15,133 additions and 11,048 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ on:
description: Instance type to provision for benchmarking.
required: true
default: 'c6i.metal'
instance_max_cpu_frequency:
description: Max CPU frequency (only baremetal).
required: true
default: '3000000'
instance_disk_size:
description: Disk size (in GB) for the instance.
required: true
default: 100
default: '100'

concurrency:
group: benchmarks
Expand Down Expand Up @@ -93,7 +97,7 @@ jobs:
run: |
cd terraform/bench-runner
terraform init
terraform apply -auto-approve -var="aws_region=${{ env.AVAILABLE_REGION }}" -var="instance_type=${{ inputs.instance_type }}" -var="instance_disk_size=${{ inputs.instance_disk_size }}" -var="registration_token=${{ env.REGISTER_TOKEN }}" -var="github_run_id=${{ github.run_id }}"
terraform apply -auto-approve -var="aws_region=${{ env.AVAILABLE_REGION }}" -var="instance_type=${{ inputs.instance_type }}" -var="max_cpu_frequency=${{ inputs.instance_max_cpu_frequency }}" -var="instance_disk_size=${{ inputs.instance_disk_size }}" -var="registration_token=${{ env.REGISTER_TOKEN }}" -var="github_run_id=${{ github.run_id }}"
- name: Notify on Failure
if: failure()
Expand All @@ -111,6 +115,7 @@ jobs:
benchmarks:
needs: provision-runner
runs-on: [bench]
timeout-minutes: 720
permissions:
contents: write
pull-requests: write
Expand All @@ -132,6 +137,9 @@ jobs:
cargo install cargo-script
wasm-opt --version
- name: Check CPU frequency
run: sudo cpupower frequency-info | grep 'current CPU frequency'

- name: Run all benchmarks
run: |
INSTANCE_TYPE="${{ inputs.instance_type }}"
Expand Down Expand Up @@ -169,8 +177,8 @@ jobs:
with:
name: weights-vara
path: |
core/src/gas_metering/
runtime/vara/src/weights/
utils/wasm-instrument/src/gas_metering/
- name: "TIP: download the artifacts and use `./scripts/unpack-weights.sh`"
run: |
Expand All @@ -182,17 +190,17 @@ jobs:
with:
commit_message: >-
chore(runtime): update weights
file_pattern: "pallets/gear/src/ pallets/gear-builtin/src/ runtime/vara/src/weights/ utils/wasm-instrument/src/gas_metering/"
file_pattern: "core/src/gas_metering/ pallets/gear/src/ pallets/gear-builtin/src/ runtime/vara/src/weights/"

- name: Create Pull Request
if: ${{ inputs.change-type == 'pull_request' }}
uses: peter-evans/create-pull-request@v7
with:
add-paths: |
core/src/gas_metering/
pallets/gear/src/
pallets/gear-builtin/src/
runtime/vara/src/weights/
utils/wasm-instrument/src/gas_metering/
commit-message: update weights
branch: weights/patch
branch-suffix: short-commit-hash
Expand Down Expand Up @@ -230,7 +238,7 @@ jobs:
run: |
cd terraform/bench-runner
terraform init
terraform destroy -auto-approve -var="aws_region=${{ needs.provision-runner.outputs.available_region }}" -var="instance_type=${{ inputs.instance_type }}" -var="instance_disk_size=${{ inputs.instance_disk_size }}" -var="registration_token=${{ env.REGISTER_TOKEN }}" -var="github_run_id=${{ github.run_id }}"
terraform destroy -auto-approve -var="aws_region=${{ needs.provision-runner.outputs.available_region }}" -var="instance_type=${{ inputs.instance_type }}" -var="max_cpu_frequency=${{ inputs.instance_max_cpu_frequency }}" -var="instance_disk_size=${{ inputs.instance_disk_size }}" -var="registration_token=${{ env.REGISTER_TOKEN }}" -var="github_run_id=${{ github.run_id }}"
- name: Notify on Failure
if: failure()
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/build-win-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ jobs:
procps
mingw-w64-x86_64-protobuf
- name: "Install: Strawberry Perl"
run: |
$perlPath = "$Env:USERPROFILE\strawberry-perl"
$tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'zip' } -PassThru
Invoke-WebRequest -OutFile $tmp "https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54001_64bit_UCRT/strawberry-perl-5.40.0.1-64bit-portable.zip"
$tmp | Expand-Archive -DestinationPath $perlPath -Force
$tmp | Remove-Item
Add-Content -Path $Env:GITHUB_ENV -Value "OPENSSl_SRC_PERL=$perlPath/perl/bin/perl.exe"
shell: powershell

- name: "Install: Rustup"
run: |
Invoke-WebRequest -OutFile rustup-init.exe https://win.rustup.rs/x86_64
Expand All @@ -59,7 +71,7 @@ jobs:

- name: "Install: cargo-nextest"
run: |
$tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'zip' } -PassThru
$tmp = "cargo-nextest.zip"
Invoke-WebRequest -OutFile $tmp https://get.nexte.st/latest/windows
$outputDir = if ($Env:CARGO_HOME) { Join-Path $Env:CARGO_HOME "bin" } else { "~/.cargo/bin" }
$tmp | Expand-Archive -DestinationPath $outputDir -Force
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
- name: "Test: Benchmarks in WASM"
# unoptimized benchmarks take a few hours to run
if: ${{ matrix.profile == 'release' }}
if: ${{ matrix.profiles.name == 'release' }}
run: |
cargo build -p gear-cli --features=runtime-benchmarks,runtime-benchmarks-checkers ${{ matrix.profiles.flags }}
# check that perf benchmarks works. `--steps=5` need to test, that benchmarks works for different input number.
Expand Down Expand Up @@ -219,6 +219,13 @@ jobs:
wineboot
winetricks win10
- name: "Install: FireDaemon OpenSSL"
run: |
wget https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-3.4.0.zip
unzip openssl-3.4.0.zip "x64/*" -d openssl
echo "OPENSSL_NO_VENDOR=1" >> $GITHUB_ENV
echo "OPENSSL_DIR=$(pwd)/openssl/x64" >> $GITHUB_ENV
- name: "Install: LLVM"
run: |
sudo ./.github/build-win-cross/update-alternatives-clang.sh 12 100
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: "Install: Node.js"
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 22.x

- name: "Show: Versioning"
run: |
Expand All @@ -43,6 +43,10 @@ jobs:
- name: "Check: ethexe contracts"
run: |
npm cache clean --force
# version from ethexe/contracts/lib/openzeppelin-foundry-upgrades/src/internal/Versions.sol
npx @openzeppelin/upgrades-core@^1.32.3
cd ethexe/contracts
forge fmt --check
forge build --sizes
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:
- false
default: 'false'

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
cp -vf target/release/wasm-proc ./
- name: "Build: Production `vara-runtime`"
run: cargo build -p vara-runtime --profile production --no-default-features --features std
run: cargo build -p vara-runtime --profile production --no-default-features --features std,metadata-hash

- name: "Test: Production `vara-runtime`"
run: ./wasm-proc --check-runtime-imports --check-runtime-is-dev false target/production/wbuild/vara-runtime/vara_runtime.compact.wasm
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/test-measurements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,9 @@ jobs:
--output-file ./target/action-pallet-output.json
- name: "Collect: pallet-gear benches"
run: >-
./target/release/gear benchmark pallet --pallet=pallet_gear
--steps=50
--repeat=20
--chain=dev
--extrinsic=*
--heap-pages=4096
--output ./target/weights.json
--template ./.maintain/regression-analysis-weight-template.hbs
run: |
touch ./target/weights.json
./target/release/gear benchmark pallet --pallet=pallet_gear --steps=50 --repeat=20 --chain=dev --extrinsic=* --heap-pages=4096 --output ./target/weights.json --template ./.maintain/regression-analysis-weight-template.hbs
- name: "Generate report: pallet-gear benches"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
tags: ${{ needs.prepare.outputs.image_name }}

- name: SSH into VM
uses: appleboy/ssh-action@v1.1.0
uses: appleboy/ssh-action@v1.2.0
env:
NEW_IMAGE: ${{ needs.prepare.outputs.image_name }}
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "ethexe/contracts/lib/openzeppelin-contracts-upgradeable"]
path = ethexe/contracts/lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "ethexe/contracts/lib/symbiotic-core"]
path = ethexe/contracts/lib/symbiotic-core
url = https://github.com/grishasobol/symbiotic-core
Loading

0 comments on commit 5994ee6

Please sign in to comment.