Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Tx Service migrations execution dependencies #138

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -65,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:
Expand All @@ -95,16 +86,15 @@ services:
txs-redis:
condition: service_healthy
command: docker/web/celery/worker/run.sh
<<: *celeryhealthcheck

txs-worker-contracts-tokens:
<<: *txs-worker
environment:
- 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:
Expand All @@ -113,10 +103,22 @@ services:
- WORKER_QUEUES=notifications,webhooks
- ETHEREUM_NODE_URL=${RPC_NODE_URL}
depends_on:
txs-db:
txs-worker-indexer:
condition: service_healthy
txs-redis:

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
Expand Down
2 changes: 0 additions & 2 deletions scripts/run_locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)" \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer necessary since the services have a startup dependency after applying the migrations.

&& 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)" \
Expand Down
Loading