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-2" 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 2 %>
16 <div class="col-md-2 pipeline-instance-spacing">
17 <%= pj[:progress_bar] %>
20 <%# column offset 4 %>
21 <% if not current_job %>
22 <div class="col-md-8"></div>
24 <div class="col-md-1">
25 <% if (pipeline_display rescue nil) %>
26 <% if current_job[:state].in? ["Complete", "Failed", "Cancelled"] %>
27 <% if current_job[:log] %>
28 <% logCollection = Collection.find? current_job[:log] %>
29 <% if logCollection %>
30 <%= link_to "Log", job_path(current_job[:uuid], anchor: "Log") %>
35 <% elsif current_job[:state] == "Running" %>
36 <% job = Job.find? current_job[:uuid] %>
38 <%= link_to "Log", job_path(current_job[:uuid], anchor: "Log") %>
46 <%# column offset 5 %>
47 <% if current_job[:state] != "Queued" %>
48 <div class="col-md-3">
49 <% if current_job[:started_at] %>
50 <% walltime = ((if current_job[:finished_at] then current_job[:finished_at] else Time.now() end) - current_job[:started_at]) %>
51 <% cputime = (current_job[:runtime_constraints].andand[:min_nodes] || 1) *
52 ((current_job[:finished_at] || Time.now()) - current_job[:started_at]) %>
53 <%= render_runtime(walltime, false) %>
54 <% if cputime > 0 %> / <%= render_runtime(cputime, false) %> (<%= (cputime/walltime).round(1) %>⨯)<% end %>
59 <% if current_job[:state] == "Queued" %>
60 <%# column offset 5 %>
61 <div class="col-md-6">
62 <% queuetime = Time.now - Time.parse(current_job[:created_at].to_s) %>
63 Queued for <%= render_runtime(queuetime, false) %>.
65 <% elsif current_job[:state] == "Running" %>
66 <%# column offset 8 %>
67 <div class="col-md-3">
68 <span class="task-summary-status">
69 <%= current_job[:tasks_summary][:done] %> <%= "task".pluralize(current_job[:tasks_summary][:done]) %> done,
70 <%= current_job[:tasks_summary][:failed] %> failed,
71 <%= current_job[:tasks_summary][:running] %> running,
72 <%= current_job[:tasks_summary][:todo] %> pending
75 <% elsif current_job[:state].in? ["Complete", "Failed", "Cancelled"] %>
76 <%# column offset 8 %>
77 <div class="col-md-4 text-overflow-ellipsis">
78 <% if pj[:output_uuid] %>
79 <%= link_to_arvados_object_if_readable(pj[:output_uuid], 'Output data not available', friendly_name: true) %>
80 <% elsif current_job[:output] %>
81 <%= link_to_arvados_object_if_readable(current_job[:output], 'Output data not available', link_text: "Output of #{pj[:name]}") %>
88 <% if current_job[:state].in? ["Queued", "Running"] and @object.editable? %>
89 <%# column offset 11 %>
90 <div class="col-md-1 pipeline-instance-spacing">
91 <%= form_tag "/jobs/#{current_job[:uuid]}/cancel", remote: true, style: "display:inline; padding-left: 1em" do |f| %>
92 <%= hidden_field_tag :return_to, url_for(@object) %>
93 <%= button_tag "Cancel", {class: 'btn btn-xs btn-danger', id: "cancel-job-button"} %>
102 <div id="collapse<%= i %>" class="panel-collapse collapse <%= if expanded then 'in' end %>">
103 <div class="panel-body">
104 <div class="container">
105 <% current_component = (if current_job then current_job else pj end) %>
107 <div class="col-md-6">
109 <% # link to repo tree/file only if the repo is readable
110 # and the commit is a sha1...
112 (/^[0-9a-f]{40}$/ =~ current_component[:script_version] and
113 Repository.where(name: current_component[:repository]).first)
115 # ...and the api server provides an http:// or https:// url
116 repo = nil unless repo.andand.http_fetch_url
118 <% [:script, :repository, :script_version, :supplied_script_version, :nondeterministic].each do |k| %>
120 <td style="padding-right: 1em">
124 <% if current_component[k].nil? %>
126 <% elsif repo and k == :repository %>
127 <%= link_to current_component[k], show_repository_tree_path(id: repo.uuid, commit: current_component[:script_version], path: '/') %>
128 <% elsif repo and k == :script %>
129 <%= link_to current_component[k], show_repository_blob_path(id: repo.uuid, commit: current_component[:script_version], path: 'crunch_scripts/'+current_component[:script]) %>
130 <% elsif repo and k == :script_version %>
131 <%= link_to current_component[k], show_repository_commit_path(id: repo.uuid, commit: current_component[:script_version]) %>
133 <%= current_component[k] %>
138 <% if current_component[:runtime_constraints].andand[:docker_image] and current_component[:docker_image_locator] %>
140 <td style="padding-right: 1em">
144 <%= current_component[:runtime_constraints][:docker_image] %>
148 <td style="padding-right: 1em">
149 docker_image_locator:
152 <%= link_to_arvados_object_if_readable(current_component[:docker_image_locator],
153 current_component[:docker_image_locator], friendly_name: true) %>
158 <td style="padding-right: 1em">
168 <div class="col-md-5">
170 <% [:uuid, :modified_by_user_uuid, :priority, :created_at, :started_at, :finished_at].each do |k| %>
172 <td style="padding-right: 1em">
177 <%= link_to_arvados_object_if_readable(current_component[k], current_component[k], link_text: current_component[k]) %>
178 <% elsif k.to_s.end_with? 'uuid' %>
179 <%= link_to_arvados_object_if_readable(current_component[k], current_component[k], friendly_name: true) %>
180 <% elsif k.to_s.end_with? '_at' %>
181 <%= render_localized_date(current_component[k]) %>
183 <%= current_component[k] %>
192 <div class="col-md-6">
193 <p>script_parameters:</p>
194 <pre><%= JSON.pretty_generate(current_component[:script_parameters]) rescue nil %></pre>