[ARVADOS] updated: d68cb1845e82f44ecf126ae4fd1ba3abc00f4463

Git user git at public.curoverse.com
Fri Oct 7 14:35:46 EDT 2016


Summary of changes:
 .../app/controllers/application_controller.rb      |  7 ++--
 .../app/views/projects/_show_dashboard.html.erb    | 43 ++++++++++++++++++----
 apps/workbench/config/application.default.yml      |  6 +++
 .../test/integration/application_layout_test.rb    |  5 ++-
 apps/workbench/test/integration/work_units_test.rb |  6 ++-
 apps/workbench/test/unit/work_unit_test.rb         |  2 +-
 services/api/test/fixtures/container_requests.yml  | 20 ++++++++++
 7 files changed, 73 insertions(+), 16 deletions(-)

       via  d68cb1845e82f44ecf126ae4fd1ba3abc00f4463 (commit)
       via  e9bf0a8dec771a53818ee76026c8bcc93a4722da (commit)
       via  23b1c79162bd422f99e4d7a0e491d82da560d91f (commit)
       via  304273fabb09ff72e94481a610e84f78776f05e3 (commit)
       via  f4c5d28ce98099b2f4204b5875449d76609c6a1c (commit)
       via  2f86d9ac26cad9cd202ccfe9cf07c31ecbabcf7e (commit)
       via  4c8559157a16bf3d2781714fdec0275fb7f53ac6 (commit)
       via  38f17f1e09e1eb2af273148744ca193d2541d37e (commit)
       via  a4ef9968a1b59b99efac934076b8216f3b2f499a (commit)
      from  47e42f1129363c2565e69c36ff26ce9c42731fb8 (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 d68cb1845e82f44ecf126ae4fd1ba3abc00f4463
Merge: 47e42f1 e9bf0a8
Author: radhika <radhika at curoverse.com>
Date:   Fri Oct 7 14:34:46 2016 -0400

    refs #10078
    Merge branch '10078-dashboard-perf'


commit e9bf0a8dec771a53818ee76026c8bcc93a4722da
Author: radhika <radhika at curoverse.com>
Date:   Fri Oct 7 13:40:34 2016 -0400

    10078: Since we are not fetching components for pipeline instances (at least until the performance issues are resolved),
    we will no longer see the running and queued jobs listed within each pipeline instance row in dashboard. Hence, update
    test to look for these for a container request row instead of for a pipeline instance row.

diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index b0a842e..c4eb941 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -257,8 +257,9 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
 
       within('.recent-processes') do
         assert_text 'pipeline_with_job'
-        within('.row-zzzzz-d1hrv-1yfj6xkidf2muk3') do
-          assert_text 'foo'
+
+        within('.row-zzzzz-xvhdp-cr4runningcntnr') do
+          assert_text 'requester_for_running_cr'
         end
 
         assert_text 'zzzzz-d1hrv-twodonepipeline'
diff --git a/apps/workbench/test/integration/work_units_test.rb b/apps/workbench/test/integration/work_units_test.rb
index eded53e..b1d5a21 100644
--- a/apps/workbench/test/integration/work_units_test.rb
+++ b/apps/workbench/test/integration/work_units_test.rb
@@ -74,12 +74,14 @@ class WorkUnitsTest < ActionDispatch::IntegrationTest
       visit page_with_token "active", "/#{type}/#{obj['uuid']}"
 
       assert_text 'created_at'
+
       if cancelable
+        assert_text 'priority: 1' if type.include?('container')
         assert_selector 'button', text: 'Cancel'
-        click_button 'Cancel'
+        first('a,button', text: 'Cancel').click
         wait_for_ajax
       end
-      assert_no_selector 'button', text: 'Cancel'
+      assert_text 'priority: 0' if cancelable and type.include?('container')
     end
   end
 
diff --git a/apps/workbench/test/unit/work_unit_test.rb b/apps/workbench/test/unit/work_unit_test.rb
index 550f218..e59d30d 100644
--- a/apps/workbench/test/unit/work_unit_test.rb
+++ b/apps/workbench/test/unit/work_unit_test.rb
@@ -15,7 +15,7 @@ class WorkUnitTest < ActiveSupport::TestCase
     [ContainerRequest, 'queued', 'cwu', 0, "Queued", nil, 0.0],   # priority 1
     [ContainerRequest, 'canceled_with_queued_container', 'cwu', 0, "Ready", nil, 0.0],
     [ContainerRequest, 'canceled_with_locked_container', 'cwu', 0, "Ready", nil, 0.0],
-    [ContainerRequest, 'canceled_with_running_container', 'cwu', 0, "Running", nil, 0.0],
+    [ContainerRequest, 'canceled_with_running_container', 'cwu', 1, "Running", nil, 0.0],
   ].each do |type, fixture, label, num_children, state, success, progress|
     test "children of #{fixture}" do
       use_token 'active'
