Skip to content

Commit 8427972

Browse files
committed
toil also support CWL v1.1 and v1.2
1 parent 485831b commit 8427972

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

wes_service/arvados_wes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def GetServiceInfo(self):
8585
["arvados-cwl-runner", "--version"], stderr=subprocess.PIPE
8686
).communicate()
8787
return {
88-
"workflow_type_versions": {"CWL": {"workflow_type_version": ["v1.0", "v1.1", "v1.2"]}},
88+
"workflow_type_versions": {
89+
"CWL": {"workflow_type_version": ["v1.0", "v1.1", "v1.2"]}
90+
},
8991
"supported_wes_versions": ["0.3.0", "1.0.0"],
9092
"supported_filesystem_protocols": ["http", "https", "keep"],
9193
"workflow_engine_versions": {"arvados-cwl-runner": str(stderr)},

wes_service/toil_wes.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ def call_cmd(self, cmd, cwd):
121121
f.write(str(cmd))
122122
stdout = open(self.outfile, "w")
123123
stderr = open(self.errfile, "w")
124-
logging.info("Calling: %s, with outfile: %s and errfile: %s", (" ".join(cmd)), self.outfile, self.errfile)
124+
logging.info(
125+
"Calling: %s, with outfile: %s and errfile: %s",
126+
(" ".join(cmd)),
127+
self.outfile,
128+
self.errfile,
129+
)
125130
process = subprocess.Popen(
126131
cmd, stdout=stdout, stderr=stderr, close_fds=True, cwd=cwd
127132
)
@@ -208,10 +213,10 @@ def run(self, request, tempdir, opts):
208213
wftype = request["workflow_type"].lower().strip()
209214
version = request["workflow_type_version"]
210215

211-
if version != "v1.0" and wftype == "cwl":
216+
if wftype == "cwl" and version not in ("v1.0", "v1.1", "v1.2"):
212217
raise RuntimeError(
213218
'workflow_type "cwl" requires '
214-
'"workflow_type_version" to be "v1.0": ' + str(version)
219+
'"workflow_type_version" to be "v1.[012]": ' + str(version)
215220
)
216221
if version != "2.7" and wftype == "py":
217222
raise RuntimeError(
@@ -274,7 +279,12 @@ def getstate(self):
274279
logging.info("Workflow " + self.run_id + ": EXECUTOR_ERROR")
275280
open(self.staterrorfile, "a").close()
276281
return "EXECUTOR_ERROR", 255
277-
if subprocess.run(["toil", "status", "--failIfNotComplete", self.jobstorefile]).returncode == 0:
282+
if (
283+
subprocess.run(
284+
["toil", "status", "--failIfNotComplete", self.jobstorefile]
285+
).returncode
286+
== 0
287+
):
278288
completed = True
279289
if completed:
280290
logging.info("Workflow " + self.run_id + ": COMPLETE")
@@ -296,7 +306,7 @@ class ToilBackend(WESBackend):
296306
def GetServiceInfo(self):
297307
return {
298308
"workflow_type_versions": {
299-
"CWL": {"workflow_type_version": ["v1.0"]},
309+
"CWL": {"workflow_type_version": ["v1.0", "v1.1", "v1.2"]},
300310
"WDL": {"workflow_type_version": ["draft-2"]},
301311
"PY": {"workflow_type_version": ["2.7"]},
302312
},

0 commit comments

Comments
 (0)