[ARVADOS] created: 898af1ecdd211f8e03bf271af8bf8f56f7cee167

git at public.curoverse.com git at public.curoverse.com
Sat Aug 9 16:51:26 EDT 2014


        at  898af1ecdd211f8e03bf271af8bf8f56f7cee167 (commit)


commit 898af1ecdd211f8e03bf271af8bf8f56f7cee167
Author: Tom Clegg <tom at curoverse.com>
Date:   Sat Aug 9 16:51:21 2014 -0400

    3212: Support arv-run-pipeline-instance --no-reuse --submit

diff --git a/sdk/cli/bin/arv-run-pipeline-instance b/sdk/cli/bin/arv-run-pipeline-instance
index 389ce9c..70fecf1 100755
--- a/sdk/cli/bin/arv-run-pipeline-instance
+++ b/sdk/cli/bin/arv-run-pipeline-instance
@@ -454,16 +454,26 @@ class WhRunPipelineInstance
   end
 
   def setup_instance
-    if $options[:submit]
-      @instance ||= PipelineInstance.
-        create(:components => @components,
-              :pipeline_template_uuid => @template[:uuid],
-              :state => 'New')
+    if @instance
+      @instance.properties[:run_options] ||= {}
+      if @options[:no_reuse]
+        # override properties of existing instance
+        @instance.properties[:run_options][:enable_job_reuse] = false
+      else
+        # Default to "enable reuse" if not specified. (This code path
+        # can go away when old clients go away.)
+        if @instance.properties[:run_options][:enable_job_reuse].nil?
+          @instance.properties[:run_options][:enable_job_reuse] = true
+        end
+      end
     else
-      @instance ||= PipelineInstance.
-        create(:components => @components,
-             :pipeline_template_uuid => @template[:uuid],
-             :state => 'RunningOnClient')
+      @instance = PipelineInstance.
+        create(components: @components,
+               properties: {
+                 enable_job_reuse: !@options[:no_reuse]
+               },
+               pipeline_template_uuid: @template[:uuid],
+               state: ($options[:submit] ? 'New' : 'RunningOnClient'))
     end
     self
   end
@@ -503,7 +513,9 @@ class WhRunPipelineInstance
             # dealing with new API servers.
             :minimum_script_version => c[:minimum_script_version],
             :exclude_script_versions => c[:exclude_minimum_script_versions],
-            :find_or_create => !(@options[:no_reuse] || c[:nondeterministic]),
+            :find_or_create => (@instance.properties[:run_options].andand[:enable_job_reuse]
+                                &&
+                                !c[:nondeterministic]),
             :filters => c[:filters]
           })
           if job

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list