1 <%# Copyright (C) The Arvados Authors. All rights reserved.
3 SPDX-License-Identifier: AGPL-3.0 %>
7 <div class="pull-right" style="padding-left: 1em">
8 Current state: <span class="badge badge-info" data-pipeline-state="<%= @object.state %>">
9 <% if @object.state == "RunningOnServer" %>
17 <% pipeline_jobs = render_pipeline_jobs %>
18 <% job_uuids = pipeline_jobs.map { |j| j[:job].andand[:uuid] }.compact %>
20 <% if @object.state == 'Paused' %>
22 This pipeline is paused. Jobs that are
23 already running will continue to run, but no new jobs will be submitted.
27 <% runningtime = determine_wallclock_runtime(pipeline_jobs.map {|j| j[:job]}.compact) %>
30 <% if @object.started_at %>
31 This pipeline started at <%= render_localized_date(@object.started_at) %>.
33 <% if @object.state == 'Complete' %>
35 <% elsif @object.state == 'Failed' %>
37 <% elsif @object.state == 'Cancelled' %>
43 <% walltime = if @object.finished_at then
44 @object.finished_at - @object.started_at
46 Time.now - @object.started_at
49 <%= if walltime > runningtime
50 render_runtime(walltime, false)
52 render_runtime(runningtime, false)
53 end %><% if @object.finished_at %> at <%= render_localized_date(@object.finished_at) %><% end %>.
55 This pipeline is <%= if @object.state.start_with? 'Running' then 'active' else @object.state.downcase end %>.
59 <% if @object.state == 'Failed' %>
60 Check the Log tab for more detail about why this pipeline failed.
66 <% if @object.state.start_with? 'Running' %>
73 cputime = pipeline_jobs.map { |j|
74 if j[:job][:started_at]
75 (j[:job][:runtime_constraints].andand[:min_nodes] || 1).to_i * ((j[:job][:finished_at] || Time.now()) - j[:job][:started_at])
80 <%= render_runtime(runningtime, false) %><% if (walltime - runningtime) > 0 %>
81 (<%= render_runtime(walltime - runningtime, false) %> queued)<% end %><% if cputime == 0 %>.<% else %>
83 <%= render_runtime(cputime, false) %>
84 of node allocation time (<%= (cputime/runningtime).round(1) %>⨯ scaling).
91 job_uuids = pipeline_jobs.collect {|j| j[:job][:uuid]}.compact
93 resource_class = resource_class_for_uuid(job_uuids.first, friendly_name: true)
94 preload_objects_for_dataclass resource_class, job_uuids
97 job_collections = pipeline_jobs.collect {|j| j[:job][:output]}.compact
98 job_collections.concat pipeline_jobs.collect {|j| j[:job][:docker_image_locator]}.uniq.compact
99 job_collections_pdhs = job_collections.select {|x| !(m = CollectionsHelper.match(x)).nil?}.uniq.compact
100 job_collections_uuids = job_collections - job_collections_pdhs
101 preload_collections_for_objects job_collections_uuids if job_collections_uuids.any?
102 preload_for_pdhs job_collections_pdhs if job_collections_pdhs.any?
105 <% pipeline_jobs.each_with_index do |pj, i| %>
106 <%= render partial: 'running_component', locals: {pj: pj, i: i, expanded: false, pipeline_display: true} %>