2023-10-09 17:45:25 +00:00
|
|
|
|
|
|
|
## Kindly run the docker compose command (`docker compose up`) from the same
|
|
|
|
## folder as this file.
|
|
|
|
|
|
|
|
version: "3.7"
|
2023-10-15 18:26:40 +00:00
|
|
|
|
|
|
|
networks:
|
|
|
|
simulation:
|
|
|
|
driver: bridge
|
|
|
|
ipam:
|
|
|
|
driver: default
|
|
|
|
config:
|
|
|
|
- subnet: "10.1.0.0/22"
|
|
|
|
|
2023-10-09 17:45:25 +00:00
|
|
|
x-logging: &logging
|
|
|
|
logging:
|
|
|
|
driver: json-file
|
|
|
|
options:
|
|
|
|
max-size: 1000m
|
|
|
|
|
|
|
|
# Environment variable definitions
|
|
|
|
x-pg-pass: &pg_pass ${POSTGRES_PASSWORD:-test123}
|
|
|
|
x-pg-user: &pg_user ${POSTGRES_USER:-postgres}
|
|
|
|
|
|
|
|
x-pg-environment: &pg_env
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: *pg_user
|
|
|
|
POSTGRES_PASSWORD: *pg_pass
|
|
|
|
PGDATA: /var/lib/postgresql/data/pgdata
|
2023-11-06 11:58:30 +00:00
|
|
|
MALLOC_CHECK_: 2 # Not directly related to Postgres. Helps debug possible crashes in nwaku node.
|
2023-10-09 17:45:25 +00:00
|
|
|
|
|
|
|
x-pg-exporter-env: &pg_exp_env
|
|
|
|
environment:
|
|
|
|
POSTGRES_PASSWORD: *pg_pass
|
|
|
|
DATA_SOURCE_URI: postgres?sslmode=disable
|
|
|
|
DATA_SOURCE_USER: *pg_user
|
|
|
|
DATA_SOURCE_PASS: *pg_pass
|
|
|
|
PG_EXPORTER_EXTEND_QUERY_PATH: /etc/pgexporter/queries.yml
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
2023-10-15 18:26:40 +00:00
|
|
|
bootstrap:
|
2023-10-09 17:45:25 +00:00
|
|
|
image: statusteam/nim-waku:v0.20.0
|
2023-11-27 13:39:16 +00:00
|
|
|
restart: always
|
2023-10-15 18:26:40 +00:00
|
|
|
ports:
|
|
|
|
- 127.0.0.1:60000:60000
|
|
|
|
- 127.0.0.1:8008:8008
|
|
|
|
- 127.0.0.1:9000:9000
|
|
|
|
- 127.0.0.1:8544:8544
|
2023-10-09 17:45:25 +00:00
|
|
|
entrypoint: sh
|
|
|
|
command:
|
2023-10-15 18:26:40 +00:00
|
|
|
- '/opt/run_bootstrap.sh'
|
|
|
|
volumes:
|
|
|
|
- ./run_bootstrap.sh:/opt/run_bootstrap.sh:Z
|
2023-10-23 17:34:19 +00:00
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpus: '1'
|
|
|
|
memory: 2048M
|
2023-10-15 18:26:40 +00:00
|
|
|
networks:
|
|
|
|
- simulation
|
2023-10-09 17:45:25 +00:00
|
|
|
|
2023-10-15 18:26:40 +00:00
|
|
|
nwaku-sqlite:
|
2023-10-09 17:45:25 +00:00
|
|
|
## Waku node with Store mounted & SQLite
|
|
|
|
image: ubuntu
|
|
|
|
restart: on-failure
|
2023-10-15 18:26:40 +00:00
|
|
|
ports:
|
|
|
|
- 0.0.0.0:8546:8546
|
2023-10-23 17:48:20 +00:00
|
|
|
- 0.0.0.0:8004:8004
|
2023-11-27 13:39:16 +00:00
|
|
|
- 0.0.0.0:60001:60001
|
2023-10-09 17:45:25 +00:00
|
|
|
<<:
|
|
|
|
- *logging
|
|
|
|
volumes:
|
2023-11-06 12:10:47 +00:00
|
|
|
- /home/shared/nwaku/build/wakunode2:/usr/bin/wakunode:Z
|
2023-10-09 17:45:25 +00:00
|
|
|
- ./data/sqlite:/data
|
|
|
|
- ./run_nwaku_store_sqlite_ubuntu.sh:/opt/run_nwaku_store_sqlite.sh:Z
|
|
|
|
entrypoint: sh
|
|
|
|
command:
|
|
|
|
- /opt/run_nwaku_store_sqlite.sh
|
2023-11-27 13:36:49 +00:00
|
|
|
depends_on:
|
|
|
|
- bootstrap
|
2023-10-23 17:34:19 +00:00
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpus: '1'
|
|
|
|
memory: 2048M
|
2023-10-15 18:26:40 +00:00
|
|
|
networks:
|
|
|
|
- simulation
|
2023-10-09 17:45:25 +00:00
|
|
|
|
2023-10-15 18:26:40 +00:00
|
|
|
nwaku-postgres:
|
2023-10-09 17:45:25 +00:00
|
|
|
## Waku node with Store mounted & Postgres
|
2023-11-23 18:09:09 +00:00
|
|
|
## It can be analyzed the metrics of this particular node
|
2023-10-09 17:45:25 +00:00
|
|
|
image: ubuntu
|
|
|
|
restart: on-failure
|
2023-10-15 18:26:40 +00:00
|
|
|
ports:
|
|
|
|
- 0.0.0.0:8545:8545
|
2023-10-23 17:48:20 +00:00
|
|
|
- 0.0.0.0:8003:8003
|
2023-11-27 13:39:16 +00:00
|
|
|
- 0.0.0.0:60002:60002
|
2023-10-09 17:45:25 +00:00
|
|
|
<<:
|
|
|
|
- *logging
|
|
|
|
- *pg_env
|
|
|
|
volumes:
|
2023-10-09 18:16:24 +00:00
|
|
|
# This is expected to be run from metal-01.he-eu-hel1.wakudev.misc.statusim.net
|
2023-10-23 12:54:57 +00:00
|
|
|
- /home/shared/nwaku/build/wakunode2:/usr/bin/wakunode:Z
|
2023-10-15 18:26:40 +00:00
|
|
|
- ./run_nwaku_store_postgres_ubuntu.sh:/opt/run_nwaku_store_postgres_ubuntu.sh:Z
|
2023-10-09 17:45:25 +00:00
|
|
|
entrypoint: bash
|
|
|
|
command:
|
2023-10-15 18:26:40 +00:00
|
|
|
- /opt/run_nwaku_store_postgres_ubuntu.sh
|
2023-10-09 17:45:25 +00:00
|
|
|
depends_on:
|
|
|
|
- postgres
|
2023-11-27 13:36:49 +00:00
|
|
|
- bootstrap
|
2023-10-23 17:34:19 +00:00
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpus: '1'
|
|
|
|
memory: 2048M
|
2023-10-15 18:26:40 +00:00
|
|
|
networks:
|
|
|
|
- simulation
|
|
|
|
|
2023-11-23 18:09:09 +00:00
|
|
|
nwaku-postgres-additional:
|
|
|
|
## Waku node with Store mounted & Postgres
|
2023-11-24 15:33:14 +00:00
|
|
|
## This is aimed to produce more insert operation to the same Potsgres database.
|
2023-11-23 18:09:09 +00:00
|
|
|
image: ubuntu
|
|
|
|
restart: on-failure
|
|
|
|
<<:
|
|
|
|
- *logging
|
|
|
|
- *pg_env
|
|
|
|
volumes:
|
|
|
|
# This is expected to be run from metal-01.he-eu-hel1.wakudev.misc.statusim.net
|
|
|
|
- /home/shared/nwaku/build/wakunode2:/usr/bin/wakunode:Z
|
|
|
|
- ./run_nwaku_store_postgres_ubuntu.sh:/opt/run_nwaku_store_postgres_ubuntu.sh:Z
|
|
|
|
entrypoint: bash
|
|
|
|
command:
|
|
|
|
- /opt/run_nwaku_store_postgres_ubuntu.sh
|
|
|
|
depends_on:
|
2023-11-27 13:36:49 +00:00
|
|
|
- bootstrap
|
2023-11-23 18:09:09 +00:00
|
|
|
deploy:
|
|
|
|
mode: replicated
|
2023-11-27 13:39:16 +00:00
|
|
|
replicas: 2
|
2023-11-23 18:09:09 +00:00
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpus: '1'
|
|
|
|
memory: 2048M
|
|
|
|
networks:
|
|
|
|
- simulation
|
|
|
|
|
2023-11-22 11:29:42 +00:00
|
|
|
db-postgres-hammer:
|
2023-11-23 18:09:09 +00:00
|
|
|
## This service is aimed to stress the database by performing simple select queries
|
2023-11-22 11:29:42 +00:00
|
|
|
image: alpine:3.16
|
|
|
|
restart: on-failure
|
|
|
|
volumes:
|
|
|
|
- ./run_database_hammer.sh:/opt/run_database_hammer.sh:Z
|
|
|
|
entrypoint: sh
|
2023-11-27 13:37:27 +00:00
|
|
|
logging:
|
|
|
|
driver: none
|
2023-11-22 22:30:21 +00:00
|
|
|
deploy:
|
|
|
|
mode: replicated
|
2023-11-27 13:39:16 +00:00
|
|
|
#replicas: 0 - with this, normal behaviour
|
|
|
|
#replicas: 25 - it worked pretty well
|
|
|
|
replicas: 50
|
2023-11-22 11:29:42 +00:00
|
|
|
command:
|
|
|
|
- /opt/run_database_hammer.sh
|
|
|
|
depends_on:
|
2023-11-22 22:30:21 +00:00
|
|
|
- postgres
|
|
|
|
networks:
|
|
|
|
- simulation
|
2023-11-22 11:29:42 +00:00
|
|
|
|
2023-10-15 18:26:40 +00:00
|
|
|
waku-store-query-generator:
|
2023-11-28 10:21:47 +00:00
|
|
|
image: ivansete/waku-store-request-maker:1b7c16
|
2023-10-15 18:26:40 +00:00
|
|
|
restart: on-failure
|
|
|
|
entrypoint: sh
|
|
|
|
- 'opt/run_waku_store_query_maker.sh'
|
|
|
|
volumes:
|
|
|
|
- ./run_waku_store_query_maker.sh:/opt/run_waku_store_query_maker.sh:Z
|
|
|
|
environment:
|
2023-10-23 10:52:51 +00:00
|
|
|
STORE_QUERIES_PER_SECOND: 1
|
2023-11-27 13:39:16 +00:00
|
|
|
NUM_CONCURRENT_USERS: 25
|
2023-11-27 13:36:49 +00:00
|
|
|
depends_on:
|
|
|
|
- nwaku-postgres
|
|
|
|
- nwaku-sqlite
|
2023-10-15 18:26:40 +00:00
|
|
|
networks:
|
|
|
|
- simulation
|
2023-10-09 17:45:25 +00:00
|
|
|
|
2023-10-15 18:26:40 +00:00
|
|
|
waku-publisher:
|
|
|
|
image: alrevuelta/waku-publisher:9fb206c
|
|
|
|
entrypoint: sh
|
|
|
|
- 'opt/run_wakupublisher.sh'
|
|
|
|
volumes:
|
|
|
|
- ./run_wakupublisher.sh:/opt/run_wakupublisher.sh:Z
|
|
|
|
environment:
|
|
|
|
MSG_PER_SECOND: 10
|
|
|
|
MSG_SIZE_KBYTES: 10
|
|
|
|
depends_on:
|
2023-11-27 13:36:49 +00:00
|
|
|
- bootstrap
|
2023-10-15 18:26:40 +00:00
|
|
|
- nwaku-postgres
|
|
|
|
- nwaku-sqlite
|
|
|
|
networks:
|
|
|
|
- simulation
|
2023-10-09 17:45:25 +00:00
|
|
|
|
|
|
|
prometheus:
|
|
|
|
image: docker.io/prom/prometheus:latest
|
|
|
|
volumes:
|
|
|
|
- ./monitoring/prometheus-config.yml:/etc/prometheus/prometheus.yml:Z
|
|
|
|
command:
|
|
|
|
- --config.file=/etc/prometheus/prometheus.yml
|
|
|
|
restart: on-failure
|
|
|
|
depends_on:
|
|
|
|
- postgres-exporter
|
2023-10-15 18:26:40 +00:00
|
|
|
- nwaku-postgres
|
|
|
|
- nwaku-sqlite
|
|
|
|
networks:
|
|
|
|
- simulation
|
2023-10-09 17:45:25 +00:00
|
|
|
|
|
|
|
grafana:
|
|
|
|
image: docker.io/grafana/grafana:latest
|
2023-10-15 18:26:40 +00:00
|
|
|
ports:
|
|
|
|
- 0.0.0.0:3000:3000
|
2023-10-09 17:45:25 +00:00
|
|
|
env_file:
|
|
|
|
- ./monitoring/configuration/grafana-plugins.env
|
|
|
|
volumes:
|
|
|
|
- ./monitoring/configuration/grafana.ini:/etc/grafana/grafana.ini:Z
|
|
|
|
- ./monitoring/configuration/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml:Z
|
|
|
|
- ./monitoring/configuration/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml:Z
|
|
|
|
- ./monitoring/configuration/dashboards:/var/lib/grafana/dashboards/:Z
|
|
|
|
- ./monitoring/configuration/customizations/custom-logo.svg:/usr/share/grafana/public/img/grafana_icon.svg:Z
|
|
|
|
- ./monitoring/configuration/customizations/custom-logo.svg:/usr/share/grafana/public/img/grafana_typelogo.svg:Z
|
|
|
|
- ./monitoring/configuration/customizations/custom-logo.png:/usr/share/grafana/public/img/fav32.png:Z
|
|
|
|
restart: on-failure
|
|
|
|
depends_on:
|
|
|
|
- prometheus
|
2023-10-15 18:26:40 +00:00
|
|
|
networks:
|
|
|
|
- simulation
|
2023-10-09 17:45:25 +00:00
|
|
|
|
|
|
|
postgres:
|
|
|
|
# This service is used when the Waku node has the 'store' protocol enabled
|
|
|
|
# and the store-message-db-url is set to use Postgres
|
|
|
|
image: postgres:15.4-alpine3.18
|
|
|
|
restart: on-failure
|
2023-10-15 18:26:40 +00:00
|
|
|
ports:
|
|
|
|
- 0.0.0.0:5432:5432
|
2023-10-09 17:45:25 +00:00
|
|
|
<<: *pg_env
|
|
|
|
volumes:
|
|
|
|
- ./data/postgres-data:/var/lib/postgresql/data
|
|
|
|
- ./postgres_cfg/postgresql.conf:/etc/postgresql/postgresql.conf
|
|
|
|
- ./postgres_cfg/db.sql:/docker-entrypoint-initdb.d/db.sql
|
|
|
|
command: postgres -c config_file=/etc/postgresql/postgresql.conf
|
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "pg_isready", "-d", "db_prod"]
|
|
|
|
interval: 30s
|
|
|
|
timeout: 60s
|
|
|
|
retries: 5
|
|
|
|
start_period: 80s
|
2023-10-23 17:34:19 +00:00
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpus: '1'
|
|
|
|
memory: 2048M
|
2023-10-15 18:26:40 +00:00
|
|
|
networks:
|
|
|
|
- simulation
|
2023-10-09 17:45:25 +00:00
|
|
|
|
|
|
|
postgres-exporter:
|
|
|
|
# Service aimed to scrape information from Postgres and post it to Prometeus
|
|
|
|
image: quay.io/prometheuscommunity/postgres-exporter:v0.12.0
|
|
|
|
restart: on-failure
|
|
|
|
<<: *pg_exp_env
|
|
|
|
volumes:
|
|
|
|
- ./monitoring/configuration/postgres-exporter.yml:/etc/pgexporter/postgres-exporter.yml
|
|
|
|
- ./monitoring/configuration/pg-exporter-queries.yml:/etc/pgexporter/queries.yml
|
|
|
|
command:
|
|
|
|
# Both the config file and 'DATA_SOURCE_NAME' should contain valid connection info
|
|
|
|
- --config.file=/etc/pgexporter/postgres-exporter.yml
|
|
|
|
depends_on:
|
|
|
|
- postgres
|
2023-10-15 18:26:40 +00:00
|
|
|
networks:
|
|
|
|
- simulation
|