[ARVADOS] updated: 240ab2c50a01531df162850be255a4c4e1084fc2
git at public.curoverse.com
git at public.curoverse.com
Tue Sep 23 10:38:14 EDT 2014
Summary of changes:
apps/workbench/app/helpers/application_helper.rb | 4 ++
apps/workbench/app/models/job.rb | 4 ++
.../collections/_show_source_summary.html.erb | 3 +-
.../workbench/app/views/jobs/_show_status.html.erb | 2 +-
.../pipeline_instances/_running_component.html.erb | 2 +-
.../_show_components_running.html.erb | 4 +-
.../views/projects/_compute_node_status.html.erb | 45 +++++++++++++++++++++-
.../app/views/projects/_show_dashboard.html.erb | 21 +++++-----
8 files changed, 67 insertions(+), 18 deletions(-)
via 240ab2c50a01531df162850be255a4c4e1084fc2 (commit)
from d23d4ce9e4c52605cb23286b9e9b46a808f7437d (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 240ab2c50a01531df162850be255a4c4e1084fc2
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue Sep 23 10:38:07 2014 -0400
3605: Filter out nodes that have a last ping time of more than 1 hour. Add
queue to compute status panel. Refactor utc-date spans to
render_localized_date().
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index b82ae89..624cb3d 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -470,6 +470,10 @@ module ApplicationHelper
end
end
+ def render_localized_date(date, opts="")
+ raw("<span class='utc-date' data-utc-date='#{date}' data-utc-date-opts='noseconds'>#{date}</span>")
+ end
+
private
def is_textile?( object, attr )
is_textile = object.textile_attributes.andand.include?(attr)
diff --git a/apps/workbench/app/models/job.rb b/apps/workbench/app/models/job.rb
index a0247ef..d3d38b0 100644
--- a/apps/workbench/app/models/job.rb
+++ b/apps/workbench/app/models/job.rb
@@ -42,6 +42,10 @@ class Job < ArvadosBase
arvados_api_client.api("jobs/", "queue_size", {"_method"=> "GET"})[:queue_size] rescue 0
end
+ def self.queue
+ arvados_api_client.unpack_api_response arvados_api_client.api("jobs/", "queue", {"_method"=> "GET"})
+ end
+
def self.state job
if job.respond_to? :state and job.state
return job.state
diff --git a/apps/workbench/app/views/collections/_show_source_summary.html.erb b/apps/workbench/app/views/collections/_show_source_summary.html.erb
index 51f9348..592e802 100644
--- a/apps/workbench/app/views/collections/_show_source_summary.html.erb
+++ b/apps/workbench/app/views/collections/_show_source_summary.html.erb
@@ -9,8 +9,7 @@
<% if c[:output_uuid] == @object.uuid %>
<b><%= cname %></b> component of <b><%= link_to_if_arvados_object(pipeline, friendly_name: true) %></b>
<% if c.andand[:job].andand[:finished_at] %>
- finished at <span class="utc-date"
- data-utc-date="<%= c[:job][:finished_at] %>"><%= c[:job][:finished_at] %></span>
+ finished at <%= render_localized_date(c[:job][:finished_at]) %>
<% end %>
<br>
<% end %>
diff --git a/apps/workbench/app/views/jobs/_show_status.html.erb b/apps/workbench/app/views/jobs/_show_status.html.erb
index 8956ad9..abd1a4f 100644
--- a/apps/workbench/app/views/jobs/_show_status.html.erb
+++ b/apps/workbench/app/views/jobs/_show_status.html.erb
@@ -16,7 +16,7 @@
<% if v[:job] and v[:job][:uuid] == @object.uuid %>
<div>
<b><%= k %></b> component of <%= link_to_if_arvados_object pipeline, friendly_name: true %>
- created at <span data-utc-date="<%= pipeline.created_at %>"><%= pipeline.created_at %></span>.
+ created at <%= render_localized_date(pipeline.created_at) %>.
</div>
<% end %>
<% end %>
diff --git a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
index 0841ed7..5eed855 100644
--- a/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
@@ -139,7 +139,7 @@
<% elsif k.to_s.end_with? 'uuid' %>
<%= link_to_if_arvados_object current_component[k], friendly_name: true %>
<% elsif k.to_s.end_with? '_at' %>
- <span data-utc-date="<%= current_component[k] %>"><%= current_component[k] %></span>
+ <%= render_localized_date(current_component[k]) %>
<% else %>
<%= current_component[k] %>
<% end %>
diff --git a/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb b/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb
index 9140780..c3c6d0a 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb
@@ -12,7 +12,7 @@
<p>
<% if @object.started_at %>
- This pipeline started at <span data-utc-date="<%= @object.started_at %>"><%= @object.started_at %></span>.
+ This pipeline started at <%= render_localized_date(@object.started_at) %>.
It
<% if @object.state == 'Complete' %>
completed in
@@ -32,7 +32,7 @@
render_runtime(walltime, true)
else
render_runtime(runningtime, true)
- end %><% if @object.finished_at %> at <span data-utc-date="<%= @object.finished_at %>"><%= @object.finished_at %></span><% end %>.
+ end %><% if @object.finished_at %> at <%= render_localized_date(@object.finished_at) %><% end %>.
<% else %>
This pipeline is <%= if @object.state.start_with? 'Running' then 'active' else @object.state.downcase end %>.
<% walltime = 0%>
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 528d0ea..693a8ae 100644
--- a/apps/workbench/app/views/projects/_compute_node_status.html.erb
+++ b/apps/workbench/app/views/projects/_compute_node_status.html.erb
@@ -1,7 +1,50 @@
+<h4>Queue</h4>
+<% queue = Job.queue %>
+<% if queue.any? %>
+<% queue.each do |j| %>
+ <div class="row">
+ <div class="col-md-4">
+ <%= link_to_if_arvados_object j, friendly_name: true %>
+ </div>
+ <div class="col-md-3">
+ <%= render_localized_date(j[:created_at]) %>
+ </div>
+ <div class="col-md-3">
+ <%= render_runtime(Time.now - j[:created_at], false) %>
+ </div>
+ <div class="col-md-2">
+ <%= j[:priority] %>
+ </div>
+ </div>
+<% end %>
+ <div class="row">
+ <div class="col-md-4">
+ <b>Job</b>
+ </div>
+ <div class="col-md-3">
+ <b>Submitted</b>
+ </div>
+ <div class="col-md-3">
+ <b>Queued</b>
+ </div>
+ <div class="col-md-2">
+ <b>Priority</b>
+ </div>
+ </div>
+ <% if Job.queue_size > queue.size %>
+ <i>Note: some items in the queue are not visible to you.</i>
+ <% end %>
+ <div>
+ </div>
+<% else %>
+ There are currently no job is the queue.
+<% end %>
+
+<h4>Node status</h4>
<div class="compute-summary-nodelist">
<% nodes.sort_by { |n| n.hostname || "" }.each do |n| %>
- <% if n.crunch_worker_state.in? ["busy", "idle"] %>
+ <% if n.crunch_worker_state.in? ["busy", "idle"] and (Time.now - n[:last_ping_at]) < 3600 %>
<div class="compute-summary">
<a data-toggle="collapse" href="#detail_<%= n.hostname %>" class="compute-summary-head label label-<%= if n.crunch_worker_state == 'busy' then 'primary' else 'default' end %>">
<%= n.hostname %>
diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index 3ad2c18..c8f768b 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -1,7 +1,7 @@
<div class="row">
<div class="col-md-6">
- <div class="panel panel-default">
+ <div class="panel panel-default" style="min-height: 10em">
<div class="panel-heading"><span class="panel-title">Active pipelines</span>
<span class="pull-right">
<%= link_to(
@@ -67,8 +67,7 @@
</div>
<div class="clearfix">
- Started at <span class="utc-date" data-utc-date="<%= p[:started_at] || p[:created_at] %>"
- data-utc-date-opts="noseconds"><%= p[:created_at] %></span>.
+ Started at <%= render_localized_date(p[:started_at] || p[:created_at], "noseconds") %>.
<% pipeline_time = Time.now - (p[:started_at] || p[:created_at]) %>
Active for <%= render_runtime(pipeline_time, false) %>.
@@ -99,8 +98,7 @@
<%= render partial: "pipeline_status_label", locals: {p: p}%>
</div>
<div class="col-md-4">
- <span class="utc-date" data-utc-date="<%= p[:finished_at] || p[:modified_at] %>"
- data-utc-date-opts="noseconds"><%= p[:modified_at] %></span>
+ <%= render_localized_date(p[:finished_at] || p[:modified_at], "noseconds") %>
</div>
</div>
<div class="row">
@@ -144,12 +142,15 @@
</div>
<div class="col-md-6">
- <% nodes = Node.all %>
- <div class="panel panel-default">
- <div class="panel-heading"><span class="panel-title"><a data-toggle="collapse" href="#compute_node_status">Compute node status <span class="caret"></span></a></span></div>
+ <% nodes = Node.all.select { |n| (Time.now - n[:last_ping_at]) < 3600 } %>
+ <div class="panel panel-default" style="min-height: 10em">
+ <div class="panel-heading"><span class="panel-title">Compute status</span></div>
<div class="panel-body">
<div>
<%= render partial: 'compute_node_summary', locals: {nodes: nodes} %>
+ <div style="text-align: center">
+ <a data-toggle="collapse" href="#compute_node_status">Details <span class="caret"></span></a>
+ </div>
</div>
<div id="compute_node_status" class="collapse">
<%= render partial: 'compute_node_status', locals: {nodes: nodes} %>
@@ -164,9 +165,7 @@
<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 %>/
- <span class="pull-right"><span class="utc-date"
- data-utc-date="<%= p[:modified_at] %>"
- data-utc-date-opts="noseconds"><%= p[:modified_at]%></span></span>
+ <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 %>
</div>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list