-
Notifications
You must be signed in to change notification settings - Fork 76
/
action.yml
190 lines (170 loc) · 7.34 KB
/
action.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
name: Regression Tests - Polygon CDK
description: Deploy a local Polygon CDK devnet using Kurtosis and perform series of regression tests
author: devtools@polygon.technology
inputs:
zkevm_agglayer:
description: 0xPolygon/agglayer (short commit hash or release tag)
required: false
default: "0.1.4"
zkevm_bridge_service:
description: 0xPolygonHermez/zkevm-bridge-service (short commit hash or release tag)
required: false
default: "v0.4.2"
zkevm_bridge_ui:
description: 0xPolygonHermez/zkevm-bridge-ui (short commit hash or release tag)
required: false
default: "0006445"
zkevm_dac:
description: 0xPolygon/cdk-data-availability (short commit hash or release tag)
required: false
default: "0.0.7"
zkevm_node:
description: 0xPolygon/cdk-validium-node (short commit hash or release tag)
required: false
default: "0.6.5-cdk"
kurtosis_cli:
description: kurtosis-tech/kurtosis (release tag)
required: false
default: "0.90.1"
kurtosis_cdk:
description: 0xPolygon/kurtosis-cdk (release tag)
required: false
default: "v0.2.0"
runs:
using: "composite"
steps:
# Build docker images.
- name: Clone and build agglayer, if no release tag given
shell: bash
run: |
if [[ ${{ inputs.zkevm_agglayer }} =~ ^[0-9a-fA-F]{7}$ ]]; then
git clone https://github.com/0xPolygon/agglayer.git
cd agglayer
git checkout "${{ inputs.zkevm_agglayer }}"
echo "Containerizing commit id: ${{ inputs.zkevm_agglayer }}"
make build
mv ./dist/agglayer .
docker build -t agglayer:local -f ./Dockerfile.release .
else
echo "Skipping building agglayer as release tag provided: ${{ inputs.zkevm_agglayer }}"
fi
- name: Clone and build zkevm-bridge-service, if no release tag given
shell: bash
run: |
if [[ ${{ inputs.zkevm_bridge_service }} =~ ^[0-9a-fA-F]{7}$ ]]; then
git clone https://github.com/0xPolygonHermez/zkevm-bridge-service.git
cd zkevm-bridge-service
git checkout "${{ inputs.zkevm_bridge_service }}"
docker build -t zkevm-bridge-service:local -f ./Dockerfile .
else
echo "Skipping building zkevm-bridge-service as release tag provided: ${{ inputs.zkevm_bridge_service }}"
fi
- name: Clone and build zkevm-bridge-ui, if no release tag given
shell: bash
run: |
if [[ ${{ inputs.zkevm_bridge_ui }} =~ ^[0-9a-fA-F]{7}$ ]]; then
git clone https://github.com/0xPolygonHermez/zkevm-bridge-ui.git
cd zkevm-bridge-ui
git checkout "${{ inputs.zkevm_bridge_ui }}"
docker build -t zkevm-bridge-ui:local -f ./Dockerfile .
else
echo "Skipping building zkevm-bridge-ui as release tag provided: ${{ inputs.zkevm_bridge_ui }}"
fi
- name: Clone and build cdk-data-availability, if no release tag given
shell: bash
run: |
if [[ ${{ inputs.zkevm_dac }} =~ ^[0-9a-fA-F]{7}$ ]]; then
git clone https://github.com/0xPolygon/cdk-data-availability.git
cd cdk-data-availability
git checkout "${{ inputs.zkevm_dac }}"
docker build -t cdk-data-availability:local -f ./Dockerfile .
else
echo "Skipping building cdk-data-availability as release tag provided: ${{ inputs.zkevm_dac }}"
fi
- name: Clone and build cdk-validium-node, if no release tag given
shell: bash
run: |
if [[ ${{ inputs.zkevm_node }} =~ ^[0-9a-fA-F]{7}$ ]]; then
git clone https://github.com/0xPolygon/cdk-validium-node.git
cd cdk-validium-node
git checkout "${{ inputs.zkevm_node }}"
docker build -t cdk-validium-node:local -f ./Dockerfile .
else
echo "Skipping building cdk-validium-node as release tag provided: ${{ inputs.zkevm_node }}"
fi
# Install tools
- name: Install Kurtosis CDK tools
uses: ./.github/actions/setup-kurtosis-cdk
with:
kurtosis-version: ${{ inputs.kurtosis_cli }}
- name: Install polycli
shell: bash
run: |
git clone https://github.com/maticnetwork/polygon-cli.git
cd polygon-cli
make install
export PATH="$HOME/go/bin:$PATH"
# Deploy components.
- name: Use specific version of kurtosis-cdk
shell: bash
run: git checkout "${{ inputs.kurtosis_cdk }}"
- name: Use local docker containers
shell: bash
run: |
# When short commit hash given, reference custom image built earlier tagged 'local'.
if [[ ${{ inputs.zkevm_agglayer }} =~ ^[0-9a-fA-F]{7}$ ]]; then
agglayer_tag="local"
agglayer_docker_hub="agglayer"
else
agglayer_tag="${{ inputs.zkevm_agglayer }}"
agglayer_docker_hub="0xpolygon/agglayer"
fi
if [[ ${{ inputs.zkevm_bridge_service }} =~ ^[0-9a-fA-F]{7}$ ]]; then
bridge_service_tag="local"
bridge_service_docker_hub="zkevm-bridge-service"
else
bridge_service_tag="${{ inputs.zkevm_bridge_service }}"
bridge_service_docker_hub="hermeznetwork/zkevm-bridge-service"
fi
if [[ ${{ inputs.zkevm_bridge_ui }} =~ ^[0-9a-fA-F]{7}$ ]]; then
bridge_ui_tag="local"
bridge_ui_docker_hub="zkevm-bridge-ui"
else
bridge_ui_tag="${{ inputs.zkevm_bridge_ui }}"
bridge_ui_docker_hub="hermeznetwork/zkevm-bridge-ui"
fi
if [[ ${{ inputs.zkevm_dac }} =~ ^[0-9a-fA-F]{7}$ ]]; then
dac_tag="local"
dac_docker_hub="cdk-data-availability"
else
dac_tag="${{ inputs.zkevm_dac }}"
dac_docker_hub="0xpolygon/cdk-data-availability"
fi
if [[ ${{ inputs.zkevm_node }} =~ ^[0-9a-fA-F]{7}$ ]]; then
node_tag="local"
node_docker_hub="cdk-validium-node"
else
node_tag="${{ inputs.zkevm_node }}"
node_docker_hub="0xpolygon/cdk-validium-node"
fi
cat params.yml
yq -Y --in-place ".args.agglayer_image = \"$agglayer_docker_hub:$agglayer_tag\"" params.yml
yq -Y --in-place ".args.zkevm_bridge_service_image = \"$bridge_service_docker_hub:$bridge_service_tag\"" params.yml
yq -Y --in-place ".args.zkevm_bridge_ui_image = \"$bridge_ui_docker_hub:$bridge_ui_tag\"" params.yml
yq -Y --in-place ".args.zkevm_da_image = \"$dac_docker_hub:$dac_tag\"" params.yml
yq -Y --in-place ".args.zkevm_node_image = \"$node_docker_hub:$node_tag\"" params.yml
cat params.yml
- name: Deploy Kurtosis CDK package
shell: bash
run: kurtosis run --enclave cdk-v1 --args-file params.yml .
- name: Monitor verified batches
uses: ./.github/actions/monitor-verified-batches
# Perform loadtest.
- name: Perform load test
shell: bash
run: |
export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 rpc)"
export PK="$(yq .args.zkevm_l2_admin_private_key params.yml)"
polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 5 --mode t
polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 10 --mode t
polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 10 --mode 2