Skip to content

Commit

Permalink
Merge pull request #770 from opentensor/testnet
Browse files Browse the repository at this point in the history
Finney Deployment 280824
  • Loading branch information
unconst authored Aug 30, 2024
2 parents 6a37d4b + 460f175 commit e79b099
Show file tree
Hide file tree
Showing 128 changed files with 17,515 additions and 13,171 deletions.
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.devcontainer
.github
.vscode
!scripts/init.sh
target
target/
.dockerignore
Dockerfile
Empty file.
7 changes: 4 additions & 3 deletions .github/workflows/check-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Devnet Deploy Check

on:
pull_request:
branches: [devnet]
branches: [devnet, devnet-ready]

env:
CARGO_TERM_COLOR: always
Expand All @@ -11,6 +11,7 @@ jobs:
check-spec-version:
name: Check spec_version bump
runs-on: SubtensorCI
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-spec-version-bump') }}
steps:
- name: Dependencies
run: |
Expand All @@ -37,7 +38,7 @@ jobs:
echo "network spec_version: $spec_version"
if (( $(echo "$local_spec_version <= $spec_version" | bc -l) )); then echo "$local_spec_version ≯ $spec_version ❌"; exit 1; fi
echo "$local_spec_version > $spec_version ✅"
check-devnet-migrations:
name: check devnet migrations
runs-on: ubuntu-22.04
Expand All @@ -51,4 +52,4 @@ jobs:
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"
extra-args: "--disable-spec-version-check --no-weight-warnings"
6 changes: 3 additions & 3 deletions .github/workflows/check-finney.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Check that spec_version has been bumped
run: |
spec_version=$(PATH=$PATH:$HOME/.cargo/.bin substrate-spec-version wss://entrypoint-finney.opentensor.ai:443 | tr -d '\n')
spec_version=$(PATH=$PATH:$HOME/.cargo/.bin substrate-spec-version ${{ secrets.NUCLEUS_ARCHIVE_NODE }} | tr -d '\n')
echo "network spec_version: $spec_version"
: ${spec_version:?bad spec version}
local_spec_version=$(cargo run -p node-subtensor-runtime --bin spec_version | tr -d '\n')
Expand All @@ -49,6 +49,6 @@ jobs:
uses: "paritytech/[email protected]"
with:
runtime-package: "node-subtensor-runtime"
node-uri: "wss://entrypoint-finney.opentensor.ai:443"
node-uri: ${{ secrets.NUCLEUS_ARCHIVE_NODE }}
checks: "pre-and-post"
extra-args: "--disable-spec-version-check --no-weight-warnings"
extra-args: "--disable-spec-version-check --no-weight-warnings"
52 changes: 48 additions & 4 deletions .github/workflows/check-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,54 @@ jobs:
- name: cargo clippy --workspace --all-targets -- -D warnings
run: cargo clippy --workspace --all-targets -- -D warnings

cargo-check-lints:
name: check custom lints
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- stable
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
os:
- ubuntu-latest
# - macos-latest
env:
RELEASE_NAME: development
RUSTV: ${{ matrix.rust-branch }}
RUSTFLAGS: -D warnings
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@v4

- 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/[email protected]
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Shared Rust Cache
uses: Swatinem/[email protected]
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

- name: check lints
run: |
set -o pipefail # Ensure the pipeline fails if any command in the pipeline fails
cargo check 2>&1 | sed -r "s/\x1B\[[0-9;]*[mK]//g" | tee /dev/tty | grep -q "^warning:" && \
(echo "Build emitted the following warnings:" >&2 && exit 1) || echo "No warnings found."
cargo-clippy-all-features:
name: cargo clippy --all-features
runs-on: SubtensorCI
Expand Down Expand Up @@ -338,7 +386,3 @@ jobs:

- name: Check features
run: zepter run check




3 changes: 2 additions & 1 deletion .github/workflows/check-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Testnet Deploy Check

on:
pull_request:
branches: [testnet]
branches: [testnet, testnet-ready]

env:
CARGO_TERM_COLOR: always
Expand All @@ -11,6 +11,7 @@ jobs:
check-spec-version:
name: Check spec_version bump
runs-on: SubtensorCI
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-spec-version-bump') }}
steps:
- name: Dependencies
run: |
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/devnet-labels.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/devnet-ready-labels.yml

This file was deleted.

33 changes: 13 additions & 20 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,42 @@
name: Publish Docker Image

on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
workflow_dispatch:
release:
types: [published]

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

jobs:
publish:
runs-on: SubtensorCI

steps:
- name: Checkout code
uses: actions/checkout@v4

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

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

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

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
Expand All @@ -52,4 +45,4 @@ jobs:
tags: |
${{ steps.meta.outputs.tags }}
ghcr.io/${{ github.repository }}:latest
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
19 changes: 0 additions & 19 deletions .github/workflows/testnet-labels.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/testnet-ready-labels.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

**/*.lock

*.ipynb

# Generated by code coverage
*.profraw
*.profdata
Expand Down
2 changes: 1 addition & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
##
# rustup run nightly -- rustfmt node/src/main.rs

# max_width = 100
# max_width = 180
# hard_tabs = false
# tab_spaces = 4
# newline_style = "Auto"
Expand Down
Loading

0 comments on commit e79b099

Please sign in to comment.