Skip to content

Commit b7dda45

Browse files
committed
chore(database): change minio to storage
1 parent 3cdac73 commit b7dda45

7 files changed

Lines changed: 52 additions & 51 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
contrib/ci/tmp
2+
.vscode/

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ test: test-style test-functional
3434
test-style:
3535
${DEV_ENV_CMD} shellcheck $(SHELL_SCRIPTS)
3636

37-
test-functional: test-functional-minio
37+
test-functional: test-functional-storage
3838

39-
test-functional-minio:
40-
contrib/ci/test-minio.sh ${IMAGE}
39+
test-functional-storage:
40+
contrib/ci/test-storage.sh ${IMAGE}
4141

4242
.PHONY: all docker-build docker-push test

charts/database/templates/_helper.tpl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@ env:
1414
secretKeyRef:
1515
name: database-creds
1616
key: password
17-
- name: "DRYCC_MINIO_LOOKUP"
17+
- name: "DRYCC_STORAGE_LOOKUP"
1818
valueFrom:
1919
secretKeyRef:
20-
name: minio-creds
20+
name: storage-creds
2121
key: lookup
22-
- name: "DRYCC_MINIO_BUCKET"
22+
- name: "DRYCC_STORAGE_BUCKET"
2323
valueFrom:
2424
secretKeyRef:
25-
name: minio-creds
25+
name: storage-creds
2626
key: database-bucket
27-
- name: "DRYCC_MINIO_ENDPOINT"
27+
- name: "DRYCC_STORAGE_ENDPOINT"
2828
valueFrom:
2929
secretKeyRef:
30-
name: minio-creds
30+
name: storage-creds
3131
key: endpoint
32-
- name: "DRYCC_MINIO_ACCESSKEY"
32+
- name: "DRYCC_STORAGE_ACCESSKEY"
3333
valueFrom:
3434
secretKeyRef:
35-
name: minio-creds
35+
name: storage-creds
3636
key: accesskey
37-
- name: "DRYCC_MINIO_SECRETKEY"
37+
- name: "DRYCC_STORAGE_SECRETKEY"
3838
valueFrom:
3939
secretKeyRef:
40-
name: minio-creds
40+
name: storage-creds
4141
key: secretkey
4242
{{- end }}
4343

charts/database/templates/database-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232
- netcat
3333
- -v
3434
- -u
35-
- $(DRYCC_MINIO_ENDPOINT)
35+
- $(DRYCC_STORAGE_ENDPOINT)
3636
{{- include "database.envs" . | indent 8 }}
3737
containers:
3838
- name: drycc-database
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eof pipefail
44

55
cleanup() {
6-
kill-containers "${MINIO_JOB}" "${PG_JOB}"
6+
kill-containers "${STORAGE_JOB}" "${PG_JOB}"
77
}
88
trap cleanup EXIT
99

@@ -16,46 +16,46 @@ CURRENT_DIR=$(cd "$(dirname "$0")"; pwd)
1616

1717
create-postgres-creds
1818

19-
puts-step "creating fake minio credentials"
19+
puts-step "creating fake storage credentials"
2020

2121
s3Accesskey="1234567890123456789012345678901234567890"
2222
s3Secretkey="1234567890123456789012345678901234567890"
23-
# boot minio
23+
# boot storage
2424
mkdir -p "${CURRENT_DIR}"/tmp/bin
2525
echo "ls /data/database/*/basebackups_005" > "${CURRENT_DIR}"/tmp/bin/backups.sh
26-
MINIO_JOB=$(docker run -d \
27-
-e DRYCC_MINIO_ACCESSKEY=$s3Accesskey \
28-
-e DRYCC_MINIO_SECRETKEY=$s3Secretkey \
26+
STORAGE_JOB=$(docker run -d \
27+
-e DRYCC_STORAGE_ACCESSKEY=$s3Accesskey \
28+
-e DRYCC_STORAGE_SECRETKEY=$s3Secretkey \
2929
-v "${CURRENT_DIR}"/tmp/bin:/tmp/bin \
30-
"${DEV_REGISTRY}"/drycc/minio:canary server /data/)
30+
"${DEV_REGISTRY}"/drycc/storage:canary server /data/)
3131

32-
puts-step "minio starting, wait 30s."
32+
puts-step "storage starting, wait 30s."
3333
sleep 30
3434

