-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
227 lines (213 loc) · 8 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
227 lines (213 loc) · 8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# This Docker Compose file must be used through `./run_locally.sh`.
services:
crdb:
image: cockroachdb/cockroach:v24.1.3
entrypoint: /db-entrypoint.sh
# 128MB limits allow larger numbers of nodes on a single machine
command: /cockroach/cockroach.sh start --insecure --join=db1.uss1.localutm --cache=128MiB --max-sql-memory=128MiB
volumes:
- $PWD/startup/db-entrypoint.sh:/db-entrypoint.sh:ro
profiles: [crdb]
restart: always
cap_add: [NET_ADMIN]
hostname: db${USS_NODE_IDX:?}.uss${USS_IDX:?}.localutm
networks:
dss_internal_network:
ipv4_address: 172.27.${USS_IDX:?}.${USS_NODE_IDX:?}
ports:
- "81${PADDED_NODE_IDX:?}:8080"
- "262${PADDED_NODE_IDX:?}:26257"
environment:
- INTRA_USS_SUBNET=172.27.${USS_IDX:?}.0/24
- INTER_USS_SUBNET=172.27.0.0/16
- INTRA_USS_NETEM_CONF=${INTRA_USS_NETEM_CONF-}
- INTER_USS_NETEM_CONF=${INTER_USS_NETEM_CONF-}
healthcheck:
test: curl -f 'http://localhost:8080/health?ready=1' || exit 1
interval: 3m
start_period: 30s
start_interval: 5s
ybdb:
image: interuss/yugabyte:2025.1.2.1-interuss
entrypoint: /db-entrypoint.sh
# ysql_output_buffer_size needs to be increased to allow ysql to retry read restart errors. https://docs.yugabyte.com/preview/reference/configuration/yb-tserver/#ysql-output-buffer-size
command: sh -c "bin/yugabyted start --background=false --tserver_flags=ysql_output_buffer_size=1048576 --advertise_address=$$YBDB_HOST --join=$$([ "$$YBDB_HOST" = db1.uss1.localutm ] || echo db1.uss1.localutm)"
volumes:
- $PWD/startup/db-entrypoint.sh:/db-entrypoint.sh:ro
profiles: [ybdb]
restart: always
cap_add: [ NET_ADMIN ]
hostname: db${USS_NODE_IDX:?}.uss${USS_IDX:?}.localutm
networks:
dss_internal_network:
ipv4_address: 172.27.${USS_IDX:?}.${USS_NODE_IDX:?}
ports:
- "70${PADDED_NODE_IDX:?}:7000"
- "90${PADDED_NODE_IDX:?}:9000"
- "154${PADDED_NODE_IDX:?}:15433"
- "54${PADDED_NODE_IDX:?}:5433"
- "91${PADDED_NODE_IDX:?}:9042"
environment:
- YBDB_HOST=db${USS_NODE_IDX:?}.uss${USS_IDX:?}.localutm
- INTRA_USS_SUBNET=172.27.${USS_IDX:?}.0/24
- INTER_USS_SUBNET=172.27.0.0/16
- INTRA_USS_NETEM_CONF=${INTRA_USS_NETEM_CONF-}
- INTER_USS_NETEM_CONF=${INTER_USS_NETEM_CONF-}
healthcheck:
test: /home/yugabyte/postgres/bin/pg_isready -h $$YBDB_HOST || exit 1
interval: 5s
timeout: 5s
retries: 10
crdb-init:
image: cockroachdb/cockroach:v24.1.3
profiles: [bootstrap-crdb]
depends_on: [crdb]
entrypoint: >
sh -c "
out=$$(/cockroach/cockroach.sh init --insecure --host=db1.uss1.localutm 2>&1);
if [ $$? -eq 0 ]; then
echo "$$out";
exit 0;
fi;
echo "$$out";
if echo \"$$out\" | grep -q \"already been initialized\"; then
exit 0;
fi;
exit 1;
"
networks: [dss_internal_network]
rid_bootstrapper:
image: ${DSS_IMAGE:-interuss/dss:v0.22.0}
profiles: [bootstrap-crdb]
entrypoint: sh -c "/usr/bin/db-manager migrate --schemas_dir=/db-schemas/rid --db_version latest --cockroach_host db1.uss1.localutm"
depends_on:
crdb-init:
condition: service_completed_successfully
networks: [dss_internal_network]
healthcheck:
disable: true
scd_bootstrapper:
image: ${DSS_IMAGE:-interuss/dss:v0.22.0}
profiles: [bootstrap-crdb]
entrypoint: sh -c "/usr/bin/db-manager migrate --schemas_dir=/db-schemas/scd --db_version latest --cockroach_host db1.uss1.localutm"
depends_on:
crdb-init:
condition: service_completed_successfully
networks: [dss_internal_network]
healthcheck:
disable: true
aux_bootstrapper:
image: ${DSS_IMAGE:-interuss/dss:v0.22.0}
profiles: [bootstrap-crdb]
entrypoint: sh -c "/usr/bin/db-manager migrate --schemas_dir=/db-schemas/aux_ --db_version latest --cockroach_host db1.uss1.localutm"
depends_on:
crdb-init:
condition: service_completed_successfully
networks: [dss_internal_network]
healthcheck:
disable: true
rid_bootstrapper-ybdb:
image: ${DSS_IMAGE:-interuss/dss:v0.22.0}
profiles: [bootstrap-ybdb]
entrypoint: sh -c "/usr/bin/db-manager migrate --schemas_dir=/db-schemas/yugabyte/rid --db_version latest --datastore_host db1.uss1.localutm --datastore_user yugabyte --datastore_port 5433"
restart: on-failure
networks: [dss_internal_network]
healthcheck:
disable: true
scd_bootstrapper-ybdb:
image: ${DSS_IMAGE:-interuss/dss:v0.22.0}
profiles: [bootstrap-ybdb]
entrypoint: sh -c "/usr/bin/db-manager migrate --schemas_dir=/db-schemas/yugabyte/scd --db_version latest --datastore_host db1.uss1.localutm --datastore_user yugabyte --datastore_port 5433"
restart: on-failure
networks: [dss_internal_network]
healthcheck:
disable: true
aux_bootstrapper-ybdb:
image: ${DSS_IMAGE:-interuss/dss:v0.22.0}
profiles: [bootstrap-ybdb]
entrypoint: sh -c "/usr/bin/db-manager migrate --schemas_dir=/db-schemas/yugabyte/aux_ --db_version latest --datastore_host db1.uss1.localutm --datastore_user yugabyte --datastore_port 5433"
restart: on-failure
networks: [dss_internal_network]
healthcheck:
disable: true
dss:
image: ${DSS_IMAGE:-interuss/dss:v0.22.0}
command: /startup/core_service.sh ${DEBUG_ON:-0}
profiles: [ crdb, ybdb, raft ]
restart: always
cap_add: [ NET_ADMIN ]
volumes:
- $PWD/../test-certs:/var/test-certs:ro
- $PWD/startup/core_service.sh:/startup/core_service.sh:ro
depends_on:
rid_bootstrapper:
condition: service_completed_successfully
required: false
scd_bootstrapper:
condition: service_completed_successfully
required: false
aux_bootstrapper:
condition: service_completed_successfully
required: false
rid_bootstrapper-ybdb:
condition: service_completed_successfully
required: false
scd_bootstrapper-ybdb:
condition: service_completed_successfully
required: false
aux_bootstrapper-ybdb:
condition: service_completed_successfully
required: false
hostname: dss${USS_NODE_IDX:?}.uss${USS_IDX:?}.localutm
networks:
- dss_internal_network
- interop_ecosystem_network
ports:
- "40${PADDED_NODE_IDX:?}:4000"
- "80${PADDED_NODE_IDX:?}:80"
- "95${PADDED_NODE_IDX:?}:95${PADDED_NODE_IDX:?}"
- "96${PADDED_NODE_IDX:?}:96${PADDED_NODE_IDX:?}"
- "97${PADDED_NODE_IDX:?}:97${PADDED_NODE_IDX:?}"
environment:
COMPOSE_PROFILES: ${COMPOSE_PROFILES}
JWT_AUDIENCES: dss${USS_NODE_IDX:?}.uss${USS_IDX:?}.localutm
DATASTORE_HOST: db${USS_NODE_IDX:?}.uss${USS_IDX:?}.localutm
INTRA_USS_SUBNET: 172.27.${USS_IDX:?}.0/24
INTER_USS_SUBNET: 172.27.0.0/16
INTRA_USS_NETEM_CONF: ${INTRA_USS_NETEM_CONF-}
INTER_USS_NETEM_CONF: ${INTER_USS_NETEM_CONF-}
RAFT_ID: ${RAFT_ID:-1}
AUX_RAFT_NODES: ${AUX_RAFT_NODES-}
RID_RAFT_NODES: ${RID_RAFT_NODES-}
SCD_RAFT_NODES: ${SCD_RAFT_NODES-}
healthcheck:
test: wget -O - 'http://localhost/healthy' || exit 1
start_period: 120s # yugabyte may be slow to be ready, and the dss service needs the ybdb service live in order to be healthy
start_interval: 5s
oauth:
image: interuss/dummy-oauth
command: -private_key_file /var/test-certs/auth2.key
volumes:
- $PWD/../test-certs:/var/test-certs:ro
profiles: [oauth]
hostname: oauth.authority.localutm
networks:
- interop_ecosystem_network
expose:
- 8085
ports:
- "8085:8085"
healthcheck:
test: wget -O - 'http://localhost:8085/token?intended_audience=-&scope=-' || exit 1
interval: 3m
start_period: 30s
start_interval: 5s
networks:
dss_internal_network:
name: dss_internal_network
external: true
interop_ecosystem_network:
name: interop_ecosystem_network
external: true
volumes:
dss_component_coordination: