[ARVADOS] updated: 1b8120689041941db937883c3132a9c6819b56c5

git at public.curoverse.com git at public.curoverse.com
Mon May 5 17:39:54 EDT 2014


Summary of changes:
 sdk/cli/bin/arv-run-pipeline-instance        |   14 +---
 services/api/app/models/link.rb              |    2 +-
 services/api/app/models/log.rb               |    6 +-
 services/api/app/models/pipeline_instance.rb |   24 +++---
 services/api/test/test_helper.rb             |   11 ++-
 services/api/test/unit/log_test.rb           |    7 --
 services/api/test/unit/permission_test.rb    |   17 ++++
 services/keep/src/keep/perms.go              |  104 ++++++++++++++++++++++++++
 services/keep/src/keep/perms_test.go         |  104 ++++++++++++++++++++++++++
 9 files changed, 252 insertions(+), 37 deletions(-)
 create mode 100644 services/api/test/unit/permission_test.rb
 create mode 100644 services/keep/src/keep/perms.go
 create mode 100644 services/keep/src/keep/perms_test.go

       via  1b8120689041941db937883c3132a9c6819b56c5 (commit)
       via  8624ad6e91ed73876bd4f12fe8df2387e3e6330e (commit)
       via  77f1f9eb6f2d03b53c0bb4567ef07718b934e8ea (commit)
       via  395b4e72d33c5b4df931c029a45870d354c32312 (commit)
       via  4d1c7f9514163b6e6949dda814bb524eeff586d9 (commit)
       via  988726079e8e2f8ce4b49115c10a8a1d22040972 (commit)
       via  8c5b4f6d87cec17f915802e3c5f14695611eba7f (commit)
       via  aeff59bfaf199eec6884ccf3ff60968bec81f581 (commit)
       via  8023ae393e2c9ce115bf67bbcf632798a3d17b87 (commit)
      from  22233bfa18060d000e303d7734ec3016f7e80c8e (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 1b8120689041941db937883c3132a9c6819b56c5
Author: radhika <radhika at curoverse.com>
Date:   Mon May 5 17:12:27 2014 -0400

    2352: when using arv-run-pipeline-instance, set state to RunningOnClient.

diff --git a/sdk/cli/bin/arv-run-pipeline-instance b/sdk/cli/bin/arv-run-pipeline-instance
index 2751c08..60d5c38 100755
--- a/sdk/cli/bin/arv-run-pipeline-instance
+++ b/sdk/cli/bin/arv-run-pipeline-instance
@@ -413,18 +413,10 @@ class WhRunPipelineInstance
   end
 
   def setup_instance
-    if $options[:submit]
-      @instance ||= PipelineInstance.
-        create(:components => @components,
+    @instance ||= PipelineInstance.
+      create(:components => @components,
              :pipeline_template_uuid => @template[:uuid],
-             :active => true)
-    else
-      @instance ||= PipelineInstance.
-        create(:components => @components,
-             :pipeline_template_uuid => @template[:uuid],
-             :state => 'RunningOnClient',
-             :active => false)
-    end
+             :state => 'RunningOnClient')
     self
   end
 
diff --git a/services/api/app/models/pipeline_instance.rb b/services/api/app/models/pipeline_instance.rb
index 73f56d1..258ee27 100644
--- a/services/api/app/models/pipeline_instance.rb
+++ b/services/api/app/models/pipeline_instance.rb
@@ -98,7 +98,7 @@ class PipelineInstance < ArvadosModel
   end
 
   def self.queue
-    self.where('active = true')
+    self.where("active = true or state = 'RunningOnClient'")
   end
 
   protected
@@ -172,7 +172,9 @@ class PipelineInstance < ArvadosModel
       end
     elsif 'active'.in? changed_attributes
       if self.active
-        self.state = RunningOnServer
+        if self.state == New || self.state == Ready || self.state == Paused
+          self.state = RunningOnServer
+        end
       else
         if self.components_look_ready?
           self.state = Ready
@@ -180,25 +182,21 @@ class PipelineInstance < ArvadosModel
           self.state = New
         end
       end
-    elsif 'components'.in? changed_attributes
-      if !self.state || self.state == New || !self.active
-        if self.components_look_ready?
-          self.state = Ready
-        else
-          self.state = New
-        end
+    end
+
+    if 'components'.in? changed_attributes
+      if self.components_look_ready? && (!self.state || self.state == New)
+        self.state = Ready
       end
     end
   end
 
   def set_state_before_save
-    if !self.state || self.state == New
+    if !self.state || self.state == New || self.state == Ready || self.state == Paused
       if self.active
         self.state = RunningOnServer
-      elsif self.components_look_ready?
+      elsif self.components_look_ready? && (!self.state || self.state == New)
         self.state = Ready
-      else
-        self.state = New
       end
     end
   end

commit 8624ad6e91ed73876bd4f12fe8df2387e3e6330e
Merge: 22233bf 77f1f9e
Author: radhika <radhika at curoverse.com>
Date:   Mon May 5 14:19:58 2014 -0400

    Merge branch 'master' into 2352-use-state


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


hooks/post-receive
-- 




More information about the arvados-commits mailing list