35-
# boot postgres, linking the minio container and setting DRYCC_MINIO_ENDPOINT
36-
MINIO_IP=$(docker inspect --format "{{ .NetworkSettings.IPAddress }}" "${MINIO_JOB}")
35+
# boot postgres, linking the storage container and setting DRYCC_STORAGE_ENDPOINT
36+
STORAGE_IP=$(docker inspect --format "{{ .NetworkSettings.IPAddress }}" "${STORAGE_JOB}")
3737
PG_CMD="docker run -d \
38-
--add-host minio.local:${MINIO_IP} \
38+
--add-host storage.local:${STORAGE_IP} \
3939
-e PGCTLTIMEOUT=1200 \
4040
-e BACKUP_FREQUENCY=1s \
41-
-e DATABASE_STORAGE=minio \
42-
-e DRYCC_MINIO_LOOKUP=path \
43-
-e DRYCC_MINIO_BUCKET=database \
44-
-e DRYCC_MINIO_ENDPOINT=http://minio.local:9000 \
45-
-e DRYCC_MINIO_ACCESSKEY=$s3Accesskey \
46-
-e DRYCC_MINIO_SECRETKEY=$s3Secretkey $1"
41+
-e DATABASE_STORAGE=storage \
42+
-e DRYCC_STORAGE_LOOKUP=path \
43+
-e DRYCC_STORAGE_BUCKET=database \
44+
-e DRYCC_STORAGE_ENDPOINT=http://storage.local:9000 \
45+
-e DRYCC_STORAGE_ACCESSKEY=$s3Accesskey \
46+
-e DRYCC_STORAGE_SECRETKEY=$s3Secretkey $1"
4747

4848
start-postgres "${PG_CMD}"
4949

5050
# display logs for debugging purposes
51-
puts-step "displaying minio logs"
52-
docker logs "${MINIO_JOB}"
51+
puts-step "displaying storage logs"
52+
docker logs "${STORAGE_JOB}"
5353

5454
check-postgres "${PG_JOB}"
5555

56-
# check if minio has the 5 backups
57-
puts-step "checking if minio has 5 backups"
58-
BACKUPS="$(docker exec "${MINIO_JOB}" sh /tmp/bin/backups.sh | grep json)"
56+
# check if storage has the 5 backups
57+
puts-step "checking if storage has 5 backups"
58+
BACKUPS="$(docker exec "${STORAGE_JOB}" sh /tmp/bin/backups.sh | grep json)"
5959

6060
NUM_BACKUPS="$(echo "${BACKUPS}" | wc -w)"
6161
# NOTE (bacongobbler): the BACKUP_FREQUENCY is only 1 second, so we could technically be checking

rootfs/bin/create_bucket

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
set -e
44

5-
mc config host add minio \
6-
"${DRYCC_MINIO_ENDPOINT}" \
7-
"${DRYCC_MINIO_ACCESSKEY}" \
8-
"${DRYCC_MINIO_SECRETKEY}" \
9-
--lookup "${DRYCC_MINIO_LOOKUP}" \
5+
mc config host add storage \
6+
"${DRYCC_STORAGE_ENDPOINT}" \
7+
"${DRYCC_STORAGE_ACCESSKEY}" \
8+
"${DRYCC_STORAGE_SECRETKEY}" \
9+
--lookup "${DRYCC_STORAGE_LOOKUP}" \
1010
--api s3v4
1111

1212
has_bucket(){
13-
mc ls minio -json|jq -r '.key'|grep -w "${DRYCC_MINIO_BUCKET}"
13+
mc ls storage -json|jq -r '.key'|grep -w "${DRYCC_STORAGE_BUCKET}"
1414
}
1515

1616
if [ -z "$(has_bucket)" ] ;then
17-
mc mb minio/"${DRYCC_MINIO_BUCKET}"
17+
mc mb storage/"${DRYCC_STORAGE_BUCKET}"
1818
if [ -z "$(has_bucket)" ] ;then
19-
echo "create bucket ${DRYCC_MINIO_BUCKET} error"
19+
echo "create bucket ${DRYCC_STORAGE_BUCKET} error"
2020
exit 1
2121
fi
2222
fi
23-
echo "create bucket ${DRYCC_MINIO_BUCKET} success"
23+
echo "create bucket ${DRYCC_STORAGE_BUCKET} success"

rootfs/docker-entrypoint-initdb.d/001_setup_envdir.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
cd "$WALG_ENVDIR"
44

5-
echo $DRYCC_MINIO_ACCESSKEY > AWS_ACCESS_KEY_ID
6-
echo $DRYCC_MINIO_SECRETKEY > AWS_SECRET_ACCESS_KEY
7-
echo "s3://$DRYCC_MINIO_BUCKET/$PG_MAJOR" > WALE_S3_PREFIX
8-
echo "${DRYCC_MINIO_ENDPOINT}" > AWS_ENDPOINT
9-
if [ "${DRYCC_MINIO_LOOKUP}" == "path" ]; then
5+
echo $DRYCC_STORAGE_ACCESSKEY > AWS_ACCESS_KEY_ID
6+
echo $DRYCC_STORAGE_SECRETKEY > AWS_SECRET_ACCESS_KEY
7+
echo "s3://$DRYCC_STORAGE_BUCKET/$PG_MAJOR" > WALE_S3_PREFIX
8+
echo "${DRYCC_STORAGE_ENDPOINT}" > AWS_ENDPOINT
9+
if [ "${DRYCC_STORAGE_LOOKUP}" == "path" ]; then
1010
echo "true" > AWS_S3_FORCE_PATH_STYLE
1111
fi
12-
echo $DRYCC_MINIO_BUCKET > BUCKET_NAME
12+
echo $DRYCC_STORAGE_BUCKET > BUCKET_NAME

0 commit comments

Comments
 (0)