Skip to content
Snippets Groups Projects
Commit 5db372fc authored by Antoine Lambert's avatar Antoine Lambert
Browse files

docker: Ensure journal client services will be up and running

Services acting as journal clients were always exiting prematurely due
to not created kafa topics they were trying to subscribe to.

So ensure needed topics will be created when starting the kafka service
and wait for their creation before starting the journal client services.

As a consequence, this makes a call to "docker-compose up -d" command a
little bit longer before it returns.
parent 0273bfab
No related branches found
No related tags found
1 merge request!91docker: Fix journal client services
version: '2'
version: "2"
services:
elasticsearch:
......@@ -29,8 +29,10 @@ services:
build: ./
entrypoint: /entrypoint.sh
depends_on:
- swh-search
- kafka
kafka:
condition: service_healthy
swh-search:
condition: service_started
volumes:
- "./conf/search_journal_client_objects.yml:/etc/softwareheritage/search/journal_client.yml:ro"
- "./services/swh-search-journal-client/entrypoint.sh:/entrypoint.sh:ro"
......@@ -40,8 +42,10 @@ services:
build: ./
entrypoint: /entrypoint.sh
depends_on:
- swh-search
- kafka
kafka:
condition: service_healthy
swh-search:
condition: service_started
volumes:
- "./conf/search_journal_client_indexed.yml:/etc/softwareheritage/search/journal_client.yml:ro"
- "./services/swh-search-journal-client/entrypoint.sh:/entrypoint.sh:ro"
......
......@@ -15,8 +15,18 @@ services:
ports:
- "5092:9092"
env_file: ./env/kafka.env
environment:
KAFKA_CREATE_TOPICS: swh.journal.objects.origin:1:1,
swh.journal.objects.origin_visit:1:1,
swh.journal.objects.origin_visit_status:1:1,
swh.journal.indexed.origin_intrinsic_metadata:1:1
depends_on:
- zookeeper
healthcheck:
test: "[ `JMX_PORT= kafka-topics.sh --list --zookeeper zookeeper:2181 | wc -l` -ge 4 ]"
interval: 10s
timeout: 5s
retries: 10
prometheus:
image: prom/prometheus
......@@ -368,9 +378,13 @@ services:
env_file:
- ./env/common_python.env
depends_on:
- kafka
- swh-storage
- swh-scheduler
kafka:
condition: service_healthy
swh-storage:
condition: service_started
swh-scheduler:
condition: service_started
volumes:
- "./conf/indexer_journal_client.yml:/etc/softwareheritage/indexer/journal_client.yml:ro"
- "./services/swh-indexer-journal-client/entrypoint.sh:/entrypoint.sh:ro"
......@@ -382,8 +396,10 @@ services:
env_file:
- ./env/common_python.env
depends_on:
- kafka
- swh-scheduler
kafka:
condition: service_healthy
swh-scheduler:
condition: service_started
volumes:
- "./conf/scheduler_journal_client.yml:/etc/softwareheritage/scheduler/journal_client.yml:ro"
- "./services/swh-scheduler-journal-client/entrypoint.sh:/entrypoint.sh:ro"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment