Skip to content

Commit 1b0c63a

Browse files
authored
Merge pull request #1634 from opentensor/testnet
mainnet deploy 5/27/2025
2 parents a1bf521 + 9fe45c5 commit 1b0c63a

File tree

135 files changed

+23952
-4881
lines changed

Some content is hidden

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

135 files changed

+23952
-4881
lines changed

.github/workflows/check-bittensor-e2e-tests.yml.yml

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,34 @@ jobs:
213213
- name: Load Docker Image
214214
run: docker load -i subtensor-localnet.tar
215215

216-
- name: Run tests
216+
# - name: Run tests
217+
# working-directory: ${{ github.workspace }}/btcli
218+
# run: |
219+
# source ${{ github.workspace }}/venv/bin/activate
220+
# uv run pytest ${{ matrix.test-file }} -s
221+
222+
- name: Run with retry
217223
working-directory: ${{ github.workspace }}/btcli
218224
run: |
219225
source ${{ github.workspace }}/venv/bin/activate
220-
uv run pytest ${{ matrix.test-file }} -s
226+
set +e
227+
for i in 1 2; do
228+
echo "🔁 Attempt $i: Running tests"
229+
uv run pytest ${{ matrix.test-file }} -s
230+
status=$?
231+
if [ $status -eq 0 ]; then
232+
echo "✅ Tests passed on attempt $i"
233+
break
234+
else
235+
echo "❌ Tests failed on attempt $i"
236+
if [ $i -eq 2 ]; then
237+
echo "🔥 Tests failed after 2 attempts"
238+
exit 1
239+
fi
240+
echo "🕒 Retrying..."
241+
sleep 5
242+
fi
243+
done
221244
222245
# main sdk job
223246
run-sdk-e2e-tests:
@@ -285,8 +308,31 @@ jobs:
285308
- name: Load Docker Image
286309
run: docker load -i subtensor-localnet.tar
287310

288-
- name: Run tests
311+
# - name: Run tests
312+
# working-directory: ${{ github.workspace }}/bittensor
313+
# run: |
314+
# source ${{ github.workspace }}/venv/bin/activate
315+
# uv run pytest ${{ matrix.test-file }} -s
316+
317+
- name: Run with retry
289318
working-directory: ${{ github.workspace }}/bittensor
290319
run: |
291320
source ${{ github.workspace }}/venv/bin/activate
292-
uv run pytest ${{ matrix.test-file }} -s
321+
set +e
322+
for i in 1 2; do
323+
echo "🔁 Attempt $i: Running tests"
324+
uv run pytest ${{ matrix.test-file }} -s
325+
status=$?
326+
if [ $status -eq 0 ]; then
327+
echo "✅ Tests passed on attempt $i"
328+
break
329+
else
330+
echo "❌ Tests failed on attempt $i"
331+
if [ $i -eq 2 ]; then
332+
echo "🔥 Tests failed after 2 attempts"
333+
exit 1
334+
fi
335+
echo "🕒 Retrying..."
336+
sleep 5
337+
fi
338+
done

.github/workflows/docker-localnet.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ jobs:
5757
username: ${{ github.actor }}
5858
password: ${{ secrets.GITHUB_TOKEN }}
5959

60+
- name: Patch non-fast-block node
61+
run: |
62+
chmod +x ./scripts/localnet_patch.sh
63+
./scripts/localnet_patch.sh
64+
6065
- name: Build and push Docker image
6166
uses: docker/build-push-action@v6
6267
with:

.github/workflows/evm-tests.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: EVM E2E Tests
2+
3+
on:
4+
pull_request:
5+
6+
## Allow running workflow manually from the Actions tab
7+
workflow_dispatch:
8+
inputs:
9+
verbose:
10+
description: "Output more information when triggered manually"
11+
required: false
12+
default: ""
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
VERBOSE: ${{ github.events.input.verbose }}
17+
18+
jobs:
19+
run:
20+
runs-on: SubtensorCI
21+
env:
22+
RUST_BACKTRACE: full
23+
steps:
24+
- name: Check-out repository under $GITHUB_WORKSPACE
25+
uses: actions/checkout@v4
26+
27+
- name: Utilize Shared Rust Cache
28+
uses: Swatinem/rust-cache@v2
29+
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v2
32+
with:
33+
node-version: "22"
34+
35+
- name: Install dependencies
36+
run: |
37+
sudo apt-get update &&
38+
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler nodejs
39+
40+
- name: Run tests
41+
working-directory: ${{ github.workspace }}
42+
run: |
43+
npm install --global yarn
44+
./evm-tests/run-ci.sh

