1 <% current_job = pj[:job] if pj[:job] != {} and pj[:job][:uuid] %>
2 <div class="panel panel-default">
3 <div class="panel-heading">
4 <div class="container-fluid">
5 <div class="row-fluid">
7 <div class="col-md-3" style="word-break:break-all;">
8 <h4 class="panel-title">
9 <a data-toggle="collapse" href="#collapse<%= i %>">
10 <%= pj[:name] %> <span class="caret"></span>
15 <%# column offset 3 %>
16 <div class="col-md-2 pipeline-instance-spacing">
17 <%= pj[:progress_bar] %>
21 <%# column offset 5 %>
22 <% if current_job[:state] != "Queued" %>
23 <div class="col-md-3">
24 <% if current_job[:started_at] %>
25 <% walltime = ((if current_job[:finished_at] then current_job[:finished_at] else Time.now() end) - current_job[:started_at]) %>
26 <% cputime = tasks.map { |task|
27 if task.started_at and task.job_uuid == current_job[:uuid]
28 finished_at = task.finished_at || current_job[:finished_at] || Time.now()
29 finished_at - task.started_at
34 <%= render_runtime(walltime, false, false) %>
35 <% if cputime > 0 %> / <%= render_runtime(cputime, false, false) %> (<%= (cputime/walltime).round(1) %>⨯)<% end %>
40 <% if current_job[:state] == "Queued" %>
41 <%# column offset 5 %>
42 <div class="col-md-6">
43 <% queuetime = Time.now - Time.parse(current_job[:created_at].to_s) %>
44 Queued for <%= render_runtime(queuetime, true) %>.
46 <% if current_job[:queue_position] == 0 %>
47 This job is next in the queue to run.
48 <% elsif current_job[:queue_position] == 1 %>
49 There is 1 job in the queue ahead of this one.
50 <% elsif current_job[:queue_position] %>
51 There are <%= current_job[:queue_position] %> jobs in the queue ahead of this one.
56 <% elsif current_job[:state] == "Running" %>
57 <%# column offset 8 %>
58 <div class="col-md-3">
59 <span class="task-summary-status">
60 <%= current_job[:tasks_summary][:done] %> <%= "task".pluralize(current_job[:tasks_summary][:done]) %> done,
61 <%= current_job[:tasks_summary][:failed] %> failed,
62 <%= current_job[:tasks_summary][:running] %> running,
63 <%= current_job[:tasks_summary][:todo] %> pending
66 <% elsif current_job[:state].in? ["Complete", "Failed", "Cancelled"] %>
67 <%# column offset 8 %>
68 <div class="col-md-4 text-overflow-ellipsis">
69 <% if pj[:output_uuid] %>
70 <%= link_to_arvados_object_if_readable(pj[:output_uuid], 'Output data not available', friendly_name: true) %>
71 <% elsif current_job[:output] %>
72 <%= link_to_arvados_object_if_readable(current_job[:output], 'Output data not available', link_text: "Output of #{pj[:name]}") %>
79 <% if current_job[:state].in? ["Queued", "Running"] and @object.editable? %>
80 <%# column offset 11 %>
81 <div class="col-md-1 pipeline-instance-spacing">
82 <%= form_tag "/jobs/#{current_job[:uuid]}/cancel", remote: true, style: "display:inline; padding-left: 1em" do |f| %>
83 <%= hidden_field_tag :return_to, url_for(@object) %>
84 <%= button_tag "Cancel", {class: 'btn btn-xs btn-danger', id: "cancel-job-button"} %>
93 <div id="collapse<%= i %>" class="panel-collapse collapse <%= if expanded then 'in' end %>">
94 <div class="panel-body">
95 <div class="container">
96 <% current_component = (if current_job then current_job else pj end) %>
98 <div class="col-md-6">
100 <% # link to repo tree/file only if the repo is readable
101 # and the commit is a sha1...
103 (/^[0-9a-f]{40}$/ =~ current_component[:script_version] and
104 Repository.where(name: current_component[:repository]).first)
106 # ...and the api server provides an http:// or https:// url
107 repo = nil unless repo.andand.http_fetch_url
109 <% [:script, :repository, :script_version, :supplied_script_version, :nondeterministic].each do |k| %>
111 <td style="padding-right: 1em">
115 <% if current_component[k].nil? %>
117 <% elsif repo and k == :repository %>
118 <%= link_to current_component[k], show_repository_tree_path(id: repo.uuid, commit: current_component[:script_version], path: '/') %>
119 <% elsif repo and k == :script %>
120 <%= link_to current_component[k], show_repository_blob_path(id: repo.uuid, commit: current_component[:script_version], path: 'crunch_scripts/'+current_component[:script]) %>
121 <% elsif repo and k == :script_version %>
122 <%= link_to current_component[k], show_repository_commit_path(id: repo.uuid, commit: current_component[:script_version]) %>
124 <%= current_component[k] %>
129 <% if current_component[:runtime_constraints].andand[:docker_image] and current_component[:docker_image_locator] %>
131 <td style="padding-right: 1em">
135 <%= current_component[:runtime_constraints][:docker_image] %>
139 <td style="padding-right: 1em">
140 docker_image_locator:
143 <%= link_to_arvados_object_if_readable(current_component[:docker_image_locator],
144 current_component[:docker_image_locator], friendly_name: true) %>
149 <td style="padding-right: 1em">
159 <div class="col-md-5">
161 <% [:uuid, :modified_by_user_uuid, :priority, :created_at, :started_at, :finished_at].each do |k| %>
163 <td style="padding-right: 1em">
168 <%= link_to_arvados_object_if_readable(current_component[k], current_component[k], link_text: current_component[k]) %>
169 <% elsif k.to_s.end_with? 'uuid' %>
170 <%= link_to_arvados_object_if_readable(current_component[k], current_component[k], friendly_name: true) %>
171 <% elsif k.to_s.end_with? '_at' %>
172 <%= render_localized_date(current_component[k]) %>
174 <%= current_component[k] %>
183 <div class="col-md-6">
184 <p>script_parameters:</p>
185 <pre><%= JSON.pretty_generate(current_component[:script_parameters]) rescue nil %></pre>