Skip to content

Commit 69adc1d

Browse files
committed
Use worker aggregator in CI
1 parent b23f440 commit 69adc1d

File tree

5 files changed

+111
-13
lines changed

5 files changed

+111
-13
lines changed

.github/workflows/daphneci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2024 Cloudflare, Inc. All rights reserved.
1+
# Copyright (c) 2025 Cloudflare, Inc. All rights reserved.
22
# SPDX-License-Identifier: BSD-3-Clause
33
---
44
name: DaphneCI
@@ -80,3 +80,15 @@ jobs:
8080
env:
8181
HPKE_SIGNING_KEY: ${{ steps.hpke_signing_key.outputs.hpke_signing_key }}
8282
E2E_TEST_HPKE_SIGNING_CERTIFICATE: ${{ steps.hpke_signing_cert.outputs.hpke_signing_cert }}
83+
84+
e2e-worker-aggregator:
85+
runs-on: ubuntu-latest
86+
steps:
87+
- name: Checking out
88+
uses: actions/checkout@v3
89+
90+
- name: Run integration tests
91+
uses: hoverkraft-tech/compose-action@v2.0.1
92+
with:
93+
compose-file: "./crates/daphne-worker-test/docker/docker-compose-e2e.yaml"
94+
up-flags: "--build --abort-on-container-exit --exit-code-from test"

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2024 Cloudflare, Inc. All rights reserved.
1+
# Copyright (c) 2025 Cloudflare, Inc. All rights reserved.
22
# SPDX-License-Identifier: BSD-3-Clause
33

44
.PHONY: accept acceptance e2e load leader l helper h storage-proxy s
@@ -45,6 +45,12 @@ e2e: /tmp/private-key /tmp/certificate
4545
--abort-on-container-exit \
4646
--exit-code-from test
4747

48+
e2e-worker:
49+
docker compose -f ./crates/daphne-worker-test/docker/docker-compose-e2e.yaml up \
50+
--build \
51+
--abort-on-container-exit \
52+
--exit-code-from test
53+
4854
build_interop:
4955
docker build . -f ./interop/Dockerfile.interop_helper --tag daphne-interop
5056

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (c) 2025 Cloudflare, Inc. All rights reserved.
2+
# SPDX-License-Identifier: BSD-3-Clause
3+
4+
FROM rust:1.83-bookworm AS builder
5+
RUN apt update && apt install -y capnproto clang cmake
6+
7+
# Pre-install worker-build and Rust's wasm32 target to speed up our custom build command
8+
RUN rustup target add wasm32-unknown-unknown
9+
RUN cargo install --git https://github.com/cloudflare/workers-rs
10+
11+
# Build the worker.
12+
WORKDIR /tmp/dap_test
13+
COPY Cargo.toml Cargo.lock ./
14+
COPY crates/daphne-worker-test ./crates/daphne-worker-test
15+
COPY crates/daphne-worker ./crates/daphne-worker
16+
COPY crates/daphne-service-utils ./crates/daphne-service-utils
17+
COPY crates/daphne ./crates/daphne
18+
WORKDIR /tmp/dap_test/crates/daphne-worker-test
19+
RUN worker-build --dev
20+
21+
FROM node:bookworm AS leader
22+
RUN npm install -g wrangler@3.60.1 && npm cache clean --force
23+
COPY --from=builder /tmp/dap_test/crates/daphne-worker-test/build/ /build
24+
COPY crates/daphne-worker-test/wrangler.aggregator.toml /
25+
# this container doesn't need worker-build but the wrangler.toml requires it, so we just fake it
26+
RUN ln -s /usr/bin/true /usr/bin/worker-build
27+
28+
ENTRYPOINT ["wrangler", "dev", "--config", "wrangler.aggregator.toml", "-e", "leader", "--port", "8787"]
29+
30+
FROM node:bookworm AS helper
31+
RUN npm install -g wrangler@3.60.1 && npm cache clean --force
32+
COPY --from=builder /tmp/dap_test/crates/daphne-worker-test/build/ /build
33+
COPY crates/daphne-worker-test/wrangler.aggregator.toml /
34+
# this container doesn't need worker-build but the wrangler.toml requires it, so we just fake it
35+
RUN ln -s /usr/bin/true /usr/bin/worker-build
36+
37+
ENTRYPOINT ["wrangler", "dev", "--config", "wrangler.aggregator.toml", "-e", "helper", "--port", "8788"]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright (c) 2025 Cloudflare, Inc. All rights reserved.
2+
# SPDX-License-Identifier: BSD-3-Clause
3+
---
4+
version: "3.9"
5+
6+
networks:
7+
dap_network:
8+
driver: bridge
9+
10+
services:
11+
leader:
12+
networks:
13+
- dap_network
14+
ports:
15+
- "8787"
16+
build:
17+
context: ../../..
18+
dockerfile: crates/daphne-worker-test/docker/aggregator.Dockerfile
19+
target: leader
20+
environment:
21+
- RUST_LOG=info
22+
helper:
23+
networks:
24+
- dap_network
25+
ports:
26+
- "8788"
27+
build:
28+
context: ../../..
29+
dockerfile: crates/daphne-worker-test/docker/aggregator.Dockerfile
30+
target: helper
31+
environment:
32+
- RUST_LOG=info
33+
test:
34+
networks:
35+
- dap_network
36+
build:
37+
context: ../../..
38+
dockerfile: crates/daphne-worker-test/docker/runtests.Dockerfile
39+
depends_on:
40+
- leader
41+
- helper
42+
environment:
43+
- "E2E_TEST_HPKE_SIGNING_CERTIFICATE=-----BEGIN CERTIFICATE-----\nMIICCTCCAa+gAwIBAgIUBECNyioI8d+hgXsgmVI+TcRD8wUwCgYIKoZIzj0EAwIw\nWjELMAkGA1UEBhMCUFQxDjAMBgNVBAcMBUJyYWdhMRcwFQYDVQQKDA5DbG91ZGZs\nYXJlIExkYTEiMCAGA1UEAwwZaGVscGVyLmRhcC5jbG91ZGZsYXJlLmNvbTAeFw0y\nNTAxMDYxMTAwNDdaFw0yNjAxMDYxMTAwNDdaMFoxCzAJBgNVBAYTAlBUMQ4wDAYD\nVQQHDAVCcmFnYTEXMBUGA1UECgwOQ2xvdWRmbGFyZSBMZGExIjAgBgNVBAMMGWhl\nbHBlci5kYXAuY2xvdWRmbGFyZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC\nAASheYdDsJLsG4UG95bs2qlVr1QQcK6+k6emAJSDAlr7bIGjHUoLwUdIQK818g/N\ngVL0vig90b4uGTS7KdKJ9o4Ko1MwUTAdBgNVHQ4EFgQUeOUaahWphjiaQotYoRfb\nVBdby+wwHwYDVR0jBBgwFoAUeOUaahWphjiaQotYoRfbVBdby+wwDwYDVR0TAQH/\nBAUwAwEB/zAKBggqhkjOPQQDAgNIADBFAiEAl0pg+5iQC3yskSbZrz8gyEgAaKx2\niyrASYsFh2gdfkICIAgkOlAOHsUHlhh0zRt9m283dLR0/ZYVoEhII8ZMkb1/\n-----END CERTIFICATE-----"

