Skip to content

using stdout field in cachekey calculation #532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cwltool/draft2tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ def job(self,
# type: (...) -> Generator[Union[JobBase, CallbackJob], None, None]

jobname = uniquename(kwargs.get("name", shortname(self.tool.get("id", "job"))))

if kwargs.get("cachedir"):
cacheargs = kwargs.copy()
cacheargs["outdir"] = "/out"
Expand All @@ -270,6 +269,8 @@ def job(self,
cmdline = ["docker", "run", dockerimg] + cmdline
keydict = {u"cmdline": cmdline}

if "stdout" in self.tool:
keydict["stdout"] = self.tool["stdout"]
for location, f in cachebuilder.pathmapper.items():
if f.type == "File":
checksum = next((e['checksum'] for e in cachebuilder.files
Expand Down
5 changes: 4 additions & 1 deletion cwltool/load_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import os
import re
import uuid
import hashlib
import json
from typing import Any, Callable, Dict, List, Text, Tuple, Union, cast

import requests.sessions
Expand Down Expand Up @@ -88,7 +90,8 @@ def _convert_stdstreams_to_files(workflowobj):
if streamtype in workflowobj:
filename = workflowobj[streamtype]
else:
filename = Text(uuid.uuid4())
filename = Text(hashlib.sha1(json.dumps(workflowobj,
sort_keys=True).encode('utf-8')).hexdigest())
workflowobj[streamtype] = filename
out['type'] = 'File'
out['outputBinding'] = {'glob': filename}
Expand Down