From 2d18dc129e15df29d1204f0678add597ae1933fd Mon Sep 17 00:00:00 2001 From: Nuwan Goonasekera <2070605+nuwang@users.noreply.github.com> Date: Tue, 21 Jul 2020 15:51:51 +0530 Subject: [PATCH 1/7] Change home dir to mount path --- rstudio/templates/_helpers.tpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rstudio/templates/_helpers.tpl b/rstudio/templates/_helpers.tpl index 76ff7de..9d46573 100644 --- a/rstudio/templates/_helpers.tpl +++ b/rstudio/templates/_helpers.tpl @@ -77,7 +77,6 @@ Return which PVC to use Creates the bash command for the init containers used to place files and change permissions in the rstudio pods */}} {{- define "rstudio.init-container-commands" -}} -cp -anrL /opt/configs/readonly/rstudio/ /home/; -chown -R rstudio:rstudio /home/rstudio +cp -anrL /opt/configs/readonly/rstudio/. {{ .Values.persistence.mountPath }}; {{- end -}} From 0676743dfe3bd9cc16195a124d2b0605e7fe1738 Mon Sep 17 00:00:00 2001 From: Nuwan Goonasekera <2070605+nuwang@users.noreply.github.com> Date: Tue, 21 Jul 2020 15:54:10 +0530 Subject: [PATCH 2/7] Added support for extra init commands --- rstudio/templates/deployment.yaml | 7 ++++++- rstudio/values.yaml | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/rstudio/templates/deployment.yaml b/rstudio/templates/deployment.yaml index 9cd3c5b..cbbf553 100644 --- a/rstudio/templates/deployment.yaml +++ b/rstudio/templates/deployment.yaml @@ -24,7 +24,12 @@ spec: initContainers: - name: {{ .Chart.Name }}-init-mounts image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - command: ['sh', '-c', {{ include "rstudio.init-container-commands" . | squote }}] + command: [ + 'sh', '-c', + '{{- if .Values.extraInitCommands -}} + {{- tpl .Values.extraInitCommands $ | nindent 13 }}; + {{- end -}} + {{ include "rstudio.init-container-commands" . }}'] volumeMounts: {{- range $entry := .Values.mutableConfigs }} {{ if $entry -}} diff --git a/rstudio/values.yaml b/rstudio/values.yaml index c17b147..27ebc10 100644 --- a/rstudio/values.yaml +++ b/rstudio/values.yaml @@ -96,3 +96,7 @@ useSecretConfigs: false # subPath: ".rstudio/monitored/user-settings/" # contents: | # initialWorkingDirectory="/opt/project/shared-data" + +extraInitCommands: | +# cp -anrL /etc/skel/. /gvl/projects/current/ +# /galaxy/server/extra/mapped/script.sh From cb124fd885f09ef09e00b916a1274edd73a373c3 Mon Sep 17 00:00:00 2001 From: Alexandru Mahmoud Date: Tue, 21 Jul 2020 13:18:14 -0400 Subject: [PATCH 3/7] Update deployment.yaml --- rstudio/templates/deployment.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rstudio/templates/deployment.yaml b/rstudio/templates/deployment.yaml index cbbf553..39a66bc 100644 --- a/rstudio/templates/deployment.yaml +++ b/rstudio/templates/deployment.yaml @@ -40,7 +40,9 @@ spec: {{- end }} - name: rstudio-data mountPath: {{.Values.persistence.mountPath}} - subPath: rstudio + {{- if .Values.persistence.subPath }} + subPath: {{ .Values.persistence.subPath }} + {{- end }} {{- if .Values.extraVolumeMounts }} {{- .Values.extraVolumeMounts | toYaml | nindent 12 }} {{- end }} @@ -111,4 +113,4 @@ spec: {{- end }} {{- if .Values.extraVolumes }} {{- .Values.extraVolumes | toYaml | nindent 8 }} - {{- end }} \ No newline at end of file + {{- end }} From 38b87c9bd9e61cca02f9c211402ab13357f37fa7 Mon Sep 17 00:00:00 2001 From: Alexandru Mahmoud Date: Tue, 21 Jul 2020 13:19:28 -0400 Subject: [PATCH 4/7] Update values.yaml --- rstudio/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rstudio/values.yaml b/rstudio/values.yaml index 27ebc10..0a4f75c 100644 --- a/rstudio/values.yaml +++ b/rstudio/values.yaml @@ -79,6 +79,8 @@ persistence: accessMode: ReadWriteMany size: 10Gi mountPath: /home/rstudio + # SubPath of directory to mount/create in the volume + # subPath: rstudio # extraVolumes: # - name: shared-data From 09963fde16ddb7452198f24bd4410e3e16966fe7 Mon Sep 17 00:00:00 2001 From: Alexandru Mahmoud Date: Tue, 21 Jul 2020 13:35:16 -0400 Subject: [PATCH 5/7] Update deployment.yaml --- rstudio/templates/deployment.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rstudio/templates/deployment.yaml b/rstudio/templates/deployment.yaml index 39a66bc..a39aa99 100644 --- a/rstudio/templates/deployment.yaml +++ b/rstudio/templates/deployment.yaml @@ -79,7 +79,9 @@ spec: {{- end }} - name: rstudio-data mountPath: {{.Values.persistence.mountPath}} - subPath: rstudio + {{- if .Values.persistence.subPath }} + subPath: {{ .Values.persistence.subPath }} + {{- end }} {{- if .Values.extraVolumeMounts }} {{- .Values.extraVolumeMounts | toYaml | nindent 12 }} {{- end }} From 727e5049976c771e8a02249f03fe46b55bde826b Mon Sep 17 00:00:00 2001 From: Alexandru Mahmoud Date: Tue, 21 Jul 2020 22:48:03 -0400 Subject: [PATCH 6/7] Update values.yaml --- rstudio/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rstudio/values.yaml b/rstudio/values.yaml index 0a4f75c..aa0938b 100644 --- a/rstudio/values.yaml +++ b/rstudio/values.yaml @@ -82,23 +82,23 @@ persistence: # SubPath of directory to mount/create in the volume # subPath: rstudio -# extraVolumes: +extraVolumes: [] # - name: shared-data # persistentVolumeClaim: # claimName: shared-data-pvc -# extraVolumeMounts: +extraVolumeMounts: [] # - name: shared-data # mountPath: /opt/project/shared-data useSecretConfigs: false -# mutableConfigs: +mutableConfigs: [] # - fileName: user-settings # subPath: ".rstudio/monitored/user-settings/" # contents: | # initialWorkingDirectory="/opt/project/shared-data" -extraInitCommands: | +extraInitCommands: "" # cp -anrL /etc/skel/. /gvl/projects/current/ # /galaxy/server/extra/mapped/script.sh From f0436a05fcfc56944abee9032d104fe6ad9cbdd0 Mon Sep 17 00:00:00 2001 From: Alexandru Mahmoud Date: Tue, 21 Jul 2020 22:48:38 -0400 Subject: [PATCH 7/7] Update values.yaml --- rstudio/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rstudio/values.yaml b/rstudio/values.yaml index aa0938b..77e0203 100644 --- a/rstudio/values.yaml +++ b/rstudio/values.yaml @@ -82,23 +82,23 @@ persistence: # SubPath of directory to mount/create in the volume # subPath: rstudio -extraVolumes: [] +# extraVolumes: # - name: shared-data # persistentVolumeClaim: # claimName: shared-data-pvc -extraVolumeMounts: [] +# extraVolumeMounts: # - name: shared-data # mountPath: /opt/project/shared-data useSecretConfigs: false -mutableConfigs: [] +# mutableConfigs: # - fileName: user-settings # subPath: ".rstudio/monitored/user-settings/" # contents: | # initialWorkingDirectory="/opt/project/shared-data" -extraInitCommands: "" +# extraInitCommands: | # cp -anrL /etc/skel/. /gvl/projects/current/ # /galaxy/server/extra/mapped/script.sh