crates/daphne-worker-test/wrangler.aggregator.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Copyright (c) 2024 Cloudflare, Inc. All rights reserved.
1+
# Copyright (c) 2025 Cloudflare, Inc. All rights reserved.
22
# SPDX-License-Identifier: BSD-3-Clause
33

44
main = "build/worker/shim.mjs"
5-
compatibility_date = "2023-12-21"
5+
compatibility_date = "2025-01-08"
66

77
# Don't ask to send metrics to Cloudflare. The worker may be run from a container.
88
send_metrics = false
@@ -34,6 +34,11 @@ DAP_DURABLE_AGGREGATE_STORE_GC_AFTER_SECS = "30"
3434
TASKPROV_SECRETS_ENABLED = "true"
3535
TASKPROV_SECRETS_VDAF_VERIFY_KEY_INIT = "b029a72fa327931a5cb643dcadcaafa098fcbfac07d990cb9e7c9a8675fafb18"
3636
TASKPROV_SECRETS_PEER_AUTH_EXPECT_LEADER_TOKEN = "I-am-the-leader"
37+
SIGNING_KEY = """-----BEGIN EC PRIVATE KEY-----
38+
MHcCAQEEIPg1ObFKii4YgTwltHaC/vgD6pwg5EtvW1YoyHVB5HfKoAoGCCqGSM49
39+
AwEHoUQDQgAEoXmHQ7CS7BuFBveW7NqpVa9UEHCuvpOnpgCUgwJa+2yBox1KC8FH
40+
SECvNfIPzYFS9L4oPdG+Lhk0uynSifaOCg==
41+
-----END EC PRIVATE KEY-----"""
3742

3843
[env.helper.vars.SERVICE_CONFIG]
3944
env = "oxy"
@@ -52,7 +57,8 @@ id = 23
5257
kem_id = "p256_hkdf_sha256"
5358
kdf_id = "hkdf_sha256"
5459
aead_id = "aes128_gcm"
55-
public_key = "047dab625e0d269abcc28c611bebf5a60987ddf7e23df0e0aa343e5774ad81a1d0160d9252b82b4b5c52354205f5ec945645cb79facff8d85c9c31b490cdf35466"
60+
public_key = "37dadb753418ebfe6380b658718f60ea47fcb952a81cd5a3b4be1d3c90f61576"
61+
# PRIVATE KEY: 658f2a0e2239692b5fb141452dc3b90130586c27cf2f5f7cb3c3c75c18684672
5662

5763
[dev]
5864
ip = "0.0.0.0"
@@ -115,7 +121,8 @@ id = 23
115121
kem_id = "p256_hkdf_sha256"
116122
kdf_id = "hkdf_sha256"
117123
aead_id = "aes128_gcm"
118-
public_key = "047dab625e0d269abcc28c611bebf5a60987ddf7e23df0e0aa343e5774ad81a1d0160d9252b82b4b5c52354205f5ec945645cb79facff8d85c9c31b490cdf35466"
124+
public_key = "37dadb753418ebfe6380b658718f60ea47fcb952a81cd5a3b4be1d3c90f61576"
125+
# PRIVATE KEY: 658f2a0e2239692b5fb141452dc3b90130586c27cf2f5f7cb3c3c75c18684672
119126

120127
[env.leader.durable_objects]
121128
bindings = [
@@ -147,11 +154,4 @@ tag = "v1"
147154
new_classes = [
148155
"AggregateStore",
149156
"GarbageCollector",
150-
"HelperStateStore",
151-
]
152-
153-
[[migrations]]
154-
tag = "v2"
155-
renamed_classes = [
156-
{ from = "GarbageCollector", to = "TestStateCleaner" },
157157
]

0 commit comments

Comments
 (0)