Skip to content

Commit aa12547

Browse files
authored
Share a docker-compose local dev env setup for the experimental blocks storage (#2011)
* Share a docker-compose local dev env setup for the experimental blocks storage Signed-off-by: Marco Pracucci <marco@pracucci.com> * Trick to avoid getting development/tsdb-blocks-storage-s3/ Docker image built by CI Signed-off-by: Marco Pracucci <marco@pracucci.com> * Mount config as volume instead of bundling it in the Docker image Signed-off-by: Marco Pracucci <marco@pracucci.com> * Renamed scripts used to turn up/down the dev env Signed-off-by: Marco Pracucci <marco@pracucci.com>
1 parent aef690e commit aa12547

File tree

10 files changed

+154
-0
lines changed

10 files changed

+154
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!cortex-tsdb
3+
!.gitignore
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cortex
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR=$(cd `dirname $0` && pwd)
4+
5+
docker-compose -f ${SCRIPT_DIR}/docker-compose.yml down
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR=$(cd `dirname $0` && pwd)
4+
5+
GOOS=linux GOARCH=amd64 go build -o ${SCRIPT_DIR}/cortex ${SCRIPT_DIR}/../../cmd/cortex && \
6+
docker-compose -f ${SCRIPT_DIR}/docker-compose.yml build distributor && \
7+
docker-compose -f ${SCRIPT_DIR}/docker-compose.yml up $@
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
auth_enabled: false
2+
3+
distributor:
4+
shard_by_all_labels: true
5+
pool:
6+
health_check_ingesters: true
7+
8+
ingester_client:
9+
grpc_client_config:
10+
# Configure the client to allow messages up to 100MB.
11+
max_recv_msg_size: 104857600
12+
max_send_msg_size: 104857600
13+
use_gzip_compression: true
14+
15+
ingester:
16+
max_transfer_retries: 1
17+
18+
lifecycler:
19+
# We want to start immediately.
20+
join_after: 0
21+
claim_on_rollout: false
22+
final_sleep: 0s
23+
num_tokens: 512
24+
25+
ring:
26+
kvstore:
27+
store: consul
28+
consul:
29+
host: consul:8500
30+
replication_factor: 1
31+
32+
tsdb:
33+
dir: /tmp/cortex-tsdb-ingester
34+
ship_interval: 1m
35+
block_ranges_period: [ 2h ]
36+
retention_period: 3h
37+
backend: s3
38+
39+
bucket_store:
40+
sync_dir: /tmp/cortex-tsdb-querier
41+
42+
s3:
43+
endpoint: minio:9000
44+
bucket_name: cortex-tsdb
45+
access_key_id: cortex
46+
secret_access_key: supersecret
47+
insecure: true
48+
49+
storage:
50+
engine: tsdb
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM alpine:3.10
2+
3+
RUN mkdir /cortex
4+
WORKDIR /cortex
5+
ADD ./cortex ./
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
version: '3.4'
2+
services:
3+
4+
consul:
5+
image: consul
6+
command: [ "agent", "-dev" ,"-client=0.0.0.0", "-log-level=info" ]
7+
ports:
8+
- 8500:8500
9+
10+
minio:
11+
image: minio/minio
12+
command: [ "server", "/data" ]
13+
environment:
14+
- MINIO_ACCESS_KEY=cortex
15+
- MINIO_SECRET_KEY=supersecret
16+
ports:
17+
- 9000:9000
18+
volumes:
19+
- .data-minio:/data:delegated
20+
21+
distributor:
22+
build:
23+
context: .
24+
dockerfile: dev.dockerfile
25+
image: cortex
26+
command: ["sh", "-c", "sleep 3 && exec ./cortex -config.file=./config/cortex.yaml -target=distributor -server.http-listen-port=8001 -server.grpc-listen-port=9001"]
27+
depends_on:
28+
- consul
29+
- minio
30+
ports:
31+
- 8001:8001
32+
volumes:
33+
- ./config:/cortex/config
34+
35+
ingester-1:
36+
build:
37+
context: .
38+
dockerfile: dev.dockerfile
39+
image: cortex
40+
command: ["sh", "-c", "sleep 3 && exec ./cortex -config.file=./config/cortex.yaml -target=ingester -server.http-listen-port=8002 -server.grpc-listen-port=9002"]
41+
depends_on:
42+
- consul
43+
- minio
44+
ports:
45+
- 8002:8002
46+
volumes:
47+
- ./config:/cortex/config
48+
- .data-ingester-1:/tmp/cortex-tsdb-ingester:delegated
49+
50+
ingester-2:
51+
build:
52+
context: .
53+
dockerfile: dev.dockerfile
54+
image: cortex
55+
command: ["sh", "-c", "sleep 3 && exec ./cortex -config.file=./config/cortex.yaml -target=ingester -server.http-listen-port=8003 -server.grpc-listen-port=9003"]
56+
depends_on:
57+
- consul
58+
- minio
59+
ports:
60+
- 8003:8003
61+
volumes:
62+
- ./config:/cortex/config
63+
- .data-ingester-2:/tmp/cortex-tsdb-ingester:delegated
64+
65+
querier:
66+
build:
67+
context: .
68+
dockerfile: dev.dockerfile
69+
image: cortex
70+
command: ["sh", "-c", "sleep 3 && exec ./cortex -config.file=./config/cortex.yaml -target=querier -server.http-listen-port=8004 -server.grpc-listen-port=9004"]
71+
depends_on:
72+
- consul
73+
- minio
74+
ports:
75+
- 8004:8004
76+
volumes:
77+
- ./config:/cortex/config

0 commit comments

Comments
 (0)