Skip to content

Commit beb7942

Browse files
authored
Merge of #2134
2 parents e3a355c + 366fba7 commit beb7942

File tree

110 files changed

+12244
-2334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+12244
-2334
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ charts/
9797
# -----------------------------------------------------------------------------
9898
# Git-related (keep .git/ for build metadata, exclude others)
9999
# -----------------------------------------------------------------------------
100+
.git/lfs/
100101
.gitignore
101102
.gitattributes
102103
**/.gitkeep

.github/workflows/test-suite-e2e-operators-tests.yml

Lines changed: 109 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
name: test-suite-e2e-operators-tests
22

3-
# Core, relayer and test-suite will use the default versions defined in the `fhevm-cli` script
3+
# Github does not support more than 10 inputs for workflow_dispatch:
4+
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#providing-inputs
5+
# Core, relayer and test-suite follow the latest-main defaults unless explicitly pinned
46
on:
57
workflow_dispatch:
68
inputs:
9+
build:
10+
description: "Build repo-owned images from the checked out branch on the runner"
11+
default: false
12+
type: boolean
13+
grep:
14+
description: "Optional narrow grep pattern for targeted operator tests"
15+
default: ""
16+
type: string
17+
scenario:
18+
description: "Optional fhevm scenario passed to deploy"
19+
default: ""
20+
type: string
721
connector_version:
822
description: "Connector Version"
923
default: ""
1024
type: string
25+
coprocessor_version:
26+
description: "Shared Coprocessor Runtime Image Version"
27+
default: ""
28+
type: string
1129
db_migration_version:
1230
description: "Coprocessor DB Migration Image Version"
1331
default: ""
@@ -21,38 +39,6 @@ on:
2139
required: false
2240
default: ""
2341
type: string
24-
host_listener_version:
25-
description: "Host Listener Image Version"
26-
default: ""
27-
type: string
28-
gateway_listener_version:
29-
description: "Gateway Listener Image Version"
30-
default: ""
31-
type: string
32-
tx_sender_version:
33-
description: "Transaction Sender Image Version"
34-
default: ""
35-
type: string
36-
tfhe_worker_version:
37-
description: "TFHE Worker Image Version"
38-
default: ""
39-
type: string
40-
sns_worker_version:
41-
description: "SNS Worker Image Version"
42-
default: ""
43-
type: string
44-
zkproof_worker_version:
45-
description: "ZKProof Worker Image Version"
46-
default: ""
47-
type: string
48-
deploy-build:
49-
description: "Build local Docker images from the checked out repository before deploy"
50-
default: false
51-
type: boolean
52-
grep:
53-
description: "Optional grep pattern to narrow operators tests"
54-
default: ""
55-
type: string
5642

5743
permissions: {}
5844

@@ -88,6 +74,24 @@ jobs:
8874
contents: 'read' # Required to checkout repository code
8975
id-token: 'write' # Required for OIDC authentication
9076
packages: 'read' # Required to read GitHub packages/container registry
77+
env:
78+
GH_TOKEN: ${{ secrets.GHCR_READ_TOKEN || github.token }}
79+
BUILD: ${{ inputs.build && 'true' || 'false' }}
80+
GREP: ${{ inputs.grep }}
81+
SCENARIO: ${{ inputs.scenario }}
82+
CONNECTOR_DB_MIGRATION_VERSION: ${{ inputs.connector_version }}
83+
CONNECTOR_GW_LISTENER_VERSION: ${{ inputs.connector_version }}
84+
CONNECTOR_KMS_WORKER_VERSION: ${{ inputs.connector_version }}
85+
CONNECTOR_TX_SENDER_VERSION: ${{ inputs.connector_version }}
86+
COPROCESSOR_DB_MIGRATION_VERSION: ${{ inputs.db_migration_version }}
87+
HOST_VERSION: ${{ inputs.host_version }}
88+
GATEWAY_VERSION: ${{ inputs.gateway_version }}
89+
COPROCESSOR_HOST_LISTENER_VERSION: ${{ inputs.coprocessor_version }}
90+
COPROCESSOR_GW_LISTENER_VERSION: ${{ inputs.coprocessor_version }}
91+
COPROCESSOR_TX_SENDER_VERSION: ${{ inputs.coprocessor_version }}
92+
COPROCESSOR_TFHE_WORKER_VERSION: ${{ inputs.coprocessor_version }}
93+
COPROCESSOR_SNS_WORKER_VERSION: ${{ inputs.coprocessor_version }}
94+
COPROCESSOR_ZKPROOF_WORKER_VERSION: ${{ inputs.coprocessor_version }}
9195
runs-on: ${{ needs.setup-instance.outputs.runner-name }}
9296
needs: setup-instance
9397
timeout-minutes: 1440
@@ -96,11 +100,25 @@ jobs:
96100
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
97101
with:
98102
persist-credentials: 'false'
103+
fetch-depth: 0
99104

