Skip to content

Commit cfafb61

Browse files
committed
Merge remote-tracking branch 'upstream/devnet-ready' into jeremy-staking-precompile-approvals
2 parents b3b2148 + daf9629 commit cfafb61

File tree

305 files changed

+52456
-15568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+52456
-15568
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
# Check if the "skip-validate-benchmarks" label is present on a PR.
3+
# Usage: check-skip-label.sh <PR_NUMBER>
4+
# Exits 0 normally, or exits 0 after cancelling the workflow if label found.
5+
6+
set -euo pipefail
7+
8+
PR_NUMBER="${1:-}"
9+
[[ -z "$PR_NUMBER" ]] && exit 0
10+
11+
REPO="${GITHUB_REPOSITORY:-}"
12+
[[ -z "$REPO" ]] && exit 0
13+
14+
labels=$(gh pr view "$PR_NUMBER" --repo "$REPO" --json labels --jq '.labels[].name' 2>/dev/null || true)
15+
16+
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
17+
echo "skip-validate-benchmarks label found — exiting."
18+
exit 1
19+
fi

.github/workflows/eco-tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: eco-tests
2+
3+
permissions:
4+
contents: read
5+
6+
concurrency:
7+
group: eco-tests-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
on:
11+
pull_request:
12+
workflow_dispatch:
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
17+
jobs:
18+
eco-tests:
19+
name: cargo test (eco-tests)
20+
runs-on: [self-hosted, type-ccx43]
21+
env:
22+
RUST_BACKTRACE: full
23+
SKIP_WASM_BUILD: 1
24+
steps:
25+
- name: Check-out repository under $GITHUB_WORKSPACE
26+
uses: actions/checkout@v4
27+
28+
- name: Install dependencies
29+
run: |
30+
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get update
31+
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" build-essential clang curl git make libssl-dev llvm libudev-dev protobuf-compiler pkg-config
32+
33+
- name: Install Rust
34+
uses: actions-rs/toolchain@v1
35+
with:
36+
toolchain: stable
37+
38+
- name: Utilize Shared Rust Cache
39+
uses: Swatinem/rust-cache@v2
40+
with:
41+
key: eco-tests
42+
cache-on-failure: true
43+
workspaces: eco-tests
44+
45+
- name: cargo test
46+
working-directory: eco-tests
47+
run: cargo test

.github/workflows/run-benchmarks.yml

Lines changed: 14 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -18,157 +18,65 @@ jobs:
1818
validate-benchmarks:
1919
runs-on: Benchmarking
2020

21-
env:
22-
SKIP_BENCHMARKS: "0"
23-
2421
steps:
2522
- name: Check out PR branch
26-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
2723
uses: actions/checkout@v4
2824
with:
2925
repository: ${{ github.event.pull_request.head.repo.full_name }}
3026
ref: ${{ github.event.pull_request.head.ref }}
3127
fetch-depth: 0
3228

3329
- name: Install GitHub CLI
34-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
3530
run: |
3631
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get update
37-
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" gh
32+
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y --no-install-recommends \
33+
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" gh
3834
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
3935
40-
# (1) — first skip‑label check
41-
- name: Check skip label
42-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
43-
run: |
44-
labels=$(gh pr view ${{ github.event.pull_request.number }} \
45-
--repo "${{ github.repository }}" \
46-
--json labels --jq '.labels[].name')
47-
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
48-
echo "skip-validate-benchmarks label found — skipping benchmarks."
49-
echo "SKIP_BENCHMARKS=1" >> "$GITHUB_ENV"
50-
fi
51-
5236
- name: Install system dependencies
53-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
5437
run: |
55-
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get update
56-
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" build-essential clang curl libssl-dev llvm libudev-dev protobuf-compiler pkg-config
57-
58-
# (2)
59-
- name: Check skip label
60-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
61-
run: |
62-
labels=$(gh pr view ${{ github.event.pull_request.number }} \
63-
--repo "${{ github.repository }}" \
64-
--json labels --jq '.labels[].name')
65-
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
66-
echo "skip-validate-benchmarks label found — skipping benchmarks."
67-
echo "SKIP_BENCHMARKS=1" >> "$GITHUB_ENV"
68-
fi
38+
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y --no-install-recommends \
39+
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
40+
build-essential clang curl libssl-dev llvm libudev-dev protobuf-compiler pkg-config
6941
7042
- name: Install Rust toolchain
71-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
7243
uses: actions-rs/toolchain@v1
7344
with:
7445
profile: minimal
7546
toolchain: stable
7647

