import ruamel.yaml as yaml
-from .runner import upload_docker, upload_dependencies
+from .runner import upload_docker, upload_dependencies, del_listing
from .arvtool import ArvadosCommandTool
logger = logging.getLogger('arvados.cwl-runner')
packed = pack(document_loader, workflowobj, uri, tool.metadata)
+ adjustDirObjs(job_order, del_listing)
+
main = [p for p in packed["$graph"] if p["id"] == "#main"][0]
for inp in main["inputs"]:
sn = shortname(inp["id"])
cwltool.draft2tool.ACCEPTLIST_RE = re.compile(r"^[a-zA-Z0-9._+-]+$")
+def del_listing(obj):
+ if obj.get("location", "").startswith("keep:") and "listing" in obj:
+ del obj["listing"]
+
def upload_dependencies(arvrunner, name, document_loader,
workflowobj, uri, loadref_run):
"""Upload the dependencies of the workflowobj document to Keep.
self.job_order.get("id", "#"),
False)
+ adjustDirObjs(self.job_order, del_listing)
+
if "id" in self.job_order:
del self.job_order["id"]
'location': 'keep:99999999999999999999999999999994+99/blorp.txt',
'class': 'File'
},
+ 'y': {
+ 'basename': '99999999999999999999999999999998+99',
+ 'location': 'keep:99999999999999999999999999999998+99',
+ 'class': 'Directory'
+ },
'cwl:tool':
'99999999999999999999999999999991+99/wf/submit_wf.cwl'
},
'kind': 'file'
},
'/var/lib/cwl/job/cwl.input.json': {
- 'portable_data_hash': '765fda0d9897729ff467a4609879c00a+60/cwl.input.json',
+ 'portable_data_hash': '606be75b6e4f811a2f282d7fac867043+60/cwl.input.json',
'kind': 'collection'
}
},
'manifest_text':
'./tool d51232d96b6116d964a69bfb7e0c73bf+450 '
'0:16:blub.txt 16:434:submit_tool.cwl\n./wf '
- '4d31c5fefd087faf67ca8db0111af36c+353 0:353:submit_wf.cwl\n',
+ '0f8864f292e901019c43fdabacd62c3e+383 0:383:submit_wf.cwl\n',
'owner_uuid': 'zzzzz-tpzed-zzzzzzzzzzzzzzz',
'name': 'submit_wf.cwl',
}, ensure_unique_name=True),
'manifest_text':
'./tool d51232d96b6116d964a69bfb7e0c73bf+450 '
'0:16:blub.txt 16:434:submit_tool.cwl\n./wf '
- '4d31c5fefd087faf67ca8db0111af36c+353 0:353:submit_wf.cwl\n',
+ '0f8864f292e901019c43fdabacd62c3e+383 0:383:submit_wf.cwl\n',
'owner_uuid': 'zzzzz-tpzed-zzzzzzzzzzzzzzz',
'name': 'submit_wf.cwl',
}, ensure_unique_name=True),
'type': 'File',
'value': '99999999999999999999999999999994+99/blorp.txt',
}
+ expect_component['script_parameters']['y'] = {
+ 'dataclass': 'Collection',
+ 'required': True,
+ 'type': 'Directory',
+ 'value': '99999999999999999999999999999998+99',
+ }
expect_template = {
"components": {
"submit_wf.cwl": expect_component,