Skip to content

Commit

Permalink
cwl_reana: pass workflow uuid for R-J-C
Browse files Browse the repository at this point in the history
* To enable cache R-J-C needs workflow uuid for getting
  workspace path.
  Connects reanahub/reana-job-controller/issues/118

Signed-off-by: Rokas Maciulaitis <[email protected]>
  • Loading branch information
Rokas Maciulaitis committed Apr 2, 2019
1 parent 2c466bf commit 4a67646
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions reana_workflow_engine_cwl/cwl_reana.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def add_volumes(self, pathmapper):
with os.fdopen(fd, "wb") as f:
f.write(vol.resolved.encode("utf-8"))

def create_task_msg(self, working_dir):
def create_task_msg(self, working_dir, workflow_uuid):
"""Create job message spec to be sent to REANA-Job-Controller."""
job_name = self.name
docker_req, _ = self.get_requirement("DockerRequirement")
Expand Down Expand Up @@ -245,7 +245,8 @@ def shouldquote(x):
"prettified_cmd": wrapped_cmd,
"workflow_workspace": working_dir,
"job_name": job_name,
"cvmfs_mounts": MOUNT_CVMFS
"cvmfs_mounts": MOUNT_CVMFS,
"workflow_uuid": workflow_uuid
}

return create_body
Expand Down Expand Up @@ -295,7 +296,8 @@ def run(self, runtimeContext):
)
log.debug(pformat(self.__dict__))

task = self.create_task_msg(runtimeContext.working_dir)
task = self.create_task_msg(runtimeContext.working_dir,
runtimeContext.workflow_uuid)

log.info(
"[job %s] CREATED TASK MSG----------------------" %
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
'enum34>=1.1.6',
'SQLAlchemy>=1.1.14',
'SQLAlchemy-Utils>=0.32.18',
'reana-commons[kubernetes]>=0.5.0.dev20190322,<0.6.0',
'reana-commons[kubernetes]>=0.5.0.dev20190402,<0.6.0',
]

packages = find_packages()
Expand Down

0 comments on commit 4a67646

Please sign in to comment.