[ARVADOS] updated: 5b039149732231ec9bd53fd8b5b005babf9eb82e

git at public.curoverse.com git at public.curoverse.com
Thu Mar 20 15:08:41 EDT 2014


Summary of changes:
 .../app/controllers/arvados/v1/jobs_controller.rb  |   22 ++++++++++++++++++-
 1 files changed, 20 insertions(+), 2 deletions(-)

       via  5b039149732231ec9bd53fd8b5b005babf9eb82e (commit)
      from  296a8cba6b65654156d3ff3abc07522a4824935e (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 5b039149732231ec9bd53fd8b5b005babf9eb82e
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Mar 20 15:08:37 2014 -0400

    Enforces that repository, script, script_version, script_parameters are provided.

diff --git a/services/api/app/controllers/arvados/v1/jobs_controller.rb b/services/api/app/controllers/arvados/v1/jobs_controller.rb
index a403356..07daf71 100644
--- a/services/api/app/controllers/arvados/v1/jobs_controller.rb
+++ b/services/api/app/controllers/arvados/v1/jobs_controller.rb
@@ -6,6 +6,14 @@ class Arvados::V1::JobsController < ApplicationController
   skip_before_filter :render_404_if_no_object, :only => :queue
 
   def create
+    [:repository, :script, :script_version, :script_parameters].each do |r|    
+      if !resource_attrs[r]
+        return render json: {
+          :error => "#{r} attribute must be specified"
+        }, status: :unprocessable_entity      
+      end
+    end
+
     r = Commit.find_commit_range(current_user,
                                  resource_attrs[:repository],
                                  resource_attrs[:minimum_script_version],
@@ -14,14 +22,24 @@ class Arvados::V1::JobsController < ApplicationController
     if !resource_attrs[:nondeterministic] and !resource_attrs[:no_reuse]
       # Search for jobs where the script_version is in the list of commits
       # returned by find_commit_range
+      @object = nil
       Job.readable_by(current_user).where(script: resource_attrs[:script],
                                           script_version: r).
         each do |j|
         if j.nondeterministic != true and 
             j.success != false and 
             j.script_parameters == resource_attrs[:script_parameters]
-          # We can re-use this job
-          @object = j
+          # Record the first job in the list
+          if !@object
+            @object = j
+          end
+          # Ensure that all candidate jobs actually did produce the same output
+          if @object.output != j.output
+            @object = nil
+            break
+          end
+        end
+        if @object
           return show
         end
       end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list