Arvbox explicitly initializes postgres with en_US.UTF-8 locale. no issue #
[arvados.git] / sdk / cwl / arvados_cwl / runner.py
index 19ce39375e62b99cd1bfee2e36e006604d2093c5..39497098498792d1a4bb8595a77f6dcf9d1f6d47 100644 (file)
@@ -46,11 +46,16 @@ def trim_anonymous_location(obj):
     if obj.get("location", "").startswith("_:"):
         del obj["location"]
 
+def remove_redundant_fields(obj):
+    for field in ("path", "nameext", "nameroot", "dirname"):
+        if field in obj:
+            del obj[field]
+
 def find_defaults(d, op):
     if isinstance(d, list):
         for i in d:
             find_defaults(i, op)
-    if isinstance(d, dict):
+    elif isinstance(d, dict):
         if "default" in d:
             op(d)
         else:
@@ -118,14 +123,9 @@ def upload_dependencies(arvrunner, name, document_loader,
             if "location" not in f and "path" in f:
                 f["location"] = f["path"]
                 del f["path"]
-            if not arvrunner.fs_access.exists(f["location"]):
+            if "location" in f and not arvrunner.fs_access.exists(f["location"]):
                 # Remove from sc
-                i = 0
-                while i < len(sc):
-                    if sc[i]["location"] == f["location"]:
-                        del sc[i]
-                    else:
-                        i += 1
+                sc[:] = [x for x in sc if x["location"] != f["location"]]
                 # Delete "default" from workflowobj
                 remove[0] = True
         visit_class(obj["default"], ("File", "Directory"), add_default)
@@ -166,6 +166,8 @@ def upload_docker(arvrunner, tool):
                 raise SourceLine(docker_req, "dockerOutputDirectory", UnsupportedRequirement).makeError(
                     "Option 'dockerOutputDirectory' of DockerRequirement not supported.")
             arv_docker_get_image(arvrunner.api, docker_req, True, arvrunner.project_uuid)
+        else:
+            arv_docker_get_image(arvrunner.api, {"dockerPull": "arvados/jobs"}, True, arvrunner.project_uuid)
     elif isinstance(tool, cwltool.workflow.Workflow):
         for s in tool.steps:
             upload_docker(arvrunner, s.embedded_tool)