-
Notifications
You must be signed in to change notification settings - Fork 5
182 lines (153 loc) · 5.5 KB
/
deploy_validator_aws.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
name: Deploy validator on Aws
on:
workflow_dispatch:
inputs:
evmos_node_tag:
description: 'Evmos node image tag (default: latest)'
default: 'latest'
type: string
required: false
oracle_db_service_tag:
description: 'Oracle Db service image tag (default: latest)'
default: 'latest'
type: string
required: false
clean:
description: 'Clean docker related components (default: true, false only for first deployment)'
default: true
type: boolean
required: false
run_test:
description: 'Run e2e test after deployment (default: true)'
default: true
type: boolean
required: false
jobs:
clean_instance:
name: Clean docker related components
runs-on: zbc-testnet
if: ${{ inputs.clean }}
steps:
- name: Stop docker compose
working-directory: ./evmos
run: |
docker compose -f docker-compose/docker-compose.validator.yml down
- name: Clean all docker related image, cache, container ...
working-directory: ./evmos
run: |
docker system prune -af
push_to_registry:
if: ${{ always() }}
name: Deploy new version of zbc testnet
needs: clean_instance
runs-on: zbc-testnet
env:
EVMOS_NODE_TAG: ${{ inputs.evmos_node_tag }}
ORACLE_DB_SERVICE_TAG: ${{ inputs.oracle_db_service_tag }}
steps:
- name: Echo user parameters
run: |
echo "evmos_node_tag: ${{ inputs.evmos_node_tag }}"
echo "oracle_db_service_tag: ${{ inputs.oracle_db_service_tag }}"
echo "clean: ${{ inputs.clean }}"
- name: Clean Workspace
uses: AutoModality/[email protected]
- name: Checkout
uses: actions/checkout@v3
with:
path: evmos
- name: Get version for all needed repositories
working-directory: ./evmos
run: |
echo "ZBC_SOLIDITY_VERSION=$(./scripts/get_version_from_makefile.sh ZBC_SOLIDITY_VERSION)" >> $GITHUB_ENV
- name: Echo versions parsed from Makefile and go.mod
run: |
echo "ZBC_SOLIDITY_VERSION: $ZBC_SOLIDITY_VERSION"
- name: Checkout zbc-solidity
uses: actions/checkout@v3
with:
repository: zama-ai/zbc-solidity
token: ${{ secrets.CONCRETE_ACTIONS_TOKEN }}
path: ./evmos/work_dir/zbc-solidity
ref: ${{ env.ZBC_SOLIDITY_VERSION }}
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-3
- name: Download keys from S3
working-directory: ./evmos
env:
AWS_S3_BUCKET: zbc-testnet
run: |
aws s3 ls s3://${AWS_S3_BUCKET}
./scripts/prepare_volumes_validator_ci.sh
- name: Prepare files for node setup
working-directory: ./evmos
run: |
mkdir -p node/evmos
cp ../evmos/private.ed25519 node/evmos
cp ../evmos/public.ed25519 node/evmos
touch vm.log
ls node/evmos
- name: List files in volumes
working-directory: ./evmos
run: |
ls volumes
- name: Login to GitHub Container Registry
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare evmos node aka run setup.sh
working-directory: ./evmos
run: |
docker compose -f docker-compose/docker-compose.validator.yml run validator bash /config/setup.sh
- name: Check running node owner and change it
working-directory: ./evmos
run: |
ls -all .
sudo chown -R $USER: running_node/
- name: Prepare keys
working-directory: ./evmos
run: |
./scripts/prepare_validator_ci.sh
- name: Start whole testnet
working-directory: ./evmos
run: |
docker compose -f docker-compose/docker-compose.validator.yml -f docker-compose/docker-compose.validator.override.yml up --detach
- name: Check running docker
run: |
docker ps
- name: Sleep for 3 seconds to ensure validtor is running
run: |
sleep 10s
- name: List files in zbc-solidity
working-directory: evmos/work_dir/zbc-solidity
run: |
ls
- name: Upload genesis and node_id to S3 bucket to allow other nodes to sync
working-directory: ./evmos
env:
AWS_S3_BUCKET: zbc-testnet
run: |
aws s3 ls s3://${AWS_S3_BUCKET}/
./scripts/upload_genesis.sh
- name: Prepare/download fhe keys
working-directory: evmos/work_dir/zbc-solidity
run: |
./ci/scripts/prepare_fhe_keys_ci.sh
- name: Install @openzeppelin/contracts
working-directory: evmos/work_dir/zbc-solidity
run: |
npm install @openzeppelin/contracts
- name: Run e2e test from zbc-solidty
if: ${{ inputs.run_test }}
working-directory: evmos/work_dir/zbc-solidity
run: |
./ci/scripts/run_ERC20_ci_test.sh mykey1 ../../