Skip to content

Commit

Permalink
Modify docker compose ports so it's possible to run multiple differen…
Browse files Browse the repository at this point in the history
…t mimir networks in parallel (#9627)

* modify external ports of monolithic mode so it can be run concurrently with other docker compose networks

* modify external ports of r/w mode so it can be run concurrently with other docker compose networks
  • Loading branch information
zenador authored Oct 16, 2024
1 parent b575ec4 commit 9d8252f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
20 changes: 10 additions & 10 deletions development/mimir-monolithic-mode/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ services:
image: consul:1.15 # latest tag not supported
command: [ "agent", "-dev" ,"-client=0.0.0.0", "-log-level=info" ]
ports:
- 8500:8500
- 8510:8500

minio:
image: minio/minio
command: [ "server", "--console-address", ":9001", "/data" ]
command: [ "server", "--console-address", ":9101", "/data" ]
environment:
- MINIO_ROOT_USER=mimir
- MINIO_ROOT_PASSWORD=supersecret
ports:
- 9000:9000
- 9001:9001
- 9100:9100
- 9101:9101
volumes:
- .data-minio:/data:delegated

Expand All @@ -26,7 +26,7 @@ services:
volumes:
- ./config:/etc/prometheus
ports:
- 9090:9090
- 9190:9090

grafana:
environment:
Expand All @@ -48,7 +48,7 @@ services:
volumes:
- ./config:/etc/agent-config
ports:
- 9091:9091
- 9191:9091

grafana-alloy:
profiles:
Expand All @@ -63,15 +63,15 @@ services:
jaeger:
image: jaegertracing/all-in-one
ports:
- 16686:16686
- 16681:16686
- "14268"

mimir-1:
build:
context: .
dockerfile: dev.dockerfile
image: mimir
command: ["sh", "-c", "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=all -server.http-listen-port=8001 -server.grpc-listen-port=9001"]
command: ["sh", "-c", "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=all -server.http-listen-port=8001 -server.grpc-listen-port=9101"]
depends_on:
- consul
- minio
Expand All @@ -83,7 +83,7 @@ services:
- JAEGER_SAMPLER_PARAM=1
- JAEGER_REPORTER_MAX_QUEUE_SIZE=1000
ports:
- 8001:8001
- 8101:8001
volumes:
- ./config:/mimir/config
- .data-mimir-1:/data:delegated
Expand All @@ -105,7 +105,7 @@ services:
- JAEGER_SAMPLER_PARAM=1
- JAEGER_REPORTER_MAX_QUEUE_SIZE=1000
ports:
- 8002:8002
- 8102:8002
volumes:
- ./config:/mimir/config
- .data-mimir-2:/data:delegated
Expand Down
14 changes: 7 additions & 7 deletions development/mimir-read-write-mode/docker-compose.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ std.manifestYamlDoc({
'QUERY_FRONTEND_HOST=mimir-read-1:8080',
'COMPACTOR_HOST=mimir-backend-1:8080',
],
ports: ['8080:8080'],
ports: ['8780:8080'],
volumes: ['../common/config:/etc/nginx/templates'],
},
},

