Skip to content

Commit

Permalink
Merge pull request #43 from smartcitiesdata/minio-s3-patch
Browse files Browse the repository at this point in the history
Mysterious minio means
  • Loading branch information
LtChae authored Feb 13, 2020
2 parents 072c149 + 38eb6aa commit ac37b58
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
8 changes: 6 additions & 2 deletions images/minio-testo/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
18 changes: 18 additions & 0 deletions images/minio-testo/kdp/act-like-s3.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions images/minio-testo/kdp/start-minio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
/kdp/act-like-s3.sh &

/usr/bin/minio server /kdp

0 comments on commit ac37b58

Please sign in to comment.