Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
477 commits
Select commit Hold shift + click to select a range
0dc9f2d
use format string for hk logging
camfairchild Mar 17, 2025
c5e0aef
check for new reg before running migration
camfairchild Mar 17, 2025
2b7067a
make sure maps filled
camfairchild Mar 17, 2025
1e40637
add test for other netuid not touched
camfairchild Mar 17, 2025
cbe1912
Merge pull request #1418 from opentensor/feat/sn-73-dissolve-migration
sam0x17 Mar 17, 2025
8ad06c1
Merge pull request #1420 from opentensor/devnet-ready
sam0x17 Mar 17, 2025
aa0f7d7
Merge pull request #1421 from opentensor/devnet
sam0x17 Mar 17, 2025
bd33f8c
Add burn/recycle extrinsics
ales-otf Mar 18, 2025
6690440
bump spec
camfairchild Mar 18, 2025
3e600e6
store migration was run for subnet volume
camfairchild Mar 18, 2025
5489569
Merge pull request #1424 from opentensor/fix/set-subnet-volume-migration
sam0x17 Mar 18, 2025
a763eca
Merge pull request #1426 from opentensor/devnet-ready
sam0x17 Mar 18, 2025
a9e6f83
Rewrite recycle/burn alpha
ales-otf Mar 18, 2025
06ad8a8
add workflows
Mar 19, 2025
27e3dd7
update branches names
Mar 19, 2025
376058c
update branches names
Mar 19, 2025
930d7b1
add devnet-ready
Mar 19, 2025
e8190f8
delete legacy bittensor e2e tests workflow
Mar 19, 2025
8f6e4e4
Feat/record initial subnet tao in totalstake (#1428)
camfairchild Mar 19, 2025
4d14ecc
update runner
Mar 19, 2025
6612cb3
Merge pull request #1430 from opentensor/devnet-ready
sam0x17 Mar 19, 2025
8f7751f
fix install folder
Mar 19, 2025
09ab70f
left just e2e tests
Mar 19, 2025
8c60aa4
cleanup + trigger
Mar 19, 2025
ed6edd8
Merge branch 'devnet-ready' into feat/roman/add-sdk-cli-e2e-test-chec…
Mar 19, 2025
9adf24f
Merge pull request #1427 from opentensor/devnet
sam0x17 Mar 19, 2025
78d446b
Merge pull request #1429 from opentensor/feat/roman/add-sdk-cli-e2e-t…
sam0x17 Mar 19, 2025
49f49bd
remove sn73 migration
camfairchild Mar 19, 2025
0a4b165
bump spec
camfairchild Mar 19, 2025
4853519
Merge pull request #1432 from opentensor/feat/remove-sn-73-dissolve-m…
sam0x17 Mar 19, 2025
77f93b6
Merge remote-tracking branch 'origin/devnet-ready' into devnet
sam0x17 Mar 19, 2025
5904a24
Merge remote-tracking branch 'origin/devnet' into testnet
sam0x17 Mar 19, 2025
114938a
Add benchmarks for burn/recycle alpha
ales-otf Mar 19, 2025
1aba3f7
Reformat
ales-otf Mar 19, 2025
2fb469f
Update spec version
ales-otf Mar 19, 2025
3ba0c70
Resolve git conflicts
ales-otf Mar 19, 2025
dbd4a3a
Update spec version
ales-otf Mar 19, 2025
f3ccdf9
Merge pull request #1423 from opentensor/feat/burn-recycle
sam0x17 Mar 19, 2025
b61dd30
Merge pull request #1395 from opentensor/testnet
sam0x17 Mar 19, 2025
cc39b6e
feature start call
open-junius Mar 20, 2025
9dbc817
merge with target branch
open-junius Mar 20, 2025
dbce5ac
commit Cargo.lock
open-junius Mar 20, 2025
93dcb79
fix test cases
open-junius Mar 20, 2025
d4d6748
update runtime version
open-junius Mar 20, 2025
d6321c0
commit Cargo.lock
open-junius Mar 20, 2025
fdbbcec
more unit test
open-junius Mar 20, 2025
b38e79d
add doc
open-junius Mar 20, 2025
12e4f10
Add move_stake and transfer_stake to staking precompile v2
gztensor Mar 20, 2025
38a2fc1
Merge branch 'devnet-ready' into tlock-commitments
JohnReedV Mar 20, 2025
0686b06
update actions version
Mar 20, 2025
533c291
upload docker image to artifacts
Mar 20, 2025
498d87e
add `on.workflow_run` trigger
Mar 20, 2025
c611966
add actions/download-artifact name
Mar 20, 2025
eed9be6
delete, moved this logic to e2e related workflow
Mar 20, 2025
ce18e25
combine 2 workflow to one
Mar 20, 2025
00c03cb
swap
Mar 20, 2025
bdd5bcc
fix ids
Mar 20, 2025
4030e7c
fixes
Mar 20, 2025
91d61ed
add run-bittensor-e2e-tests output
Mar 20, 2025
f84be89
fix needs reference in main steps
Mar 20, 2025
397e187
remove path
Mar 20, 2025
e31c452
remove path for cli step
Mar 20, 2025
2b674c7
reset bonds for miners recently deregistered
camfairchild Mar 21, 2025
4725f55
reset bonds from deregistered validator
camfairchild Mar 21, 2025
f7e1531
add tests
camfairchild Mar 21, 2025
dfe3161
Merge pull request #1442 from opentensor/fix/roman/use-docker-image-f…
sam0x17 Mar 21, 2025
f3a108f
Merge branch 'devnet-ready' into tlock-commitments
JohnReedV Mar 21, 2025
213b7b1
use next_block/run_to_block _no_epoch
camfairchild Mar 21, 2025
cbca1c3
chore: fmt
camfairchild Mar 21, 2025
c86de44
benchmark file update
open-junius Mar 21, 2025
ceed34a
Merge pull request #1443 from opentensor/feat/reset-bonds-on-dereg
sam0x17 Mar 21, 2025
187ed94
mark deprecated items
JohnReedV Mar 21, 2025
ef9a7af
Adjust staking fees
gztensor Mar 21, 2025
589f9f2
Revert move fee
gztensor Mar 21, 2025
b683362
add a pending alpha (to valis) for prop em
camfairchild Mar 21, 2025
ef17ae6
undo move epoch
camfairchild Mar 21, 2025
abc3603
rename the storage
open-junius Mar 24, 2025
9d8877f
cargo fix
open-junius Mar 24, 2025
5887a92
Merge branch 'devnet-ready' into feat/start-call
open-junius Mar 24, 2025
b8c8da7
commit Cargo.lock
open-junius Mar 24, 2025
810f94c
update migration name
open-junius Mar 24, 2025
5fb588a
update coinbase test case
open-junius Mar 24, 2025
ad195fd
doc: added comment in localnet Dockerfile about fastblocks default
l0r1s Mar 24, 2025
ea8d0e3
Merge pull request #1448 from l0r1s/docfix-docker-localnet-fastblocks
sam0x17 Mar 24, 2025
d5e97c3
Merge pull request #1445 from opentensor/fix/tx-fees
sam0x17 Mar 24, 2025
5127d4d
Merge pull request #1354 from opentensor/tlock-commitments
sam0x17 Mar 24, 2025
8206aa3
Add start call to subtensor module (#1436)
ales-otf Mar 24, 2025
1428d24
remove `TotalHotkeyAlpha` balances that drop to 0
JohnReedV Mar 24, 2025
c862c46
add migration to remove existing zero value items
JohnReedV Mar 24, 2025
b663a4f
add migration test
JohnReedV Mar 24, 2025
280079d
fmt
JohnReedV Mar 24, 2025
554a7e8
clippy
JohnReedV Mar 24, 2025
660d9c7
Merge pull request #1449 from opentensor/debloat-TotalHotkeyAlpha
sam0x17 Mar 24, 2025
ef5d36f
feat: add actual_fee to StakeAdded and StakeRemoved events
tb-team-dev-2 Mar 24, 2025
9d9893a
feat: add actual_fee to StakeAdded and StakeRemoved events pt 2
tb-team-dev-2 Mar 24, 2025
d72d641
Merge branch 'devnet-ready' into feat/actual-fee-in-events
tb-team-dev-2 Mar 24, 2025
60b3551
shorten start call duration for fast blocks
camfairchild Mar 25, 2025
606df3d
init solution
open-junius Mar 25, 2025
b53b749
commit Cargo.lock
open-junius Mar 25, 2025
67d0567
more code
open-junius Mar 25, 2025
31a7f62
use prop_alpha_dividends
camfairchild Mar 21, 2025
eeba941
refactor coinbase for testability
camfairchild Mar 21, 2025
7ed1430
rename
camfairchild Mar 21, 2025
5c64e93
use stake_map as input instead of storage
camfairchild Mar 21, 2025
9f43a9d
extract tao_weight
camfairchild Mar 21, 2025
c0d04c6
test dividend distr sums near inputs
camfairchild Mar 21, 2025
76b52d8
extract functions from drain_pending
camfairchild Mar 22, 2025
a2e0a31
add more tests
camfairchild Mar 22, 2025
28a17c3
add epoch test for single reg
camfairchild Mar 22, 2025
834b6d3
add test for calc divs and incentives fn
camfairchild Mar 22, 2025
4e33275
extract calls to drain
camfairchild Mar 22, 2025
c46718d
fix/add tests
camfairchild Mar 22, 2025
c35d7ee
fix no miners alpha drain
camfairchild Mar 25, 2025
705dd77
remove magic number from test
camfairchild Mar 25, 2025
99f43db
fix tests
camfairchild Mar 25, 2025
6464278
spec bump
camfairchild Mar 25, 2025
0e85b7f
Merge branch 'devnet-ready' into fix/alpha-underpayment
camfairchild Mar 25, 2025
1047a72
Merge pull request #1447 from opentensor/fix/alpha-underpayment
sam0x17 Mar 25, 2025
6a2be68
bump spec version
sam0x17 Mar 25, 2025
22aefdd
Merge pull request #1455 from opentensor/feat/fast-blocks-start-call-…
sam0x17 Mar 25, 2025
a6a979a
add subnets_to_emit_to
camfairchild Mar 25, 2025
aadd712
Merge branch 'devnet-ready' into fix/runs-epoch-before-start-call
camfairchild Mar 25, 2025
a8b80a5
Merge branch 'devnet-ready' into feat/actual-fee-in-events
tb-team-dev-2 Mar 25, 2025
33a970c
fix clippy
camfairchild Mar 25, 2025
e7ea5d9
move test utils
camfairchild Mar 25, 2025
d100cb5
add tests. including for start call
camfairchild Mar 25, 2025
e88256a
compile ok
open-junius Mar 26, 2025
75c0d6e
set init bonds penalty to 1.0 (u16 max)
camfairchild Mar 26, 2025
bd8ed7b
Merge pull request #1462 from opentensor/fix/runs-epoch-before-start-…
sam0x17 Mar 26, 2025
d48f224
oops
camfairchild Mar 26, 2025
eb9549f
Merge pull request #1464 from opentensor/fix/default-bond-penalty-one
sam0x17 Mar 26, 2025
259a0ec
Merge pull request #1465 from opentensor/devnet-ready
sam0x17 Mar 26, 2025
ccceb75
Merge branch 'devnet-ready' into selective-metagraph
open-junius Mar 26, 2025
b3cb0f9
add test case
open-junius Mar 26, 2025
a90ae12
fix clippy
open-junius Mar 26, 2025
a77ea67
add error UnexpectedUnreserveLeftover
JohnReedV Mar 26, 2025
62f8189
update version
open-junius Mar 26, 2025
ba02bea
better logic
JohnReedV Mar 26, 2025
9179e14
fix min burn set too low
camfairchild Mar 26, 2025
8d3044c
add to mock and add a test
camfairchild Mar 26, 2025
96f7501
spec bump
camfairchild Mar 26, 2025
ada3a06
fix mechid in event
camfairchild Mar 26, 2025
1f606bc
Merge branch 'devnet-ready' into feat/actual-fee-in-events
tb-team-dev-2 Mar 26, 2025
33779ef
fix event filtering
camfairchild Mar 26, 2025
32954b8
clippy
JohnReedV Mar 26, 2025
58b0640
bump spec
JohnReedV Mar 26, 2025
67920ac
remove unwrap from test
camfairchild Mar 26, 2025
c3b3f92
fix burn adjust test
camfairchild Mar 26, 2025
e8d73bc
Merge pull request #1470 from opentensor/commitments-deposit-error
sam0x17 Mar 26, 2025
17dc5dd
Merge branch 'devnet-ready' into feat/actual-fee-in-events
tb-team-dev-2 Mar 26, 2025
96939a7
Merge pull request #1454 from tb-team-dev-2/feat/actual-fee-in-events
sam0x17 Mar 26, 2025
340060c
Merge pull request #1469 from opentensor/fix/min-burn-set-low-on-new-…
sam0x17 Mar 26, 2025
7ced248
Merge pull request #1471 from opentensor/devnet-ready
sam0x17 Mar 26, 2025
41d3bf9
just store decrypted bytes
JohnReedV Mar 27, 2025
6bcbafc
fix test compile errors
JohnReedV Mar 27, 2025
67c0044
rm deprecated test
JohnReedV Mar 27, 2025
f64b0a1
fix recycle alpha, allow nom usage and deduct from shares
camfairchild Mar 27, 2025
9b5d162
add failing tests
camfairchild Mar 27, 2025
af12395
keep all revealed instead of replacing
JohnReedV Mar 27, 2025
7521a52
fix impl
camfairchild Mar 27, 2025
30b5510
update tests
camfairchild Mar 27, 2025
7c549ac
add test for root netuid no burn/recyc
camfairchild Mar 27, 2025
094b875
dont burn TAO
camfairchild Mar 27, 2025
5bcf610
bump spec
camfairchild Mar 27, 2025
0042e50
test with root subnet creation
camfairchild Mar 27, 2025
34c60ef
bump spec version
sam0x17 Mar 27, 2025
e47fa2d
Merge remote-tracking branch 'origin/devnet-ready' into fix/recycle-b…
sam0x17 Mar 27, 2025
0a92a5e
Merge pull request #1473 from opentensor/fix/recycle-burn-ext
sam0x17 Mar 27, 2025
f376f75
Merge pull request #1477 from opentensor/devnet-ready
sam0x17 Mar 27, 2025
9ee2ea5
Merge pull request #1461 from opentensor/devnet
sam0x17 Mar 27, 2025
ad0ae60
commit Cargo.lock
open-junius Mar 28, 2025
c38dde8
cargo fix
open-junius Mar 28, 2025
c8539f1
update version
open-junius Mar 28, 2025
7b542e2
Merge branch 'devnet-ready' into stake_on_subnet_precompile
open-junius Mar 28, 2025
7f22435
remove unused func
open-junius Mar 28, 2025
0824f1d
update solidity
open-junius Mar 28, 2025
6ee0b21
bump runtime version
open-junius Mar 28, 2025
c513a4e
add new evm test case
open-junius Mar 28, 2025
f5ddec8
add test file
open-junius Mar 28, 2025
8de0d23
Merge pull request #1479 from opentensor/testnet
sam0x17 Mar 28, 2025
aa2f376
fmt
JohnReedV Mar 28, 2025
05a31c9
add test timelocked_index_complex_scenario_works
JohnReedV Mar 28, 2025
4b7ef1d
add migration for new storage
JohnReedV Mar 28, 2025
bdda4d9
clippy
JohnReedV Mar 28, 2025
fd798cc
divs are minimum zero
camfairchild Mar 28, 2025
2ebf807
bump spec
camfairchild Mar 28, 2025
4ea7fb1
Merge pull request #1481 from opentensor/hotfix/no-negative-divs
sam0x17 Mar 28, 2025
f636217
Merge branch 'devnet-ready' into improve-tlocked-commitments
JohnReedV Mar 28, 2025
5ce4d8b
Merge branch 'devnet-ready' into improve-tlocked-commitments
JohnReedV Mar 28, 2025
acbbe52
bump spec
JohnReedV Mar 28, 2025
0c2cd89
don't save bad commitments
JohnReedV Mar 28, 2025
b987c05
add test reveal_timelocked_bad_timelocks_are_removed
JohnReedV Mar 28, 2025
0481bb9
only keep the 10 most recent revealed commitments
JohnReedV Mar 28, 2025
59dfa9b
add tests for revealed limit
JohnReedV Mar 28, 2025
23a0a96
fix test
JohnReedV Mar 28, 2025
8cc4049
fmt
JohnReedV Mar 28, 2025
da30941
clippy
JohnReedV Mar 28, 2025
d4f3413
Do not use saturating_sub for signed types
gztensor Mar 29, 2025
6e673f5
Create extrinsic to allow EVM key association
keithtensor Mar 31, 2025
d3e0e14
Merge remote-tracking branch 'origin/devnet-ready' into associate-evm…
keithtensor Mar 31, 2025
a2e61c5
Merge branch 'devnet-ready' into fix/get-rid-of-i96
gztensor Mar 31, 2025
7ec9477
spec version bump
gztensor Mar 31, 2025
8f1de13
Merge pull request #1472 from opentensor/improve-tlocked-commitments
JohnReedV Mar 31, 2025
cec883e
add new events
JohnReedV Mar 31, 2025
d0d01f8
emit new events
JohnReedV Mar 31, 2025
b6b4531
fmt
JohnReedV Mar 31, 2025
654ee8b
Merge pull request #1488 from opentensor/add-missing-commit-reveal-ev…
sam0x17 Mar 31, 2025
6e896f1
Merge pull request #1485 from opentensor/fix/get-rid-of-i96
sam0x17 Mar 31, 2025
f4d1a25
Use last epoch hotkey alpha for fee calculation
gztensor Mar 31, 2025
79213b2
Merge branch 'devnet-ready' into fix/tx-fees-in-tao
gztensor Mar 31, 2025
ee4941d
Merge devnet-ready
gztensor Mar 31, 2025
cfe38a5
More tests for dividend variables
gztensor Apr 1, 2025
3fc43c5
add min commitment size
JohnReedV Apr 1, 2025
f405515
add test
JohnReedV Apr 1, 2025
7540223
clippy
JohnReedV Apr 1, 2025
f429c01
Merge branch 'devnet-ready' into feat/stake-transfer-precompile
gztensor Apr 1, 2025
13a5bc6
fix new errors in old tests
JohnReedV Apr 1, 2025
76b3fd8
magic number => variable
JohnReedV Apr 1, 2025
8d7ec15
Merge pull request #1491 from opentensor/min-commit-space
sam0x17 Apr 1, 2025
2d47812
Add transferToggle precompile call, deprecate setMinBurn and setWeigh…
gztensor Apr 1, 2025
3cfc000
Merge pull request #1489 from opentensor/fix/tx-fees-in-tao
sam0x17 Apr 1, 2025
2d023f7
Merge branch 'devnet-ready' into selective-metagraph
gztensor Apr 1, 2025
cee6335
Merge remote-tracking branch 'origin/devnet-ready' into stake_on_subn…
sam0x17 Apr 1, 2025
f6f547b
Merge pull request #1438 from opentensor/feat/stake-transfer-precompile
sam0x17 Apr 1, 2025
1a371e3
Merge pull request #1480 from opentensor/stake_on_subnet_precompile
sam0x17 Apr 1, 2025
c3d85bd
Merge pull request #1463 from opentensor/selective-metagraph
sam0x17 Apr 1, 2025
4863d5e
Merge branch 'devnet-ready' into associate-evm-key
keithtensor Apr 2, 2025
50cd748
Use encode and current block number in event
keithtensor Apr 2, 2025
fde069f
Bump the signature block number
keithtensor Apr 2, 2025
7d3d754
Refactor EVM functions and weights
keithtensor Apr 2, 2025
3a666b6
Change update_moving_price() function
shamil-gadelshin Apr 2, 2025
3676dc3
Merge branch 'feat/uniswapv3-lp' into sasha/feat/uniswapv3-lp
ales-otf Apr 2, 2025
d584e22
Merge branch 'feat/uniswapv3-lp' into sasha/feat/uniswapv3-lp
ales-otf Apr 2, 2025
a3511db
add validate to unstake all and tests
camfairchild Apr 2, 2025
1c61c73
Merge pull request #1496 from opentensor/update_moving_price_fix
sam0x17 Apr 2, 2025
e08d517
cargo fmt
sam0x17 Apr 2, 2025
f4c80da
Merge remote-tracking branch 'origin/devnet-ready' into associate-evm…
sam0x17 Apr 2, 2025
433be65
Merge pull request #1498 from opentensor/fix/unstake-all-should-not-g…
sam0x17 Apr 2, 2025
77cae16
bump spec version
sam0x17 Apr 2, 2025
3e3be01
Merge pull request #1487 from opentensor/associate-evm-key
sam0x17 Apr 2, 2025
3f70d00
Merge branch 'feat/uniswapv3-lp' into sasha/feat/uniswapv3-lp
ales-otf Apr 3, 2025
19944be
Merge branch 'feat/uniswapv3-lp' into sasha/feat/uniswapv3-lp
ales-otf Apr 4, 2025
b9909a8
Fix benchmarks compilation for swap
ales-otf Apr 4, 2025
252185f
Merge with devnet-ready
ales-otf Apr 4, 2025
f7d63af
Fix pallet-subtensor compilation
ales-otf Apr 4, 2025
4cccc96
Merge branch 'feat/uniswapv3-lp' into sasha/feat/uniswapv3-lp
ales-otf Apr 8, 2025
5798126
Calculate reserves update during swap
ales-otf Apr 8, 2025
7938582
Configure swap in subtensor module mock
ales-otf Apr 9, 2025
afc595f
Fix TickIndex bounded price calculation
ales-otf Apr 9, 2025
cb73353
Remove Min/MaxSqrtPrice from swap Config
ales-otf Apr 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
292 changes: 292 additions & 0 deletions .github/workflows/check-bittensor-e2e-tests.yml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
name: Bittensor Bittensor E2E Test

permissions:
pull-requests: write
contents: read

concurrency:
group: e2e-cli-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
branches:
- devnet
- devnet-ready
- testnet
- testnet-ready
- main
types: [opened, synchronize, reopened, labeled, unlabeled]

env:
CARGO_TERM_COLOR: always
VERBOSE: ${{ github.event.inputs.verbose }}

jobs:
apply-label-to-new-pr:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.draft == false }}
outputs:
should_continue: ${{ steps.check.outputs.should_continue }}
steps:
- name: Check
id: check
run: |
ACTION="${{ github.event.action }}"
if [[ "$ACTION" == "opened" || "$ACTION" == "reopened" ]]; then
echo "should_continue=true" >> $GITHUB_OUTPUT
else
echo "should_continue=false" >> $GITHUB_OUTPUT
fi
shell: bash

