Skip to content
Snippets Groups Projects
Commit c6a19e95 authored by Xiao Gui's avatar Xiao Gui
Browse files

maint: added expiry to responses

parent 001b2f4e
No related branches found
No related tags found
No related merge requests found
...@@ -30,12 +30,19 @@ jobs: ...@@ -30,12 +30,19 @@ jobs:
kubecfg_path=${{ runner.temp }}/.kube_config kubecfg_path=${{ runner.temp }}/.kube_config
echo "${{ secrets.KUBECONFIG }}" > $kubecfg_path echo "${{ secrets.KUBECONFIG }}" > $kubecfg_path
helm --kubeconfig=$kubecfg_path \ helm ls | awk '{print $1}' | grep -q ${{ inputs.DEPLOYMENT_NAME }} \
&& helm --kubeconfig=$kubecfg_path \
upgrade \ upgrade \
--history-max 3 \ --history-max 3 \
--reuse-values \ --reuse-values \
--set image.tag=${{ inputs.IMAGE_TAG }} \ --set image.tag=${{ inputs.IMAGE_TAG }} \
--set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \ --set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \
${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/ \
|| helm --kubeconfig=$kubecfg_path \
install\
--set image.tag=${{ inputs.IMAGE_TAG }} \
--set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \
--set envObj.HOST_PATHNAME=/viewer \
${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/ ${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/
rm $kubecfg_path rm $kubecfg_path
...@@ -50,14 +57,21 @@ jobs: ...@@ -50,14 +57,21 @@ jobs:
kubecfg_path=${{ runner.temp }}/.kube_config kubecfg_path=${{ runner.temp }}/.kube_config
echo "${{ secrets.KUBECONFIG }}" > $kubecfg_path echo "${{ secrets.KUBECONFIG }}" > $kubecfg_path
helm --kubeconfig=$kubecfg_path \ helm ls | awk '{print $1}' | grep -q ${{ inputs.DEPLOYMENT_NAME }} \
&& helm --kubeconfig=$kubecfg_path \
upgrade \ upgrade \
--history-max 3 \ --history-max 3 \
--reuse-values \ --reuse-values \
--set image.tag=${{ inputs.IMAGE_TAG }} \ --set image.tag=${{ inputs.IMAGE_TAG }} \
--set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \ --set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \
${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/ \
|| helm --kubeconfig=$kubecfg_path \
install\
--set image.tag=${{ inputs.IMAGE_TAG }} \
--set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \
--set envObj.HOST_PATHNAME=/viewer-staging \
${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/ ${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/
rm $kubecfg_path rm $kubecfg_path
trigger-deploy-expmt: trigger-deploy-expmt:
...@@ -70,12 +84,19 @@ jobs: ...@@ -70,12 +84,19 @@ jobs:
kubecfg_path=${{ runner.temp }}/.kube_config kubecfg_path=${{ runner.temp }}/.kube_config
echo "${{ secrets.KUBECONFIG }}" > $kubecfg_path echo "${{ secrets.KUBECONFIG }}" > $kubecfg_path
helm --kubeconfig=$kubecfg_path \ helm ls | awk '{print $1}' | grep -q ${{ inputs.DEPLOYMENT_NAME }} \
&& helm --kubeconfig=$kubecfg_path \
upgrade \ upgrade \
--history-max 3 \ --history-max 3 \
--reuse-values \ --reuse-values \
--set image.tag=${{ inputs.IMAGE_TAG }} \ --set image.tag=${{ inputs.IMAGE_TAG }} \
--set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \ --set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \
${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/ \
|| helm --kubeconfig=$kubecfg_path \
install\
--set image.tag=${{ inputs.IMAGE_TAG }} \
--set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \
--set envObj.HOST_PATHNAME=/viewer-expmt \
${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/ ${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/
rm $kubecfg_path rm $kubecfg_path
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# This is a YAML-formatted file. # This is a YAML-formatted file.
# Declare variables to be passed into your templates. # Declare variables to be passed into your templates.
replicaCount: 1 replicaCount: 2
image: image:
repository: docker-registry.ebrains.eu/siibra/siibra-explorer repository: docker-registry.ebrains.eu/siibra/siibra-explorer
...@@ -96,7 +96,6 @@ tolerations: [] ...@@ -96,7 +96,6 @@ tolerations: []
affinity: {} affinity: {}
envObj: envObj:
HOSTNAME: https://siibra-explorer.apps.tc.humanbrainproject.eu
OVERWRITE_SPATIAL_ENDPOINT: https://siibra-spatial-backend.apps.tc.humanbrainproject.eu OVERWRITE_SPATIAL_ENDPOINT: https://siibra-spatial-backend.apps.tc.humanbrainproject.eu
HOST_PATHNAME: /viewer HOST_PATHNAME: /viewer
OVERWRITE_API_ENDPOINT: https://siibra-api-prod.apps.tc.humanbrainproject.eu/v3_0 OVERWRITE_API_ENDPOINT: https://siibra-api-prod.apps.tc.humanbrainproject.eu/v3_0
FROM node:16 as builder FROM node:16 as builder
ARG BUILD_HASH
ENV BUILD_HASH=${BUILD_HASH:-devbuild}
ARG BACKEND_URL ARG BACKEND_URL
ENV BACKEND_URL=${BACKEND_URL} ENV BACKEND_URL=${BACKEND_URL}
...@@ -47,6 +44,9 @@ RUN node third_party/matomo/processMatomo.js ...@@ -47,6 +44,9 @@ RUN node third_party/matomo/processMatomo.js
# prod container # prod container
FROM python:3.10-alpine FROM python:3.10-alpine
ARG BUILD_HASH
ENV BUILD_HASH=${BUILD_HASH:-devbuild}
RUN adduser --disabled-password nonroot RUN adduser --disabled-password nonroot
RUN mkdir /common RUN mkdir /common
......
...@@ -12,5 +12,8 @@ class VersionHeaderMW(BaseHTTPMiddleware): ...@@ -12,5 +12,8 @@ class VersionHeaderMW(BaseHTTPMiddleware):
or (300 <= resp.status_code < 400) # if the request is redirect, do not interfere or (300 <= resp.status_code < 400) # if the request is redirect, do not interfere
): ):
return resp return resp
# allow for debugging, cache should be busted every 10 min
resp.headers["ETag"] = BUILD_HASH resp.headers["ETag"] = BUILD_HASH
resp.headers["Cache-Control"] = "max-age=600"
return resp return resp
# v2.14.9
## Bugfix
- Fix deployment issues
{ {
"name": "siibra-explorer", "name": "siibra-explorer",
"version": "2.14.8", "version": "2.14.9",
"description": "siibra-explorer - explore brain atlases. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular", "description": "siibra-explorer - explore brain atlases. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular",
"scripts": { "scripts": {
"lint": "eslint src --ext .ts", "lint": "eslint src --ext .ts",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment