From 38eb6aa1054993d75870d8992ab9e8fd833d2352 Mon Sep 17 00:00:00 2001 From: Timothy Regan Date: Thu, 13 Feb 2020 09:45:08 -0500 Subject: [PATCH] Mysterious minio means --- images/minio-testo/Dockerfile | 8 ++++++-- images/minio-testo/kdp/act-like-s3.sh | 18 ++++++++++++++++++ images/minio-testo/kdp/start-minio.sh | 4 ++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 images/minio-testo/kdp/act-like-s3.sh create mode 100755 images/minio-testo/kdp/start-minio.sh diff --git a/images/minio-testo/Dockerfile b/images/minio-testo/Dockerfile index 56c05a3..620d426 100644 --- a/images/minio-testo/Dockerfile +++ b/images/minio-testo/Dockerfile @@ -1,5 +1,9 @@ -FROM minio/minio:RELEASE.2019-01-16T21-44-08Z +FROM minio/minio:RELEASE.2020-02-07T23-28-16Z + +RUN apk add inotify-tools COPY kdp /kdp -CMD ["server", "/kdp"] +ENTRYPOINT [] + +CMD ["/kdp/start-minio.sh"] diff --git a/images/minio-testo/kdp/act-like-s3.sh b/images/minio-testo/kdp/act-like-s3.sh new file mode 100755 index 0000000..7291ef6 --- /dev/null +++ b/images/minio-testo/kdp/act-like-s3.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env sh +# WHY?!?! +## Hive cannot drop an empty folder as part of a drop table +## S3 handles this in some mysterious way +## Minio does not +## This makes minio act in an equally mysterious way that works +set -x + +mkdir -p /kdp/kdp-cloud-storage/hive-s3/ + +# Watches for new directories +inotifywait -m /kdp/kdp-cloud-storage/hive-s3/ -e create \ +| while read parent_directory action new_directory; do + if [ "${action}" == "CREATE,ISDIR" ]; then + # Makes a 0-byte file as a placeholder + touch ${parent_directory}${new_directory}/.placeholder + fi +done diff --git a/images/minio-testo/kdp/start-minio.sh b/images/minio-testo/kdp/start-minio.sh new file mode 100755 index 0000000..10a01fd --- /dev/null +++ b/images/minio-testo/kdp/start-minio.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +/kdp/act-like-s3.sh & + +/usr/bin/minio server /kdp