-
Notifications
You must be signed in to change notification settings - Fork 163
221 lines (195 loc) · 7.04 KB
/
check-finney-clone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: Finney Data Genesis
concurrency:
group: check-rust-${{ github.ref }}
cancel-in-progress: true
on:
## Allow running workflow manually from the Actions tab
workflow_dispatch:
inputs:
javascriptCode:
description: "Enter JavaScript code to execute"
required: false
type: textarea
verbose:
description: "Output more information when triggered manually"
required: false
default: ""
push:
branches:
- ci/add-baedeker-job
env:
CARGO_TERM_COLOR: always
VERBOSE: ${{ github.events.input.verbose }}
jobs:
# install-baedeker:
# name: install-baedeker
# runs-on: SubtensorCI
# strategy:
# matrix:
# rust-branch:
# - stable
# 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: Checkout Baedeker repository
# uses: actions/checkout@v3
# with:
# repository: 'UniqueNetwork/baedeker'
# path: 'baedeker'
# - name: Install Rust toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# profile: minimal
# override: true
# - name: Build baedeker
# run: |
# cd baedeker
# cargo build --release
# - name: Prepare binary for artifact upload
# run: |
# mkdir -p ${{ github.workspace }}/bin
# cp ./baedeker/target/release/baedeker ${{ github.workspace }}/bin/
# chmod +x ${{ github.workspace }}/bin/baedeker
# - name: Upload baedeker binary as an artifact
# uses: actions/upload-artifact@v3
# with:
# name: baedeker-binary
# path: ${{ github.workspace }}/bin/baedeker
# download-finney-state:
# needs: install-baedeker
# runs-on: SubtensorCI
# strategy:
# matrix:
# rust-branch:
# - stable
# 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@v4
# - name: Download baedeker binary
# uses: actions/download-artifact@v3
# with:
# name: baedeker-binary
# path: bin
# - name: Execute baedeker
# run: |
# chmod +x bin/baedeker
# RUST_LOG=info bin/baedeker --spec=docker -J.baedeker/vendor/ --generator=docker_compose=.baedeker/.bdk-env --generator=docker_compose_discover=.baedeker/.bdk-env/discover.env --secret=file=.baedeker/.bdk-env/secret --tla-str=relay_spec=rococo-local --input-modules='lib:baedeker-library/ops/nginx.libsonnet' --input-modules='lib:baedeker-library/ops/devtools.libsonnet' --tla-str=repoDir=$(realpath .baedeker/..) .baedeker/forkless-data.jsonnet --tla-str=forked_spec=subtensor --tla-str=fork_source=wss://entrypoint-finney.opentensor.ai .baedeker/rewrites.jsonnet
# - name: Prepare genesis with data for artifact upload
# run: |
# mkdir -p ${{ github.workspace }}/finney-spec
# cp .baedeker/.bdk-env/specs/subtensor.json ${{ github.workspace }}/finney-spec/
# - name: Prepare secrets for artifact upload
# run: |
# mkdir -p ${{ github.workspace }}/finney-spec
# mkdir -p ${{ github.workspace }}/finney-spec/secret
# cp -r .baedeker/.bdk-env/secret/* ${{ github.workspace }}/finney-spec/secret
# - name: Upload spec and secrets as an artifact
# uses: actions/upload-artifact@v3
# with:
# name: finney-state
# path: ${{ github.workspace }}/finney-spec/
# runs localnet with finney state
run-local-chain:
# needs: download-finney-state
name: run local chain
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- stable
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@v4
# - name: Download finney clone genesis and secrets
# uses: actions/download-artifact@v3
# with:
# name: finney-state
# path: finney-spec
# - name: Copy secrets and spec from artifacts
# run: |
# mkdir -p .baedeker/.bdk-env
# mkdir -p .baedeker/.bdk-env/specs
# mkdir -p .baedeker/.bdk-env/secret
# cp finney-spec/subtensor.json .baedeker/.bdk-env/specs
# cp -r finney-spec/secret/* .baedeker/.bdk-env/secret
- name: Set up Docker Compose
run: |
# Install Docker Compose if not already installed (GitHub hosted runners usually have it installed)
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Run localnet with docker compose
run: |
mkdir -p target
docker-compose -f docker-compose-baedeker.yml up -d
- name: Runtime upgrade
working-directory: .baedeker/util
run: |
ls -la
ls -la ..
ls -la ../..
ls -la ../../target
ls -la ../../target/release
yarn install
../../scripts/wait_first_block_local.sh
echo "Executing runtime upgrade"
node runtimeUpgrade.js
# check that runtime upgrade happened (spec version updated)
# Wait for new blocks after upgrade
# Balance transfer test
# need process exit from JS, it's not exiting
# see how to run custom JS with this job (msg from Sam J.)
# epoch test: Set subnet1 tempo to 10 blocks
# - wait for OTF hotkey to receive rewards
# - check block times
# feature for testing hotkey tempos (talk to Samuel - maybe add to fast-blocks)
# - add childkey test