Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIG-1835: make a self-contained init-minio make target #877

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ pnpm-debug.log*

# macOS-specific files
.DS_Store

# minio-related files
lib/minio/access-key
lib/minio/secret-key
lib/minio/aws-credentials
26 changes: 18 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ clean-secrets:


#>>>
# remove all peristant volumes and local data
# remove all persistent volumes and local data
# make clean-volumes

#<<<
Expand Down Expand Up @@ -360,7 +360,7 @@ docker-push:

#<<<
.PHONY: docker-secrets
docker-secrets: mkdir authx-secrets data-secrets #minio-secrets
docker-secrets: mkdir authx-secrets data-secrets


data-secrets: mkdir
Expand All @@ -383,11 +383,12 @@ authx-secrets: mkdir

minio-secrets: mkdir
@echo "making minio secrets"
@echo $(DEFAULT_ADMIN_USER) > tmp/secrets/minio-access-key
@echo $(DEFAULT_ADMIN_USER) > lib/minio/access-key
$(MAKE) secret-minio-secret-key
@echo '[default]' > tmp/secrets/aws-credentials
@echo "aws_access_key_id=`cat tmp/secrets/minio-access-key`" >> tmp/secrets/aws-credentials
@echo "aws_secret_access_key=`cat tmp/secrets/minio-secret-key`" >> tmp/secrets/aws-credentials
mv tmp/secrets/minio-secret-key lib/minio/secret-key
@echo '[default]' > lib/minio/aws-credentials
@echo "aws_access_key_id=`cat lib/minio/access-key`" >> lib/minio/aws-credentials
@echo "aws_secret_access_key=`cat lib/minio/secret-key`" >> lib/minio/aws-credentials


#>>>
Expand All @@ -399,8 +400,6 @@ minio-secrets: mkdir
docker-volumes:
docker volume create grafana-data --label candigv2=volume
docker volume create jupyter-data --label candigv2=volume
# docker volume create minio-config --label candigv2=volume
# docker volume create minio-data $(MINIO_VOLUME_OPT) --label candigv2=volume
docker volume create prometheus-data --label candigv2=volume
docker volume create toil-jobstore --label candigv2=volume
docker volume create keycloak-data --label candigv2=volume
Expand All @@ -425,6 +424,17 @@ init-authx: mkdir
$(foreach MODULE, $(CANDIG_AUTH_MODULES), $(MAKE) build-$(MODULE); $(MAKE) compose-$(MODULE); python settings.py;)


#>>>
# create a minio container (that won't be removed as part of clean-all)
# make init-minio

#<<<
init-minio: minio-secrets
docker volume create minio-config
docker volume create minio-data $(MINIO_VOLUME_OPT)
docker compose -f lib/candigv2/docker-compose.yml -f lib/minio/docker-compose.yml --compatibility up -d 2>&1 | tee -a $(ERRORLOG)


#>>>
# initialize conda environment
# make init-conda
Expand Down
2 changes: 1 addition & 1 deletion etc/env/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# site options
CANDIG_MODULES=logging keycloak vault redis postgres htsget katsu query tyk opa federation candig-ingest candig-data-portal
#minio drs-server wes-server monitoring
#drs-server wes-server monitoring
CANDIG_AUTH_MODULES=keycloak vault tyk opa federation
CANDIG_DATA_MODULES=keycloak vault redis postgres logging

Expand Down
12 changes: 0 additions & 12 deletions lib/candigv2/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
volumes:
# minio-data:
# external: true
# minio-config:
# external: true
toil-jobstore:
external: true
prometheus-data:
Expand Down Expand Up @@ -31,14 +27,6 @@ secrets:
file: $PWD/tmp/postgres/db-secret
labels:
- "candigv2=secret"
# minio-access-key:
# file: $PWD/tmp/secrets/minio-access-key
# labels:
# - "candigv2=secret"
# minio-secret-key:
# file: $PWD/tmp/secrets/minio-secret-key
# labels:
# - "candigv2=secret"
wes-dependency-resolver:
file: $PWD/etc/yml/${WES_DEPENDENCY_RESOLVER}.yml
labels:
Expand Down
12 changes: 10 additions & 2 deletions lib/minio/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
volumes:
minio-data:
external: true
minio-config:
external: true
secrets:
minio-access-key:
file: $PWD/lib/minio/access-key
minio-secret-key:
file: $PWD/lib/minio/secret-key
services:
minio:
image: minio/minio:${MINIO_VERSION:-latest}
labels:
- "candigv2=minio"
volumes:
- minio-data:/data
- minio-config:/root/.minio
Expand Down
7 changes: 7 additions & 0 deletions lib/toil/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
secrets:
minio-access-key:
file: $PWD/lib/minio/access-key
minio-secret-key:
file: $PWD/lib/minio/secret-key
aws-credentials:
file: $PWD/lib/minio/aws-credentials
services:
toil-server:
image: ${DOCKER_REGISTRY}/toil:${TOIL_VERSION:-latest}
Expand Down
7 changes: 7 additions & 0 deletions lib/wes-server/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
secrets:
minio-access-key:
file: $PWD/lib/minio/access-key
minio-secret-key:
file: $PWD/lib/minio/secret-key
aws-credentials:
file: $PWD/lib/minio/aws-credentials
services:
wes-server:
build:
Expand Down