diff --git a/services/api/test/fixtures/container_requests.yml b/services/api/test/fixtures/container_requests.yml
index 1daccda..acacf40 100644
--- a/services/api/test/fixtures/container_requests.yml
+++ b/services/api/test/fixtures/container_requests.yml
@@ -36,6 +36,26 @@ running:
     vcpus: 1
     ram: 123
 
+requester_for_running:
+  uuid: zzzzz-xvhdp-req4runningcntr
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: requester_for_running_cr
+  state: Committed
+  priority: 1
+  created_at: <%= 2.minute.ago.to_s(:db) %>
+  updated_at: <%= 2.minute.ago.to_s(:db) %>
+  modified_at: <%= 2.minute.ago.to_s(:db) %>
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  container_image: test
+  cwd: test
+  output_path: test
+  command: ["echo", "hello"]
+  container_uuid: zzzzz-dz642-logscontainer03
+  requesting_container_uuid: zzzzz-dz642-runningcontainr
+  runtime_constraints:
+    vcpus: 1
+    ram: 123
+
 running_older:
   uuid: zzzzz-xvhdp-cr4runningcntn2
   owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz

commit 23b1c79162bd422f99e4d7a0e491d82da560d91f
Author: radhika <radhika at curoverse.com>
Date:   Fri Oct 7 10:19:48 2016 -0400

    10078: When fetching recent_processes, do not select 'components' which is not needed in this context. For very large pipelines, this will perform better.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index c6148ca..5b3f3f5 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -855,7 +855,8 @@ class ApplicationController < ActionController::Base
   def recent_processes lim
     lim = 12 if lim.nil?
 
-    pipelines = PipelineInstance.limit(lim).order(["created_at desc"])
+    cols = %w(uuid owner_uuid created_at modified_at pipeline_template_uuid name state started_at finished_at)
+    pipelines = PipelineInstance.select(cols).limit(lim).order(["created_at desc"])
 
     crs = ContainerRequest.limit(lim).order(["created_at desc"]).filter([["requesting_container_uuid", "=", nil]])
     procs = {}

