Skip to content

Commit

Permalink
Ingest storage local dev env: configure Mimir components to start aft…
Browse files Browse the repository at this point in the history
…er Kafka is healthy (#7153)

Signed-off-by: Marco Pracucci <[email protected]>
  • Loading branch information
pracucci authored Jan 17, 2024
1 parent a0f2856 commit 4fbea7c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 15 deletions.
12 changes: 11 additions & 1 deletion development/mimir-ingest-storage/docker-compose.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ std.manifestYamlDoc({
ports: [
'29092:29092',
],
healthcheck: {
test: 'nc -z localhost 9092 || exit -1',
start_period: '1s',
interval: '1s',
timeout: '1s',
retries: '30',
},
},
},

Expand Down Expand Up @@ -164,7 +171,10 @@ std.manifestYamlDoc({
name: error 'missing name',
target: error 'missing target',
publishedHttpPort: error 'missing publishedHttpPort',
dependsOn: ['minio', 'kafka'],
dependsOn: {
minio: { condition: 'service_started' },
kafka: { condition: 'service_healthy' },
},
env: {},
extraVolumes: [],
memberlistBindPort: self.publishedHttpPort + 2000,
Expand Down
48 changes: 34 additions & 14 deletions development/mimir-ingest-storage/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
- "KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,ORBSTACK:PLAINTEXT"
- "KAFKA_INTER_BROKER_LISTENER_NAME=PLAINTEXT"
- "KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1"
"healthcheck":
"interval": "1s"
"retries": "30"
"start_period": "1s"
"test": "nc -z localhost 9092 || exit -1"
"timeout": "1s"
"image": "confluentinc/cp-kafka:latest"
"ports":
- "29092:29092"
Expand All @@ -46,8 +52,10 @@
- "-target=backend"
- "-activity-tracker.filepath=/activity/mimir-backend-1"
"depends_on":
- "minio"
- "kafka"
"kafka":
"condition": "service_healthy"
"minio":
"condition": "service_started"
"environment": []
"hostname": "mimir-backend-1"
"image": "mimir"
Expand All @@ -66,8 +74,10 @@
- "-target=backend"
- "-activity-tracker.filepath=/activity/mimir-backend-2"
"depends_on":
- "minio"
- "kafka"
"kafka":
"condition": "service_healthy"
"minio":
"condition": "service_started"
"environment": []
"hostname": "mimir-backend-2"
"image": "mimir"
Expand All @@ -86,8 +96,10 @@
- "-target=read"
- "-activity-tracker.filepath=/activity/mimir-read-1"
"depends_on":
- "minio"
- "kafka"
"kafka":
"condition": "service_healthy"
"minio":
"condition": "service_started"
"environment": []
"hostname": "mimir-read-1"
"image": "mimir"
Expand All @@ -106,8 +118,10 @@
- "-target=read"
- "-activity-tracker.filepath=/activity/mimir-read-2"
"depends_on":
- "minio"
- "kafka"
"kafka":
"condition": "service_healthy"
"minio":
"condition": "service_started"
"environment": []
"hostname": "mimir-read-2"
"image": "mimir"
Expand All @@ -126,8 +140,10 @@
- "-target=write"
- "-activity-tracker.filepath=/activity/mimir-write-1"
"depends_on":
- "minio"
- "kafka"
"kafka":
"condition": "service_healthy"
"minio":
"condition": "service_started"
"environment": []
"hostname": "mimir-write-1"
"image": "mimir"
Expand All @@ -147,8 +163,10 @@
- "-target=write"
- "-activity-tracker.filepath=/activity/mimir-write-2"
"depends_on":
- "minio"
- "kafka"
"kafka":
"condition": "service_healthy"
"minio":
"condition": "service_started"
"environment": []
"hostname": "mimir-write-2"
"image": "mimir"
Expand All @@ -168,8 +186,10 @@
- "-target=write"
- "-activity-tracker.filepath=/activity/mimir-write-3"
"depends_on":
- "minio"
- "kafka"
"kafka":
"condition": "service_healthy"
"minio":
"condition": "service_started"
"environment": []
"hostname": "mimir-write-3"
"image": "mimir"
Expand Down

0 comments on commit 4fbea7c

Please sign in to comment.