From f026f7bf54c889af69cbeb36d6d77b7eac532094 Mon Sep 17 00:00:00 2001 From: Felipe Alvarado Date: Thu, 2 May 2024 15:59:12 +0200 Subject: [PATCH 1/3] Add Celery healthcheck and update services dependencies --- docker-compose.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 14aa37d..d1cf1c6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,13 @@ x-healthcheck-redis-template: &redishealthcheck timeout: 30s retries: 3 +x-healthcheck-celery-template: &celeryhealthcheck + healthcheck: + test: ["CMD", "celery", "inspect", "ping"] + interval: 30s + timeout: 30s + retries: 3 + services: # Common nginx and database nginx: @@ -95,6 +102,7 @@ services: txs-redis: condition: service_healthy command: docker/web/celery/worker/run.sh + <<: *celeryhealthcheck txs-worker-contracts-tokens: <<: *txs-worker @@ -102,9 +110,7 @@ services: - WORKER_QUEUES=contracts,tokens - ETHEREUM_NODE_URL=${RPC_NODE_URL} depends_on: - txs-db: - condition: service_healthy - txs-redis: + txs-worker-indexer: condition: service_healthy txs-worker-notifications-webhooks: @@ -113,9 +119,7 @@ services: - WORKER_QUEUES=notifications,webhooks - ETHEREUM_NODE_URL=${RPC_NODE_URL} depends_on: - txs-db: - condition: service_healthy - txs-redis: + txs-worker-indexer: condition: service_healthy txs-scheduler: From 2494fc4eb75c290fa85a906be158ebbfd8f6e6af Mon Sep 17 00:00:00 2001 From: Felipe Alvarado Date: Mon, 6 May 2024 10:21:05 +0200 Subject: [PATCH 2/3] Add migration application dependency for txs-web --- docker-compose.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d1cf1c6..2070b8d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -72,22 +72,6 @@ services: txs-rabbitmq: image: rabbitmq:alpine - txs-web: - image: safeglobal/safe-transaction-service:${TXS_VERSION} - env_file: - - container_env_files/txs.env - environment: - - ETHEREUM_NODE_URL=${RPC_NODE_URL} - depends_on: - txs-db: - condition: service_healthy - txs-redis: - condition: service_healthy - working_dir: /app - volumes: - - nginx-shared-txs:/nginx - command: docker/web/run_web.sh - txs-worker-indexer: &txs-worker image: safeglobal/safe-transaction-service:${TXS_VERSION} env_file: @@ -122,6 +106,20 @@ services: txs-worker-indexer: condition: service_healthy + txs-web: + image: safeglobal/safe-transaction-service:${TXS_VERSION} + env_file: + - container_env_files/txs.env + environment: + - ETHEREUM_NODE_URL=${RPC_NODE_URL} + depends_on: + txs-worker-indexer: + condition: service_healthy + working_dir: /app + volumes: + - nginx-shared-txs:/nginx + command: docker/web/run_web.sh + txs-scheduler: <<: *txs-worker depends_on: From b1f4bc8b15d1bec7c75aeba0648300bd17a740b0 Mon Sep 17 00:00:00 2001 From: Felipe Alvarado Date: Mon, 6 May 2024 10:22:51 +0200 Subject: [PATCH 3/3] Remove waiting of migrations application --- scripts/run_locally.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/run_locally.sh b/scripts/run_locally.sh index eba9629..5ebb323 100644 --- a/scripts/run_locally.sh +++ b/scripts/run_locally.sh @@ -4,8 +4,6 @@ set -e echo "==> $(date +%H:%M:%S) ==> Starting up environment containers..." docker compose up -d \ - && echo "==> $(date +%H:%M:%S) ==> Waiting for migrations... (may take a while)" \ - && sleep 60 \ && echo "==> $(date +%H:%M:%S) ==> Creating super-user for Safe Config Service... (may take a while)" \ && docker compose exec cfg-web python src/manage.py createsuperuser \ && echo "==> $(date +%H:%M:%S) ==> Creating super-user for Safe Transaction Service... (may take a while)" \