16353: Bump cwltool version
authorPeter Amstutz <peter.amstutz@curii.com>
Mon, 13 Jul 2020 15:20:10 +0000 (11:20 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Mon, 13 Jul 2020 15:20:10 +0000 (11:20 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/cwl/arvados_cwl/runner.py
sdk/cwl/setup.py

index 8540b6d245e5a823c137f2cf351da711eae52807..b10f02d1401b9e31014eb30b32e18adfdcb394d2 100644 (file)
@@ -106,7 +106,7 @@ def make_builder(joborder, hints, requirements, runtimeContext, metadata):
                  outdir="",              # type: Text
                  tmpdir="",              # type: Text
                  stagedir="",            # type: Text
-                 cwlVersion=metadata.get("http://commonwl.org/cwltool#original_cwlVersion")
+                 cwlVersion=metadata.get("http://commonwl.org/cwltool#original_cwlVersion") or metadata.get("cwlVersion")
                 )
 
 def search_schemadef(name, reqs):
@@ -173,7 +173,10 @@ def set_secondary(fsaccess, builder, inputschema, secondaryspec, primary, discov
         specs = []
         primary["secondaryFiles"] = secondaryspec
         for i, sf in enumerate(aslist(secondaryspec)):
-            pattern = builder.do_eval(sf["pattern"], context=primary)
+            if builder.cwlVersion == "v1.0":
+                pattern = builder.do_eval(sf, context=primary)
+            else:
+                pattern = builder.do_eval(sf["pattern"], context=primary)
             if pattern is None:
                 continue
             if isinstance(pattern, list):
@@ -264,6 +267,8 @@ def upload_dependencies(arvrunner, name, document_loader,
         # that external references in $include and $mixin are captured.
         scanobj = loadref("", workflowobj["id"])
 
+    metadata = scanobj
+
     sc_result = scandeps(uri, scanobj,
                   loadref_fields,
                   set(("$include", "$schemas", "location")),
@@ -356,7 +361,7 @@ def upload_dependencies(arvrunner, name, document_loader,
                                obj.get("hints", []),
                                obj.get("requirements", []),
                                ArvRuntimeContext(),
-                               {})
+                               metadata)
         discover_secondary_files(arvrunner.fs_access,
                                  builder,
                                  obj["inputs"],
index fd41be86a343619573768949b6b0e8940001bc2b..ea63ec485f30ed76ca0630a38bcc81f3f0d2afe4 100644 (file)
@@ -39,7 +39,7 @@ setup(name='arvados-cwl-runner',
       # file to determine what version of cwltool and schema-salad to
       # build.
       install_requires=[
-          'cwltool==3.0.20200706173533',
+          'cwltool==3.0.20200710214758',
           'schema-salad==7.0.20200612160654',
           'arvados-python-client{}'.format(pysdk_dep),
           'setuptools',