100105
- name: Setup Docker
101106
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
102107

103-
- name: Install Foundry
108+
- name: Install unzip
109+
run: |
110+
sudo apt-get update
111+
sudo apt-get install -y unzip
112+
113+
- name: Install GitHub CLI
114+
run: |
115+
sudo apt-get update
116+
sudo apt-get install -y gh
117+
118+
- name: Setup Bun
119+
uses: oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2.1.3
120+
121+
- name: Install foundry
104122
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0
105123

106124
- name: Login to GitHub Container Registry
@@ -117,69 +135,80 @@ jobs:
117135
username: ${{ secrets.CGR_USERNAME }}
118136
password: ${{ secrets.CGR_PASSWORD }}
119137

138+
- name: Install CLI deps
139+
working-directory: test-suite/fhevm
140+
run: |
141+
bun install --frozen-lockfile
142+
120143
- name: Deploy fhevm Stack
121144
working-directory: test-suite/fhevm
122-
env:
123-
CONNECTOR_DB_MIGRATION_VERSION: ${{ inputs.connector_version }}
124-
CONNECTOR_GW_LISTENER_VERSION: ${{ inputs.connector_version }}
125-
CONNECTOR_KMS_WORKER_VERSION: ${{ inputs.connector_version }}
126-
CONNECTOR_TX_SENDER_VERSION: ${{ inputs.connector_version }}
127-
DB_MIGRATION_VERSION: ${{ inputs.db_migration_version }}
128-
HOST_VERSION: ${{ inputs.host_version }}
129-
GATEWAY_VERSION: ${{ inputs.gateway_version }}
130-
HOST_LISTENER_VERSION: ${{ inputs.host_listener_version }}
131-
GW_LISTENER_VERSION: ${{ inputs.gateway_listener_version }}
132-
TX_SENDER_VERSION: ${{ inputs.tx_sender_version }}
133-
TFHE_WORKER_VERSION: ${{ inputs.tfhe_worker_version }}
134-
SNS_WORKER_VERSION: ${{ inputs.sns_worker_version }}
135-
ZKPROOF_WORKER_VERSION: ${{ inputs.zkproof_worker_version }}
136-
DEPLOY_BUILD: ${{ inputs.deploy-build }}
137145
run: |
138-
if [[ "$DEPLOY_BUILD" == 'true' ]]; then
139-
./fhevm-cli deploy --build --coprocessors 2 --coprocessor-threshold 2
140-
else
141-
./fhevm-cli deploy --coprocessors 2 --coprocessor-threshold 2
146+
args=(--target latest-main)
147+
if [ "$BUILD" = "true" ]; then
148+
args+=(--build)
142149
fi
150+
if [ -n "$SCENARIO" ]; then
151+
args+=(--scenario "$SCENARIO")
152+
fi
153+
./fhevm-cli deploy "${args[@]}"
154+
155+
- name: Validate targeted grep
156+
if: ${{ inputs.grep != '' }}
157+
run: |
158+
case "$GREP" in
159+
"test operator"|"FHEVM manual operations"|"test operator|FHEVM manual operations")
160+
echo "grep is too broad for targeted operators runs; pass a narrow explicit pattern" >&2
161+
exit 1
162+
;;
163+
esac
143164
144165
- name: All operators tests
166+
if: ${{ !inputs.grep }}
145167
working-directory: test-suite/fhevm
146-
env:
147-
GREP: ${{ inputs.grep }}
148168
run: |
149-
if [ -n "$GREP" ]; then
150-
./fhevm-cli test operators -g "$GREP"
151-
else
152-
./fhevm-cli test operators
153-
fi
169+
./fhevm-cli test operators --parallel
170+
171+
- name: Targeted operators grep
172+
if: ${{ inputs.grep != '' }}
173+
working-directory: test-suite/fhevm
174+
run: |
175+
./fhevm-cli test operators --parallel --grep "$GREP"
154176
155177
- name: Random operators tests
156-
if: ${{ inputs.grep == '' }}
178+
if: ${{ !inputs.grep }}
157179
working-directory: test-suite/fhevm
158180
run: |
159181
./fhevm-cli test random
160182
161-
- name: Show logs on test failure
183+
- name: Show logs
162184
working-directory: test-suite/fhevm
163185
if: failure()
164186
run: |
165-
echo "::group::Relayer Logs"
166-
./fhevm-cli logs relayer
167-
echo "::endgroup::"
168-
echo "::group::SNS Worker Logs"
169-
./fhevm-cli logs sns-worker | grep -v "Selected 0 rows to process"
170-
echo "::endgroup::"
171-
echo "::group::Transaction Sender Logs (filtered)"
172-
./fhevm-cli logs transaction-sender | grep -v "Selected 0 rows to process"
173-
echo "::endgroup::"
174-
echo "::group::Coprocessor 2 - SNS Worker"
175-
./fhevm-cli logs coprocessor-2-sns-worker 2>/dev/null | grep -v "Selected 0 rows to process" || true
176-
echo "::endgroup::"
177-
echo "::group::Coprocessor 2 - Transaction Sender (filtered)"
178-
./fhevm-cli logs coprocessor-2-transaction-sender 2>/dev/null | grep -v "Selected 0 rows to process" || true
179-
echo "::endgroup::"
180-
echo "::group::Coprocessor 2 - TFHE Worker"
181-
./fhevm-cli logs coprocessor-2-tfhe-worker 2>/dev/null || true
182-
echo "::endgroup::"
187+
snapshot_logs() {
188+
local group="$1"
189+
local container="$2"
190+
local filter="${3:-}"
191+
echo "::group::${group}"
192+
if [ -n "$filter" ]; then
193+
docker logs --tail 120 "${container}" 2>&1 | grep -v "$filter" || true
194+
else
195+
docker logs --tail 120 "${container}" 2>&1 || true
196+
fi
197+
echo "::endgroup::"
198+
}
199+
snapshot_logs "Relayer Logs" fhevm-relayer
200+
snapshot_logs "Host Listener" coprocessor-host-listener
201+
snapshot_logs "Gateway Listener" coprocessor-gw-listener
202+
snapshot_logs "SNS Worker Logs" coprocessor-sns-worker "Selected 0 rows to process"
203+
snapshot_logs "Transaction Sender Logs (filtered)" coprocessor-transaction-sender "Selected 0 rows to process"
204+
snapshot_logs "ZKProof Worker" coprocessor-zkproof-worker
205+
snapshot_logs "TFHE Worker" coprocessor-tfhe-worker
206+
snapshot_logs "Coprocessor 2 - Host Listener" coprocessor1-host-listener
207+
snapshot_logs "Coprocessor 2 - Gateway Listener" coprocessor1-gw-listener
208+
snapshot_logs "Coprocessor 2 - SNS Worker" coprocessor1-sns-worker "Selected 0 rows to process"
209+
snapshot_logs "Coprocessor 2 - Transaction Sender (filtered)" coprocessor1-transaction-sender "Selected 0 rows to process"
210+
snapshot_logs "Coprocessor 2 - ZKProof Worker" coprocessor1-zkproof-worker
211+
snapshot_logs "Coprocessor 2 - TFHE Worker" coprocessor1-tfhe-worker
183212
184213
- name: Cleanup
185214
working-directory: test-suite/fhevm

0 commit comments

Comments
 (0)