Skip to content

Commit

Permalink
fix(minio): add env variables for auth
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdoret committed Feb 9, 2024
1 parent 3c47238 commit 5b3187c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
35 changes: 22 additions & 13 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
version: '2'

volumes:
minio-data:
driver: local

networks:
modo-network:
driver: bridge

services:

minio:
image: docker.io/bitnami/minio:2024
ports:
- '8080:8080'
- '8081:8081'
- '9000:9000' # api
- '9001:9001' # console
volumes:
- minio-data:/bitnami/minio/data
- /data/s3:/bitnami/minio/data
networks:
- modo-network
environment:
- MINIO_ROOT_USER=minio
- MINIO_ROOT_PASSWORD=miniosecret
- MINIO_DEFAULT_BUCKETS=modo-bucket:readwrite

htsget:
image: ghcr.io/umccr/htsget-rs:dev-latest
networks:
- modo-network
volumes:
- minio-data:/data/s3
environment:
- S3_ENDPOINT=minio:9000
- MINIO_SERVER_ACCESS_KEY=user
- MINIO_SERVER_SECRET_KEY=pass

modo-server:
build: ./modo-server
ports:
- '8000:8000'
- '9000:9000'
networks:
- modo-network
environment:
- S3_ENDPOINT=minio:8080
volumes:
- minio-data:/data/s3
command: uvicorn --host 0.0.0.0 --port 8000 --reload server:app

volumes:
minio-data:
driver: local

networks:
modo-network:
17 changes: 10 additions & 7 deletions deploy/modo-server/server.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import os
from typing import Union

from fastapi import FastAPI
import modo
from modo.api import MODO
import rdflib


S3_BUCKET = "s3://foo/bar"

S3 = os.environ["S3_ENDPOINT"]

app = FastAPI()


@app.get("/")
def index():
return {
"S3 endpoint": f"{S3}",
}


def gather_metadata() -> rdflib.Graph:
"""Generate metadata KG from all MODOs."""
# Loop on MODOs
Expand All @@ -19,11 +27,6 @@ def gather_metadata() -> rdflib.Graph:
# Graph union


@app.get("/")
def read_root():
return {"Hello": "World"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}
Expand Down

0 comments on commit 5b3187c

Please sign in to comment.