[ARVADOS] updated: 80ec2c7fe823b84ba5b3533f3c43d1bf3c627f70

git at public.curoverse.com git at public.curoverse.com
Mon Sep 22 16:09:14 EDT 2014


Summary of changes:
 .../{show.html.erb => _default_show.html.erb}      |   2 -
 apps/workbench/app/views/application/show.html.erb |  71 +-------
 .../workbench/app/views/jobs/_show_status.html.erb | 108 +++----------
 apps/workbench/app/views/jobs/show.html.erb        |  32 ++++
 ...unning.html.erb => _running_component.html.erb} |  74 +--------
 .../_show_components_running.html.erb              | 178 +--------------------
 6 files changed, 56 insertions(+), 409 deletions(-)
 copy apps/workbench/app/views/application/{show.html.erb => _default_show.html.erb} (95%)
 create mode 100644 apps/workbench/app/views/jobs/show.html.erb
 copy apps/workbench/app/views/pipeline_instances/{_show_components_running.html.erb => _running_component.html.erb} (74%)

       via  80ec2c7fe823b84ba5b3533f3c43d1bf3c627f70 (commit)
      from  aecc7109edd37aee2388c06a36d5c8ba853b3267 (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 80ec2c7fe823b84ba5b3533f3c43d1bf3c627f70
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Sep 22 16:09:08 2014 -0400

    3605: Render individual job status using the same partial as the pipeline
    instance page.  Also list pipelines that reference this job.

diff --git a/apps/workbench/app/views/application/show.html.erb b/apps/workbench/app/views/application/_default_show.html.erb
similarity index 95%
copy from apps/workbench/app/views/application/show.html.erb
copy to apps/workbench/app/views/application/_default_show.html.erb
index e0e1b8f..6557442 100644
--- a/apps/workbench/app/views/application/show.html.erb
+++ b/apps/workbench/app/views/application/_default_show.html.erb
@@ -67,5 +67,3 @@
 <% end %>
 
 <% end %>
-
-<%= render partial: 'content', layout: 'content_layout', locals: {pane_list: controller.show_pane_list }%>
diff --git a/apps/workbench/app/views/application/show.html.erb b/apps/workbench/app/views/application/show.html.erb
index e0e1b8f..86e212e 100644
--- a/apps/workbench/app/views/application/show.html.erb
+++ b/apps/workbench/app/views/application/show.html.erb
@@ -1,71 +1,2 @@
-<% content_for :page_title do %>
-  <%= (@object.respond_to?(:properties) and !@object.properties.nil? ? @object.properties[:page_title] : nil) ||
-      @name_link.andand.name ||
-      @object.friendly_link_name %>
-<% end %>
-
-<% content_for :content_top do %>
-  <% if !['Group','User', 'Collection'].include? @object.class.to_s # projects and collections handle it themselves %>
-    <%= render partial: 'name_and_description' %>
-  <% end %>
-
-<% if @object.class.goes_in_projects? && @object.uuid != current_user.uuid # Not the "Home" project %>
-  <% content_for :tab_line_buttons do %>
-    <% if @object.class.copies_to_projects? %>
-      <%= link_to(
-          choose_projects_path(
-           title: 'Copy to project...',
-           action_name: 'Copy',
-           action_href: actions_path,
-           action_method: 'post',
-           action_data: {
-             copy_selections_into_project: true,
-             selection: @name_link.andand.uuid || @object.uuid,
-             selection_param: 'uuid',
-             success: 'redirect-to-created-object'
-           }.to_json),
-          { class: "btn btn-sm btn-primary", remote: true, method: 'get' }) do %>
-        <i class="fa fa-fw fa-copy"></i> Copy to project...
-      <% end %>
-    <% end %>
-    <% if @object.owner_uuid == current_user.uuid or (Group.find(@object.owner_uuid).writable_by.include?(current_user.uuid) rescue nil) %>
-      <%= link_to(
-          choose_projects_path(
-           title: 'Move to project...',
-           action_name: 'Move',
-           action_href: actions_path,
-           action_method: 'post',
-           action_data: {
-             move_selections_into_project: true,
-             selection: @name_link.andand.uuid || @object.uuid,
-             selection_param: 'uuid',
-             success: 'redirect-to-created-object'
-           }.to_json),
-          { class: "btn btn-sm btn-primary", remote: true, method: 'get' }) do %>
-        <i class="fa fa-fw fa-truck"></i> Move to project...
-      <% end %>
-    <% end %>
-  <% end %>
-<% end %>
-
-<% if @object.respond_to? :properties and !@object.properties.nil? %>
-  <% if @object.properties[:page_content] %>
-    <% content_for :page_content do %>
-      <h1>
-        <%= render_markup(@object.properties[:page_title] || @object.uuid) %>
-      </h1>
-
-      <% if @object.properties[:page_subtitle] %>
-        <h4>
-          <%= render_markup @object.properties[:page_subtitle] %>
-        </h4>
-      <% end %>
-
-      <%= render_markup @object.properties[:page_content] %>
-    <% end %>
-  <% end %>
-<% end %>
-
-<% end %>
-
+<%= render partial: 'default_show' %>
 <%= render partial: 'content', layout: 'content_layout', locals: {pane_list: controller.show_pane_list }%>
diff --git a/apps/workbench/app/views/jobs/_show_status.html.erb b/apps/workbench/app/views/jobs/_show_status.html.erb
index ede168d..8956ad9 100644
--- a/apps/workbench/app/views/jobs/_show_status.html.erb
+++ b/apps/workbench/app/views/jobs/_show_status.html.erb
@@ -1,93 +1,25 @@
+<% pj = {} %>
+<% pj[:job] = @object %>
+<% pj[:name] = @object[:name] || "this job" %>
+<% tasks = JobTask.filter([['job_uuid', '=', @object.uuid]]).results %>
+<%= render partial: 'pipeline_instances/running_component', locals: {tasks: tasks, pj: pj, i: 0, expanded: true} %>
 
-<div class="pull-right">
-  <% if @object.running %>
-    <%= form_tag "/jobs/#{@object.uuid}/cancel", style: "display:inline; padding-left: 1em" do |f| %>
-      <%= button_tag "Cancel running job", {class: 'btn btn-danger', id: "cancel-job-button"} %>
-    <% end %>
-  <% else %>
-    Re-run job using script version:
-    <%= form_tag '/jobs', style: "display:inline; padding-left: 1em" do |f| %>
-      <% [:script, :script_version, :repository, :supplied_script_version, :nondeterministic].each do |d| %>
-        <%= hidden_field :job, d, :value => @object[d] %>
-      <% end %>
-      <% [:script_parameters, :runtime_constraints].each do |d| %>
-        <%= hidden_field :job, d, :value => JSON.dump(@object[d]) %>
-      <% end %>
-      <%= button_tag "Same as this run", {class: 'btn btn-primary', id: "re-run-same-job-button"} %>
-    <% end %>
-  <% if @object.respond_to? :supplied_script_version and !@object.supplied_script_version.nil? and !@object.supplied_script_version.empty? and @object.script_version != @object.supplied_script_version%>
-      <%= form_tag '/jobs', style: "display:inline" do |f| %>
-      <% [:script, :repository, :supplied_script_version, :nondeterministic].each do |d| %>
-        <%= hidden_field :job, d, :value => @object[d] %>
-      <% end %>
-      <%= hidden_field :job, :script_version, :value => @object[:supplied_script_version] %>
-      <% [:script_parameters, :runtime_constraints].each do |d| %>
-        <%= hidden_field :job, d, :value => JSON.dump(@object[d]) %>
-      <% end %>
-      <%= button_tag "Latest (#{@object.repository}/#{@object.supplied_script_version})", {class: 'btn btn-primary', id: "re-run-latest-job-button"} %>
+  <div class="panel panel-default">
+    <div class="panel-heading">
+      <span class="panel-title">Used in pipelines</span>
+    </div>
+    <div class="panel-body">
+<% pi = PipelineInstance.order("created_at desc").filter([["components", "like", "%#{@object.uuid}%"]]) %>
+
+<% pi.each do |pipeline| %>
+  <% pipeline.components.each do |k, v| %>
+    <% 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>.
+      </div>
     <% end %>
   <% end %>
 <% end %>
 </div>
-
-<table class="table pipeline-components-table">
-  <colgroup>
-    <col style="width: 20%" />
-    <col style="width: 24%" />
-    <col style="width: 12%" />
-    <col style="width: 45%" />
-  </colgroup>
-  <thead>
-    <tr><th>
-        script, version
-      </th><th>
-        progress
-        <%# format:'js' here helps browsers avoid using the cached js
-            content in html context (e.g., duplicate tab -> see
-                                     javascript) %>
-        <%= link_to '(refresh)', {format: :js}, {class: 'refresh hide', remote: true, method: 'get'} %>
-      </th>
-      <th></th>
-      <th>
-        output
-      </th>
-    </tr>
-  </thead>
-  <tbody>
-    <tr>
-      <td>
-        <%= @object[:script] %><br>
-        <span class="deemphasize"><%= @object[:script_version] %></span>
-      </td>
-      <td>
-        <%= render partial: 'job_progress', locals: {:j => @object} %>
-        <% if @object.running == false %>
-          <% if @object[:job].andand[:uuid] %>
-            <span class="deemphasize">
-              <%= link_to("..."+ at object[:job][:uuid].last(15), job_url(id: @object[:job][:uuid])) %>
-            </span>
-
-            <% current_job = @object %>
-            <% if current_job.andand[:log] %>
-              <% fixup = /([a-f0-9]{32}\+\d+)(\+?.*)/.match(current_job[:log])%>
-              <% Collection.limit(1).where(uuid: fixup[1]).each do |c| %>
-                <% c.files.each do |file| %>
-                  <br/><span class="deemphasize">
-                    <a href="<%= collection_path(current_job[:log]) %>/<%= file[1] %>?disposition=inline&size=<%= file[2] %>">log</a>
-                  </span>
-                <% end %>
-              <% end %>
-            <% end %>
-          <% end %>
-        <% end %>
-      </td><td>
-        <%= render(partial: 'job_status_label',
-                   locals: { :j => @object }) %>
-      </td><td>
-        <%= link_to_if_arvados_object @object[:output], {:thumbnail => true} %>
-      </td>
-    </tr>
-    <tfoot>
-      <tr><td colspan="5"></td></tr>
-    </tfoot>
-</table>
+</div>
diff --git a/apps/workbench/app/views/jobs/show.html.erb b/apps/workbench/app/views/jobs/show.html.erb
new file mode 100644
index 0000000..d72fa3f
--- /dev/null
+++ b/apps/workbench/app/views/jobs/show.html.erb
@@ -0,0 +1,32 @@
+<% content_for :tab_line_buttons do %>
+    <% if @object.running %>
+    <%= form_tag "/jobs/#{@object.uuid}/cancel", style: "display:inline; padding-left: 1em" do |f| %>
+      <%= button_tag "Cancel running job", {class: 'btn btn-sm btn-danger', id: "cancel-job-button"} %>
+    <% end %>
+  <% else %>
+    <%= form_tag '/jobs', style: "display:inline; padding-left: 1em" do |f| %>
+      <% [:script, :script_version, :repository, :supplied_script_version, :nondeterministic].each do |d| %>
+        <%= hidden_field :job, d, :value => @object[d] %>
+      <% end %>
+      <% [:script_parameters, :runtime_constraints].each do |d| %>
+        <%= hidden_field :job, d, :value => JSON.dump(@object[d]) %>
+      <% end %>
+      <%= button_tag "Re-run same version", {class: 'btn btn-sm btn-primary', id: "re-run-same-job-button"} %>
+    <% end %>
+  <% if @object.respond_to? :supplied_script_version and !@object.supplied_script_version.nil? and !@object.supplied_script_version.empty? and @object.script_version != @object.supplied_script_version%>
+      <%= form_tag '/jobs', style: "display:inline" do |f| %>
+      <% [:script, :repository, :supplied_script_version, :nondeterministic].each do |d| %>
+        <%= hidden_field :job, d, :value => @object[d] %>
+      <% end %>
+      <%= hidden_field :job, :script_version, :value => @object[:supplied_script_version] %>
+      <% [:script_parameters, :runtime_constraints].each do |d| %>
+        <%= hidden_field :job, d, :value => JSON.dump(@object[d]) %>
+      <% end %>
+      <%= button_tag "Re-run latest version", {class: 'btn btn-sm btn-primary', id: "re-run-latest-job-button"} %>
+    <% end %>
+  <% end %>
+<% end %>
+<% end %>
+
+<%= render partial: 'default_show' %>
+<%= render partial: 'content', layout: 'content_layout', locals: {pane_list: controller.show_pane_list }%>
diff --git a/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
similarity index 74%
copy from apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb
copy to apps/workbench/app/views/pipeline_instances/_running_component.html.erb
index 0b1bec8..a14a2d9 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_running_component.html.erb
@@ -1,74 +1,3 @@
-<%# Summary %>
-
-<% if @object.state == 'Paused' %>
-  <p>
-    This pipeline is paused.  Jobs that are
-    already running will continue to run, but no new jobs will be submitted.
-  </p>
-<% end %>
-
-<% tasks = JobTask.filter([['job_uuid', 'in', render_pipeline_jobs.map { |j| j[:job].andand[:uuid] }]]).results %>
-<% runningtime = determine_wallclock_runtime(render_pipeline_jobs.map {|j| j[:job]}) %>
-
-<p>
-  <% if @object.started_at %>
-    This pipeline started at <span data-utc-date="<%= @object.started_at %>"><%= @object.started_at %></span>.
-    It 
-    <% if @object.state == 'Complete' %>
-      completed in
-    <% elsif @object.state == 'Failed' %>
-      failed after
-    <% else %>
-      has been active for
-    <% end %>
-
-    <% walltime = if @object.finished_at then
-                    @object.finished_at - @object.started_at
-                  else
-                    Time.now - @object.started_at
-                  end %>
-    
-    <%= if walltime > runningtime 
-          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 %>.
-    <% else %>
-      This pipeline is <%= if @object.state.start_with? 'Running' then 'active' else @object.state.downcase end %>.
-        <% walltime = 0%>
-    <% end %>
-
-  <% if @object.state == 'Failed' %>
-    Check the Log tab for more detail about why this pipeline failed.
-  <% end %>
-</p>
-
-<p>
-    This pipeline
-    <% if @object.state.start_with? 'Running' %>
-      has run
-    <% else %>
-      ran
-    <% end %>
-    for
-    <%= render_runtime(runningtime, true, false) %><% cputime = tasks.map { |task|
-                  if task.started_at
-                    (if task.finished_at then task.finished_at else Time.now() end) - task.started_at
-                  else
-                    0
-                  end
-                }.reduce(:+) %><% if walltime - runningtime > 0 %>
-      (<%= render_runtime(walltime - runningtime, true) %> queued)<% end %><% if cputime == 0 %>.<% else %>
-      and used
-    <%= render_runtime(cputime, true) %>
-    of CPU time (<%= (cputime/runningtime).round(1) %>⨯ scaling).
-    <% end %>
-</p>
-
-<%# Components %>
-
-<% render_pipeline_jobs.each_index do |i| %>
-  <% pj = render_pipeline_jobs[i] %>
   <% current_job = pj[:job] if pj[:job] != {} %>
   <div class="panel panel-default">
     <div class="panel-heading">
@@ -147,7 +76,7 @@
 </div>
 </div>
 
-<div id="collapse<%= i %>" class="panel-collapse collapse">
+<div id="collapse<%= i %>" class="panel-collapse collapse <%= if expanded then 'in' end %>">
   <div class="panel-body">
     <div class="container">
         <% current_component = (if current_job then current_job else pj end) %>
@@ -243,4 +172,3 @@
   </div>
 </div>
 </div>
-<% 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 0b1bec8..6b87ef1 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
@@ -67,180 +67,6 @@
 
 <%# Components %>
 
-<% render_pipeline_jobs.each_index do |i| %>
-  <% pj = render_pipeline_jobs[i] %>
-  <% current_job = pj[:job] if pj[:job] != {} %>
-  <div class="panel panel-default">
-    <div class="panel-heading">
-      <div class="container-fluid">
-        <div class="row">
-          <div class="col-md-3">
-            <h4 class="panel-title">
-              <a data-toggle="collapse" href="#collapse<%= i %>" style="white-space: nowrap;">
-                <%= pj[:name] %> <span class="caret"></span>
-              </a>
-            </h4>
-          </div>
-
-          <% if current_job %>
-            <div class="col-md-1">
-              <%= render(partial: 'job_status_label', locals: { j: current_job }) %>
-            </div>
-
-            <div class="col-md-3">
-              <% if current_job[:started_at] %>
-                <% walltime = ((if current_job.finished_at then current_job.finished_at else Time.now() end) - current_job.started_at) %>
-                <% cputime = tasks.map { |task|
-                     if task.started_at and task.job_uuid == current_job.uuid
-                       (if task.finished_at then task.finished_at else Time.now() end) - task.started_at
-                     else
-                       0
-                     end
-                   }.reduce(:+) %>
-                <%= render_runtime(walltime, false, false) %>
-                <% if cputime > 0 %> / <%= render_runtime(cputime, false, false) %> (<%= (cputime/walltime).round(1) %>⨯)<% end %>
-              <% end %>
-            </div>
-
-            <% if Job::state(current_job).in? ["Completed", "Failed", "Canceled"] %>
-              <div class="col-md-5 text-overflow-ellipsis">
-                <% if pj[:output_uuid] %>
-                  <%= link_to_if_arvados_object pj[:output_uuid], friendly_name: true %>
-                <% elsif current_job.andand[:output] %>
-                  <%= link_to_if_arvados_object current_job[:output], link_text: "Output of #{pj[:name]}" %>
-                <% else %>
-                  No output.
-                <% end %>
-              </div>
-            <% elsif Job::state(current_job) == "Running" %>
-              <div class="col-md-3 pipeline-instance-spacing">
-                <%= pj[:progress_bar] %>
-              </div>
-              <div class="col-md-1 pipeline-instance-spacing">
-                <%= form_tag "/jobs/#{current_job.uuid}/cancel", style: "display:inline; padding-left: 1em" do |f| %>
-                <%= hidden_field_tag :return_to, url_for(@object) %>
-                <%= button_tag "Cancel", {class: 'btn btn-xs btn-danger', id: "cancel-job-button"} %>
-            </div>
-            <% end %>
-          <% elsif Job::state(current_job) == "Queued" %>
-            <div class="col-md-5">
-              <% queuetime = Time.now - current_job[:created_at] %>
-              Queued for <%= render_runtime(queuetime, true) %>.
-              <% begin %>
-              <% if current_job.queue_position == 0 %>
-                This job is next in the queue to run.
-              <% elsif current_job.queue_position == 1 %>
-                There is 1 job in the queue ahead of this one.
-              <% else  %>
-                There are <%= current_job.queue_position %> jobs in the queue ahead of this one.
-              <% end %>
-              <% rescue %>
-          <% end %>
-            </div>
-          <% end %>
-        <% else %>
-          <div class="col-md-3 col-md-offset-3">
-            <span class="label label-default">Not ready</span>
-          </div>
-<% end %>
-</div>
-</div>
-</div>
-
-<div id="collapse<%= i %>" class="panel-collapse collapse">
-  <div class="panel-body">
-    <div class="container">
-        <% current_component = (if current_job then current_job else pj end) %>
-        <div class="row">
-          <div class="col-md-6">
-            <table>
-              <% [:script, :repository, :script_version, :supplied_script_version, :nondeterministic].each do |k| %>
-                <tr>
-                  <td style="padding-right: 1em">
-                    <%= k.to_s %>:
-                  </td>
-                  <td>
-                    <% if current_component[k].nil? %>
-                      (none)
-                    <% else %>
-                      <%= current_component[k] %>
-                    <% end %>
-                  </td>
-                </tr>
-              <% end %>
-              <% if current_component[:runtime_constraints].andand[:docker_image] and current_component[:docker_image_locator] %>
-                <tr>
-                  <td style="padding-right: 1em">
-                    docker_image:
-                  </td>
-                  <td>
-                    <%= current_component[:runtime_constraints][:docker_image] %>
-                  </td>
-                </tr>
-                <tr>
-                  <td style="padding-right: 1em">
-                    docker_image_locator:
-                  </td>
-                  <td>
-                    <%= link_to_if_arvados_object current_component[:docker_image_locator], friendly_name: true %>
-                  </td>
-                </tr>
-              <% else %>
-                <tr>
-                  <td style="padding-right: 1em">
-                    docker_image:
-                  </td>
-                  <td>
-                    Not run in Docker
-                  </td>
-                </tr>
-              <% end %>
-            </table>
-          </div>
-          <div class="col-md-5">
-            <table>
-              <% [:uuid, :modified_by_user_uuid, :priority, :created_at, :started_at, :finished_at].each do |k| %>
-                <tr>
-                  <td style="padding-right: 1em">
-                    <%= k.to_s %>:
-                  </td>
-                  <td>
-                    <% if k == :uuid %>
-                      <%= link_to_if_arvados_object current_component[k], link_text: current_component[k] %>
-                    <% 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>
-                    <% else %>
-                      <%= current_component[k] %>
-                    <% end %>
-                  </td>
-                </tr>
-              <% end %>
-            </table>
-          </div>
-        </div>
-        <div class="row">
-          <div class="col-md-6">
-            <p>script_parameters:</p>
-            <pre><%= JSON.pretty_generate(current_component[:script_parameters]) rescue nil %></pre>
-          </div>
-          <% if current_component[:tasks_summary] %>
-          <div class="col-md-3">
-            <table>
-              <% [:done, :running, :failed, :todo].each do |d| %>
-              <tr>
-                <td style="padding-right: 1em"><%= 'tasks:' if d == :done %></td>
-                <td style="padding-right: 1em"><%= d.to_s %></td>
-                <td><%= current_component[:tasks_summary][d] %></td>
-              </tr>
-              <% end %>
-            </table>
-          </div>
-          <% end %>
-        </div>
-    </div>
-  </div>
-</div>
-</div>
+<% render_pipeline_jobs.each_with_index do |pj, i| %>
+  <%= render partial: 'running_component', locals: {tasks: tasks, pj: pj, i: i, expanded: false} %>
 <% end %>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list