-
Notifications
You must be signed in to change notification settings - Fork 305
Expand file tree
/
Copy pathbench-fireactions-docker-localnet-dryrun.yml
More file actions
138 lines (131 loc) · 4.72 KB
/
bench-fireactions-docker-localnet-dryrun.yml
File metadata and controls
138 lines (131 loc) · 4.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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 | ${{ github.event.inputs.sweep_id }} | ${{ github.event.inputs.bench_job_key }} | ${{ github.event.inputs.runner_label }} | rep-${{ github.event.inputs.rep }}
concurrency:
group: bench-docker-localnet-${{ github.event.inputs.sweep_id }}-${{ github.event.inputs.bench_job_key }}-${{ github.event.inputs.runner_label }}-rep-${{ github.event.inputs.rep }}
cancel-in-progress: false
permissions:
contents: read
actions: read
packages: read
jobs:
setup:
runs-on: [self-hosted, ${{ github.event.inputs.runner_label }}]
outputs:
ref: ${{ steps.vars.outputs.ref }}
tag: ${{ steps.vars.outputs.tag }}
steps:
- id: vars
run: |
echo "ref=${{ github.event.inputs.ref }}" >> "$GITHUB_OUTPUT"
echo "tag=dryrun-${{ github.run_id }}" >> "$GITHUB_OUTPUT"
artifacts:
name: Node • ${{ matrix.runtime }} • amd64
needs: setup
if: ${{ github.event.inputs.bench_job_key == 'docker' || github.event.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, ${{ github.event.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: ${{ github.event.inputs.bench_job_key == 'docker' }}
needs: [setup, artifacts]
runs-on: [self-hosted, ${{ github.event.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 }}