Skip to content

Commit

Permalink
Merge 70fb545 into 3c630ca
Browse files Browse the repository at this point in the history
  • Loading branch information
roksys committed Jul 19, 2019
2 parents 3c630ca + 70fb545 commit d4fbee8
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions reana_workflow_controller/workflow_run_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
WORKFLOW_RUNTIME_USER_UID)
from reana_commons.k8s.api_client import current_k8s_batchv1_api_client
from reana_commons.k8s.secrets import REANAUserSecretsStore
from reana_commons.k8s.volumes import get_shared_volume
from reana_commons.utils import (create_cvmfs_persistent_volume_claim,
create_cvmfs_storage_class, format_cmd)
from reana_db.database import Session
Expand Down Expand Up @@ -185,16 +186,16 @@ class KubernetesWorkflowRunManager(WorkflowRunManager):

k8s_shared_volume = {
'cephfs': {
'name': 'default-shared-volume',
'name': 'reana-shared-volume',
'persistentVolumeClaim': {
'claimName': MANILA_CEPHFS_PVC,
'readOnly': False,
}
},
'local': {
'name': 'default-shared-volume',
'name': 'reana-shared-volume',
'hostPath': {
'path': SHARED_FS_MAPPING['MOUNT_SOURCE_PATH'],
'path': SHARED_FS_MAPPING['MOUNT_SOURCE_PATH']
}
}
}
Expand Down Expand Up @@ -322,6 +323,16 @@ def _create_job_spec(self, name, command=None, image=None,
job_controller_env_vars = []
owner_id = str(self.workflow.owner_id)
command = format_cmd(command)
workspace_mount, _ = get_shared_volume(
self.workflow.get_workspace(),
KubernetesWorkflowRunManager.k8s_shared_volume
[REANA_STORAGE_BACKEND]['hostPath']['path']
)
db_mount, _ = get_shared_volume(
'db',
KubernetesWorkflowRunManager.k8s_shared_volume
[REANA_STORAGE_BACKEND]['hostPath']['path']
)

workflow_metadata = client.V1ObjectMeta(name=name)
job = client.V1Job()
Expand Down Expand Up @@ -357,13 +368,7 @@ def _create_job_spec(self, name, command=None, image=None,
run_as_group=WORKFLOW_RUNTIME_USER_GID,
run_as_user=WORKFLOW_RUNTIME_USER_UID
)
workflow_enginge_container.volume_mounts = [
{
'name': 'default-shared-volume',
'mountPath': SHARED_FS_MAPPING['MOUNT_DEST_PATH'],
}
]

workflow_enginge_container.volume_mounts = [workspace_mount]
secrets_store = REANAUserSecretsStore(owner_id)
user_secrets = secrets_store.get_secrets()
file_secrets_items = []
Expand Down Expand Up @@ -421,17 +426,13 @@ def _create_job_spec(self, name, command=None, image=None,
job_controller_container.env.extend(job_controller_env_vars)
job_controller_container.env.extend(job_controller_env_secrets)

job_controller_container.volume_mounts = [
{
'name': 'default-shared-volume',
'mountPath': SHARED_FS_MAPPING['MOUNT_DEST_PATH'],
},
job_controller_container.volume_mounts = [workspace_mount, db_mount]
job_controller_container.volume_mounts.append(
{
'name': owner_id,
'mountPath': "/etc/reana/secrets",
'readOnly': True
},
]
})
job_controller_container.ports = [{
"containerPort":
current_app.config['JOB_CONTROLLER_CONTAINER_PORT']
Expand Down

0 comments on commit d4fbee8

Please sign in to comment.