2 collections = [current_obj.outputs, current_obj.docker_image].flatten.compact.uniq
3 collections_pdhs = collections.select {|x| !CollectionsHelper.match(x).nil?}.uniq.compact
4 collections_uuids = collections - collections_pdhs
5 preload_collections_for_objects collections_uuids if collections_uuids.any?
6 preload_links_for_objects collections_uuids if collections_uuids.any?
8 preload_objects_for_dataclass(Repository, [current_obj.repository], :name) if current_obj.repository
10 # if container_X, preload mounted collections
11 if @object.is_a? Container or @object.is_a? ContainerRequest
12 # get any collections in mounts
13 mounts = current_obj.send(:mounts) if current_obj.respond_to?(:mounts)
14 input_obj = mounts.andand[:"/var/lib/cwl/cwl.input.json"].andand[:content]
16 input_obj.to_s.scan(/([0-9a-f]{32}\+\d+)/).each {|cs| collections_pdhs += cs}
19 command = current_obj.send(:command) if current_obj.respond_to?(:command)
21 command.to_s.scan(/([0-9a-f]{32}\+\d+)/).each {|cs| collections_pdhs += cs}
25 collections_pdhs.compact.uniq
26 preload_for_pdhs collections_pdhs if collections_pdhs.any?
27 preload_links_for_objects collections_pdhs if collections_pdhs.any?
30 <div class="container">
32 <div class="col-md-6" style="overflow-x: auto">
33 <% if current_obj.uuid.nil? %>
34 No <%= current_obj.title %> has been submitted yet.
36 <table class="table table-condensed">
37 <% keys = [:uuid, :modified_by_user_uuid, :created_at, :started_at, :finished_at, :container_uuid] %>
38 <% keys << :log_collection if @object.uuid != current_obj.uuid %>
39 <% keys << :outputs %>
40 <% keys.each do |k| %>
42 val = current_obj.send(k) if current_obj.respond_to?(k)
44 has_val = val.andand.any?
45 elsif k == :log_collection and current_obj.state_label == "Running"
53 <td style="padding-right: 1em">
58 <%= link_to_arvados_object_if_readable(val, val, link_text: val) %>
59 <% elsif k.to_s.end_with? 'uuid' %>
60 <%= link_to_arvados_object_if_readable(val, val, friendly_name: true) %>
61 <% elsif k.to_s.end_with? '_at' %>
62 <%= render_localized_date(val) %>
63 <% elsif k == :outputs and val.any? %>
64 <% if val.size == 1 %>
65 <%= link_to_arvados_object_if_readable(val[0], 'Output data not available', friendly_name: true) %>
67 <%= render partial: 'work_units/show_outputs', locals: {id: current_obj.uuid, outputs: val, align:""} %>
69 <% elsif k == :log_collection %>
70 <%= render partial: 'work_units/show_log_link', locals: {wu: current_obj} %>
81 <div class="col-md-6">
82 <table class="table table-condensed">
83 <% # link to repo tree/file only if the repo is readable and the commit is a sha1
84 repo = (/^[0-9a-f]{40}$/ =~ current_obj.script_version and
85 current_obj.repository and
86 object_for_dataclass(Repository, current_obj.repository, :name))
87 repo = nil unless repo.andand.http_fetch_url
89 <% [:script, :repository, :script_version, :supplied_script_version, :nondeterministic,
90 :priority, :runtime_constraints, :requesting_container_uuid].each do |k| %>
91 <% val = current_obj.send(k) if current_obj.respond_to?(k) %>
94 <td style="padding-right: 1em">
98 <% if repo and k == :repository %>
99 <%= link_to val, show_repository_tree_path(id: repo.uuid, commit: current_obj.script_version, path: '/') %>
100 <% elsif repo and k == :script %>
101 <%= link_to val, show_repository_blob_path(id: repo.uuid, commit: current_obj.script_version, path: 'crunch_scripts/'+current_obj.script) %>
102 <% elsif repo and k == :script_version %>
103 <%= link_to val, show_repository_commit_path(id: repo.uuid, commit: current_obj.script_version) %>
104 <% elsif k == :runtime_constraints and val.any? %>
105 <%= render partial: 'work_units/show_table_data', locals: {id: current_obj.uuid, name: k, data_map: val} %>
106 <% elsif k.to_s.end_with? 'uuid' %>
107 <%= link_to_arvados_object_if_readable(val, val, friendly_name: true) %>
117 mounts = current_obj.send(:mounts) if current_obj.respond_to?(:mounts)
118 mount_wf = mounts.andand[:"/var/lib/cwl/workflow.json"]
119 mount_wf = mount_wf[5..-1] if mount_wf.andand.is_a?(String) and mount_wf.start_with?('keep:')
120 mount_wf_cls = resource_class_for_uuid(mount_wf) if mount_wf
123 <% if mount_wf_cls == Collection %>
124 <td style="padding-right: 1em">
128 <%= link_to_if_arvados_object mount_wf, friendly_name: true %>
133 <% if current_obj.runtime_constraints.andand[:docker_image] and current_obj.docker_image %>
135 <td style="padding-right: 1em">
139 <%= current_obj.runtime_constraints[:docker_image] %>
143 <td style="padding-right: 1em">
144 docker_image_locator:
147 <%= link_to_arvados_object_if_readable(current_obj.docker_image,
148 current_obj.docker_image, friendly_name: true) %>
151 <% elsif current_obj.docker_image %>
153 <td style="padding-right: 1em">
154 docker_image_locator:
157 <%= link_to_arvados_object_if_readable(current_obj.docker_image,
158 current_obj.docker_image, friendly_name: true) %>
165 <div class="col-md-12">
166 <table class="table table-condensed" style="table-layout:fixed;">
169 <% [:command].each do |k| %>
170 <% val = current_obj.send(k) if current_obj.respond_to?(k) %>
176 <td style="word-wrap: break-all;">
177 <% if k == :command %>
178 <% val = JSON.pretty_generate(val) %>
179 <%= render partial: 'show_text_with_locators', locals: {data_height: 200, text_data: val} %>
189 mounts = current_obj.send(:mounts) if current_obj.respond_to?(:mounts)
190 input_obj = mounts.andand[:"/var/lib/cwl/cwl.input.json"].andand[:content]
191 mnt_inputs = JSON.pretty_generate(input_obj) if input_obj
198 <td style="word-wrap: break-all;">
199 <%= render partial: 'show_text_with_locators', locals: {data_height: 400, text_data: mnt_inputs} %>
208 <% if current_obj.parameters and !current_obj.parameters.empty? %>
210 <div class="col-md-6">
211 <p>script_parameters:</p>
212 <pre><%= JSON.pretty_generate(current_obj.parameters) rescue nil %></pre>