[ARVADOS] updated: 4cacfe7a9566d7ea6f53be24daf83cf9e441aebb

Git user git at public.curoverse.com
Mon May 8 14:25:32 EDT 2017


Summary of changes:
 services/api/app/controllers/application_controller.rb         |  2 +-
 services/api/app/controllers/arvados/v1/groups_controller.rb   |  5 +++--
 services/api/app/models/job.rb                                 |  4 ++++
 services/api/app/models/pipeline_instance.rb                   |  4 ++++
 services/api/app/models/pipeline_template.rb                   |  4 ++++
 .../api/test/functional/arvados/v1/groups_controller_test.rb   | 10 +++-------
 6 files changed, 19 insertions(+), 10 deletions(-)

       via  4cacfe7a9566d7ea6f53be24daf83cf9e441aebb (commit)
       via  3f285d4c2555aa57e9b64c9890bbb494cdf46a0f (commit)
      from  cb109bfddd08bd8136b75e90b681e4af3d60ea30 (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 4cacfe7a9566d7ea6f53be24daf83cf9e441aebb
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon May 8 14:17:46 2017 -0400

    11629: Apply memory limits to job/pipeline "components" fields.

diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index 2bf7952..6bac512 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -281,7 +281,7 @@ class ApplicationController < ActionController::Base
     return if limit_columns.empty?
     model_class.transaction do
       limit_query = @objects.
-        except(:select).
+        except(:select, :distinct).
         select("(%s) as read_length" %
                limit_columns.map { |s| "octet_length(#{s})" }.join(" + "))
       new_limit = 0
diff --git a/services/api/app/models/job.rb b/services/api/app/models/job.rb
index 2fdfbb1..90fba3c 100644
--- a/services/api/app/models/job.rb
+++ b/services/api/app/models/job.rb
@@ -73,6 +73,10 @@ class Job < ArvadosModel
     @need_crunch_dispatch_trigger = false
   end
 
+  def self.limit_index_columns_read
+    ["components"]
+  end
+
   def assert_finished
     update_attributes(finished_at: finished_at || db_current_time,
                       success: success.nil? ? false : success,
diff --git a/services/api/app/models/pipeline_instance.rb b/services/api/app/models/pipeline_instance.rb
index 75903ca..800fc8b 100644
--- a/services/api/app/models/pipeline_instance.rb
+++ b/services/api/app/models/pipeline_instance.rb
@@ -38,6 +38,10 @@ class PipelineInstance < ArvadosModel
      (Complete = 'Complete'),
     ]
 
+  def self.limit_index_columns_read
+    ["components"]
+  end
+
   # if all components have input, the pipeline is Ready
   def components_look_ready?
     if !self.components || self.components.empty?
diff --git a/services/api/app/models/pipeline_template.rb b/services/api/app/models/pipeline_template.rb
index b016ce1..c6fb7a2 100644
--- a/services/api/app/models/pipeline_template.rb
+++ b/services/api/app/models/pipeline_template.rb
@@ -9,4 +9,8 @@ class PipelineTemplate < ArvadosModel
     t.add :components
     t.add :description
   end
+
+  def self.limit_index_columns_read
+    ["components"]
+  end
 end
diff --git a/services/api/test/functional/arvados/v1/groups_controller_test.rb b/services/api/test/functional/arvados/v1/groups_controller_test.rb
index 4c5810d..02d8c15 100644
--- a/services/api/test/functional/arvados/v1/groups_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/groups_controller_test.rb
@@ -464,6 +464,8 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
   end
 
   test 'get contents with low max_index_database_read' do
+    # Some result will certainly have at least 12 bytes in a
+    # restricted column
     Rails.configuration.max_index_database_read = 12
     authorize_with :active
     get :contents, {
@@ -471,14 +473,8 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
           format: :json,
         }
     assert_response :success
+    assert_not_empty(json_response['items'])
     assert_operator(json_response['items'].count,
                     :<, json_response['items_available'])
-    collections = 0
-    json_response['items'].each do |item|
-      if item['kind'] == 'arvados#collection'
-        collections += 1
-      end
-    end
-    assert_equal 1, collections
   end
 end

commit 3f285d4c2555aa57e9b64c9890bbb494cdf46a0f
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon May 8 14:17:16 2017 -0400

    11629: Fix items_available in groups#contents response.

diff --git a/services/api/app/controllers/arvados/v1/groups_controller.rb b/services/api/app/controllers/arvados/v1/groups_controller.rb
index 7b0c0f0..3bf91c3 100644
--- a/services/api/app/controllers/arvados/v1/groups_controller.rb
+++ b/services/api/app/controllers/arvados/v1/groups_controller.rb
@@ -149,8 +149,9 @@ class Arvados::V1::GroupsController < ApplicationController
 
       if klass_object_list[:limit] < klass_limit
         # object_list() had to reduce @limit to comply with
-        # max_index_database_read. We have to stop now.
-        break
+        # max_index_database_read. From now on, we'll do all queries
+        # with limit=0 and just accumulate items_available.
+        limit_all = all_objects.count
       end
     end
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list