Skip to content

Commit 81ee047

Browse files
authored
Merge pull request #2020 from opentensor/testnet
mainnet deploy 9/9/2025
2 parents 737e4ac + b033d0e commit 81ee047

Some content is hidden

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

74 files changed

+2329
-1603
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# .github/workflows/apply-benchmark-patch.yml
2+
name: Apply-Benchmark-Patch
3+
4+
on:
5+
pull_request:
6+
types: [labeled]
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
actions: read # required to list & download artifacts across workflows
12+
13+
jobs:
14+
apply:
15+
if: ${{ github.event.label.name == 'apply-benchmark-patch' }}
16+
runs-on: Benchmarking
17+
18+
steps:
19+
- name: Check out PR branch
20+
uses: actions/checkout@v4
21+
with:
22+
repository: ${{ github.event.pull_request.head.repo.full_name }}
23+
ref: ${{ github.event.pull_request.head.ref }}
24+
fetch-depth: 0
25+
26+
- name: Install GitHub CLI
27+
run: |
28+
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get update
29+
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
30+
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
31+
32+
- name: Download latest bench patch artifact from heavy workflow
33+
uses: dawidd6/action-download-artifact@v3
34+
with:
35+
workflow: run-benchmarks.yml
36+
pr: ${{ github.event.pull_request.number }}
37+
name: bench-patch
38+
path: .
39+
allow_forks: true
40+
check_artifacts: true
41+
search_artifacts: true
42+
workflow_conclusion: ""
43+
if_no_artifact_found: warn
44+
45+
- name: Extract bench patch archive
46+
run: |
47+
set -euo pipefail
48+
if [ -f "bench-patch.tgz" ]; then
49+
tar -xzf bench-patch.tgz
50+
elif [ -f "bench-patch/bench-patch.tgz" ]; then
51+
tar -xzf bench-patch/bench-patch.tgz
52+
else
53+
echo "No bench-patch.tgz found after download."
54+
exit 0
55+
fi
56+
ls -la .bench_patch || true
57+
58+
- name: Apply and commit patch
59+
run: |
60+
set -euo pipefail
61+
62+
if [ ! -d ".bench_patch" ]; then
63+
echo "No .bench_patch directory found after extraction."
64+
exit 0
65+
fi
66+
67+
if [ -f ".bench_patch/summary.txt" ]; then
68+
echo "==== summary.txt ===="
69+
sed -n '1,200p' .bench_patch/summary.txt || true
70+
echo "====================="
71+
fi
72+
73+
if [ ! -f ".bench_patch/benchmark_patch.diff" ]; then
74+
echo "No benchmark_patch.diff found (no auto-patch created)."
75+
exit 0
76+
fi
77+
78+
git config user.name "github-actions[bot]"
79+
git config user.email "github-actions[bot]@users.noreply.github.com"
80+
81+
if ! git apply --index --3way .bench_patch/benchmark_patch.diff; then
82+
echo "Patch failed to apply cleanly. Please re-run Validate-Benchmarks to regenerate."
83+
exit 1
84+
fi
85+
86+
if git diff --cached --quiet; then
87+
echo "Patch applied but produced no changes (already up to date)."
88+
exit 0
89+
fi
90+
91+
echo "==== diff preview ===="
92+
git diff --cached --stat
93+
git diff --cached | head -n 120 || true
94+
echo "======================"
95+
96+
branch=$(git symbolic-ref --quiet --short HEAD || true)
97+
if [ -z "$branch" ]; then
98+
echo "Not on a branch - cannot push" >&2
99+
exit 1
100+
fi
101+
102+
git commit -m "auto-update benchmark weights"
103+
git push origin "HEAD:${branch}"
104+
105+
- name: Remove apply-benchmark-patch label
106+
if: ${{ success() }}
107+
run: |
108+
gh pr edit ${{ github.event.pull_request.number }} \
109+
--repo "${{ github.repository }}" \
110+
--remove-label "apply-benchmark-patch" || true

.github/workflows/docker-localnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ permissions:
2828

2929
jobs:
3030
publish:
31-
runs-on: [self-hosted, type-ccx33]
31+
runs-on: [self-hosted, type-ccx53, type-ccx43, type-ccx33]
3232

3333
steps:
3434
- name: Determine Docker tag and ref

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ permissions:
2727

2828
jobs:
2929
publish:
30-
runs-on: [self-hosted, type-ccx33]
30+
runs-on: [self-hosted, type-ccx53, type-ccx43, type-ccx33]
3131

3232
steps:
3333
- name: Determine Docker tag and ref

.github/workflows/evm-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: Swatinem/rust-cache@v2
4141

4242
- name: Set up Node.js
43-
uses: actions/setup-node@v2
43+
uses: actions/setup-node@v4
4444
with:
4545
node-version: "22"
4646

.github/workflows/run-benchmarks.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# .github/workflows/benchmarks.yml
1+
# .github/workflows/run-benchmarks.yml
22
name: Validate-Benchmarks
33

44
on:
@@ -20,10 +20,8 @@ jobs:
2020

2121
env:
2222
SKIP_BENCHMARKS: "0"
23-
AUTO_COMMIT_WEIGHTS: "1"
2423

2524
steps:
26-
# ──────────────────────────────────────────────────────────────────
2725
- name: Check out PR branch
2826
if: ${{ env.SKIP_BENCHMARKS != '1' }}
2927
uses: actions/checkout@v4
@@ -124,16 +122,45 @@ jobs:
124122
echo "SKIP_BENCHMARKS=1" >> "$GITHUB_ENV"
125123
fi
126124
125+
- name: Ensure artifact folder exists
126+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
127+
run: mkdir -p .bench_patch
128+
127129
- name: Run & validate benchmarks
128130
if: ${{ env.SKIP_BENCHMARKS != '1' }}
129-
uses: nick-fields/retry@v3
131+
timeout-minutes: 180
132+
run: |
133+
chmod +x scripts/benchmark_action.sh
134+
scripts/benchmark_action.sh
135+
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+
147+
- name: Archive bench patch
148+
if: ${{ always() }}
149+
run: |
150+
if [ -d ".bench_patch" ]; then
151+
tar -czf bench-patch.tgz .bench_patch
152+
ls -lh bench-patch.tgz
153+
else
154+
echo "No .bench_patch directory to archive."
155+
fi
156+
157+
- name: Upload patch artifact (if prepared)
158+
if: ${{ always() }}
159+
uses: actions/upload-artifact@v4
130160
with:
131-
timeout_minutes: 180
132-
max_attempts: 3
133-
retry_wait_seconds: 60
134-
command: |
135-
chmod +x scripts/benchmark_action.sh
136-
scripts/benchmark_action.sh
161+
name: bench-patch
162+
path: bench-patch.tgz
163+
if-no-files-found: warn
137164

138165
# (6) — final check after run
139166
- name: Check skip label after run

0 commit comments

Comments
 (0)