[ARVADOS] updated: 1.2.0-427-gbb570d30e

Git user git at public.curoverse.com
Wed Nov 21 12:41:34 EST 2018


Summary of changes:
 sdk/cwl/arvados_cwl/__init__.py | 12 +++++++-----
 sdk/cwl/arvados_cwl/arvtool.py  | 13 ++++++++-----
 sdk/cwl/arvados_cwl/executor.py |  4 +++-
 3 files changed, 18 insertions(+), 11 deletions(-)

       via  bb570d30eb44e34c95d645fea42fabbede5e91f9 (commit)
      from  b3f5f8c124348be3208da49dc1287bf01a9f546c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit bb570d30eb44e34c95d645fea42fabbede5e91f9
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Wed Nov 21 12:41:11 2018 -0500

    14198: Call validate_cluster_target on --submit-runner-cluster
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index 605d33005..7b2731ea9 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -146,16 +146,18 @@ def arg_parser():  # type: () -> argparse.ArgumentParser
                         default=None)
 
     parser.add_argument("--always-submit-runner", action="store_true",
-                        help="Always submit a runner to manage the workflow, even when running only a single CommandLineTool",
+                        help="When invoked with --submit --wait, always submit a runner to manage the workflow, even when only running a single CommandLineTool",
                         default=False)
 
     exgroup = parser.add_mutually_exclusive_group()
     exgroup.add_argument("--submit-request-uuid", type=str,
-                        default=None,
-                        help="Update and commit to supplied container request instead of creating a new one (containers API only).")
+                         default=None,
+                         help="Update and commit to supplied container request instead of creating a new one (containers API only).",
+                         metavar="UUID")
     exgroup.add_argument("--submit-runner-cluster", type=str,
-                        help="Submit toplevel runner to a remote cluster (containers API only)",
-                        default=None)
+                         help="Submit workflow runner to a remote cluster (containers API only)",
+                         default=None,
+                         metavar="CLUSTER_ID")
 
     parser.add_argument("--name", type=str,
                         help="Name to use for workflow execution instance.",
diff --git a/sdk/cwl/arvados_cwl/arvtool.py b/sdk/cwl/arvados_cwl/arvtool.py
index 014cedb75..525764530 100644
--- a/sdk/cwl/arvados_cwl/arvtool.py
+++ b/sdk/cwl/arvados_cwl/arvtool.py
@@ -10,6 +10,12 @@ from functools import partial
 from schema_salad.sourceline import SourceLine
 from cwltool.errors import WorkflowException
 
+def validate_cluster_target(arvrunner, runtimeContext):
+    if (runtimeContext.submit_runner_cluster and
+        runtimeContext.submit_runner_cluster not in arvrunner.api._rootDesc["remoteHosts"] and
+        runtimeContext.submit_runner_cluster != arvrunner.api._rootDesc["uuidPrefix"]):
+        raise WorkflowException("Unknown or invalid cluster id '%s' known remote clusters are %s" % (runtimeContext.submit_runner_cluster,
+                                                                                                  ", ".join(arvrunner.api._rootDesc["remoteHosts"].keys())))
 def set_cluster_target(tool, arvrunner, builder, runtimeContext):
     cluster_target_req = None
     for field in ("hints", "requirements"):
@@ -26,11 +32,8 @@ def set_cluster_target(tool, arvrunner, builder, runtimeContext):
         runtimeContext = runtimeContext.copy()
         runtimeContext.submit_runner_cluster = builder.do_eval(cluster_target_req.get("cluster_id")) or runtimeContext.submit_runner_cluster
         runtimeContext.project_uuid = builder.do_eval(cluster_target_req.get("project_uuid")) or runtimeContext.project_uuid
-        if (runtimeContext.submit_runner_cluster and
-            runtimeContext.submit_runner_cluster not in arvrunner.api._rootDesc["remoteHosts"] and
-            runtimeContext.submit_runner_cluster != arvrunner.api._rootDesc["uuidPrefix"]):
-            raise WorkflowException("Unknown or invalid cluster id '%s' known remote clusters are %s" % (runtimeContext.submit_runner_cluster,
-                                                                                                      ", ".join(arvrunner.api._rootDesc["remoteHosts"].keys())))
+        validate_cluster_target(arvrunner, runtimeContext)
+
     return runtimeContext
 
 class ArvadosCommandTool(CommandLineTool):
diff --git a/sdk/cwl/arvados_cwl/executor.py b/sdk/cwl/arvados_cwl/executor.py
index 994594023..6cac70926 100644
--- a/sdk/cwl/arvados_cwl/executor.py
+++ b/sdk/cwl/arvados_cwl/executor.py
@@ -27,7 +27,7 @@ import arvados_cwl.util
 from .arvcontainer import RunnerContainer
 from .arvjob import RunnerJob, RunnerTemplate
 from .runner import Runner, upload_docker, upload_job_order, upload_workflow_deps
-from .arvtool import ArvadosCommandTool
+from .arvtool import ArvadosCommandTool, validate_cluster_target
 from .arvworkflow import ArvadosWorkflow, upload_workflow
 from .fsaccess import CollectionFsAccess, CollectionFetcher, collectionResolver, CollectionCache
 from .perf import Perf
@@ -178,6 +178,8 @@ http://doc.arvados.org/install/install-api-server.html#disable_api_methods
         self.runtimeContext.make_fs_access = partial(CollectionFsAccess,
                                                      collection_cache=self.collection_cache)
 
+        validate_cluster_target(self, self.runtimeContext)
+
 
     def arv_make_tool(self, toolpath_object, loadingContext):
         if "class" in toolpath_object and toolpath_object["class"] == "CommandLineTool":

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list