Skip to content

Commit

Permalink
Merge pull request #519 from opentensor/finney_deployment_11062024
Browse files Browse the repository at this point in the history
Finney deployment 11062024
  • Loading branch information
distributedstatemachine committed Jun 11, 2024
2 parents 0c77062 + b82a57e commit 703bdbd
Show file tree
Hide file tree
Showing 75 changed files with 7,352 additions and 3,926 deletions.
179 changes: 134 additions & 45 deletions .github/workflows/check-rust.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
name: Check Rust

concurrency:
group: ci-${{ github.ref }}
group: check-rust-${{ github.ref }}
cancel-in-progress: true

on:
Expand Down Expand Up @@ -65,8 +65,7 @@ jobs:
- name: cargo fmt
run: cargo fmt --check --all

# runs cargo clippy --workspace --all-targets --all-features
cargo-clippy:
cargo-clippy-default-features:
name: cargo clippy
runs-on: SubtensorCI
strategy:
Expand Down Expand Up @@ -111,8 +110,104 @@ jobs:
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

- name: cargo clippy --workspace --all-targets --all-features
run: cargo clippy --workspace --all-targets --all-features
- name: cargo clippy --workspace --all-targets -- -D warnings
run: cargo clippy --workspace --all-targets -- -D warnings

cargo-clippy-all-features:
name: cargo clippy --all-features
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
os:
- ubuntu-latest
# - macos-latest
include:
- os: ubuntu-latest
# - os: macos-latest
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Shared Rust Cache
uses: Swatinem/rust-cache@v2.2.1
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

- name: cargo clippy --workspace --all-targets --all-features -- -D warnings
run: cargo clippy --workspace --all-targets --all-features -- -D warnings

cargo-clippy-all-features:
name: cargo clippy --all-features
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
os:
- ubuntu-latest
# - macos-latest
include:
- os: ubuntu-latest
# - os: macos-latest
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Shared Rust Cache
uses: Swatinem/rust-cache@v2.2.1
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

- name: cargo clippy --workspace --all-targets --all-features -- -D warnings
run: cargo clippy --workspace --all-targets --all-features -- -D warnings

# runs cargo test --workspace
cargo-test:
Expand Down Expand Up @@ -273,7 +368,7 @@ jobs:
check-feature-propagation:
name: zepter run check
runs-on: ubuntu-22.04
runs-on: SubtensorCI

steps:
- name: Install stable Rust
Expand All @@ -295,7 +390,7 @@ jobs:

check-finney-migrations:
name: check finney migrations
runs-on: ubuntu-22.04
runs-on: SubtensorCI
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -306,40 +401,34 @@ jobs:
runtime-package: "node-subtensor-runtime"
node-uri: "wss://entrypoint-finney.opentensor.ai:443"
checks: "pre-and-post"
extra-args: "--disable-spec-version-check --no-weight-warnings --disable-idempotency-checks"

# ----
# We can enable devnet and finney migrations once Polkadot v1.0 is deployed to finney, after
# which time all future migrations should be idempotent and won't start failing after the
# upgrade is deployed.
# ----
# check-devnet-migrations:
# name: check devnet migrations
# runs-on: ubuntu-22.04
# steps:
# - name: Checkout sources
# uses: actions/checkout@v4
#
# - name: Run Try Runtime Checks
# uses: "paritytech/try-runtime-gha@v0.1.0"
# with:
# runtime-package: "node-subtensor-runtime"
# node-uri: "wss://dev.chain.opentensor.ai:443"
# checks: "pre-and-post"
# extra-args: "--disable-spec-version-check --no-weight-warnings --disable-idempotency-checks"
#
# check-testnet-migrations:
# name: check testnet migrations
# runs-on: ubuntu-22.04
# steps:
# - name: Checkout sources
# uses: actions/checkout@v4
#
# - name: Run Try Runtime Checks
# uses: "paritytech/try-runtime-gha@v0.1.0"
# with:
# runtime-package: "node-subtensor-runtime"
# node-uri: "wss://test.chain.opentensor.ai:443"
# checks: "pre-and-post"
# extra-args: "--disable-spec-version-check --no-weight-warnings --disable-idempotency-checks"
#
extra-args: "--disable-spec-version-check --no-weight-warnings"

check-devnet-migrations:
name: check devnet migrations
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Run Try Runtime Checks
uses: "paritytech/try-runtime-gha@v0.1.0"
with:
runtime-package: "node-subtensor-runtime"
node-uri: "wss://dev.chain.opentensor.ai:443"
checks: "pre-and-post"
extra-args: "--disable-spec-version-check --no-weight-warnings"

check-testnet-migrations:
name: check testnet migrations
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Run Try Runtime Checks
uses: "paritytech/try-runtime-gha@v0.1.0"
with:
runtime-package: "node-subtensor-runtime"
node-uri: "wss://test.chain.opentensor.ai:443"
checks: "pre-and-post"
extra-args: "--disable-spec-version-check --no-weight-warnings"
85 changes: 85 additions & 0 deletions .github/workflows/e2e-bittensor-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: E2E Bittensor Tests

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

on:
## Run automatically for all PRs against main, regardless of what the changes are
## to be safe and so we can more easily force re-run the CI when github is being
## weird by using a blank commit
push:
branches: [main, development, staging]

##
# Run automatically for PRs against default/main branch if Rust files change
pull_request:
branches: [main, development, staging]

## Allow running workflow manually from the Actions tab
workflow_dispatch:
inputs:
verbose:
description: "Output more information when triggered manually"
required: false
default: ""

env:
CARGO_TERM_COLOR: always
VERBOSE: ${{ github.events.input.verbose }}

jobs:
run:
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
os:
- ubuntu-latest
# - macos-latest
include:
- os: ubuntu-latest
# - os: macos-latest
env:
RELEASE_NAME: development
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt
profile: minimal

- name: Clone bittensor repo
run: git clone https://github.com/opentensor/bittensor.git

- name: Setup bittensor repo
working-directory: ${{ github.workspace }}/bittensor
run: |
git checkout staging
python3 -m pip install -e .
python3 -m pip install torch
python3 -m pip install pytest
- name: Run tests
working-directory: ${{ github.workspace }}/bittensor
run: |
pwd
ls
LOCALNET_SH_PATH="${{ github.workspace }}/scripts/localnet.sh" pytest tests/e2e_tests/ -s
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ specs/*.json
*.orig

# VSCode configuration
.vscode
.vscode

# IntelliJ IDEA configuration
.idea

# Runtime upgrade snapshot
bt.snap
Empty file added CITATION.cft
Empty file.
Loading

0 comments on commit 703bdbd

Please sign in to comment.