[ARVADOS] updated: f9def1f7abc8ad6720d9b88ec541b00a03ff1d0e

Git user git at public.curoverse.com
Fri Jun 3 10:36:44 EDT 2016


Summary of changes:
 .../app/controllers/application_controller.rb      | 12 ++++++
 .../views/projects/_compute_node_status.html.erb   | 17 +++++----
 .../app/views/projects/_show_dashboard.html.erb    |  2 +-
 .../test/integration/application_layout_test.rb    | 43 ++++++++++++++--------
 apps/workbench/test/unit/work_unit_test.rb         |  2 +-
 services/api/test/fixtures/containers.yml          | 16 ++++++++
 6 files changed, 66 insertions(+), 26 deletions(-)

       via  f9def1f7abc8ad6720d9b88ec541b00a03ff1d0e (commit)
      from  f9ac3734498a72657adf82004d012ebfae87f5cd (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 f9def1f7abc8ad6720d9b88ec541b00a03ff1d0e
Author: radhika <radhika at curoverse.com>
Date:   Fri Jun 3 10:36:14 2016 -0400

    9318: Compute node summary pane includes queued and locked containers.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 3e5afbd..63c75bc 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -867,6 +867,18 @@ class ApplicationController < ActionController::Base
     Hash[procs.sort_by {|key, value| value}].keys.reverse.first(lim)
   end
 
+  helper_method :queued_processes
+  def queued_processes
+    procs = {}
+    queued_jobs = Job.queue
+    queued_jobs.each { |j| procs[j] = j.priority }
+
+    queued_containers = Container.order(["priority desc", "created_at desc"]).filter([["state", "in", ["Queued", "Locked"]]])
+    queued_containers.results.each { |c| procs[c] = c.priority }
+
+    Hash[procs.sort_by {|key, value| value}].keys.reverse
+  end
+
   helper_method :recent_collections
   def recent_collections lim
     c = Collection.limit(lim).order(["modified_at desc"]).filter([["owner_uuid", "is_a", "arvados#group"]])
diff --git a/apps/workbench/app/views/projects/_compute_node_status.html.erb b/apps/workbench/app/views/projects/_compute_node_status.html.erb
index cd9243d..8fb0b14 100644
--- a/apps/workbench/app/views/projects/_compute_node_status.html.erb
+++ b/apps/workbench/app/views/projects/_compute_node_status.html.erb
@@ -1,26 +1,27 @@
 <h4>Queue</h4>
-<% queue = Job.queue %>
+<% queue = queued_processes %>
 <% if queue.any? %>
 
-<% queue.each do |j| %>
+<% queue.each do |p| %>
+  <% wu = p.work_unit %>
   <div class="row">
     <div class="col-md-3 text-overflow-ellipsis">
-      <%= link_to_if_arvados_object j, friendly_name: true %>
+      <%= link_to_if_arvados_object p, friendly_name: true %>
     </div>
     <div class="col-md-4">
-      <%= render_localized_date(j[:created_at]) %>
+      <%= render_localized_date(p.created_at) %>
     </div>
     <div class="col-md-3">
-      <%= render_runtime(Time.now - j[:created_at], false) %>
+      <%= render_runtime(Time.now - p.created_at, false) %>
     </div>
     <div class="col-md-2">
-      <%= j[:priority] %>
+      <%= p.priority %>
     </div>
   </div>
 <% end %>
   <div class="row">
     <div class="col-md-3">
-      <b>Job</b>
+      <b>Process</b>
     </div>
     <div class="col-md-4">
       <b>Submitted</b>
@@ -38,7 +39,7 @@
   <div>
   </div>
 <% else %>
-  There are currently no jobs in your queue.
+  There are currently no processes in your queue.
 <% end %>
 
 <h4>Node status</h4>
diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index ef43668..f813258 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -132,7 +132,7 @@
             <% end %>
           </span>
         </div>
-        <div class="panel-body">
+        <div class="panel-body compute-node-summary-pane">
           <div>
             <%= render partial: 'compute_node_summary', locals: {nodes: nodes} %>
             <div style="text-align: center">
diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index d00eb88..4685b0c 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -180,22 +180,6 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
         first('button', text: 'x').click
       end
       assert_text 'Active processes' # seeing dashboard now
-      if token == 'active'
-        within('.active-processes') do
-          assert_text 'zzzzz-dz642-runningcontainr'
-          assert_text 'zzzzz-dz642-runningcontain2'
-          assert_text 'zzzzz-d1hrv-partdonepipelin'
-          assert_no_text 'zzzzz-d1hrv-twodonepipeline'
-          assert_no_text 'zzzzz-xvhdp-cr4queuedcontnr'
-        end
-        within('.finished-processes') do
-          assert_text 'zzzzz-d1hrv-twodonepipeline'
-          assert_text 'zzzzz-dz642-compltcontainer'
-          assert_text 'zzzzz-dz642-compltcontainr2'
-          assert_no_text 'zzzzz-d1hrv-partdonepipelin'
-          assert_no_text 'zzzzz-dz642-runningcontainr'
-        end
-      end
     end
   end
 
@@ -257,4 +241,31 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
       assert_text look_for
     end
   end
+
+  test "dashboard panes" do
+    visit page_with_token('active')
+
+    assert_text 'Active processes' # seeing dashboard now
+    within('.active-processes') do
+      assert_text 'zzzzz-dz642-runningcontainr'
+      assert_text 'zzzzz-dz642-runningcontain2'
+      assert_text 'zzzzz-d1hrv-partdonepipelin'
+      assert_no_text 'zzzzz-d1hrv-twodonepipeline'
+      assert_no_text 'zzzzz-xvhdp-cr4queuedcontnr'
+    end
+    within('.finished-processes') do
+      assert_text 'zzzzz-d1hrv-twodonepipeline'
+      assert_text 'zzzzz-dz642-compltcontainer'
+      assert_text 'zzzzz-dz642-compltcontainr2'
+      assert_no_text 'zzzzz-d1hrv-partdonepipelin'
+      assert_no_text 'zzzzz-dz642-runningcontainr'
+    end
+
+    within('.compute-node-summary-pane') do
+      click_link 'Details'
+      assert_text 'zzzzz-dz642-lockedcontainer'
+      assert_text 'zzzzz-dz642-queuedcontainer'
+      assert_text '"foo" job submitted'
+    end
+  end
 end
diff --git a/apps/workbench/test/unit/work_unit_test.rb b/apps/workbench/test/unit/work_unit_test.rb
index 6d31b74..974002c 100644
--- a/apps/workbench/test/unit/work_unit_test.rb
+++ b/apps/workbench/test/unit/work_unit_test.rb
@@ -6,7 +6,7 @@ class WorkUnitTest < ActiveSupport::TestCase
     [PipelineInstance, 'pipeline_in_running_state', nil, 1, "Running", nil, 0.0],
     [PipelineInstance, 'has_component_with_completed_jobs', nil, 3, "Complete", true, 1.0],
     [PipelineInstance, 'pipeline_with_tagged_collection_input', "pwu", 1, "Ready", nil, 0.0],
-    [Container, 'requester', 'cwu', 3, "Complete", true, 1.0],
+    [Container, 'requester', 'cwu', 5, "Complete", true, 1.0],
   ].each do |type, name, label, num_children, state, success, progress|
     test "children of #{name}" do
       use_token 'admin'
diff --git a/services/api/test/fixtures/containers.yml b/services/api/test/fixtures/containers.yml
index 6fc3fd1..febd3df 100644
--- a/services/api/test/fixtures/containers.yml
+++ b/services/api/test/fixtures/containers.yml
@@ -48,6 +48,22 @@ running-older:
     ram: 12000000000
     vcpus: 4
 
+locked:
+  uuid: zzzzz-dz642-lockedcontainer
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  state: Locked
+  priority: 2
+  created_at: 2016-01-01 11:11:11.111111111 Z
+  updated_at: 2016-01-01 11:11:11.111111111 Z
+  container_image: test
+  cwd: test
+  output: test
+  output_path: test
+  command: ["echo", "hello"]
+  runtime_constraints:
+    ram: 12000000000
+    vcpus: 4
+
 completed:
   uuid: zzzzz-dz642-compltcontainer
   owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list