- name: Add label
if: steps.check.outputs.should_continue == 'true'
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: run-bittensor-e2e-tests

check-label:
needs: apply-label-to-new-pr
runs-on: ubuntu-latest
if: always()
outputs:
run-bittensor-e2e-tests: ${{ steps.get-labels.outputs.run-bittensor-e2e-tests }}
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Get labels from PR
id: get-labels
run: |
LABELS=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
echo "Current labels: $LABELS"
if echo "$LABELS" | grep -q "run-bittensor-e2e-tests"; then
echo "run-bittensor-e2e-tests=true" >> $GITHUB_ENV
echo "::set-output name=run-bittensor-e2e-tests::true"
else
echo "run-bittensor-e2e-tests=false" >> $GITHUB_ENV
echo "::set-output name=run-bittensor-e2e-tests::false"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

find-btcli-e2e-tests:
needs: check-label
if: always() && needs.check-label.outputs.run-bittensor-e2e-tests == 'true'
runs-on: ubuntu-latest
outputs:
test-files: ${{ steps.get-btcli-tests.outputs.test-files }}
steps:
- name: Research preparation
working-directory: ${{ github.workspace }}
run: git clone https://github.com/opentensor/btcli.git

- name: Checkout
working-directory: ${{ github.workspace }}/btcli
run: git checkout staging

