Skip to content

Commit

Permalink
feat: Add new compose file for aws storage
Browse files Browse the repository at this point in the history
  • Loading branch information
1ambda committed Dec 7, 2021
1 parent 88d6b00 commit 89bbdaf
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ compose.presto: compose.prepare
-f docker-compose.presto.yml \
up --build

.PHONY: compose.aws
compose.aws: compose.aws
@ echo "[$(TAG)] ($(shell TZ=UTC date -u '+%H:%M:%S')) - Running docker-compose"
@ docker stop $(docker ps -a -q) || true
@ docker rm -f $(docker ps -a -q) || true
@ docker volume rm $(docker volume ls -f dangling=true -q) || true
@ docker compose -f docker-compose.aws.yml rm -fsv || true
@ DOCKER_HOST_IP=$(DOCKER_HOST_IP) docker compose \
-f docker-compose.aws.yml \
up --build

.PHONY: compose.clean
compose.clean:
@ echo "[$(TAG)] ($(shell TZ=UTC date -u '+%H:%M:%S')) - Starting: Cleaning docker resources"
Expand All @@ -85,6 +96,19 @@ compose.clean:
@ echo "\n-----------------------------------------"
@ echo "[$(TAG)] ($(shell TZ=UTC date -u '+%H:%M:%S')) - Finished: Cleaning docker resources"

.PHONY: compose.storage-all
compose.storage-all: compose.storage-all
@ echo "[$(TAG)] ($(shell TZ=UTC date -u '+%H:%M:%S')) - Running docker-compose"
@ docker stop $(docker ps -a -q) || true
@ docker rm -f $(docker ps -a -q) || true
@ docker volume rm $(docker volume ls -f dangling=true -q) || true
@ docker compose -f docker-compose.aws.yml rm -fsv || true
@ DOCKER_HOST_IP=$(DOCKER_HOST_IP) docker compose \
-f docker-compose.storage.yml \
-f docker-compose.aws.yml \
-f docker-compose.kafka.yml \
up --build

##
## Storage CLIs
##
Expand Down
49 changes: 49 additions & 0 deletions docker-compose.aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: '3.7'
services:
dynamodb-local:
image: amazon/dynamodb-local:latest
container_name: dynamodb-local
ports:
- "8000:8000"

dynamodb-admin:
image: aaronshaf/dynamodb-admin
ports:
- "8001:8001"
environment:
DYNAMO_ENDPOINT: "http://dynamodb-local:8000"
AWS_REGION: "ap-northeast-2"
AWS_ACCESS_KEY_ID: accesskey
AWS_SECRET_ACCESS_KEY: secretkey
depends_on:
- dynamodb-local

minio:
image: minio/minio:latest
container_name: minio
environment:
- MINIO_ACCESS_KEY=accesskey
- MINIO_SECRET_KEY=secretkey
- MINIO_ROOT_USER=admin
- MINIO_ROOT_PASSWORD=admin12345
volumes:
- ./_volume/docker-minio:/data
ports:
- "9000:9000"
- "9001:9001"
command: server /data --console-address ":9001"

minio-script:
image: minio/mc
container_name: minio-script
depends_on:
- minio
entrypoint: >
/bin/sh -c "
sleep 10s;
/usr/bin/mc alias set myminio http://minio:9000 admin admin12345;
/usr/bin/mc mb myminio/udon-data-lake || true;
/usr/bin/mc admin user add myminio accesskey accesskey || true;
/usr/bin/mc admin policy set myminio readwrite user=accesskey || true;
exit 0;
"
4 changes: 2 additions & 2 deletions docker-compose.metastore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ services:
/bin/sh -c "
/usr/bin/mc alias set myminio http://minio:9000 admin admin12345;
/usr/bin/mc mb myminio/udon-data-lake || true;
/usr/bin/mc admin user add myminio accesskey secretkey || true;
/usr/bin/mc admin policy set myminio readwrite user=accesskey || true;
/usr/bin/mc admin user add myminio accesskey accesskey || true;
/usr/bin/mc admin policy set myminio readwrite user=secretkey || true;
exit 0;
"
Expand Down

0 comments on commit 89bbdaf

Please sign in to comment.