From b2d20ed821ea1f05e7562d939536b9b83e31d627 Mon Sep 17 00:00:00 2001 From: Camila Diaz Date: Tue, 7 Sep 2021 10:46:32 -0500 Subject: [PATCH] cluster: integrate -w option on reana-dev cluster-deploy with workspace exposure for admins Closes reanahub/reana#532 --- helm/reana/templates/reana-server.yaml | 16 ---------------- .../templates/reana-workflow-controller.yaml | 16 ---------------- reana/reana_dev/cluster.py | 9 ++------- 3 files changed, 2 insertions(+), 39 deletions(-) diff --git a/helm/reana/templates/reana-server.yaml b/helm/reana/templates/reana-server.yaml index 6f5b7e2f..8b80b4c2 100644 --- a/helm/reana/templates/reana-server.yaml +++ b/helm/reana/templates/reana-server.yaml @@ -53,14 +53,6 @@ spec: {{- end }} - mountPath: {{ .Values.shared_storage.shared_volume_mount_path }} name: reana-shared-volume - {{- if .Values.components.reana_workflow_controller.environment.REANA_WORKSPACE_HOSTPATH_MOUNTS }} - {{- range $workspace_paths := split "," .Values.components.reana_workflow_controller.environment.REANA_WORKSPACE_HOSTPATH_MOUNTS }} - {{- $workspace_path := split ":" $workspace_paths }} - - name: {{ $workspace_path._0 | quote | replace "/" "" }} - mountPath: {{ $workspace_path._1 }} - mountPropagation: HostToContainer - {{- end }} - {{- end }} {{- if .Values.workspaces }}{{ if .Values.workspaces.paths }} {{- range $workspace_paths := .Values.workspaces.paths }} - name: {{ $workspace_paths | quote | replace "/" "" }} @@ -269,14 +261,6 @@ spec: nodeSelector: {{ $full_label._0 }}: {{ $full_label._1 }} {{- end }} - {{- if .Values.components.reana_workflow_controller.environment.REANA_WORKSPACE_HOSTPATH_MOUNTS }} - {{- range $workspace_paths := split "," .Values.components.reana_workflow_controller.environment.REANA_WORKSPACE_HOSTPATH_MOUNTS }} - {{- $workspace_path := split ":" $workspace_paths }} - - name: {{ $workspace_path._0 | quote | replace "/" "" }} - hostPath: - path: {{ $workspace_path._0 }} - {{- end }} - {{- end }} {{- if .Values.workspaces }}{{ if .Values.workspaces.paths }} {{- range $workspace_paths := .Values.workspaces.paths }} - name: {{ $workspace_paths | quote | replace "/" "" }} diff --git a/helm/reana/templates/reana-workflow-controller.yaml b/helm/reana/templates/reana-workflow-controller.yaml index f733f4f2..eae98c6b 100644 --- a/helm/reana/templates/reana-workflow-controller.yaml +++ b/helm/reana/templates/reana-workflow-controller.yaml @@ -50,14 +50,6 @@ spec: {{- end }} - mountPath: {{ .Values.shared_storage.shared_volume_mount_path }} name: reana-shared-volume - {{- if .Values.components.reana_workflow_controller.environment.REANA_WORKSPACE_HOSTPATH_MOUNTS }} - {{- range $workspace_paths := split "," .Values.components.reana_workflow_controller.environment.REANA_WORKSPACE_HOSTPATH_MOUNTS }} - {{- $workspace_path := split ":" $workspace_paths }} - - name: {{ $workspace_path._0 | quote | replace "/" "" }} - mountPath: {{ $workspace_path._1 }} - mountPropagation: HostToContainer - {{- end }} - {{- end }} {{- if .Values.workspaces }}{{ if .Values.workspaces.paths }} {{- range $workspace_paths := .Values.workspaces.paths }} - name: {{ $workspace_paths | quote | replace "/" "" }} @@ -255,14 +247,6 @@ spec: nodeSelector: {{ $full_label._0 }}: {{ $full_label._1 }} {{- end }} - {{- if .Values.components.reana_workflow_controller.environment.REANA_WORKSPACE_HOSTPATH_MOUNTS }} - {{- range $workspace_paths := split "," .Values.components.reana_workflow_controller.environment.REANA_WORKSPACE_HOSTPATH_MOUNTS }} - {{- $workspace_path := split ":" $workspace_paths }} - - name: {{ $workspace_path._0 | quote | replace "/" "" }} - hostPath: - path: {{ $workspace_path._0 }} - {{- end }} - {{- end }} {{- if .Values.workspaces }}{{ if .Values.workspaces.paths }} {{- range $workspace_paths := .Values.workspaces.paths }} - name: {{ $workspace_paths | quote | replace "/" "" }} diff --git a/reana/reana_dev/cluster.py b/reana/reana_dev/cluster.py index 68ab9c4b..1c10764f 100644 --- a/reana/reana_dev/cluster.py +++ b/reana/reana_dev/cluster.py @@ -236,7 +236,7 @@ def cluster_build( "--workspace-mounts", multiple=True, help="Which directories from the Kubernetes nodes to mount inside the cluster pods? " - "cluster_node_path:cluster_pod_mountpath, e.g /var/reana/mydata:/mydata", + "cluster_node_path, e.g /var/reana/mydata", ) @click.option( "--mode", @@ -318,12 +318,7 @@ def job_mounts_to_config(job_mounts): ).setdefault("environment", {})["REANA_JOB_HOSTPATH_MOUNTS"] = job_mount_config if workspace_mounts: - workspace_mounts = ",".join(workspace_mounts) - values_dict.setdefault("components", {}).setdefault( - "reana_workflow_controller", {} - ).setdefault("environment", {})[ - "REANA_WORKSPACE_HOSTPATH_MOUNTS" - ] = workspace_mounts + values_dict.setdefault("workspaces", {})["paths"] = workspace_mounts if mode in ("debug"): values_dict.setdefault("debug", {})["enabled"] = True