Skip to content

Commit

Permalink
cluster: integrate -w option on reana-dev cluster-deploy with workspa…
Browse files Browse the repository at this point in the history
…ce exposure for admins

Closes reanahub#532
  • Loading branch information
marcdiazsan committed Sep 7, 2021
1 parent 278acd1 commit b2d20ed
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 39 deletions.
16 changes: 0 additions & 16 deletions helm/reana/templates/reana-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "/" "" }}
Expand Down Expand Up @@ -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 "/" "" }}
Expand Down
16 changes: 0 additions & 16 deletions helm/reana/templates/reana-workflow-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "/" "" }}
Expand Down Expand Up @@ -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 "/" "" }}
Expand Down
9 changes: 2 additions & 7 deletions reana/reana_dev/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b2d20ed

Please sign in to comment.