X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/60d5347a73a24638b57715c5f5d9c56d84a9e57e..0821f5481edd016a3744bb50d97a9e5b99cd1a0f:/sdk/cwl/arvados_cwl/runner.py diff --git a/sdk/cwl/arvados_cwl/runner.py b/sdk/cwl/arvados_cwl/runner.py index aafe7c3dd4..a4132ca3f7 100644 --- a/sdk/cwl/arvados_cwl/runner.py +++ b/sdk/cwl/arvados_cwl/runner.py @@ -21,9 +21,18 @@ from .pathmapper import ArvPathMapper logger = logging.getLogger('arvados.cwl-runner') -cwltool.draft2tool.ACCEPTLIST_RE = re.compile(r"^[a-zA-Z0-9._+-]+$") +cwltool.draft2tool.ACCEPTLIST_RE = re.compile(r".*") + +def trim_listing(obj): + """Remove 'listing' field from Directory objects that are keep references. + + When Directory objects represent Keep references, it redundant and + potentially very expensive to pass fully enumerated Directory objects + between instances of cwl-runner (e.g. a submitting a job, or using the + RunInSingleContainer feature), so delete the 'listing' field when it is + safe to do so. + """ -def del_listing(obj): if obj.get("location", "").startswith("keep:") and "listing" in obj: del obj["listing"] if obj.get("location", "").startswith("_:"): @@ -135,7 +144,7 @@ class Runner(object): self.job_order.get("id", "#"), False) - adjustDirObjs(self.job_order, del_listing) + adjustDirObjs(self.job_order, trim_listing) if "id" in self.job_order: del self.job_order["id"]