Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new development/deployment/release process #346

Merged
merged 54 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6efd94b
add check-labels action
sam0x17 May 10, 2024
cada696
add label-triggers action
sam0x17 May 10, 2024
135c809
bump CI
sam0x17 May 10, 2024
9253416
split devnet and testnet label checking into their own actions
sam0x17 May 10, 2024
f261b89
typo
sam0x17 May 10, 2024
9a2a776
spec-version sub-crate scaffold
sam0x17 May 10, 2024
36409e2
remove from workspace to avoid version conflicts for now
sam0x17 May 10, 2024
1ab3f47
never mind
sam0x17 May 10, 2024
ebcda57
WIP
sam0x17 May 10, 2024
7b3347e
try fake deploy
sam0x17 May 10, 2024
7c12332
force it to show up
sam0x17 May 10, 2024
ce23465
blah blah specify toolchain yes yes
sam0x17 May 10, 2024
39d4520
use new output style
sam0x17 May 10, 2024
b7baa91
try single line
sam0x17 May 10, 2024
25f5f71
fix
sam0x17 May 10, 2024
6f464e3
try again
sam0x17 May 13, 2024
2f2df2e
tweak again
sam0x17 May 13, 2024
9eaebf9
remove trigger
sam0x17 May 13, 2024
de29985
another
sam0x17 May 13, 2024
c3a0448
try on ubuntu-latest
sam0x17 May 13, 2024
36ab313
never mind
sam0x17 May 13, 2024
e6b95cc
show ping pong
sam0x17 May 13, 2024
b97eb5b
wait 30 seconds
sam0x17 May 13, 2024
66acdda
try test.chain.opentensor.ai instead
sam0x17 May 13, 2024
8dbdd71
try with subxt
sam0x17 May 15, 2024
f832c68
fix
sam0x17 May 15, 2024
7c258e7
try with new substrate-spec-version crate
sam0x17 May 15, 2024
af1bc4e
live spec version working :tada: :tada:
sam0x17 May 15, 2024
71525d9
perform full build / make use of spec version
sam0x17 May 15, 2024
c92def2
simplified rust toolchain setup
sam0x17 May 15, 2024
0f50a7f
remove concurrency settings
sam0x17 May 17, 2024
1fbbcf6
Merge remote-tracking branch 'origin/main' into sam-revamp-deployment
sam0x17 May 23, 2024
8cf0126
fix using outdated version of checkout action
sam0x17 May 23, 2024
664b1be
real spec version check
sam0x17 May 23, 2024
df27f60
clear out old migrations
sam0x17 May 23, 2024
e7c479d
fix warnings
sam0x17 May 23, 2024
d307066
proper spec version check
sam0x17 May 23, 2024
5a02594
fix
sam0x17 May 23, 2024
1e8ad85
whoops
sam0x17 May 23, 2024
ed611e3
formatting correct now
sam0x17 May 23, 2024
2ce1333
use not-greater-than symbol
sam0x17 May 23, 2024
bff1f63
fix labels
sam0x17 May 23, 2024
753064a
add check-testnet
sam0x17 May 23, 2024
7bcfe49
add finney check
sam0x17 May 23, 2024
cc60878
tweaks
sam0x17 May 23, 2024
0faea6d
WIP
sam0x17 May 23, 2024
749ce24
labels and pull request lifecycle
sam0x17 May 23, 2024
05c297e
tweak
sam0x17 May 23, 2024
3c0c885
done
sam0x17 May 23, 2024
3415696
Merge remote-tracking branch 'origin/main' into sam-revamp-deployment
sam0x17 May 23, 2024
a9bbc88
tweak branches
sam0x17 May 23, 2024
e294b20
fix typos
sam0x17 May 23, 2024
5e061dd
update SOP period for testnet
sam0x17 May 28, 2024
4e319c5
Merge remote-tracking branch 'origin/main' into sam-revamp-deployment
sam0x17 May 28, 2024
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
39 changes: 39 additions & 0 deletions .github/workflows/check-devnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Devnet Deploy Check

on:
pull_request:
branches: [devnet]

env:
CARGO_TERM_COLOR: always

jobs:
check-spec-version:
name: Check spec_version bump
runs-on: SubtensorCI
steps:
- name: Dependencies
run: |
sudo apt-get update &&
sudo apt-get install -y curl clang curl libssl-dev llvm \
libudev-dev protobuf-compiler

- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Install substrate-spec-version
run: cargo install substrate-spec-version

- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v4

- name: Check that spec_version has been bumped
run: |
spec_version=$(PATH=$PATH:$HOME/.cargo/.bin substrate-spec-version wss://dev.chain.opentensor.ai:443 | 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')
echo "local spec_version: $local_spec_version"
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 ✅"
39 changes: 39 additions & 0 deletions .github/workflows/check-finney.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Finney Deploy Check

on:
pull_request:
branches: [finney]

env:
CARGO_TERM_COLOR: always

jobs:
check-spec-version:
name: Check spec_version bump
runs-on: SubtensorCI
steps:
- name: Dependencies
run: |
sudo apt-get update &&
sudo apt-get install -y curl clang curl libssl-dev llvm \
libudev-dev protobuf-compiler

- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Install substrate-spec-version
run: cargo install substrate-spec-version

- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v4

- 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')
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')
echo "local spec_version: $local_spec_version"
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 ✅"
26 changes: 10 additions & 16 deletions .github/workflows/check-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@ concurrency:
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]
branches: [main, devnet-ready, devnet, testnet, finney]

##
# 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:
Expand Down Expand Up @@ -56,7 +50,7 @@ jobs:
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential
Expand Down Expand Up @@ -98,7 +92,7 @@ jobs:
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down Expand Up @@ -147,7 +141,7 @@ jobs:
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down Expand Up @@ -196,7 +190,7 @@ jobs:
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down Expand Up @@ -245,7 +239,7 @@ jobs:
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down Expand Up @@ -292,7 +286,7 @@ jobs:
run: cargo install --locked -q zepter && zepter --version

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Dont clone historic commits.

Expand All @@ -304,7 +298,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run Try Runtime Checks
uses: "paritytech/[email protected]"
Expand All @@ -324,7 +318,7 @@ jobs:
# runs-on: ubuntu-22.04
# steps:
# - name: Checkout sources
# uses: actions/checkout@v3
# uses: actions/checkout@v4
#
# - name: Run Try Runtime Checks
# uses: "paritytech/[email protected]"
Expand All @@ -339,7 +333,7 @@ jobs:
# runs-on: ubuntu-22.04
# steps:
# - name: Checkout sources
# uses: actions/checkout@v3
# uses: actions/checkout@v4
#
# - name: Run Try Runtime Checks
# uses: "paritytech/[email protected]"
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/check-testnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Testnet Deploy Check

on:
pull_request:
branches: [testnet]

env:
CARGO_TERM_COLOR: always

jobs:
check-spec-version:
name: Check spec_version bump
runs-on: SubtensorCI
steps:
- name: Dependencies
run: |
sudo apt-get update &&
sudo apt-get install -y curl clang curl libssl-dev llvm \
libudev-dev protobuf-compiler

- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Install substrate-spec-version
run: cargo install substrate-spec-version

- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v4

- name: Check that spec_version has been bumped
run: |
spec_version=$(PATH=$PATH:$HOME/.cargo/.bin substrate-spec-version wss://test.finney.opentensor.ai:443 | 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')
echo "local spec_version: $local_spec_version"
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 ✅"
18 changes: 18 additions & 0 deletions .github/workflows/devnet-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Tested on Devnet
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
jobs:
check-labels:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: mheap/github-action-required-labels@v5
with:
mode: minimum
count: 1
labels: |
devnet-pass
devnet-skip
25 changes: 25 additions & 0 deletions .github/workflows/label-triggers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Label Triggers
on:
pull_request:
types:
- labeled

permissions:
issues: write
pull-requests: write

jobs:
comment_on_breaking_change:
runs-on: ubuntu-latest
steps:
- name: Check if 'breaking change' label is added
if: github.event.label.name == 'breaking-change'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@opentensor/cerebrum / @opentensor/gyrus / @opentensor/cortex breaking change detected! Please prepare accordingly!'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we resolved permissioning issues with these alerts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt it, @garrett-opentensor will need to make sure each of those groups has permissions to receive notifications in github

})
18 changes: 18 additions & 0 deletions .github/workflows/testnet-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Tested on Testnet
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
sam0x17 marked this conversation as resolved.
Show resolved Hide resolved
jobs:
check-labels:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: mheap/github-action-required-labels@v5
with:
mode: minimum
count: 1
labels: |
testnet-pass
testnet-skip
Loading
Loading