ci: add temporary benchmark workflows for pr2483 sweep #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Bench Fireactions Docker Localnet Dry-Run | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| ref: | ||
| description: Branch or tag to benchmark | ||
| required: true | ||
| default: fireactions-runners | ||
| runner_label: | ||
| description: Fireactions benchmark label | ||
| required: true | ||
| sweep_id: | ||
| description: Sweep identifier | ||
| required: true | ||
| rep: | ||
| description: Repetition number | ||
| required: true | ||
| bench_job_key: | ||
| description: Job selector (artifacts-fast-runtime, artifacts-non-fast-runtime, docker) | ||
| required: true | ||
| default: artifacts-fast-runtime | ||
| run-name: bench-docker-localnet | ${{ inputs.sweep_id }} | ${{ inputs.bench_job_key }} | ${{ inputs.runner_label }} | rep-${{ inputs.rep }} | ||
| concurrency: | ||
| group: bench-docker-localnet-${{ inputs.sweep_id }}-${{ inputs.bench_job_key }}-${{ inputs.runner_label }}-rep-${{ inputs.rep }} | ||
| cancel-in-progress: false | ||
| permissions: | ||
| contents: read | ||
| actions: read | ||
| packages: read | ||
| jobs: | ||
| setup: | ||
| runs-on: [self-hosted, ${{ inputs.runner_label }}] | ||
| outputs: | ||
| ref: ${{ steps.vars.outputs.ref }} | ||
| tag: ${{ steps.vars.outputs.tag }} | ||
| steps: | ||
| - id: vars | ||
| run: | | ||
| echo "ref=${{ inputs.ref }}" >> "$GITHUB_OUTPUT" | ||
| echo "tag=dryrun-${{ github.run_id }}" >> "$GITHUB_OUTPUT" | ||
| artifacts: | ||
| name: Node • ${{ matrix.runtime }} • amd64 | ||
| needs: setup | ||
| if: ${{ inputs.bench_job_key == 'docker' || inputs.bench_job_key == matrix.key }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - runtime: fast-runtime | ||
| key: artifacts-fast-runtime | ||
| - runtime: non-fast-runtime | ||
| key: artifacts-non-fast-runtime | ||
| runs-on: [self-hosted, ${{ inputs.runner_label }}] | ||
| timeout-minutes: 120 | ||
| env: | ||
| CARGO_BUILD_JOBS: 6 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ needs.setup.outputs.ref }} | ||
| - name: Dependency gate | ||
| run: | | ||
| set -euo pipefail | ||
| for cmd in docker clang pkg-config protoc; do | ||
| command -v "$cmd" | ||
| done | ||
| pkg-config --exists openssl | ||
| pkg-config --exists libudev | ||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| profile: minimal | ||
| toolchain: 1.88.0 | ||
| - run: rustup target add x86_64-unknown-linux-gnu | ||
| - name: Patch limits for local run | ||
| run: | | ||
| chmod +x ./scripts/localnet_patch.sh | ||
| ./scripts/localnet_patch.sh | ||
| - name: Build binaries | ||
| run: | | ||
| export PATH="$HOME/.cargo/bin:$PATH" | ||
| export CARGO_BUILD_TARGET="x86_64-unknown-linux-gnu" | ||
| if [ "${{ matrix.runtime }}" = "fast-runtime" ]; then | ||
| ./scripts/localnet.sh --build-only | ||
| else | ||
| ./scripts/localnet.sh False --build-only | ||
| fi | ||
| - name: Prepare artifacts for upload | ||
| run: | | ||
| RUNTIME="${{ matrix.runtime }}" | ||
| TRIPLE="x86_64-unknown-linux-gnu" | ||
| mkdir -p build/ci_target/${RUNTIME}/${TRIPLE}/release/ | ||
| cp -v target/${RUNTIME}/${TRIPLE}/release/node-subtensor build/ci_target/${RUNTIME}/${TRIPLE}/release/ | ||
| mkdir -p build/ci_target/${RUNTIME}/${TRIPLE}/release/wbuild/node-subtensor-runtime/ | ||
| cp -v target/${RUNTIME}/${TRIPLE}/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm build/ci_target/${RUNTIME}/${TRIPLE}/release/wbuild/node-subtensor-runtime/ | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dryrun-binaries-x86_64-unknown-linux-gnu-${{ matrix.runtime }} | ||
| path: build/ | ||
| if-no-files-found: error | ||
| docker: | ||
| if: ${{ inputs.bench_job_key == 'docker' }} | ||
| needs: [setup, artifacts] | ||
| runs-on: [self-hosted, ${{ inputs.runner_label }}] | ||
| timeout-minutes: 90 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ needs.setup.outputs.ref }} | ||
| - uses: actions/download-artifact@v5 | ||
| with: | ||
| pattern: dryrun-binaries-* | ||
| path: build/ | ||
| merge-multiple: true | ||
| - name: Dependency gate | ||
| run: | | ||
| set -euo pipefail | ||
| command -v docker | ||
| docker version | ||
| - uses: docker/setup-buildx-action@v3 | ||
| with: | ||
| driver: docker | ||
| - uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: Dockerfile-localnet | ||
| build-args: | | ||
| BUILT_IN_CI="Boom shakalaka" | ||
| push: false | ||
| load: false | ||
| platforms: linux/amd64 | ||
| tags: ghcr.io/${{ github.repository }}-localnet:${{ needs.setup.outputs.tag }} | ||