From 0eb96bf766feff44a1f9c73958aee7f67ecb695c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Alfred=C3=A9en?= Date: Sun, 4 Aug 2024 16:05:27 +0200 Subject: [PATCH] Upgraded shiny proxy and seats configuration (#47) --- apps/shinyproxy/Chart.yaml | 2 +- apps/shinyproxy/templates/configmap.yaml | 18 ++++++++++++ .../shinyproxy/templates/shiny-configmap.yaml | 29 +++++++++++++++++++ apps/shinyproxy/values.yaml | 5 +++- 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 apps/shinyproxy/templates/shiny-configmap.yaml diff --git a/apps/shinyproxy/Chart.yaml b/apps/shinyproxy/Chart.yaml index 81e63d7..b5fcec8 100644 --- a/apps/shinyproxy/Chart.yaml +++ b/apps/shinyproxy/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: shinyproxy description: A Helm chart to install Shinyproxy type: application -version: 1.1.0 +version: 1.2.2 appVersion: "0.1" maintainers: - name: Team Whale diff --git a/apps/shinyproxy/templates/configmap.yaml b/apps/shinyproxy/templates/configmap.yaml index d450a2a..09a50ea 100644 --- a/apps/shinyproxy/templates/configmap.yaml +++ b/apps/shinyproxy/templates/configmap.yaml @@ -40,6 +40,9 @@ data: id: {{ .Release.Name }} display-name: {{ .Values.app_name | quote }} description: {{ .Values.app_description | quote }} + minimum-seats-available: {{ .Values.appconfig.minimumSeatsAvailable }} + seats-per-container: {{ .Values.appconfig.seatsPerContainer }} + allow-container-re-use: {{ .Values.appconfig.allowContainerReuse }} labels: sp.instance: {{ .Release.Name }} allow-internet-egress: "true" @@ -53,4 +56,19 @@ data: runAsNonRoot: true allowPrivilegeEscalation: false privileged: false + - op: add + path: /spec/volumes + value: + - name: {{ .Release.Name }}-shiny-configmap + configMap: + name: {{ .Release.Name }}-shiny-configmap + items: + - key: shiny-server.conf + path: shiny-server.conf + - op: add + path: /spec/containers/0/volumeMounts + value: + - mountPath: /etc/shiny-server/shiny-server.conf + subPath: shiny-server.conf + name: {{ .Release.Name }}-shiny-configmap title: Serve Shiny Proxy diff --git a/apps/shinyproxy/templates/shiny-configmap.yaml b/apps/shinyproxy/templates/shiny-configmap.yaml new file mode 100644 index 0000000..1531c11 --- /dev/null +++ b/apps/shinyproxy/templates/shiny-configmap.yaml @@ -0,0 +1,29 @@ +# This configmap relates to the shiny app pod spawned by the shinyproxy deployment +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-shiny-configmap + namespace: {{ .Release.Namespace }} +data: + shiny-server.conf: |- + # Instruct Shiny Server to run applications as the user "shiny" + run_as shiny; + http_keepalive_timeout 600; + # Define a server that listens on user defined port + server { + listen {{ .Values.appconfig.port }} 0.0.0.0; + # Define a location at the base URL + location / { + # Host the directory of Shiny Apps stored in this directory + site_dir /srv/shiny-server; + # Log all Shiny output to files in this directory + log_dir /var/log/shiny-server; + # When a user visits the base URL rather than a particular application, + # an index of the applications available in this directory will be shown. + directory_index on; + app_init_timeout 600; + app_idle_timeout 600; + } + app_init_timeout 600; + app_idle_timeout 600; + } diff --git a/apps/shinyproxy/values.yaml b/apps/shinyproxy/values.yaml index 8d3993a..ff084f9 100644 --- a/apps/shinyproxy/values.yaml +++ b/apps/shinyproxy/values.yaml @@ -4,10 +4,13 @@ project: slug: project-slug appconfig: - proxyimage: ghcr.io/scilifelabdatacentre/serve-shinyproxy:231124-2126 + proxyimage: ghcr.io/scilifelabdatacentre/serve-shinyproxy:240703-0833 proxyport: 8080 port: 3838 image: + minimumSeatsAvailable: 2 + seatsPerContainer: 3 + allowContainerReuse: true global: