1 <%# Copyright (C) The Arvados Authors. All rights reserved.
3 SPDX-License-Identifier: AGPL-3.0 %>
6 collections = [current_obj.outputs, current_obj.docker_image].flatten.compact.uniq
7 collections_pdhs = collections.select {|x| !CollectionsHelper.match(x).nil?}.uniq.compact
8 collections_uuids = collections - collections_pdhs
9 preload_collections_for_objects collections_uuids if collections_uuids.any?
10 preload_links_for_objects collections_uuids if collections_uuids.any?
12 preload_objects_for_dataclass(Repository, [current_obj.repository], :name) if current_obj.repository
14 # if container_X, preload mounted collections
15 if @object.is_a? Container or @object.is_a? ContainerRequest
16 # get any collections in mounts
17 mounts = current_obj.send(:mounts) if current_obj.respond_to?(:mounts)
18 input_obj = mounts.andand[:"/var/lib/cwl/cwl.input.json"].andand[:content]
20 input_obj.to_s.scan(/([0-9a-f]{32}\+\d+)/).each {|cs| collections_pdhs += cs}
23 command = current_obj.send(:command) if current_obj.respond_to?(:command)
25 command.to_s.scan(/([0-9a-f]{32}\+\d+)/).each {|cs| collections_pdhs += cs}
29 collections_pdhs.compact.uniq
30 preload_for_pdhs collections_pdhs if collections_pdhs.any?
31 preload_links_for_objects collections_pdhs if collections_pdhs.any?
34 <div class="container">
36 <div class="col-md-6" style="overflow-x: auto">
37 <% if current_obj.uuid.nil? %>
38 No <%= current_obj.title %> has been submitted yet.
40 <table class="table table-condensed">
41 <% keys = [:uuid, :modified_by_user_uuid, :created_at, :started_at, :finished_at, :container_uuid] %>
42 <% keys << :log_collection if @object.uuid != current_obj.uuid %>
43 <% keys << :outputs %>
44 <% keys.each do |k| %>
46 val = current_obj.send(k) if current_obj.respond_to?(k)
48 has_val = val.andand.any?
49 elsif k == :log_collection and current_obj.state_label == "Running"
57 <td style="padding-right: 1em">
62 <%= link_to_arvados_object_if_readable(val, val, link_text: val) %>
63 <% elsif k.to_s.end_with? 'uuid' %>
64 <%= link_to_arvados_object_if_readable(val, val, friendly_name: true) %>
65 <% elsif k.to_s.end_with? '_at' %>
66 <%= render_localized_date(val) %>
67 <% elsif k == :outputs and val.any? %>
68 <% if val.size == 1 %>
69 <%= link_to_arvados_object_if_readable(val[0], 'Output data not available', friendly_name: true) %>
71 <%= render partial: 'work_units/show_outputs', locals: {id: current_obj.uuid, outputs: val, align:""} %>
73 <% elsif k == :log_collection %>
74 <%= render partial: 'work_units/show_log_link', locals: {wu: current_obj} %>
85 <div class="col-md-6">
86 <table class="table table-condensed">
87 <% # link to repo tree/file only if the repo is readable and the commit is a sha1
88 repo = (/^[0-9a-f]{40}$/ =~ current_obj.script_version and
89 current_obj.repository and
90 object_for_dataclass(Repository, current_obj.repository, :name))
91 repo = nil unless repo.andand.http_fetch_url
93 <% [:script, :repository, :script_version, :supplied_script_version, :nondeterministic,
94 :priority, :runtime_constraints, :requesting_container_uuid].each do |k| %>
95 <% val = current_obj.send(k) if current_obj.respond_to?(k) %>
98 <td style="padding-right: 1em">
102 <% if repo and k == :repository %>
103 <%= link_to val, show_repository_tree_path(id: repo.uuid, commit: current_obj.script_version, path: '/') %>
104 <% elsif repo and k == :script %>
105 <%= link_to val, show_repository_blob_path(id: repo.uuid, commit: current_obj.script_version, path: 'crunch_scripts/'+current_obj.script) %>
106 <% elsif repo and k == :script_version %>
107 <%= link_to val, show_repository_commit_path(id: repo.uuid, commit: current_obj.script_version) %>
108 <% elsif k == :runtime_constraints and val.any? %>
109 <%= render partial: 'work_units/show_table_data', locals: {id: current_obj.uuid, name: k, data_map: val} %>
110 <% elsif k.to_s.end_with? 'uuid' %>
111 <%= link_to_arvados_object_if_readable(val, val, friendly_name: true) %>
121 mounts = current_obj.send(:mounts) if current_obj.respond_to?(:mounts)
122 mount_wf = mounts.andand[:"/var/lib/cwl/workflow.json"]
123 mount_wf = mount_wf[5..-1] if mount_wf.andand.is_a?(String) and mount_wf.start_with?('keep:')
124 mount_wf_cls = resource_class_for_uuid(mount_wf) if mount_wf
127 <% if mount_wf_cls == Collection %>
128 <td style="padding-right: 1em">
132 <%= link_to_if_arvados_object mount_wf, friendly_name: true %>
137 <% if current_obj.runtime_constraints.andand[:docker_image] and current_obj.docker_image %>
139 <td style="padding-right: 1em">
143 <%= current_obj.runtime_constraints[:docker_image] %>
147 <td style="padding-right: 1em">
148 docker_image_locator:
151 <%= link_to_arvados_object_if_readable(current_obj.docker_image,
152 current_obj.docker_image, friendly_name: true) %>
155 <% elsif current_obj.docker_image %>
157 <td style="padding-right: 1em">
158 docker_image_locator:
161 <%= link_to_arvados_object_if_readable(current_obj.docker_image,
162 current_obj.docker_image, friendly_name: true) %>
169 <div class="col-md-12">
170 <table class="table table-condensed" style="table-layout:fixed;">
173 <% [:command].each do |k| %>
174 <% val = current_obj.send(k) if current_obj.respond_to?(k) %>
180 <td style="word-wrap: break-all;">
181 <% if k == :command %>
182 <% val = JSON.pretty_generate(val) %>
183 <%= render partial: 'show_text_with_locators', locals: {data_height: 200, text_data: val} %>
193 mounts = current_obj.send(:mounts) if current_obj.respond_to?(:mounts)
194 input_obj = mounts.andand[:"/var/lib/cwl/cwl.input.json"].andand[:content]
195 mnt_inputs = JSON.pretty_generate(input_obj) if input_obj
202 <td style="word-wrap: break-all;">
203 <%= render partial: 'show_text_with_locators', locals: {data_height: 400, text_data: mnt_inputs} %>
212 <% if current_obj.parameters and !current_obj.parameters.empty? %>
214 <div class="col-md-12">
215 <p>script_parameters:</p>
216 <pre><%= JSON.pretty_generate(current_obj.parameters) rescue nil %></pre>