commit 304273fabb09ff72e94481a610e84f78776f05e3
Author: radhika <radhika at curoverse.com>
Date:   Mon Oct 3 18:58:59 2016 -0400

    10078: Now that the recent_collections panel includes collections from Home directory as well
    (self and other users' for admin user), suppress displaying confusing '(none)' in place of a Home directory.

diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index c830b59..873d4f3 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -176,7 +176,9 @@
           <% recent_cs[:collections].each do |p| %>
             <div class="dashboard-panel-info-row">
               <div>
+                <% if recent_cs[:owners][p[:owner_uuid]].is_a?(Group) %>
                 <i class="fa fa-fw fa-folder-o"></i><%= link_to_if_arvados_object recent_cs[:owners][p[:owner_uuid]], friendly_name: true %>/
+                <% end %>
                 <span class="pull-right"><%= render_localized_date(p[:modified_at], "noseconds") %></span>
               </div>
               <div class="text-overflow-ellipsis" style="margin-left: 1em; width: 100%"><%= link_to_if_arvados_object p, {friendly_name: true, no_tags: true} %>

commit f4c5d28ce98099b2f4204b5875449d76609c6a1c
Author: radhika <radhika at curoverse.com>
Date:   Mon Oct 3 17:07:43 2016 -0400

    10078: add configuration parameter to suppress display of user notifications to improve dashboard performance

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 3886d1c..c6148ca 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -769,7 +769,7 @@ class ApplicationController < ActionController::Base
 
   helper_method :user_notifications
   def user_notifications
-    return [] if @errors or not current_user.andand.is_active
+    return [] if @errors or not current_user.andand.is_active or not Rails.configuration.show_user_notifications_in_dashboard
     @notifications ||= @@notification_tests.map do |t|
       t.call(self, current_user)
     end.compact
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index 6326285..95b1784 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -282,6 +282,7 @@ common:
   running_job_log_records_to_fetch: 2000
 
   # In systems with many shared projects, dashboard loading can be
-  # slow due to collections indexing; the recent collections panel
-  # can be hidden by setting this configuration parameter to false
+  # slow due to collections indexing; use the following parameters
+  # to suppress certain properties from dashboard
   show_recent_collections_in_dashboard: true
+  show_user_notifications_in_dashboard: true

commit 2f86d9ac26cad9cd202ccfe9cf07c31ecbabcf7e
Author: radhika <radhika at curoverse.com>
Date:   Mon Oct 3 14:29:00 2016 -0400

    10078: config parameter to hide / show recent_collections panel in dashboard.

diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index c1e3b6e..c830b59 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -1,5 +1,5 @@
 <%
-  recent_procs = recent_processes(10)
+  recent_procs = recent_processes(12)
 
   wus = {}
   outputs = []
@@ -13,7 +13,7 @@
   collection_pdhs = outputs.select {|x| !(m = CollectionsHelper.match(x)).nil?}.uniq.compact
   collection_uuids = outputs - collection_pdhs
 
-  if !Rails.configuration.suppress_collections_in_dashboard
+  if Rails.configuration.show_recent_collections_in_dashboard
     recent_cs = recent_collections(8)
     collection_uuids = collection_uuids + recent_cs[:collections].collect {|c| c.uuid}
     collection_uuids.flatten.uniq
@@ -163,7 +163,7 @@
           </div>
         </div>
       </div>
-      <% if !Rails.configuration.suppress_collections_in_dashboard %>
+      <% if Rails.configuration.show_recent_collections_in_dashboard %>
       <div class="panel panel-default">
         <div class="panel-heading"><span class="panel-title">Recent collections</span>
           <span class="pull-right">
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index 5e5f4e9..6326285 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -281,6 +281,7 @@ common:
   # and display in the Log tab, while subscribing to web sockets.
   running_job_log_records_to_fetch: 2000
 
-  # In systems with many shared projects, dashboard loading can be slow
-  # due to collections indexing; hide the recent collections panel
-  suppress_collections_in_dashboard: false
+  # In systems with many shared projects, dashboard loading can be
+  # slow due to collections indexing; the recent collections panel
+  # can be hidden by setting this configuration parameter to false
+  show_recent_collections_in_dashboard: true

commit 4c8559157a16bf3d2781714fdec0275fb7f53ac6
Author: radhika <radhika at curoverse.com>
Date:   Fri Sep 30 22:54:09 2016 -0400

    10078: preload collections and links during dashboard display

diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index 806ed8a..c1e3b6e 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -1,3 +1,29 @@
+<%
+  recent_procs = recent_processes(10)
+
+  wus = {}
+  outputs = []
+  recent_procs.each do |p|
+    wu = p.work_unit
+    wus[p] = wu
+    outputs << wu.outputs
+  end
+  outputs = outputs.flatten.uniq
+
+  collection_pdhs = outputs.select {|x| !(m = CollectionsHelper.match(x)).nil?}.uniq.compact
+  collection_uuids = outputs - collection_pdhs
+
+  if !Rails.configuration.suppress_collections_in_dashboard
+    recent_cs = recent_collections(8)
+    collection_uuids = collection_uuids + recent_cs[:collections].collect {|c| c.uuid}
+    collection_uuids.flatten.uniq
+  end
+
+  preload_collections_for_objects collection_uuids if collection_uuids.any?
+  preload_for_pdhs collection_pdhs if collection_pdhs.any?
+  preload_links_for_objects(collection_pdhs + collection_uuids)
+%>
+
   <div class="row">
     <div class="col-md-6">
       <div class="panel panel-default" style="min-height: 10.5em">
@@ -26,13 +52,11 @@
           <% end %>
         </div>
 
-        <% _recent_processes = recent_processes(12) %>
         <div class="panel-body recent-processes">
-          <% if _recent_processes.empty? %>
+          <% if recent_procs.empty? %>
             No recent pipelines or processes.
           <% else %>
-          <% _recent_processes.each do |p| %>
-            <% wu = p.work_unit %>
+          <% wus.each do |p, wu| %>
             <% if wu.is_finished? %>
             <div class="dashboard-panel-info-row row-<%=wu.uuid%>">
               <div class="row">
@@ -139,6 +163,7 @@
           </div>
         </div>
       </div>
+      <% if !Rails.configuration.suppress_collections_in_dashboard %>
       <div class="panel panel-default">
         <div class="panel-heading"><span class="panel-title">Recent collections</span>
           <span class="pull-right">
@@ -148,11 +173,10 @@
           </span>
         </div>
         <div class="panel-body">
-          <% r = recent_collections(8) %>
-          <% r[:collections].each do |p| %>
+          <% recent_cs[:collections].each do |p| %>
             <div class="dashboard-panel-info-row">
               <div>
-                <i class="fa fa-fw fa-folder-o"></i><%= link_to_if_arvados_object r[:owners][p[:owner_uuid]], friendly_name: true %>/
+                <i class="fa fa-fw fa-folder-o"></i><%= link_to_if_arvados_object recent_cs[:owners][p[:owner_uuid]], friendly_name: true %>/
                 <span class="pull-right"><%= render_localized_date(p[:modified_at], "noseconds") %></span>
               </div>
               <div class="text-overflow-ellipsis" style="margin-left: 1em; width: 100%"><%= link_to_if_arvados_object p, {friendly_name: true, no_tags: true} %>
@@ -161,5 +185,6 @@
           <% end %>
         </div>
       </div>
+      <% end %>
     </div>
   </div>
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index 74d317b..5e5f4e9 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -280,3 +280,7 @@ common:
   # Maximum number of historic log records of a running job to fetch
   # and display in the Log tab, while subscribing to web sockets.
   running_job_log_records_to_fetch: 2000
+
+  # In systems with many shared projects, dashboard loading can be slow
+  # due to collections indexing; hide the recent collections panel
+  suppress_collections_in_dashboard: false

commit 38f17f1e09e1eb2af273148744ca193d2541d37e
Author: radhika <radhika at curoverse.com>
Date:   Fri Sep 30 10:40:41 2016 -0400

    10078: Update recent_collections so that the collection query it is not executed twice, once in this method and once in show_dashboard for r[:collections].each statement.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 0da5956..3886d1c 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -867,7 +867,7 @@ class ApplicationController < ActionController::Base
 
   helper_method :recent_collections
   def recent_collections lim
-    c = Collection.limit(lim).order(["modified_at desc"]).filter([["owner_uuid", "is_a", "arvados#group"]])
+    c = Collection.limit(lim).order(["modified_at desc"]).results
     own = {}
     Group.filter([["uuid", "in", c.map(&:owner_uuid)]]).each do |g|
       own[g[:uuid]] = g

commit a4ef9968a1b59b99efac934076b8216f3b2f499a
Author: radhika <radhika at curoverse.com>
Date:   Fri Sep 30 10:36:07 2016 -0400

    10078: Update the Node.filter so that this query is not executed three times: once for nodes.sort_by and twice in compute_node_summary for nodes.select

diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index c02577f..806ed8a 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -106,7 +106,7 @@
     </div>
 
     <div class="col-md-6">
-      <% nodes = Node.filter([["last_ping_at", ">", Time.now - 3600]]) %>
+      <% nodes = Node.filter([["last_ping_at", ">", Time.now - 3600]]).results %>
       <div class="panel panel-default" style="min-height: 10.5em">
         <div class="panel-heading"><span class="panel-title">Compute node status</span>
           <span class="pull-right compute-node-actions">

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list