File tree Expand file tree Collapse file tree 4 files changed +23
-16
lines changed
python/materialize/mzcompose/services Expand file tree Collapse file tree 4 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -19,21 +19,18 @@ FROM materialize/console:25.2.3 AS console
19
19
20
20
MZFROM ubuntu-base
21
21
22
- RUN groupadd --system --gid=999 materialize \
23
- && useradd --system --gid=999 --uid=999 --create-home materialize
24
-
25
22
ARG CI_SANITIZER=none
26
23
27
- RUN apt-get update \
24
+ RUN groupadd --system --gid=999 materialize \
25
+ && useradd --system --gid=999 --uid=999 --create-home materialize \
26
+ && apt-get update \
28
27
&& TZ=UTC DEBIAN_FRONTEND=noninteractive apt-get -qy install --no-install-recommends \
29
- ca-certificates \
30
28
curl \
31
29
gettext-base \
32
30
nginx \
33
31
postgresql \
34
- postgresql-contrib \
35
- tini \
36
32
ssh \
33
+ tini \
37
34
&& if [ "$CI_SANITIZER" != "none" ]; then \
38
35
TZ=UTC DEBIAN_FRONTEND=noninteractive apt-get -qy install --no-install-recommends llvm; \
39
36
fi \
@@ -57,7 +54,3 @@ RUN MZ_ENDPOINT=http://localhost:6876 \
57
54
&& rm /etc/nginx/templates/default.conf.template
58
55
59
56
USER materialize
60
-
61
- RUN pg_ctlcluster 16 main start \
62
- && psql -U postgres -c "CREATE ROLE root WITH LOGIN PASSWORD 'root'" \
63
- && psql -U postgres -c "CREATE DATABASE root OWNER root"
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ def __init__(
114
114
115
115
environment = [
116
116
"MZ_NO_TELEMETRY=1" ,
117
+ "MZ_NO_BUILTIN_CONSOLE=1" ,
117
118
"MZ_TEST_ONLY_DUMMY_SEGMENT_CLIENT=true" ,
118
119
f"MZ_SOFT_ASSERTIONS={ int (soft_assertions )} " ,
119
120
# The following settings can not be baked in the default image, as they
Original file line number Diff line number Diff line change @@ -15,6 +15,16 @@ COPY materialized entrypoint.sh /usr/local/bin/
15
15
USER root
16
16
RUN ln -s /usr/local/bin/materialized /usr/local/bin/environmentd \
17
17
&& ln -s /usr/local/bin/materialized /usr/local/bin/clusterd
18
+
18
19
USER materialize
19
20
21
+ RUN bash -c '\
22
+ set -euo pipefail; \
23
+ tini -- entrypoint.sh & \
24
+ tini_pid=$!; \
25
+ until curl -sf localhost:6878/api/readyz; do sleep 0.1; done; \
26
+ kill -TERM "$tini_pid"; \
27
+ wait "$tini_pid" || true; \
28
+ pg_ctlcluster 16 main stop --mode=fast --force'
29
+
20
30
ENTRYPOINT ["tini" , "--" , "entrypoint.sh" ]
Original file line number Diff line number Diff line change 41
41
42
42
# Start PostgreSQL, unless suppressed.
43
43
if [ -z " ${MZ_NO_BUILTIN_POSTGRES:- } " ]; then
44
+ (trap ' pg_ctlcluster 16 main stop --mode=fast --force' SIGTERM SIGINT
45
+ rm -f /var/run/postgresql/.s.PGSQL.26257.lock
44
46
pg_ctlcluster 16 main start
45
- psql -U root -c " CREATE SCHEMA IF NOT EXISTS consensus"
46
- psql -U root -c " CREATE SCHEMA IF NOT EXISTS storage"
47
- psql -U root -c " CREATE SCHEMA IF NOT EXISTS adapter"
48
- psql -U root -c " CREATE SCHEMA IF NOT EXISTS tsoracle"
47
+ psql -U postgres -c " CREATE ROLE root WITH LOGIN PASSWORD 'root'" || true
48
+ psql -U postgres -c " CREATE DATABASE root OWNER root" || true
49
+ psql -U root -c " CREATE SCHEMA IF NOT EXISTS consensus; CREATE SCHEMA IF NOT EXISTS storage; CREATE SCHEMA IF NOT EXISTS adapter; CREATE SCHEMA IF NOT EXISTS tsoracle" ) &
49
50
fi
50
51
51
52
# Start nginx to serve the console.
52
- nginx
53
+ if [ -z " ${MZ_NO_BUILTIN_CONSOLE:- } " ]; then
54
+ nginx &
55
+ fi
53
56
54
57
if [[ ! -f /mzdata/environment-id ]]; then
55
58
echo " docker-container-$( cat /proc/sys/kernel/random/uuid) -0" > /mzdata/environment-id
You can’t perform that action at this time.
0 commit comments