.github/workflows/label-triggers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
owner: context.repo.owner,
2626
repo: context.repo.repo,
2727
body: '@opentensor/cerebrum / @opentensor/gyrus / @opentensor/cortex breaking change detected! Please prepare accordingly!'
28-
})
28+
})

.github/workflows/run-benchmarks.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# .github/workflows/benchmarks.yml
2+
name: Validate-Benchmarks
3+
4+
on:
5+
pull_request:
6+
types:
7+
- opened
8+
- synchronize
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: run-benchmarks-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
validate-benchmarks:
17+
runs-on: Benchmarking
18+
19+
env:
20+
SKIP_BENCHMARKS: '0'
21+
22+
steps:
23+
- name: Check out PR branch
24+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
25+
uses: actions/checkout@v4
26+
with:
27+
ref: ${{ github.head_ref }}
28+
fetch-depth: 0
29+
30+
- name: Install GitHub CLI
31+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y gh
35+
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
36+
37+
- name: Check skip label
38+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
39+
run: |
40+
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
41+
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
42+
echo "skip-validate-benchmarks label found — skipping benchmarks."
43+
echo "SKIP_BENCHMARKS=1" >> "$GITHUB_ENV"
44+
fi
45+
46+
- name: Install system dependencies
47+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
51+
52+
- name: Check skip label
53+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
54+
run: |
55+
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
56+
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
57+
echo "skip-validate-benchmarks label found — skipping benchmarks."
58+
echo "SKIP_BENCHMARKS=1" >> "$GITHUB_ENV"
59+
fi
60+
61+
- name: Install Rust toolchain
62+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
63+
uses: actions-rs/toolchain@v1
64+
with:
65+
profile: minimal
66+
toolchain: stable
67+
68+
- name: Check skip label
69+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
70+
run: |
71+
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
72+
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
73+
echo "skip-validate-benchmarks label found — skipping benchmarks."
74+
echo "SKIP_BENCHMARKS=1" >> "$GITHUB_ENV"
75+
fi
76+
77+
- name: Cache Rust build
78+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
79+
uses: Swatinem/rust-cache@v2
80+
with:
81+
key: bench-${{ hashFiles('**/Cargo.lock') }}
82+
83+
- name: Check skip label
84+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
85+
run: |
86+
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
87+
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
88+
echo "skip-validate-benchmarks label found — skipping benchmarks."
89+
echo "SKIP_BENCHMARKS=1" >> "$GITHUB_ENV"
90+
fi
91+
92+
- name: Build node with benchmarks
93+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
94+
run: |
95+
cargo build --profile production -p node-subtensor --features runtime-benchmarks
96+
97+
- name: Check skip label
98+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
99+
run: |
100+
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
101+
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
102+
echo "skip-validate-benchmarks label found — skipping benchmarks."
103+
echo "SKIP_BENCHMARKS=1" >> "$GITHUB_ENV"
104+
fi
105+
106+
- name: Run & validate benchmarks
107+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
108+
run: |
109+
chmod +x scripts/benchmark_action.sh
110+
./scripts/benchmark_action.sh
111+
112+
- name: Check skip label after run
113+
if: ${{ env.SKIP_BENCHMARKS != '1' }}
114+
run: |
115+
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
116+
if echo "$labels" | grep -q "skip-validate-benchmarks"; then
117+
echo "skip-validate-benchmarks label was found — but benchmarks already ran."
118+
fi

.github/workflows/rustdocs.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish rustdocs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
runs-on: SubtensorCI
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Install rustup
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
25+
- name: Generate documentation
26+
uses: actions-rs/cargo@v1
27+
with:
28+
command: doc
29+
args: --document-private-items
30+
31+
- name: Fix file permissions
32+
shell: sh
33+
run: |
34+
chmod -c -R +rX "target/doc" |
35+
while read line; do
36+
echo "::warning title=Invalid file permissions automatically fixed::$line"
37+
done
38+
- name: Generate index.html file
39+
run: |
40+
echo "<meta http-equiv=refresh content=0;url=wasm_oidc_plugin/index.html>" > target/doc/index.html
41+
- name: Upload documentation
42+
uses: actions/upload-pages-artifact@v1
43+
with:
44+
path: ./target/doc
45+
46+
deploy:
47+
needs: build
48+
runs-on: SubtensorCI
49+
50+
permissions:
51+
pages: write
52+
id-token: write
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.pages.outputs.page_url }}
56+
57+
steps:
58+
- name: Deploy documentation
59+
id: pages
60+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)