Skip to content

Commit f565eb5

Browse files
committed
fix(database): premission denied
1 parent 3587e6f commit f565eb5

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
FROM docker.io/drycc/base:bullseye
22

3-
ENV PGDATA /opt/drycc/postgresql/14/data
4-
ENV WALG_ENVDIR /etc/wal-g.d/env
5-
63
COPY rootfs/bin /bin/
74
COPY rootfs/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d/
85
COPY rootfs/docker-entrypoint.sh /docker-entrypoint.sh
@@ -11,8 +8,13 @@ ENV JQ_VERSION="1.6" \
118
MC_VERSION="2022.02.26.03.58.31" \
129
WAL_G_VERSION="1.1" \
1310
PYTHON_VERSION="3.10.2" \
11+
PG_MAJOR=14 \
1412
POSTGRESQL_VERSION="14.2"
1513

14+
15+
ENV PGDATA /data/${PG_MAJOR}
16+
ENV WALG_ENVDIR /etc/wal-g.d/env
17+
1618
RUN mkdir -p $WALG_ENVDIR \
1719
&& install-stack jq $JQ_VERSION \
1820
&& install-stack gosu $GOSU_VERSION \

charts/database/templates/database-deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
- name: drycc-database-init
2525
image: docker.io/drycc/python-dev:latest
2626
imagePullPolicy: {{.Values.imagePullPolicy}}
27-
command:
27+
args:
2828
- netcat
2929
- -v
3030
- -a
@@ -60,12 +60,14 @@ spec:
6060
preStop:
6161
exec:
6262
command:
63+
- init-stack
6364
- gosu
6465
- postgres
6566
- do_backup
6667
readinessProbe:
6768
exec:
6869
command:
70+
- init-stack
6971
- is_running
7072
initialDelaySeconds: 30
7173
timeoutSeconds: 1
@@ -76,7 +78,7 @@ spec:
7678
mountPath: /var/run/secrets/drycc/objectstore/creds
7779
{{- if .Values.persistence.enabled }}
7880
- name: database-data
79-
mountPath: /var/lib/postgresql
81+
mountPath: /data
8082
{{- end }}
8183
volumes:
8284
{{- if .Values.persistence.enabled }}

contrib/ci/test-minio.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ echo "1234567890123456789012345678901234567890" > "${CURRENT_DIR}"/tmp/aws-user/
2626

2727
# boot minio
2828
mkdir -p "${CURRENT_DIR}"/tmp/bin
29-
echo "ls /data/*/basebackups_005" > "${CURRENT_DIR}"/tmp/bin/backups.sh
29+
echo "ls /data/database-bucket/*/basebackups_005" > "${CURRENT_DIR}"/tmp/bin/backups.sh
3030
MINIO_JOB=$(docker run -d \
3131
-v "${CURRENT_DIR}"/tmp/bin:/tmp/bin \
3232
-v "${CURRENT_DIR}"/tmp/aws-user:/var/run/secrets/drycc/objectstore/creds \
3333
drycc/minio:canary server /data/)
3434

35-
3635
puts-step "minio starting, wait 30s."
3736
sleep 30
3837

@@ -55,6 +54,7 @@ check-postgres "${PG_JOB}"
5554
# check if minio has the 5 backups
5655
puts-step "checking if minio has 5 backups"
5756
BACKUPS="$(docker exec "${MINIO_JOB}" sh /tmp/bin/backups.sh | grep json)"
57+
5858
NUM_BACKUPS="$(echo "${BACKUPS}" | wc -w)"
5959
# NOTE (bacongobbler): the BACKUP_FREQUENCY is only 1 second, so we could technically be checking
6060
# in the middle of a backup. Instead of failing, let's consider N+1 backups an acceptable case

0 commit comments

Comments
 (0)