Skip to content

Commit 4a1c4b0

Browse files
imotovguilload
andauthored
Map docker compose services to localhost (#3229)
Maps docker compose test services to localhost by default. This can be changed by changing the MAP_HOST_<SERVICE> in .env file to 0.0.0.0. It also removes .env file from the version control to make it available for making these changes. Fixes #3183 Co-authored-by: Adrien Guillo <[email protected]>
1 parent 22af25e commit 4a1c4b0

File tree

5 files changed

+76
-31
lines changed

5 files changed

+76
-31
lines changed

.env

-4
This file was deleted.

.env.example

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Change the user name and password of the postgres database
2+
POSTGRES_USER=quickwit-dev
3+
POSTGRES_PASSWORD=quickwit-dev
4+
POSTGRES_DB=quickwit-metastore-dev
5+
6+
# Update all services to the latest versions
7+
LOCALSTACK_VERSION=latest
8+
POSTGRES_VERSION=latest
9+
PULSAR_VERSION=latest
10+
CP_VERSION=latest
11+
AZURITE_VERSION=latest
12+
JAEGER_VERSION=latest
13+
OTEL_VERSION=latest
14+
PROMETHEUS_VERSION=latest
15+
16+
# Expose the services to outside network
17+
MAP_HOST_LOCALSTACK=0.0.0.0
18+
MAP_HOST_POSTGRES=0.0.0.0
19+
MAP_HOST_PULSAR=0.0.0.0
20+
MAP_HOST_KAFKA=0.0.0.0
21+
MAP_HOST_ZOOKEEPER=0.0.0.0
22+
MAP_HOST_AZURITE=0.0.0.0
23+
MAP_HOST_GRAFANA=0.0.0.0
24+
MAP_HOST_JAEGER=0.0.0.0
25+
MAP_HOST_OTEL=0.0.0.0
26+
MAP_HOST_PROMETHEUS=0.0.0.0

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ quickwit/quickwit-ui/package-lock.json
2222
deps
2323
qwdata
2424
elastic-search-artifacts
25+
.env

docker-compose.yml

+43-26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
version: "3.9"
22

3+
# By default, this docker compose script maps all services to localhost only.
4+
# If you need to make services available outside of your machine, add
5+
# appropriate service mappings to the .env file. See .env.example file for
6+
# configuration example.
7+
#
8+
# Notes on image versions:
9+
# - For the key services such as postgres and pulsar we are trying to run
10+
# against the oldest supported version
11+
# - For the zookeeper and kafka we are trying to use the oldest supported
12+
# version that has arm64 images
13+
# - For everything else we are trying to run against the latest version.
14+
#
15+
# To run against the latest image versions update .env file. See .env.example
16+
# file for configuration examples. You might need to remove the old images
17+
# first if they are already tagged latest and volumes if their content is
18+
# incompatible with the latest version, as in case of postgres.
19+
320
networks:
421
default:
522
name: quickwit-network
@@ -13,9 +30,9 @@ services:
1330
image: localstack/localstack:${LOCALSTACK_VERSION:-2.0.2}
1431
container_name: localstack
1532
ports:
16-
- "4566:4566"
17-
- "4571:4571"
18-
- "8080:8080"
33+
- "${MAP_HOST_LOCALSTACK:-127.0.0.1}:4566:4566"
34+
- "${MAP_HOST_LOCALSTACK:-127.0.0.1}:4571:4571"
35+
- "${MAP_HOST_LOCALSTACK:-127.0.0.1}:8080:8080"
1936
profiles:
2037
- all
2138
- localstack
@@ -39,7 +56,7 @@ services:
3956
image: postgres:${POSTGRES_VERSION:-11.19-alpine}
4057
container_name: postgres
4158
ports:
42-
- "5432:5432"
59+
- "${MAP_HOST_POSTGRESS:-127.0.0.1}:5432:5432"
4360
profiles:
4461
- all
4562
- postgres
@@ -62,8 +79,8 @@ services:
6279
container_name: pulsar-broker
6380
command: bin/pulsar standalone
6481
ports:
65-
- "6650:6650"
66-
- "8081:8080"
82+
- "${MAP_HOST_PULSAR:-127.0.0.1}:6650:6650"
83+
- "${MAP_HOST_PULSAR:-127.0.0.1}:8081:8080"
6784
environment:
6885
PULSAR_MEM: " -Xms512m -Xmx512m -XX:MaxDirectMemorySize=2g"
6986
profiles:
@@ -77,8 +94,8 @@ services:
7794
depends_on:
7895
- zookeeper
7996
ports:
80-
- "9092:9092"
81-
- "9101:9101"
97+
- "${MAP_HOST_KAFKA:-127.0.0.1}:9092:9092"
98+
- "${MAP_HOST_KAFKA:-127.0.0.1}:9101:9101"
8299
profiles:
83100
- all
84101
- kafka
@@ -105,7 +122,7 @@ services:
105122
image: confluentinc/cp-zookeeper:${CP_VERSION:-7.0.9}
106123
container_name: zookeeper
107124
ports:
108-
- "2181:2181"
125+
- "${MAP_HOST_ZOOKEEPER:-127.0.0.1}:2181:2181"
109126
profiles:
110127
- all
111128
- kafka
@@ -123,7 +140,7 @@ services:
123140
image: mcr.microsoft.com/azure-storage/azurite:${AZURITE_VERSION:-3.23.0}
124141
container_name: azurite
125142
ports:
126-
- "10000:10000" # Blob store port
143+
- "${MAP_HOST_AZURITE:-127.0.0.1}:10000:10000" # Blob store port
127144
profiles:
128145
- all
129146
- azurite
@@ -135,7 +152,7 @@ services:
135152
image: grafana/grafana-oss:${GRAFANA_VERSION:-9.4.7}
136153
container_name: grafana
137154
ports:
138-
- "3000:3000"
155+
- "${MAP_HOST_GRAFANA:-127.0.0.1}:3000:3000"
139156
profiles:
140157
- grafana
141158
- monitoring
@@ -151,13 +168,13 @@ services:
151168
image: jaegertracing/all-in-one:${JAEGER_VERSION:-1.20.0}
152169
container_name: jaeger
153170
ports:
154-
- "5775:5775/udp"
155-
- "5778:5778"
156-
- "6831:6831/udp"
157-
- "6832:6832/udp"
158-
- "14250:14250"
159-
- "14268:14268"
160-
- "16686:16686"
171+
- "${MAP_HOST_JAEGER:-127.0.0.1}:5775:5775/udp"
172+
- "${MAP_HOST_JAEGER:-127.0.0.1}:5778:5778"
173+
- "${MAP_HOST_JAEGER:-127.0.0.1}:6831:6831/udp"
174+
- "${MAP_HOST_JAEGER:-127.0.0.1}:6832:6832/udp"
175+
- "${MAP_HOST_JAEGER:-127.0.0.1}:14250:14250"
176+
- "${MAP_HOST_JAEGER:-127.0.0.1}:14268:14268"
177+
- "${MAP_HOST_JAEGER:-127.0.0.1}:16686:16686"
161178
profiles:
162179
- jaeger
163180
- monitoring
@@ -166,13 +183,13 @@ services:
166183
image: otel/opentelemetry-collector:${OTEL_VERSION:-0.75.0}
167184
container_name: otel-collector
168185
ports:
169-
- "1888:1888" # pprof extension
170-
- "8888:8888" # Prometheus metrics exposed by the collector
171-
- "8889:8889" # Prometheus exporter metrics
172-
- "13133:13133" # health_check extension
173-
- "4317:4317" # OTLP gRPC receiver
174-
- "4318:4318" # OTLP http receiver
175-
- "55679:55679" # zpages extension
186+
- "${MAP_HOST_OTEL:-127.0.0.1}:1888:1888" # pprof extension
187+
- "${MAP_HOST_OTEL:-127.0.0.1}:8888:8888" # Prometheus metrics exposed by the collector
188+
- "${MAP_HOST_OTEL:-127.0.0.1}:8889:8889" # Prometheus exporter metrics
189+
- "${MAP_HOST_OTEL:-127.0.0.1}:13133:13133" # health_check extension
190+
- "${MAP_HOST_OTEL:-127.0.0.1}:4317:4317" # OTLP gRPC receiver
191+
- "${MAP_HOST_OTEL:-127.0.0.1}:4318:4318" # OTLP http receiver
192+
- "${MAP_HOST_OTEL:-127.0.0.1}:55679:55679" # zpages extension
176193
profiles:
177194
- otel
178195
- monitoring
@@ -184,7 +201,7 @@ services:
184201
image: prom/prometheus:${PROMETHEUS_VERSION:-v2.43.0}
185202
container_name: prometheus
186203
ports:
187-
- "9090:9090"
204+
- "${MAP_HOST_PROMETHEUS:-127.0.0.1}:9090:9090"
188205
profiles:
189206
- prometheus
190207
- monitoring

quickwit/Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ fix: fmt
1515
# `make test-all` starts the Docker services and runs all the tests.
1616
# `make -k test-all docker-compose-down`, tears down the Docker services after running all the tests.
1717
test-all:
18-
QW_S3_ENDPOINT=http://localhost:4566 AWS_REGION=us-east-1 AWS_ACCESS_KEY_ID=ignored AWS_SECRET_ACCESS_KEY=ignored cargo test --all-features
18+
QW_S3_ENDPOINT=http://localhost:4566 \
19+
AWS_REGION=us-east-1 \
20+
AWS_ACCESS_KEY_ID=ignored \
21+
AWS_SECRET_ACCESS_KEY=ignored \
22+
TEST_DATABASE_URL=postgres://quickwit-dev:quickwit-dev@localhost:5432/quickwit-metastore-dev \
23+
cargo test --all-features
1924
cargo test --test failpoints --features fail/failpoints
2025

2126
test-failpoints:

0 commit comments

Comments
 (0)