77-
# (3)
78-
- name: Check skip label
79-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
80-
run: |
81-
labels=$(gh pr view ${{ github.event.pull_request.number }} \
82-
--repo "${{ github.repository }}" \
83-
--json labels --jq '.labels[].name')
84-
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
85-
echo "skip-validate-benchmarks label found — skipping benchmarks."
86-
echo "SKIP_BENCHMARKS=1" >> "$GITHUB_ENV"
87-
fi
88-
8948
- name: Cache Rust build
90-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
9149
uses: Swatinem/rust-cache@v2
9250
with:
9351
key: bench-${{ hashFiles('**/Cargo.lock') }}
9452
cache-on-failure: true
9553

96-
# (4)
97-
- name: Check skip label
98-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
99-
run: |
100-
labels=$(gh pr view ${{ github.event.pull_request.number }} \
101-
--repo "${{ github.repository }}" \
102-
--json labels --jq '.labels[].name')
103-
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
104-
echo "skip-validate-benchmarks label found — skipping benchmarks."
105-
echo "SKIP_BENCHMARKS=1" >> "$GITHUB_ENV"
106-
fi
107-
108-
- name: Build node with benchmarks
109-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
54+
- name: Build node with benchmarks + weight tools
11055
run: |
56+
.github/scripts/check-skip-label.sh ${{ github.event.pull_request.number }}
11157
cargo build --profile production -p node-subtensor --features runtime-benchmarks
112-
113-
# (5)
114-
- name: Check skip label
115-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
116-
run: |
117-
labels=$(gh pr view ${{ github.event.pull_request.number }} \
118-
--repo "${{ github.repository }}" \
119-
--json labels --jq '.labels[].name')
120-
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
121-
echo "skip-validate-benchmarks label found — skipping benchmarks."
122-
echo "SKIP_BENCHMARKS=1" >> "$GITHUB_ENV"
123-
fi
124-
125-
- name: Ensure artifact folder exists
126-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
127-
run: mkdir -p .bench_patch
58+
.github/scripts/check-skip-label.sh ${{ github.event.pull_request.number }}
59+
cargo build --profile production -p subtensor-weight-tools --bin weight-compare
12860
12961
- name: Run & validate benchmarks
130-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
13162
timeout-minutes: 180
13263
run: |
64+
.github/scripts/check-skip-label.sh ${{ github.event.pull_request.number }}
65+
mkdir -p .bench_patch
13366
chmod +x scripts/benchmark_action.sh
13467
scripts/benchmark_action.sh
13568
136-
- name: List artifact contents (for debugging)
137-
if: ${{ always() }}
138-
run: |
139-
echo "Workspace: $GITHUB_WORKSPACE"
140-
if [ -d ".bench_patch" ]; then
141-
echo "== .bench_patch =="
142-
ls -la .bench_patch || true
143-
else
144-
echo ".bench_patch directory is missing"
145-
fi
146-
14769
- name: Archive bench patch
148-
if: ${{ always() }}
70+
if: always()
14971
run: |
15072
if [ -d ".bench_patch" ]; then
15173
tar -czf bench-patch.tgz .bench_patch
152-
ls -lh bench-patch.tgz
153-
else
154-
echo "No .bench_patch directory to archive."
15574
fi
15675
157-
- name: Upload patch artifact (if prepared)
158-
if: ${{ always() }}
76+
- name: Upload patch artifact
77+
if: always()
15978
uses: actions/upload-artifact@v4
16079
with:
16180
name: bench-patch
16281
path: bench-patch.tgz
16382
if-no-files-found: warn
164-
165-
# (6) — final check after run
166-
- name: Check skip label after run
167-
if: ${{ env.SKIP_BENCHMARKS != '1' }}
168-
run: |
169-
labels=$(gh pr view ${{ github.event.pull_request.number }} \
170-
--repo "${{ github.repository }}" \
171-
--json labels --jq '.labels[].name')
172-
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
173-
echo "skip-validate-benchmarks label was found — but benchmarks already ran."
174-
fi
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Scheduled Smoke Tests
2+
3+
on:
4+
schedule:
5+
- cron: '0 */6 * * *'
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
run-smoke-tests:
15+
runs-on: [self-hosted, type-ccx33]
16+
timeout-minutes: 30
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- test: smoke_mainnet
23+
- test: smoke_testnet
24+
25+
name: "smoke-e2e-${{ matrix.test }}"
26+
27+
steps:
28+
- name: Check-out repository
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version-file: ts-tests/.nvmrc
35+
36+
- name: Setup pnpm
37+
uses: pnpm/action-setup@v4
38+
with:
39+
version: 10
40+
41+
- name: Install e2e dependencies
42+
working-directory: ts-tests
43+
run: pnpm install --frozen-lockfile
44+
45+
- name: Run smoke test
46+
working-directory: ts-tests
47+
run: pnpm moonwall test ${{ matrix.test }}

0 commit comments

Comments
 (0)