From a3eda5cd38c148e802f45909055e604678423375 Mon Sep 17 00:00:00 2001 From: Xiao Gui Date: Mon, 21 Oct 2024 13:10:18 +0200 Subject: [PATCH] fix: minor update on download contents --- .helm/adhoc/deprecated-hostname.yaml | 2 +- .helm/adhoc/ingress.yaml | 42 +++++++++++++++++++ .../templates/_helpers.tpl | 1 + .../templates/_helpers.tpl | 1 + .../data_handlers/compounds/download.py | 6 ++- 5 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 .helm/adhoc/ingress.yaml diff --git a/.helm/adhoc/deprecated-hostname.yaml b/.helm/adhoc/deprecated-hostname.yaml index 8a632ca..d693350 100644 --- a/.helm/adhoc/deprecated-hostname.yaml +++ b/.helm/adhoc/deprecated-hostname.yaml @@ -61,6 +61,6 @@ spec: path: "/" backend: service: - name: prod-siibra-api + name: prod-server-siibra-api-v4-server port: number: 5000 diff --git a/.helm/adhoc/ingress.yaml b/.helm/adhoc/ingress.yaml new file mode 100644 index 0000000..e94c1b4 --- /dev/null +++ b/.helm/adhoc/ingress.yaml @@ -0,0 +1,42 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: siibra-api-prod + labels: + name: siibra-api-prod +spec: + tls: + - secretName: siibra-api-prod-secret + hosts: + - siibra-api-prod.apps.tc.humanbrainproject.eu + rules: + - host: siibra-api-prod.apps.tc.humanbrainproject.eu + http: + paths: + - pathType: Prefix + path: "/v1_0" + backend: + service: + name: siibra-api-v1 + port: + number: 5000 + - host: siibra-api-prod.apps.tc.humanbrainproject.eu + http: + paths: + - pathType: Prefix + path: "/v2_0" + backend: + service: + name: siibra-api-v2 + port: + number: 5000 + - host: siibra-api-prod.apps.tc.humanbrainproject.eu + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: prod-server-siibra-api-v4-server + port: + number: 5000 diff --git a/.helm/siibra-api-v4-server/templates/_helpers.tpl b/.helm/siibra-api-v4-server/templates/_helpers.tpl index c56a560..0176f4d 100644 --- a/.helm/siibra-api-v4-server/templates/_helpers.tpl +++ b/.helm/siibra-api-v4-server/templates/_helpers.tpl @@ -52,6 +52,7 @@ Create chart name and version as used by the chart label. Common labels */}} {{- define "siibra-api-v4-server.labels" -}} +app-role: server helm.sh/chart: {{ include "siibra-api-v4-server.chart" . }} {{ include "siibra-api-v4-server.selectorLabels" . }} {{- if .Chart.AppVersion }} diff --git a/.helm/siibra-api-v4-worker/templates/_helpers.tpl b/.helm/siibra-api-v4-worker/templates/_helpers.tpl index 6b8e212..f5a3696 100644 --- a/.helm/siibra-api-v4-worker/templates/_helpers.tpl +++ b/.helm/siibra-api-v4-worker/templates/_helpers.tpl @@ -84,6 +84,7 @@ Create chart name and version as used by the chart label. Common labels */}} {{- define "siibra-api-v4-worker.labels" -}} +app-role: worker helm.sh/chart: {{ include "siibra-api-v4-worker.chart" . }} {{ include "siibra-api-v4-worker.selectorLabels" . }} {{- if .Chart.AppVersion }} diff --git a/api/common/data_handlers/compounds/download.py b/api/common/data_handlers/compounds/download.py index a8445d2..7035463 100644 --- a/api/common/data_handlers/compounds/download.py +++ b/api/common/data_handlers/compounds/download.py @@ -46,7 +46,7 @@ """ -LICENSE = """Please check the respective citations regarding licenses to use these data.""" +LICENSE = """Please check the respective `.info.md` regarding licenses of the data.""" @data_decorator(ROLE) def download_all(space_id: str, parcellation_id: str, region_id: str=None, feature_id: str=None, bbox=None) -> str: @@ -124,9 +124,11 @@ def write_desc(filename, obj, **kwargs): except Exception as e: zipfile.writestr(f"{filename}.error.txt", str(e)) + injected_content=f"space_id={space_id}, parcellation_id={parcellation_id}, region_id={region_id}, bbox={bbox}" + readme_txt = README.format(siibra_api_version=__version__, timestamp=str(datetime.now()), - injected_content=f"space_id={space_id}, parcellation_id={parcellation_id}, region_id={region_id}") + injected_content=injected_content) zipfile.writestr("README.md", readme_txt) zipfile.writestr("LICENCE.txt", LICENSE) try: