13773: Show 'Warning' label on jobs that have this runtime status and aren't failing.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Thu, 6 Sep 2018 14:51:40 +0000 (11:51 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Thu, 6 Sep 2018 14:51:40 +0000 (11:51 -0300)
* Show warning information panel on job detailed view
* Show tooltip with error/warning information on dashboard
* Fix test

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

apps/workbench/app/models/container_work_unit.rb
apps/workbench/app/views/projects/_show_dashboard.html.erb
apps/workbench/app/views/work_units/_show_component.html.erb
services/api/test/unit/container_test.rb

index 94b41617390bff090cfebee0870802d275cd9cf1..964295619af4bf3b738b565ff401007fb203a72b 100644 (file)
@@ -120,6 +120,8 @@ class ContainerWorkUnit < ProxyWorkUnit
     when 'Running'
       if runtime_status[:error]
         'Failing'
+      elsif runtime_status[:warning]
+        'Warning'
       else
         state
       end
@@ -137,6 +139,8 @@ class ContainerWorkUnit < ProxyWorkUnit
     case state_label
     when 'Failing'
       'danger'
+    when 'Warning'
+      'warning'
     else
       super
     end
index e51cf5314d275137260f214f2e0bbbc6852bd373..cc00e0a8eb1578d9c77b6fe50d773a17fdbc4c19 100644 (file)
@@ -88,8 +88,19 @@ SPDX-License-Identifier: AGPL-3.0 %>
             No recent pipelines or processes.
           <% else %>
           <% wus.each do |p, wu| %>
+            <%
+            # Set up tooltip containing useful runtime information
+            runtime_status_tooltip = nil
+            if wu.runtime_status
+              if wu.runtime_status[:error]
+                runtime_status_tooltip = "Error: #{wu.runtime_status[:error]}"
+              elsif wu.runtime_status[:warning]
+                runtime_status_tooltip = "Warning: #{wu.runtime_status[:warning]}"
+              end
+            end
+            %>
             <% if wu.is_finished? %>
-            <div class="dashboard-panel-info-row row-<%=wu.uuid%>">
+            <div class="dashboard-panel-info-row row-<%=wu.uuid%>" title="<%=runtime_status_tooltip%>">
               <div class="row">
                 <div class="col-md-6 text-overflow-ellipsis">
                   <%= link_to_if_arvados_object p, {friendly_name: true} %>
@@ -114,7 +125,7 @@ SPDX-License-Identifier: AGPL-3.0 %>
 
             </div>
             <% else %>
-            <div class="dashboard-panel-info-row row-<%=wu.uuid%>">
+            <div class="dashboard-panel-info-row row-<%=wu.uuid%>" title="<%=runtime_status_tooltip%>">
               <div class="row">
                 <div class="col-md-6 text-overflow-ellipsis">
                   <%= link_to_if_arvados_object p, {friendly_name: true} %>
index d853295767633b10c64d6449a023eacf98359d83..b635b0044df2a5d42e5d9b6141e894925fe3c145 100644 (file)
@@ -57,6 +57,18 @@ SPDX-License-Identifier: AGPL-3.0 %>
     </div>
   </div>
 </div>
+<%# Display runtime warning message %>
+<% elsif wu.runtime_status.andand[:warning] %>
+<div class="container">
+  <div class="col-md-12">
+    <div class="panel panel-warning">
+      <div class="panel-heading">Warning</div>
+      <div class="panel-body">
+        <%= wu.runtime_status[:warning] %>
+      </div>
+    </div>
+  </div>
+</div>
 <% end %>
 
 <p>
index 3d8bf841e851b8beb3a4b2be1585db8890edfed2..c0bf4059dd6a366d968097488105d36dfeec0519 100644 (file)
@@ -135,7 +135,7 @@ class ContainerTest < ActiveSupport::TestCase
     set_user_from_auth :active
     attrs = {
       environment: {},
-      mounts: {"BAR" => "FOO"},
+      mounts: {"BAR" => {"kind" => "FOO"}},
       output_path: "/tmp",
       priority: 1,
       runtime_constraints: {"vcpus" => 1, "ram" => 1}