-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathtest-suite-e2e-operators-tests.yml
More file actions
215 lines (196 loc) · 8.12 KB
/
test-suite-e2e-operators-tests.yml
File metadata and controls
215 lines (196 loc) · 8.12 KB
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
name: test-suite-e2e-operators-tests
# Github does not support more than 10 inputs for workflow_dispatch:
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#providing-inputs
# Core, relayer and test-suite follow the latest-main defaults unless explicitly pinned
on:
workflow_dispatch:
inputs:
connector_version:
description: "Connector Version"
default: ""
type: string
db_migration_version:
description: "Coprocessor DB Migration Image Version"
default: ""
type: string
host_version:
description: "Host Image Version"
default: ""
type: string
gateway_version:
description: "Gateway Image Version"
required: false
default: ""
type: string
host_listener_version:
description: "Host Listener Image Version"
default: ""
type: string
gateway_listener_version:
description: "Gateway Listener Image Version"
default: ""
type: string
tx_sender_version:
description: "Transaction Sender Image Version"
default: ""
type: string
tfhe_worker_version:
description: "TFHE Worker Image Version"
default: ""
type: string
sns_worker_version:
description: "SNS Worker Image Version"
default: ""
type: string
zkproof_worker_version:
description: "ZKProof Worker Image Version"
default: ""
type: string
permissions: {}
# Allow to run multiple instances of the same workflow in parallel when triggered manually
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' && github.run_id || 'auto' }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
setup-instance:
name: test-suite-e2e-operators-tests/setup-instance
runs-on: ubuntu-latest
permissions:
contents: 'read' # Required to checkout repository code
outputs:
runner-name: ${{ steps.start-remote-instance.outputs.label }}
steps:
- name: Start remote instance
id: start-remote-instance
uses: zama-ai/slab-github-runner@79939325c3c429837c10d6041e4fd8589d328bac
with:
mode: start
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
slab-url: ${{ secrets.SLAB_BASE_URL }}
job-secret: ${{ secrets.JOB_SECRET }}
backend: aws
profile: bench
operators-e2e-test:
name: test-suite-e2e-operators-tests/operators-e2e-test
if: ${{ github.event_name == 'workflow_dispatch' }}
permissions:
contents: 'read' # Required to checkout repository code
id-token: 'write' # Required for OIDC authentication
packages: 'read' # Required to read GitHub packages/container registry
env:
GH_TOKEN: ${{ secrets.GHCR_READ_TOKEN || github.token }}
CONNECTOR_DB_MIGRATION_VERSION: ${{ inputs.connector_version }}
CONNECTOR_GW_LISTENER_VERSION: ${{ inputs.connector_version }}
CONNECTOR_KMS_WORKER_VERSION: ${{ inputs.connector_version }}
CONNECTOR_TX_SENDER_VERSION: ${{ inputs.connector_version }}
COPROCESSOR_DB_MIGRATION_VERSION: ${{ inputs.db_migration_version }}
HOST_VERSION: ${{ inputs.host_version }}
GATEWAY_VERSION: ${{ inputs.gateway_version }}
COPROCESSOR_HOST_LISTENER_VERSION: ${{ inputs.host_listener_version }}
COPROCESSOR_GW_LISTENER_VERSION: ${{ inputs.gateway_listener_version }}
COPROCESSOR_TX_SENDER_VERSION: ${{ inputs.tx_sender_version }}
COPROCESSOR_TFHE_WORKER_VERSION: ${{ inputs.tfhe_worker_version }}
COPROCESSOR_SNS_WORKER_VERSION: ${{ inputs.sns_worker_version }}
COPROCESSOR_ZKPROOF_WORKER_VERSION: ${{ inputs.zkproof_worker_version }}
runs-on: ${{ needs.setup-instance.outputs.runner-name }}
needs: setup-instance
timeout-minutes: 1440
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
fetch-depth: 0
- name: Setup Docker
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Install unzip
run: |
sudo apt-get update
sudo apt-get install -y unzip
- name: Install GitHub CLI
run: |
sudo apt-get update
sudo apt-get install -y gh
- name: Setup Bun
uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2.1.3
- name: Install foundry
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_READ_TOKEN }}
- name: Login to Chainguard Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: cgr.dev
username: ${{ secrets.CGR_USERNAME }}
password: ${{ secrets.CGR_PASSWORD }}
- name: Install CLI deps
working-directory: test-suite/fhevm
run: |
bun install --frozen-lockfile
- name: Deploy fhevm Stack
working-directory: test-suite/fhevm
run: |
./fhevm-cli up --target latest-main --scenario ./scenarios/two-of-two.yaml
- name: All operators tests
working-directory: test-suite/fhevm
run: |
./fhevm-cli test operators
- name: Random operators tests
working-directory: test-suite/fhevm
run: |
./fhevm-cli test random
- name: Show logs on test failure
working-directory: test-suite/fhevm
if: failure()
run: |
snapshot_logs() {
local group="$1"
local container="$2"
local filter="${3:-}"
echo "::group::${group}"
if [ -n "$filter" ]; then
docker logs --tail 200 "${container}" 2>&1 | grep -v "$filter" || true
else
docker logs --tail 200 "${container}" 2>&1 || true
fi
echo "::endgroup::"
}
snapshot_logs "Relayer Logs" fhevm-relayer
snapshot_logs "Host Listener" coprocessor-host-listener
snapshot_logs "Gateway Listener" coprocessor-gw-listener
snapshot_logs "SNS Worker Logs" coprocessor-sns-worker "Selected 0 rows to process"
snapshot_logs "Transaction Sender Logs (filtered)" coprocessor-transaction-sender "Selected 0 rows to process"
snapshot_logs "ZKProof Worker" coprocessor-zkproof-worker
snapshot_logs "TFHE Worker" coprocessor-tfhe-worker
snapshot_logs "Coprocessor 2 - Host Listener" coprocessor1-host-listener
snapshot_logs "Coprocessor 2 - Gateway Listener" coprocessor1-gw-listener
snapshot_logs "Coprocessor 2 - SNS Worker" coprocessor1-sns-worker "Selected 0 rows to process"
snapshot_logs "Coprocessor 2 - Transaction Sender (filtered)" coprocessor1-transaction-sender "Selected 0 rows to process"
snapshot_logs "Coprocessor 2 - ZKProof Worker" coprocessor1-zkproof-worker
snapshot_logs "Coprocessor 2 - TFHE Worker" coprocessor1-tfhe-worker
- name: Cleanup
working-directory: test-suite/fhevm
if: always()
run: |
./fhevm-cli clean --images
teardown-instance:
name: test-suite-e2e-operators-tests/teardown
if: ${{ always() && needs.setup-instance.result == 'success' }}
needs: [ setup-instance, operators-e2e-test]
runs-on: ubuntu-latest
permissions:
contents: 'read' # Required to checkout repository code
steps:
- name: Stop remote instance
id: stop-instance
uses: zama-ai/slab-github-runner@79939325c3c429837c10d6041e4fd8589d328bac
with:
mode: stop
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
slab-url: ${{ secrets.SLAB_BASE_URL }}
job-secret: ${{ secrets.JOB_SECRET }}
label: ${{ needs.setup-instance.outputs.runner-name }}