Skip to content

Commit

Permalink
helm: support new paths for local workspace directories
Browse files Browse the repository at this point in the history
  • Loading branch information
audrium committed Aug 6, 2021
1 parent c2b84ba commit 2aa1e71
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions helm/reana/templates/reana-workflow-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ 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 }}
env:
- name: REANA_COMPONENT_PREFIX
value: {{ include "reana.prefix" . }}
Expand Down Expand Up @@ -232,3 +240,11 @@ 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 }}
16 changes: 16 additions & 0 deletions reana/reana_dev/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ def cluster_build(
help="Which directories from the Kubernetes nodes to mount inside the job pods? "
"cluster_node_path:job_pod_mountpath, e.g /var/reana/mydata:/mydata",
)
@click.option(
"-w",
"--workspace-mounts",
multiple=True,
help="Which directories from the Kubernetes nodes to mount inside the cluster pods? "
"cluster_node_path:job_pod_mountpath, e.g /var/reana/mydata:/mydata",
)
@click.option(
"--mode",
default="latest",
Expand Down Expand Up @@ -260,6 +267,7 @@ def cluster_build(
def cluster_deploy(
namespace,
job_mounts,
workspace_mounts,
mode,
values,
exclude_components,
Expand Down Expand Up @@ -309,6 +317,14 @@ def job_mounts_to_config(job_mounts):
"reana_workflow_controller", {}
).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

if mode in ("debug"):
values_dict.setdefault("debug", {})["enabled"] = True

Expand Down

0 comments on commit 2aa1e71

Please sign in to comment.