Skip to content

Commit a26061d

Browse files
authored
test(test-suite): update with new coprocessor images (#321)
* test(test-suite): update with new coprocessor images * chore(test-suite): build all images from main * feat(test-suite): add --build option to fhevm-cli * fix(test-suite): improve caching with local build * test(test-suite): update fhevm stack to latest as a shortcut to test * fix(test-suite): update fhevm-reayer to match rc13 config * docs(test-suite): improve doc
1 parent 90cc47c commit a26061d

12 files changed

Lines changed: 420 additions & 64 deletions
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: test-suite-e2e-tests-with-build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
core_version:
7+
description: "KMS Core Version"
8+
default: ""
9+
type: string
10+
relayer_version:
11+
description: "Relayer Image Version"
12+
default: ""
13+
type: string
14+
# WIP: still not working - skipped for now
15+
# pull_request:
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
20+
21+
jobs:
22+
check-changes:
23+
name: test-suite-e2e-tests-with-build/check-changes
24+
permissions:
25+
actions: 'read'
26+
contents: 'read'
27+
pull-requests: 'read'
28+
runs-on: ubuntu-latest
29+
outputs:
30+
changes-fhevm: ${{ steps.filter.outputs.fhevm }}
31+
steps:
32+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
34+
id: filter
35+
with:
36+
filters: |
37+
fhevm:
38+
- 'test-suite/fhevm/**'
39+
tests:
40+
name: test-suite-e2e-tests-with-build/tests
41+
needs: check-changes
42+
if: ${{ needs.check-changes.outputs.changes-fhevm == 'true' || github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
43+
permissions:
44+
contents: "read"
45+
id-token: "write"
46+
packages: "read"
47+
48+
runs-on: large_ubuntu_32
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52+
53+
- name: Display Docker and Buildx version
54+
run: |
55+
echo "Docker version: $(docker --version)"
56+
echo "Docker Buildx version: $(docker buildx version)"
57+
echo "--- Docker Info ---"
58+
docker info
59+
echo "-------------------"
60+
61+
- name: Setup Docker Buildx
62+
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
63+
64+
- name: Login to GitHub Container Registry
65+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
66+
with:
67+
registry: ghcr.io
68+
username: ${{ github.actor }}
69+
password: ${{ secrets.GHCR_READ_TOKEN }}
70+
71+
- name: Deploy fhevm Stack
72+
working-directory: test-suite/fhevm
73+
env:
74+
CORE_VERSION: ${{ inputs.core_version }}
75+
RELAYER_VERSION: ${{ inputs.relayer_version }}
76+
DOCKER_BUILDKIT: 1
77+
timeout-minutes: 90
78+
run: |
79+
./fhevm-cli deploy --build
80+
81+
- name: Input proof test (uint64)
82+
working-directory: test-suite/fhevm
83+
run: |
84+
./fhevm-cli test input-proof
85+
86+
- name: Public Decryption test
87+
working-directory: test-suite/fhevm
88+
run: |
89+
./fhevm-cli test public-decryption
90+
91+
- name: User Decryption test
92+
working-directory: test-suite/fhevm
93+
run: |
94+
./fhevm-cli test user-decryption
95+
96+
- name: ERC20 test
97+
working-directory: test-suite/fhevm
98+
run: |
99+
./fhevm-cli test erc20
100+
101+
- name: Public Decryption HTTP endpoint test (ebool)
102+
working-directory: test-suite/fhevm
103+
run: |
104+
./fhevm-cli test public-decrypt-http-ebool
105+
106+
- name: Public Decryption HTTP endpoint test (mixed)
107+
working-directory: test-suite/fhevm
108+
run: |
109+
./fhevm-cli test public-decrypt-http-mixed
110+
111+
- name: Show logs on test failure
112+
working-directory: test-suite/fhevm
113+
if: always()
114+
run: |
115+
echo "::group::Relayer Logs"
116+
./fhevm-cli logs relayer
117+
echo "::endgroup::"
118+
echo "::group::SNS Worker Logs"
119+
./fhevm-cli logs sns-worker | grep -v "Selected 0 rows to process"
120+
echo "::endgroup::"
121+
echo "::group::Transaction Sender Logs (filtered)"
122+
./fhevm-cli logs transaction-sender | grep -v "Selected 0 rows to process"
123+
echo "::endgroup::"
124+
125+
- name: Cleanup
126+
working-directory: test-suite/fhevm
127+
if: always()
128+
run: |
129+
./fhevm-cli clean

host-contracts/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/zama-ai/fhevm-node:latest
1+
FROM ghcr.io/zama-ai/fhevm/gci/nodejs:22.14.0-alpine3.21
22

33
USER root
44

test-suite/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ KMS can be configured to two modes:
2626

2727
## Get started
2828

29+
### Quickstart
2930
The test suite offers a unified CLI for all operations:
3031

3132
```sh
@@ -52,6 +53,32 @@ cd test-suite/fhevm
5253
./fhevm-cli clean
5354
```
5455

56+
### WIP - Forcing Local Builds (`--build`)
57+
58+
⚠️ **IMPORTANT: THIS FEATURE IS STILL A WORK IN PROGRESS!** ⚠️
59+
We are actively working to optimize caching for local machines and GitHub runners.
60+
61+
🚨 **SECURITY NOTICE:**
62+
The pre-built Docker images for the FHEVM stack are currently hosted in a **private registry** and are **not publicly available** for direct pulling. This is intentional for security reasons.
63+
64+
Therefore, for external developers or anyone setting up the stack for the first time without access to our private registry, **using the `--build` option is the recommended and necessary way to get started:**
65+
66+
```sh
67+
./fhevm-cli deploy --build
68+
```
69+
70+
This command instructs Docker Compose to:
71+
1. Build the images locally using the `Dockerfile` and context specified in the respective `docker-compose/*.yml` files for each service. This process uses the source code available in your local checkout (or cloned sub-repositories).
72+
2. Tag the newly built images with the versions specified in the `fhevm-cli` script.
73+
3. Then, start the services using these freshly built local images.
74+
75+
**Why `--build` is essential for external developers:**
76+
* **Image Access:** Since pre-built images are private, `--build` allows you to construct the necessary images from the publicly available source code.
77+
* **Local Modifications:** If you have made local changes to any of the Dockerfiles or the build context of a service (e.g., you've cloned one of the sub-repositories like `fhevm-contracts` or `fhevm-coprocessor` into the expected relative paths and made changes), `--build` ensures these changes are incorporated.
78+
* **Ensuring Correct Setup:** It guarantees that you are running with images built directly from the provided source, eliminating discrepancies that could arise from attempting to pull non-existent or inaccessible public images.
79+
80+
🚧 **In summary:** Until public images are made available, external users should always use `./fhevm-cli deploy --build` to ensure a successful deployment.
81+
5582
## Security policy
5683

5784
### Handling sensitive data

test-suite/fhevm/config/relayer/local.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
environment: development
22

3-
inputproof:
4-
url: "0.0.0.0:3000"
5-
6-
7-
3+
http_endpoint: "0.0.0.0:3000"
84

95
transaction:
106
private_key_fhevm_env: FHEVM_PRIVATE_KEY
@@ -24,6 +20,10 @@ transaction:
2420
base_delay_secs: 3
2521
max_delay_secs: 225
2622

23+
metrics_endpoint: "0.0.0.0:9898"
24+
http_metrics:
25+
histogram_buckets: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 40]
26+
2727

2828
log:
2929
# Set log level for development

test-suite/fhevm/docker-compose/connector-docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ services:
33
kms-connector:
44
container_name: kms-connector
55
image: ghcr.io/zama-ai/fhevm/kms-connector:${CONNECTOR_VERSION}
6+
build:
7+
context: ../../..
8+
dockerfile: kms-connector/Dockerfile
9+
cache_from:
10+
- type=gha
11+
cache_to:
12+
- type=gha,mode=max
613
env_file:
714
- ../env/staging/.env.connector.local
815
volumes:

test-suite/fhevm/docker-compose/coprocessor-docker-compose.yml

Lines changed: 66 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ services:
3535
db-migration:
3636
container_name: fhevm-db-migration
3737
image: ghcr.io/zama-ai/fhevm/coprocessor/db-migration:${DB_MIGRATION_VERSION}
38+
build:
39+
context: ../../..
40+
dockerfile: coprocessor/fhevm-engine/db-migration/Dockerfile
41+
cache_from:
42+
- type=gha
43+
cache_to:
44+
- type=gha,mode=max
3845
env_file:
3946
- ../env/staging/.env.coprocessor.local
4047
environment:
@@ -50,9 +57,16 @@ services:
5057
condition: service_completed_successfully
5158

5259
####################### COPROCESSOR SERVICES #######################
53-
fhevm-listener:
54-
container_name: fhevm-fhevm-listener
55-
image: ghcr.io/zama-ai/fhevm/coprocessor:${COPROCESSOR_VERSION}
60+
host-listener:
61+
container_name: fhevm-host-listener
62+
image: ghcr.io/zama-ai/fhevm/coprocessor/host-listener:${HOST_LISTENER_VERSION}
63+
build:
64+
context: ../../..
65+
dockerfile: coprocessor/fhevm-engine/fhevm-listener/Dockerfile
66+
cache_from:
67+
- type=gha
68+
cache_to:
69+
- type=gha,mode=max
5670
env_file:
5771
- ../env/staging/.env.coprocessor.local
5872
command:
@@ -68,11 +82,14 @@ services:
6882

6983
gw-listener:
7084
container_name: fhevm-gw-listener
71-
image: ghcr.io/zama-ai/fhevm/coprocessor:${COPROCESSOR_VERSION}
72-
# image: ghcr.io/zama-ai/fhevm/coprocessor/gw-listener:latest
73-
# build:
74-
# context: ../../..
75-
# dockerfile: coprocessor/fhevm-engine/gw-listener/Dockerfile
85+
image: ghcr.io/zama-ai/fhevm/coprocessor/gw-listener:${GW_LISTENER_VERSION}
86+
build:
87+
context: ../../..
88+
dockerfile: coprocessor/fhevm-engine/gw-listener/Dockerfile
89+
cache_from:
90+
- type=gha
91+
cache_to:
92+
- type=gha,mode=max
7693
healthcheck:
7794
test: ["CMD-SHELL", "curl -f http://localhost:8080/liveness || exit 1"]
7895
interval: 10s
@@ -97,7 +114,14 @@ services:
97114

98115
tfhe-worker:
99116
container_name: fhevm-tfhe-worker
100-
image: ghcr.io/zama-ai/fhevm/coprocessor:${COPROCESSOR_VERSION}
117+
image: ghcr.io/zama-ai/fhevm/coprocessor/tfhe-worker:${TFHE_WORKER_VERSION}
118+
build:
119+
context: ../../..
120+
dockerfile: coprocessor/fhevm-engine/coprocessor/Dockerfile
121+
cache_from:
122+
- type=gha
123+
cache_to:
124+
- type=gha,mode=max
101125
env_file:
102126
- ../env/staging/.env.coprocessor.local
103127
command:
@@ -118,7 +142,14 @@ services:
118142

119143
zkproof-worker:
120144
container_name: fhevm-zkproof-worker
121-
image: ghcr.io/zama-ai/fhevm/coprocessor:${COPROCESSOR_VERSION}
145+
image: ghcr.io/zama-ai/fhevm/coprocessor/zkproof-worker:${ZKPROOF_WORKER_VERSION}
146+
build:
147+
context: ../../..
148+
dockerfile: coprocessor/fhevm-engine/zkproof-worker/Dockerfile
149+
cache_from:
150+
- type=gha
151+
cache_to:
152+
- type=gha,mode=max
122153
env_file:
123154
- ../env/staging/.env.coprocessor.local
124155
command:
@@ -137,7 +168,14 @@ services:
137168

138169
sns-worker:
139170
container_name: fhevm-sns-worker
140-
image: ghcr.io/zama-ai/fhevm/coprocessor:${COPROCESSOR_VERSION}
171+
image: ghcr.io/zama-ai/fhevm/coprocessor/sns-worker:${SNS_WORKER_VERSION}
172+
build:
173+
context: ../../..
174+
dockerfile: coprocessor/fhevm-engine/sns-executor/Dockerfile
175+
cache_from:
176+
- type=gha
177+
cache_to:
178+
- type=gha,mode=max
141179
env_file:
142180
- ../env/staging/.env.coprocessor.local
143181
command:
@@ -147,19 +185,19 @@ services:
147185
- --pg-listen-channels
148186
- event_pbs_computations
149187
- event_ciphertext_computed
150-
- --pg-notify-channel="event_ciphertext128_computed"
188+
- --pg-notify-channel
189+
- event_ciphertext128_computed
151190
- --work-items-batch-size=20
152191
- --pg-polling-interval=30
153192
- --pg-pool-connections=10
154193
- --bucket-name-ct64=ct64
155194
- --bucket-name-ct128=ct128
156-
# # uncomment if you are using release => v0.7.0-rc2
157-
# - --s3-max-concurrent-uploads=100
158-
# - --s3-max-retries-per-upload=100
159-
# - --s3-max-backoff=10s
160-
# - --s3-max-retries-timeout=120s
161-
# - --s3-recheck-duration=2s
162-
# - --s3-regular-recheck-duration=120s
195+
- --s3-max-concurrent-uploads=100
196+
- --s3-max-retries-per-upload=100
197+
- --s3-max-backoff=10s
198+
- --s3-max-retries-timeout=120s
199+
- --s3-recheck-duration=2s
200+
- --s3-regular-recheck-duration=120s
163201
depends_on:
164202
db:
165203
condition: service_healthy
@@ -168,7 +206,14 @@ services:
168206

169207
transaction-sender:
170208
container_name: fhevm-transaction-sender
171-
image: ghcr.io/zama-ai/fhevm/coprocessor:${COPROCESSOR_VERSION}
209+
image: ghcr.io/zama-ai/fhevm/coprocessor/tx-sender:${TX_SENDER_VERSION}
210+
build:
211+
context: ../../..
212+
dockerfile: coprocessor/fhevm-engine/transaction-sender/Dockerfile
213+
cache_from:
214+
- type=gha
215+
cache_to:
216+
- type=gha,mode=max
172217
env_file:
173218
- ../env/staging/.env.coprocessor.local
174219
command:
@@ -186,8 +231,7 @@ services:
186231
- --verify-proof-resp-batch-limit=128
187232
- --verify-proof-resp-max-retries=15
188233
- --verify-proof-remove-after-max-retries
189-
# # uncomment if you are using release => v0.7.0-rc2
190-
# - --signer-type=private-key
234+
- --signer-type=private-key
191235
depends_on:
192236
db:
193237
condition: service_healthy

test-suite/fhevm/docker-compose/gateway-docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ services:
2424
gateway-sc-deploy:
2525
container_name: fhevm-gateway-sc-deploy
2626
image: ghcr.io/zama-ai/fhevm/gateway-contracts:${GATEWAY_VERSION}
27+
build:
28+
context: ../../../gateway-contracts
29+
dockerfile: Dockerfile
30+
cache_from:
31+
- type=gha
32+
cache_to:
33+
- type=gha,mode=max
2734
env_file:
2835
- ../env/staging/.env.gateway.local
2936
command:
@@ -37,6 +44,13 @@ services:
3744
gateway-sc-add-network:
3845
container_name: fhevm-gateway-sc-add-network
3946
image: ghcr.io/zama-ai/fhevm/gateway-contracts:${GATEWAY_VERSION}
47+
build:
48+
context: ../../../gateway-contracts
49+
dockerfile: Dockerfile
50+
cache_from:
51+
- type=gha
52+
cache_to:
53+
- type=gha,mode=max
4054
env_file:
4155
- ../env/staging/.env.gateway.local
4256
command:

0 commit comments

Comments
 (0)