18870: Need to declare NODES as array
[arvados.git] / sdk / cwl / arvados_cwl / arvtool.py
index c79b1e67b6fcfa0d0ea81e2719dca9b42a0fa017..b66e8ad3aac6b73b3bb086a60a1403c8a6cf7a64 100644 (file)
@@ -6,6 +6,7 @@ from cwltool.command_line_tool import CommandLineTool, ExpressionTool
 from .arvcontainer import ArvadosContainer
 from .pathmapper import ArvPathMapper
 from .runner import make_builder
+from ._version import __version__
 from functools import partial
 from schema_salad.sourceline import SourceLine
 from cwltool.errors import WorkflowException
@@ -19,7 +20,7 @@ def validate_cluster_target(arvrunner, runtimeContext):
     if runtimeContext.project_uuid:
         cluster_target = runtimeContext.submit_runner_cluster or arvrunner.api._rootDesc["uuidPrefix"]
         if not runtimeContext.project_uuid.startswith(cluster_target):
-            raise WorkflowException("Project uuid '%s' must be for target cluster '%s'" % (runtimeContext.project_uuid, cluster_target))
+            raise WorkflowException("Project uuid '%s' should start with id of target cluster '%s'" % (runtimeContext.project_uuid, cluster_target))
 
         try:
             if runtimeContext.project_uuid[5:12] == '-tpzed-':
@@ -29,7 +30,7 @@ def validate_cluster_target(arvrunner, runtimeContext):
                 if proj["group_class"] != "project":
                     raise Exception("not a project, group_class is '%s'" % (proj["group_class"]))
         except Exception as e:
-            raise WorkflowException("Invalid value for project uuid '%s': %s" % (runtimeContext.project_uuid, e))
+            raise WorkflowException("Invalid project uuid '%s': %s" % (runtimeContext.project_uuid, e))
 
 def set_cluster_target(tool, arvrunner, builder, runtimeContext):
     cluster_target_req = None
@@ -57,6 +58,12 @@ class ArvadosCommandTool(CommandLineTool):
 
     def __init__(self, arvrunner, toolpath_object, loadingContext):
         super(ArvadosCommandTool, self).__init__(toolpath_object, loadingContext)
+
+        (docker_req, docker_is_req) = self.get_requirement("DockerRequirement")
+        if not docker_req:
+            self.hints.append({"class": "DockerRequirement",
+                               "dockerPull": "arvados/jobs:"+__version__})
+
         self.arvrunner = arvrunner
 
     def make_job_runner(self, runtimeContext):