Skip to content

Commit d67a40a

Browse files
committed
fix(htsget): minio connection
1 parent 4c6f18b commit d67a40a

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

deploy/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ services:
5656
networks:
5757
- modos-network
5858
environment:
59-
- ENDPOINT=${S3_PUBLIC_URL:-http://localhost/s3}
59+
- ENDPOINT=${S3_LOCAL_URL:-http://localhost/s3}
6060
- BUCKET=${S3_BUCKET:-modos-demo}
6161
- S3_ADDRESSING_STYLE=${S3_ADDRESSING_STYLE:-auto}
6262
- AWS_ACCESS_KEY_ID=${MINIO_ROOT_USER:-minio}

deploy/htsget/docker-entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/sh
22
set -e
33

4-
if [ "${S3_ADDRESSING_STYLE}" = "path" ]; then
5-
export PATH_STYLE=true
6-
else
4+
if [ "${S3_ADDRESSING_STYLE}" = "virtual" ]; then
75
export PATH_STYLE=false
6+
else
7+
export PATH_STYLE=true
88
fi
99

1010
# only use entrypoint if running htsget-actix

modos/genomics/htsget.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def build_htsget_url(
7575
stem = path.with_suffix("") if path.name.endswith("gz") else path
7676
stem = stem.with_suffix("")
7777

78-
url = f"{host}{endpoint}/{stem}?format={format.name}"
78+
netloc = host if str(host).endswith("/") else f"{host}/"
79+
url = f"{netloc}{endpoint}/{stem}?format={format.name}"
7980
if region:
8081
url += f"&{region.to_htsget_query()}"
8182
return url
@@ -84,7 +85,7 @@ def build_htsget_url(
8485
@validate_call
8586
def parse_htsget_url(url: HttpUrl) -> tuple[str, Path, Optional[Region]]:
8687
"""Given a URL to an htsget resource, extract the host, path, and region."""
87-
parsed = urlparse(url)
88+
parsed = urlparse(str(url))
8889
query = parse_qs(parsed.query)
8990

9091
if "format" not in query:
@@ -98,7 +99,7 @@ def parse_htsget_url(url: HttpUrl) -> tuple[str, Path, Optional[Region]]:
9899
f".{format.name.lower()}"
99100
)
100101
try:
101-
region = Region.from_htsget_query(url)
102+
region = Region.from_htsget_query(str(url))
102103
except KeyError:
103104
region = None
104105
return (host, path, region)

0 commit comments

Comments
 (0)