-
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
197 lines (180 loc) · 7.41 KB
/
test-suite-e2e-operators-tests.yml
File metadata and controls
197 lines (180 loc) · 7.41 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
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 will use the default versions defined in the `fhevm-cli` script
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'
- name: Setup Docker
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Setup Bun
uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2
- 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-release --coprocessors 2 --threshold 2
- 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: |
echo "::group::Relayer Logs"
timeout 20 ./fhevm-cli logs relayer || true
echo "::endgroup::"
echo "::group::SNS Worker Logs"
timeout 20 ./fhevm-cli logs sns-worker | grep -v "Selected 0 rows to process" || true
echo "::endgroup::"
echo "::group::Transaction Sender Logs (filtered)"
timeout 20 ./fhevm-cli logs transaction-sender | grep -v "Selected 0 rows to process" || true
echo "::endgroup::"
echo "::group::Coprocessor 2 - SNS Worker"
./fhevm-cli logs coprocessor-2-sns-worker 2>/dev/null | grep -v "Selected 0 rows to process" || true
echo "::endgroup::"
echo "::group::Coprocessor 2 - Transaction Sender (filtered)"
./fhevm-cli logs coprocessor-2-transaction-sender 2>/dev/null | grep -v "Selected 0 rows to process" || true
echo "::endgroup::"
echo "::group::Coprocessor 2 - TFHE Worker"
./fhevm-cli logs coprocessor-2-tfhe-worker 2>/dev/null || true
echo "::endgroup::"
- 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 }}