You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
204 lines
5.1 KiB
204 lines
5.1 KiB
version: "3.8" |
|
|
|
services: |
|
# Next.orly.dev relay (this repository) |
|
next-orly: |
|
build: |
|
context: ../.. |
|
dockerfile: cmd/benchmark/Dockerfile.next-orly |
|
container_name: benchmark-next-orly |
|
environment: |
|
- ORLY_DATA_DIR=/data |
|
- ORLY_LISTEN=0.0.0.0 |
|
- ORLY_PORT=8080 |
|
- ORLY_LOG_LEVEL=off |
|
volumes: |
|
- ./data/next-orly:/data |
|
ports: |
|
- "8001:8080" |
|
networks: |
|
- benchmark-net |
|
healthcheck: |
|
test: ["CMD", "curl", "-f", "http://localhost:8080/"] |
|
interval: 30s |
|
timeout: 10s |
|
retries: 3 |
|
start_period: 40s |
|
|
|
# Khatru with SQLite |
|
khatru-sqlite: |
|
build: |
|
context: ./external/khatru |
|
dockerfile: ../../Dockerfile.khatru-sqlite |
|
container_name: benchmark-khatru-sqlite |
|
environment: |
|
- DATABASE_TYPE=sqlite |
|
- DATABASE_PATH=/data/khatru.db |
|
volumes: |
|
- ./data/khatru-sqlite:/data |
|
ports: |
|
- "8002:3334" |
|
networks: |
|
- benchmark-net |
|
healthcheck: |
|
test: ["CMD-SHELL", "wget -q -O- http://localhost:3334 || exit 0"] |
|
interval: 30s |
|
timeout: 10s |
|
retries: 3 |
|
start_period: 40s |
|
|
|
# Khatru with Badger |
|
khatru-badger: |
|
build: |
|
context: ./external/khatru |
|
dockerfile: ../../Dockerfile.khatru-badger |
|
container_name: benchmark-khatru-badger |
|
environment: |
|
- DATABASE_TYPE=badger |
|
- DATABASE_PATH=/data/badger |
|
volumes: |
|
- ./data/khatru-badger:/data |
|
ports: |
|
- "8003:3334" |
|
networks: |
|
- benchmark-net |
|
healthcheck: |
|
test: ["CMD-SHELL", "wget -q -O- http://localhost:3334 || exit 0"] |
|
interval: 30s |
|
timeout: 10s |
|
retries: 3 |
|
start_period: 40s |
|
|
|
# Relayer basic example |
|
relayer-basic: |
|
build: |
|
context: ./external/relayer |
|
dockerfile: ../../Dockerfile.relayer-basic |
|
container_name: benchmark-relayer-basic |
|
environment: |
|
- POSTGRESQL_DATABASE=postgres://relayer:relayerpass@postgres:5432/relayerdb?sslmode=disable |
|
volumes: |
|
- ./data/relayer-basic:/data |
|
ports: |
|
- "8004:7447" |
|
networks: |
|
- benchmark-net |
|
depends_on: |
|
postgres: |
|
condition: service_healthy |
|
healthcheck: |
|
test: ["CMD-SHELL", "wget -q -O- http://localhost:7447 || exit 0"] |
|
interval: 30s |
|
timeout: 10s |
|
retries: 3 |
|
start_period: 40s |
|
|
|
# Strfry |
|
strfry: |
|
image: ghcr.io/hoytech/strfry:latest |
|
container_name: benchmark-strfry |
|
environment: |
|
- STRFRY_DB_PATH=/data/strfry-db |
|
- STRFRY_RELAY_PORT=8080 |
|
volumes: |
|
- ./data/strfry:/data |
|
- ./configs/strfry.conf:/etc/strfry.conf |
|
ports: |
|
- "8005:8080" |
|
networks: |
|
- benchmark-net |
|
entrypoint: /bin/sh |
|
command: -c "mkdir -p /data/strfry-db && exec /app/strfry relay" |
|
healthcheck: |
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://127.0.0.1:8080"] |
|
interval: 30s |
|
timeout: 10s |
|
retries: 3 |
|
start_period: 40s |
|
|
|
# Nostr-rs-relay |
|
nostr-rs-relay: |
|
build: |
|
context: ./external/nostr-rs-relay |
|
dockerfile: ../../Dockerfile.nostr-rs-relay |
|
container_name: benchmark-nostr-rs-relay |
|
environment: |
|
- RUST_LOG=info |
|
volumes: |
|
- ./data/nostr-rs-relay:/data |
|
- ./configs/config.toml:/app/config.toml |
|
ports: |
|
- "8006:8080" |
|
networks: |
|
- benchmark-net |
|
healthcheck: |
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080"] |
|
interval: 30s |
|
timeout: 10s |
|
retries: 3 |
|
start_period: 40s |
|
|
|
# Benchmark runner |
|
benchmark-runner: |
|
build: |
|
context: ../.. |
|
dockerfile: cmd/benchmark/Dockerfile.benchmark |
|
container_name: benchmark-runner |
|
depends_on: |
|
next-orly: |
|
condition: service_healthy |
|
khatru-sqlite: |
|
condition: service_healthy |
|
khatru-badger: |
|
condition: service_healthy |
|
relayer-basic: |
|
condition: service_healthy |
|
strfry: |
|
condition: service_healthy |
|
nostr-rs-relay: |
|
condition: service_healthy |
|
environment: |
|
- BENCHMARK_TARGETS=next-orly:8080,khatru-sqlite:3334,khatru-badger:3334,relayer-basic:7447,strfry:8080,nostr-rs-relay:8080 |
|
- BENCHMARK_EVENTS=50000 |
|
- BENCHMARK_WORKERS=24 |
|
- BENCHMARK_DURATION=60s |
|
volumes: |
|
- ./reports:/reports |
|
networks: |
|
- benchmark-net |
|
command: > |
|
sh -c " |
|
echo 'Waiting for all relays to be ready...' && |
|
sleep 30 && |
|
echo 'Starting benchmark tests...' && |
|
/app/benchmark-runner --output-dir=/reports && |
|
echo 'Benchmark complete - triggering shutdown...' && |
|
exit 0 |
|
" |
|
|
|
# PostgreSQL for relayer-basic |
|
postgres: |
|
image: postgres:16-alpine |
|
container_name: benchmark-postgres |
|
environment: |
|
- POSTGRES_DB=relayerdb |
|
- POSTGRES_USER=relayer |
|
- POSTGRES_PASSWORD=relayerpass |
|
volumes: |
|
- ./data/postgres:/var/lib/postgresql/data |
|
networks: |
|
- benchmark-net |
|
healthcheck: |
|
test: ["CMD-SHELL", "pg_isready -U relayer -d relayerdb"] |
|
interval: 10s |
|
timeout: 5s |
|
retries: 5 |
|
start_period: 20s |
|
|
|
networks: |
|
benchmark-net: |
|
driver: bridge |
|
|
|
volumes: |
|
benchmark-data: |
|
driver: local
|
|
|