-
Notifications
You must be signed in to change notification settings - Fork 15
325 lines (311 loc) · 12.9 KB
/
test-patch-upgrade.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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
---
name: Test Patch Upgrade
on:
workflow_dispatch:
push:
paths-ignore:
- 'docs/**'
- 'examples/**'
- 'logs/**'
- '!examples/inventory-local.yml'
- 'README.md'
jobs:
set-version-matrix:
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install requests
- name: Obtain latest non-rc release
id: set-start
run: |
versions=$(tests/patch_upgrade/patch_upgrade_matrix.py)
echo $versions
echo "matrix=$versions" >> $GITHUB_OUTPUT
outputs:
version_matrix: ${{ steps.set-start.outputs.matrix }}
patch-upgrade:
runs-on: ubuntu-22.04
needs: set-version-matrix
strategy:
matrix:
${{ fromJSON(needs.set-version-matrix.outputs.version_matrix) }}
fail-fast: false
environment: patch-upgrade-workflow
env:
PROVIDER_SERVICE_1: ${{ vars.PROVIDER_SERVICE_1 }}
PROVIDER_SERVICE_2: ${{ vars.PROVIDER_SERVICE_2 }}
CHAIN_BINARY: ${{ vars.CHAIN_BINARY }}
HOME_1: ${{ vars.HOME_1 }}
HOME_2: ${{ vars.HOME_2 }}
CHAIN_ID: ${{ vars.CHAIN_ID }}
MONIKER_1: ${{ vars.MONIKER_1 }}
MONIKER_2: ${{ vars.MONIKER_2 }}
MNEMONIC_1: ${{ vars.MNEMONIC_1 }}
MNEMONIC_2: ${{ vars.MNEMONIC_2 }}
DENOM: ${{ vars.DENOM }}
VAL_FUNDS: ${{ vars.VAL_FUNDS }}
VAL_STAKE: ${{ vars.VAL_STAKE }}
VAL_STAKE_STEP: ${{ vars.VAL_STAKE_STEP }}
VOTING_PERIOD: ${{ vars.VOTING_PERIOD }}
VAL1_RPC_PORT: ${{ vars.VAL1_RPC_PORT }}
VAL2_RPC_PORT: ${{ vars.VAL2_RPC_PORT }}
WALLET_1: ${{ vars.WALLET_1 }}
WALLET_2: ${{ vars.WALLET_2 }}
VALOPER_1: ${{ vars.VALOPER_1 }}
CONSUMER_CHAIN_BINARY_URL: ${{ vars.CONSUMER_CHAIN_BINARY_URL }}
CONSUMER_CHAIN_BINARY: ${{ vars.CONSUMER_CHAIN_BINARY }}
CONSUMER_DENOM: ${{ vars.CONSUMER_DENOM }}
CONSUMER_HOME_1: /home/runner/.cona1
CONSUMER_HOME_2: /home/runner/.cona2
CON1_API_PORT: 25101
CON2_API_PORT: 25102
CON1_GRPC_PORT: 26101
CON2_GRPC_PORT: 26102
CON1_RPC_PORT: 27101
CON2_RPC_PORT: 27102
CON1_P2P_PORT: 28101
CON2_P2P_PORT: 28102
CON1_PPROF_PORT: 6163
CON2_PPROF_PORT: 6164
CONSUMER_SERVICE_1: cona1.service
CONSUMER_SERVICE_2: cona2.service
BASE_FEES: 1500
HIGH_FEES: 10000
steps:
- name: start-version
run: echo ${{matrix.start_version}}
- name: target-version
run: echo ${{matrix.target_branch}}
- name: upgrade-coverage
run: echo ${{matrix.upgrade_coverage}}
- name: Target RC
if: ${{ contains(matrix.target_branch, 'rc') }}
run: |
echo "${{matrix.target_branch}}"
- name: Target commit
if: ${{ !contains(matrix.target_branch, 'rc') }}
run: |
BUILD_TAG=gaiad-linux-${{matrix.target_branch}}
TARGET_COMMIT=$(curl -s -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/hyphacoop/cosmos-builds/releases/tags/$BUILD_TAG | jq -r '.name')
echo $TARGET_COMMIT
- name: Consumer chain binary URL
run: echo $CONSUMER_CHAIN_BINARY_URL
- name: Update PATH
run: |
echo "$HOME/go/bin" >> $GITHUB_PATH
echo "$HOME/.hermes" >> $GITHUB_PATH
- name: Bypass the grub-efi-amd64-signed package
run: sudo apt-mark hold grub-efi-amd64-signed
- run: echo "Test upgrading ${{matrix.start_version}} to ${{matrix.target_branch}}"
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install requests toml-cli
- name: Start chains
env:
START_VERSION: ${{matrix.start_version}}
run: tests/patch_upgrade/patch_start_chains.sh
- name: Download consumer chain binary
run: |
wget $CONSUMER_CHAIN_BINARY_URL -O $HOME/go/bin/$CONSUMER_CHAIN_BINARY
chmod +x $HOME/go/bin/$CONSUMER_CHAIN_BINARY
- name: blocks-1
run: tests/test_block_production.sh 127.0.0.1 $VAL1_RPC_PORT
- name: signatures-1
run: tests/patch_upgrade/patch_test_signatures.sh $VAL1_RPC_PORT 2 # two validators
- name: txs-1
run: tests/patch_upgrade/patch_test_tx.sh
- name: api-1
run: tests/test_endpoints_api.sh localhost 25001
- name: rpc-1
run: tests/test_endpoints_rpc.sh localhost $VAL1_RPC_PORT
- name: Set up relayer
run: tests/patch_upgrade/patch_setup_relayer.sh
- name: Initialize consumer chain a
env:
CONSUMER_CHAIN_ID: consumera
run: tests/patch_upgrade/patch_init_consumer.sh
- name: Launch consumer chain a
env:
CONSUMER_CHAIN_ID: consumera
run: tests/patch_upgrade/patch_launch_consumer.sh 1
- name: consumera-blocks-1
run: tests/test_block_production.sh 127.0.0.1 $CON1_RPC_PORT
- name: consumera-signatures-1
run: tests/patch_upgrade/patch_test_signatures.sh $CON1_RPC_PORT 2 # two validators
- name: Establish CCV channel for consumer a
run: |
hermes create connection --a-chain consumera --a-client 07-tendermint-0 --b-client 07-tendermint-0
hermes create channel --a-chain consumera --a-port consumer --b-port provider --order ordered --a-connection connection-0 --channel-version 1
sudo systemctl restart hermes
sleep 10
- name: consumera-vsc-1
run: tests/patch_upgrade/patch_test_ccv.sh
- name: consumera-ibc-1
env:
CONSUMER_CHAIN_ID: consumera
run: tests/patch_upgrade/patch_test_ibc_transfer.sh channel-1 2
- name: Initialize consumer chain b
env:
CONSUMER_CHAIN_ID: consumerb
CONSUMER_HOME_1: /home/runner/.conb1
CONSUMER_HOME_2: /home/runner/.conb2
CON1_API_PORT: 25201
CON2_API_PORT: 25202
CON1_GRPC_PORT: 26201
CON2_GRPC_PORT: 26202
CON1_RPC_PORT: 27201
CON2_RPC_PORT: 27202
CON1_P2P_PORT: 28201
CON2_P2P_PORT: 28202
CON1_PPROF_PORT: 6165
CON2_PPROF_PORT: 6166
CONSUMER_SERVICE_1: conb1.service
CONSUMER_SERVICE_2: conb2.service
run: tests/patch_upgrade/patch_init_consumer.sh
- name: Launch consumer chain b
env:
CONSUMER_CHAIN_ID: consumerb
CONSUMER_HOME_1: /home/runner/.conb1
CONSUMER_HOME_2: /home/runner/.conb2
CONSUMER_SERVICE_1: conb1.service
CONSUMER_SERVICE_2: conb2.service
run: tests/patch_upgrade/patch_launch_consumer.sh 2
- name: consumerb-blocks
run: tests/test_block_production.sh 127.0.0.1 27201
- name: consumerb-signatures
run: tests/patch_upgrade/patch_test_signatures.sh 27201 2 # two validators
- name: Establish CCV channel for consumer b
run: |
hermes create connection --a-chain consumerb --a-client 07-tendermint-0 --b-client 07-tendermint-1
hermes create channel --a-chain consumerb --a-port consumer --b-port provider --order ordered --a-connection connection-0 --channel-version 1
sudo systemctl restart hermes
sleep 10
- name: consumerb-vsc
env:
CON1_RPC_PORT: 27201
run: tests/patch_upgrade/patch_test_ccv.sh
- name: consumerb-ibc
env:
CONSUMER_CHAIN_ID: consumerb
CONSUMER_HOME_1: /home/runner/.conb1
CONSUMER_HOME_2: /home/runner/.conb2
run: tests/patch_upgrade/patch_test_ibc_transfer.sh channel-3 3
- name: consumerb-key
env:
CONSUMER_CHAIN_ID: consumerb
run: tests/patch_upgrade/patch_test_key_assignment.sh
- name: Stop consumer chain
env:
CONSUMER_CHAIN_ID: consumerb
run: tests/patch_upgrade/patch_stop_consumer.sh 3
- name: consumerb-remove
run: tests/patch_upgrade/patch_test_consumer_removed.sh
- name: consumera-blocks-2
run: tests/test_block_production.sh 127.0.0.1 $CON1_RPC_PORT
- name: consumera-signatures-2
run: tests/patch_upgrade/patch_test_signatures.sh $CON1_RPC_PORT 2 # two validators
- name: blocks-2
run: tests/test_block_production.sh 127.0.0.1 $VAL1_RPC_PORT
- name: signatures-2
run: tests/patch_upgrade/patch_test_signatures.sh $VAL1_RPC_PORT 2 # two validators
- name: Full upgrade to rc build
if: ${{ contains(matrix.target_branch, 'rc') && matrix.upgrade_coverage == 'full' }}
env:
UPGRADE_BINARY_URL: https://github.com/cosmos/gaia/releases/download/${{matrix.target_branch}}/gaiad-${{matrix.target_branch}}-linux-amd64
run: tests/patch_upgrade/patch_test_full_upgrade.sh
- name: Full upgrade to branch build
if: ${{ !contains(matrix.target_branch, 'rc') && matrix.upgrade_coverage == 'full' }}
env:
UPGRADE_BINARY_URL: https://github.com/hyphacoop/cosmos-builds/releases/download/gaiad-linux-${{matrix.target_branch}}/gaiad-linux
run: tests/patch_upgrade/patch_test_full_upgrade.sh
- name: Partial upgrade to rc build
if: ${{ contains(matrix.target_branch, 'rc') && matrix.upgrade_coverage == 'partial' }}
env:
UPGRADE_BINARY_URL: https://github.com/cosmos/gaia/releases/download/${{matrix.target_branch}}/gaiad-${{matrix.target_branch}}-linux-amd64
run: tests/patch_upgrade/patch_test_partial_upgrade.sh
- name: Partial upgrade to branch build
if: ${{ !contains(matrix.target_branch, 'rc') && matrix.upgrade_coverage == 'partial'}}
env:
UPGRADE_BINARY_URL: https://github.com/hyphacoop/cosmos-builds/releases/download/gaiad-linux-${{matrix.target_branch}}/gaiad-linux
run: tests/patch_upgrade/patch_test_partial_upgrade.sh
- name: blocks-3
run: tests/test_block_production.sh 127.0.0.1 $VAL1_RPC_PORT
- name: signatures-3
run: tests/patch_upgrade/patch_test_signatures.sh $VAL1_RPC_PORT 2 # two validators
- name: txs-2
run: tests/patch_upgrade/patch_test_tx.sh
- name: api-2
run: tests/test_endpoints_api.sh localhost 25001
- name: rpc-2
run: tests/test_endpoints_rpc.sh localhost $VAL1_RPC_PORT
- name: consumera-vsc-2
run: tests/patch_upgrade/patch_test_ccv.sh
- name: Initialize consumer chain c
env:
CONSUMER_CHAIN_ID: consumerc
CONSUMER_HOME_1: /home/runner/.conc1
CONSUMER_HOME_2: /home/runner/.conc2
CON1_API_PORT: 25301
CON2_API_PORT: 25302
CON1_GRPC_PORT: 26301
CON2_GRPC_PORT: 26302
CON1_RPC_PORT: 27301
CON2_RPC_PORT: 27302
CON1_P2P_PORT: 28301
CON2_P2P_PORT: 28302
CON1_PPROF_PORT: 6167
CON2_PPROF_PORT: 6168
CONSUMER_SERVICE_1: conc1.service
CONSUMER_SERVICE_2: conc2.service
run: tests/patch_upgrade/patch_init_consumer.sh
- name: Launch consumer chain c
env:
CONSUMER_CHAIN_ID: consumerc
CONSUMER_HOME_1: /home/runner/.conc1
CONSUMER_HOME_2: /home/runner/.conc2
CONSUMER_SERVICE_1: conc1.service
CONSUMER_SERVICE_2: conc2.service
run: tests/patch_upgrade/patch_launch_consumer.sh 4
- name: consumerc-blocks
run: tests/test_block_production.sh 127.0.0.1 27301
- name: consumerc-signatures
run: tests/patch_upgrade/patch_test_signatures.sh 27301 2 # two validators
- name: Establish CCV channel for consumer c
run: |
hermes create connection --a-chain consumerc --a-client 07-tendermint-0 --b-client 07-tendermint-2
hermes create channel --a-chain consumerc --a-port consumer --b-port provider --order ordered --a-connection connection-0 --channel-version 1
sudo systemctl restart hermes
sleep 10
- name: consumerc-vsc
env:
CON1_RPC_PORT: 27301
run: tests/patch_upgrade/patch_test_ccv.sh
- name: consumerc-ibc
env:
CONSUMER_CHAIN_ID: consumerc
CONSUMER_HOME_1: /home/runner/.conc1
CONSUMER_HOME_2: /home/runner/.conc2
run: tests/patch_upgrade/patch_test_ibc_transfer.sh channel-5 4
- name: Stop consumer chain
env:
CONSUMER_CHAIN_ID: consumerc
run: tests/patch_upgrade/patch_stop_consumer.sh 5
- name: consumerc-remove
run: tests/patch_upgrade/patch_test_consumer_removed.sh
- name: blocks-4
run: tests/test_block_production.sh 127.0.0.1 $VAL1_RPC_PORT
- name: signatures-4
run: tests/patch_upgrade/patch_test_signatures.sh $VAL1_RPC_PORT 2 # two validators