minio:: {
minio: {
image: 'minio/minio',
command: ['server', '--console-address', ':9001', '/data'],
command: ['server', '--console-address', ':9701', '/data'],
environment: ['MINIO_ROOT_USER=mimir', 'MINIO_ROOT_PASSWORD=supersecret'],
ports: [
'9000:9000',
'9001:9001',
'9700:9700',
'9701:9701',
],
volumes: ['.data-minio:/data:delegated'],
},
Expand Down Expand Up @@ -116,7 +116,7 @@ std.manifestYamlDoc({
image: 'grafana/agent:v0.37.3',
command: ['-config.file=/etc/agent-config/grafana-agent.yaml', '-metrics.wal-directory=/tmp', '-server.http.address=127.0.0.1:9091'],
volumes: ['./config:/etc/agent-config'],
ports: ['9091:9091'],
ports: ['9791:9091'],
},
},

Expand All @@ -131,7 +131,7 @@ std.manifestYamlDoc({
volumes: [
'./config:/etc/prometheus',
],
ports: ['9090:9090'],
ports: ['9790:9090'],
},
},

Expand Down Expand Up @@ -168,7 +168,7 @@ std.manifestYamlDoc({
],
hostname: options.name,
// Only publish HTTP port, but not gRPC one.
ports: ['%d:8080' % options.publishedHttpPort],
ports: ['%d:8080' % (options.publishedHttpPort + 700)],
depends_on: options.dependsOn,
volumes: ['./config:/mimir/config', './activity:/activity'] + options.extraVolumes,
},
Expand Down
26 changes: 13 additions & 13 deletions development/mimir-read-write-mode/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- "-server.http.address=127.0.0.1:9091"
"image": "grafana/agent:v0.37.3"
"ports":
- "9091:9091"
- "9791:9091"
"volumes":
- "./config:/etc/agent-config"
"memcached":
Expand All @@ -35,7 +35,7 @@
"hostname": "mimir-backend-1"
"image": "mimir"
"ports":
- "8006:8080"
- "8706:8080"
"volumes":
- "./config:/mimir/config"
- "./activity:/activity"
Expand All @@ -54,7 +54,7 @@
"hostname": "mimir-backend-2"
"image": "mimir"
"ports":
- "8007:8080"
- "8707:8080"
"volumes":
- "./config:/mimir/config"
- "./activity:/activity"
Expand All @@ -73,7 +73,7 @@
"hostname": "mimir-read-1"
"image": "mimir"
"ports":
- "8004:8080"
- "8704:8080"
"volumes":
- "./config:/mimir/config"
- "./activity:/activity"
Expand All @@ -92,7 +92,7 @@
"hostname": "mimir-read-2"
"image": "mimir"
"ports":
- "8005:8080"
- "8705:8080"
"volumes":
- "./config:/mimir/config"
- "./activity:/activity"
Expand All @@ -111,7 +111,7 @@
"hostname": "mimir-write-1"
"image": "mimir"
"ports":
- "8001:8080"
- "8701:8080"
"volumes":
- "./config:/mimir/config"
- "./activity:/activity"
Expand All @@ -131,7 +131,7 @@
"hostname": "mimir-write-2"
"image": "mimir"
"ports":
- "8002:8080"
- "8702:8080"
"volumes":
- "./config:/mimir/config"
- "./activity:/activity"
Expand All @@ -151,7 +151,7 @@
"hostname": "mimir-write-3"
"image": "mimir"
"ports":
- "8003:8080"
- "8703:8080"
"volumes":
- "./config:/mimir/config"
- "./activity:/activity"
Expand All @@ -160,15 +160,15 @@
"command":
- "server"
- "--console-address"
- ":9001"
- ":9701"
- "/data"
"environment":
- "MINIO_ROOT_USER=mimir"
- "MINIO_ROOT_PASSWORD=supersecret"
"image": "minio/minio"
"ports":
- "9000:9000"
- "9001:9001"
- "9700:9700"
- "9701:9701"
"volumes":
- ".data-minio:/data:delegated"
"nginx":
Expand All @@ -182,7 +182,7 @@
"hostname": "nginx"
"image": "nginxinc/nginx-unprivileged:1.22-alpine"
"ports":
- "8080:8080"
- "8780:8080"
"volumes":
- "../common/config:/etc/nginx/templates"
"prometheus":
Expand All @@ -192,6 +192,6 @@
- "--enable-feature=native-histograms"
"image": "prom/prometheus:v2.53.0"
"ports":
- "9090:9090"
- "9790:9090"
"volumes":
- "./config:/etc/prometheus"

0 comments on commit 9d8252f

Please sign in to comment.