Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Update docker-compose for e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Nov 20, 2023
1 parent 3502c7f commit 82ddc77
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on: # yamllint disable-line rule:truthy
outputs:
workflow_output:
description: "E2E output"
value: ${{ jobs.build.outputs.run_e2e_failure }}
value: ${{ jobs.execution.outputs.run_e2e_failure }}

jobs:
build:
execution:
runs-on: ubuntu-latest
env:
CI_VERBOSE: true
Expand Down
9 changes: 3 additions & 6 deletions test/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
.PHONY: run
run: stop ## Run all the services needed to perform an E2E test
docker compose up -d zkevm-state-db zkevm-pool-db beethoven-db l1
sleep 1
docker compose up -d zkevm-prover beethoven
sleep 3
docker compose up -d zkevm-node
docker compose -f docker-compose.yaml up -d l1 zkevm-prover zkevm-node
docker compose -f docker-compose.yaml up -d --build beethoven

.PHONY: stop
stop: ## Stop all the services needed to perform an E2E test
docker compose down
docker compose -f docker-compose.yaml down
110 changes: 80 additions & 30 deletions test/docker-compose.yml → test/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
version: '3.5'
services:
zkevm-state-db:
image: postgres:16.0-alpine
container_name: zkevm-state-db
image: postgres
command: ["postgres", "-N", "500"]
deploy:
resources:
limits:
Expand All @@ -14,14 +15,22 @@ services:
volumes:
- ./config/init_prover_db.sql:/docker-entrypoint-initdb.d/init.sql
environment:
- POSTGRES_USER=state_user
- POSTGRES_PASSWORD=state_password
- POSTGRES_DB=state_db
command: ["postgres", "-N", "500"]
POSTGRES_USER: state_user
POSTGRES_PASSWORD: state_password
POSTGRES_DB: state_db
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d", "prover_db" ]
interval: 30s
timeout: 60s
retries: 5
start_period: 10s
networks:
- beethoven-localnet

zkevm-pool-db:
container_name: zkevm-pool-db
image: postgres
image: postgres:16.0-alpine
command: ["postgres", "-N", "500"]
deploy:
resources:
limits:
Expand All @@ -31,14 +40,22 @@ services:
ports:
- 5433:5432
environment:
- POSTGRES_USER=pool_user
- POSTGRES_PASSWORD=pool_password
- POSTGRES_DB=pool_db
command: ["postgres", "-N", "500"]
POSTGRES_USER: pool_user
POSTGRES_PASSWORD: pool_password
POSTGRES_DB: pool_db
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d", "pool_db" ]
interval: 30s
timeout: 60s
retries: 5
start_period: 10s
networks:
- beethoven-localnet

beethoven-db:
container_name: beethoven-db
image: postgres
image: postgres:16.0-alpine
command: ["postgres", "-N", "500"]
deploy:
resources:
limits:
Expand All @@ -47,34 +64,50 @@ services:
memory: 1G
ports:
- 5435:5432
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d", "beethoven_db" ]
interval: 30s
timeout: 60s
retries: 5
start_period: 10s
environment:
- POSTGRES_USER=beethoven_user
- POSTGRES_PASSWORD=beethoven_password
- POSTGRES_DB=beethoven_db
command: ["postgres", "-N", "500"]
POSTGRES_USER: beethoven_user
POSTGRES_PASSWORD: beethoven_password
POSTGRES_DB: beethoven_db
networks:
- beethoven-localnet
restart: always

zkevm-node:
container_name: zkevm-node
image: hermeznetwork/cdk-validium-node:beethoven
command:
- "/bin/sh"
- "-c"
- "/app/cdk-validium-node approve --network custom --custom-network-file /app/genesis.json --am 115792089237316195423570985008687907853269984665640564039457584007913129639935 -y --cfg /app/config.toml --key-store-path /pk/sequencer.keystore --password testonly &&
/app/cdk-validium-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components \"synchronizer,rpc,sequencer,sequence-sender,aggregator,eth-tx-manager,l2gaspricer\""
ports:
- 8123:8123
- 61090:61090
depends_on:
zkevm-state-db:
condition: service_healthy
zkevm-pool-db:
condition: service_healthy
zkevm-prover:
condition: service_started
l1:
condition: service_started
volumes:
- ./config/sequencer.keystore:/pk/sequencer.keystore
- ./config/node.toml:/app/config.toml
- ./config/genesis.json:/app/genesis.json
command:
- "/bin/sh"
- "-c"
- "/app/cdk-validium-node approve --network custom --custom-network-file /app/genesis.json --am 115792089237316195423570985008687907853269984665640564039457584007913129639935 -y --cfg /app/config.toml --key-store-path /pk/sequencer.keystore --password testonly &&
/app/cdk-validium-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components \"synchronizer,rpc,sequencer,sequence-sender,aggregator,eth-tx-manager,l2gaspricer\""
networks:
- beethoven-localnet

l1:
container_name: l1
image: hermeznetwork/geth-cdk-validium-contracts:v0.0.1
ports:
- 8545:8545
- 8546:8546
command:
- "--http"
- "--http.api"
Expand All @@ -98,27 +131,44 @@ services:
- "--syncmode"
- "full"
- "--rpc.allow-unprotected-txs"
ports:
- 8545:8545
- 8546:8546
networks:
- beethoven-localnet

zkevm-prover:
container_name: zkevm-prover
image: hermeznetwork/zkevm-prover:v2.2.0
command: [
"zkProver",
"-c",
"/usr/src/app/config.json"
]
depends_on:
zkevm-state-db:
condition: service_healthy
ports:
- 50061:50061 # MT
- 50071:50071 # Executor
volumes:
- ./config/prover.json:/usr/src/app/config.json
command: >
zkProver -c /usr/src/app/config.json
networks:
- beethoven-localnet

beethoven:
container_name: beethoven
image: beethoven
command: [ 'run', '--cfg', '/app/config.toml']
ports:
- 4444:4444
- 8444:8444
volumes:
- ./config/interop.keystore:/pk/interop.keystore
- ./config/beethoven.toml:/app/config.toml
command:
- "/bin/sh"
- "-c"
- "/app/beethoven run --cfg /app/config.toml"
networks:
- beethoven-localnet
restart: always

networks:
beethoven-localnet:
driver: bridge

0 comments on commit 82ddc77

Please sign in to comment.