- name: Install dependencies
run: sudo apt-get install -y jq

- name: Find e2e test files
id: get-btcli-tests
run: |
test_files=$(find ${{ github.workspace }}/btcli/tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
echo "::set-output name=test-files::$test_files"
shell: bash

find-sdk-e2e-tests:
needs: check-label
if: always() && needs.check-label.outputs.run-bittensor-e2e-tests == 'true'
runs-on: ubuntu-latest
outputs:
test-files: ${{ steps.get-sdk-tests.outputs.test-files }}
steps:
- name: Research preparation
working-directory: ${{ github.workspace }}
run: git clone https://github.com/opentensor/bittensor.git

- name: Checkout
working-directory: ${{ github.workspace }}/bittensor
run: git checkout staging

- name: Install dependencies
run: sudo apt-get install -y jq

- name: Find e2e test files
id: get-sdk-tests
run: |
test_files=$(find ${{ github.workspace }}/bittensor/tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
echo "::set-output name=test-files::$test_files"
shell: bash

build-image-with-current-branch:
needs: check-label
runs-on: SubtensorCI
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker Image
run: docker build -f Dockerfile-localnet -t localnet .

- name: Save Docker Image as Tar
run: docker save -o subtensor-localnet.tar localnet

- name: Upload Docker Image as Artifact
uses: actions/upload-artifact@v4
with:
name: subtensor-localnet
path: subtensor-localnet.tar

# main btcli job
run-btcli-e2e-tests:
needs:
- check-label
- find-btcli-e2e-tests
- build-image-with-current-branch
if: always() && needs.check-label.outputs.run-bittensor-e2e-tests == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 16
matrix:
rust-branch:
- stable
rust-target:
- x86_64-unknown-linux-gnu
os:
- ubuntu-latest
test-file: ${{ fromJson(needs.find-btcli-e2e-tests.outputs.test-files) }}

env:
RELEASE_NAME: development
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
TARGET: ${{ matrix.rust-target }}

timeout-minutes: 60
name: "cli: ${{ matrix.test-file }}"
steps:
- name: Check-out repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Create Python virtual environment
working-directory: ${{ github.workspace }}
run: uv venv ${{ github.workspace }}/venv

- name: Clone Bittensor CLI repo
working-directory: ${{ github.workspace }}
run: git clone https://github.com/opentensor/btcli.git

- name: Setup Bittensor-cli from cloned repo
working-directory: ${{ github.workspace }}/btcli
run: |
source ${{ github.workspace }}/venv/bin/activate
git checkout staging
git fetch origin staging
uv run --active pip install --upgrade pip
uv run --active pip install '.[dev]'
uv run --active pip install pytest

- name: Install uv dependencies
working-directory: ${{ github.workspace }}/btcli
run: uv sync --all-extras --dev

- name: Download Cached Docker Image
uses: actions/download-artifact@v4
with:
name: subtensor-localnet

- name: Load Docker Image
run: docker load -i subtensor-localnet.tar

- name: Run tests
working-directory: ${{ github.workspace }}/btcli
run: |
source ${{ github.workspace }}/venv/bin/activate
uv run pytest ${{ matrix.test-file }} -s

# main sdk job
run-sdk-e2e-tests:
needs:
- check-label
- find-sdk-e2e-tests
- build-image-with-current-branch
if: always() && needs.check-label.outputs.run-bittensor-e2e-tests == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 16
matrix:
rust-branch:
- stable
rust-target:
- x86_64-unknown-linux-gnu
os:
- ubuntu-latest
test-file: ${{ fromJson(needs.find-sdk-e2e-tests.outputs.test-files) }}

env:
RELEASE_NAME: development
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
TARGET: ${{ matrix.rust-target }}

timeout-minutes: 60
name: "sdk: ${{ matrix.test-file }}"
steps:
- name: Check-out repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Create Python virtual environment
working-directory: ${{ github.workspace }}
run: uv venv ${{ github.workspace }}/venv

- name: Clone Bittensor SDK repo
working-directory: ${{ github.workspace }}
run: git clone https://github.com/opentensor/bittensor.git

- name: Setup Bittensor SDK from cloned repo
working-directory: ${{ github.workspace }}/bittensor
run: |
source ${{ github.workspace }}/venv/bin/activate
git checkout staging
git fetch origin staging
uv run --active pip install --upgrade pip
uv run --active pip install '.[dev]'
uv run --active pip install pytest

- name: Install uv dependencies
working-directory: ${{ github.workspace }}/bittensor
run: uv sync --all-extras --dev

- name: Download Cached Docker Image
uses: actions/download-artifact@v4
with:
name: subtensor-localnet

- name: Load Docker Image
run: docker load -i subtensor-localnet.tar

- name: Run tests
working-directory: ${{ github.workspace }}/bittensor
run: |
source ${{ github.workspace }}/venv/bin/activate
uv run pytest ${{ matrix.test-file }} -s
69 changes: 69 additions & 0 deletions .github/workflows/docker-localnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Publish Localnet Docker Image

on:
release:
types: [published]
workflow_dispatch:
inputs:
branch-or-tag:
description: "Branch or tag to use for the Docker image tag and ref to checkout (optional)"
required: false
default: ""
push:
branches:
- devnet-ready

permissions:
contents: read
packages: write
actions: read
security-events: write

jobs:
publish:
runs-on: SubtensorCI

steps:
- name: Determine Docker tag and ref
id: tag
run: |
branch_or_tag="${{ github.event.inputs.branch-or-tag || github.ref_name }}"
echo "Determined branch or tag: $branch_or_tag"
echo "tag=$branch_or_tag" >> $GITHUB_ENV
echo "ref=$branch_or_tag" >> $GITHUB_ENV

# Check if this is a tagged release (not devnet-ready/devnet/testnet)
if [[ "$branch_or_tag" != "devnet-ready" ]]; then
echo "latest_tag=true" >> $GITHUB_ENV
else
echo "latest_tag=false" >> $GITHUB_ENV
fi

- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.ref }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile-localnet
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository }}-localnet:${{ env.tag }}
${{ env.latest_tag == 'true' && format('ghcr.io/{0}-localnet:latest', github.repository) || '' }}
Loading
Loading