[ARVADOS] created: 6f62739bee508c9b2b8c4ce2f2593fe1714cfda6

Git user git at public.curoverse.com
Mon May 1 21:44:00 EDT 2017


        at  6f62739bee508c9b2b8c4ce2f2593fe1714cfda6 (commit)


commit 6f62739bee508c9b2b8c4ce2f2593fe1714cfda6
Author: radhika <radhika at curoverse.com>
Date:   Mon May 1 21:43:37 2017 -0400

    10645: container request mounts display

diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 41b3370..4112802 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -584,6 +584,30 @@ module ApplicationHelper
     end
   end
 
+  # yields collection id (pdh or uuid), and full file_path
+  def cwl_input_collections(path, &b)
+    case path
+    when ArvadosBase
+      path.class.columns.each do |c|
+        cwl_input_collections(path[c.name.to_sym], &b)
+      end
+    when Hash
+      path.each do |k, v|
+        cwl_input_collections(v, &b)
+      end
+    when Array
+      path.each do |v|
+        cwl_input_collections(v, &b)
+      end
+    when String
+      if m = /[a-f0-9]{32}\+\d+/.match(path)
+        yield m[0], path.split('keep:')[-1]
+      elsif m = /[0-9a-z]{5}-4zz18-[0-9a-z]{15}/.match(path)
+        yield m[0], path.split('keep:')[-1]
+      end
+    end
+  end
+
   def render_arvados_object_list_start(list, button_text, button_href,
                                        params={}, *rest, &block)
     show_max = params.delete(:show_max) || 3
diff --git a/apps/workbench/app/views/work_units/_component_detail.html.erb b/apps/workbench/app/views/work_units/_component_detail.html.erb
index bb5b913..a3a246f 100644
--- a/apps/workbench/app/views/work_units/_component_detail.html.erb
+++ b/apps/workbench/app/views/work_units/_component_detail.html.erb
@@ -15,7 +15,7 @@
               No <%= current_obj.title %> has been submitted yet.
             <% else %>
             <table>
-              <% keys = [:uuid, :modified_by_user_uuid, :created_at, :started_at, :finished_at, :container_uuid, :priority] %>
+              <% keys = [:uuid, :modified_by_user_uuid, :created_at, :started_at, :finished_at, :container_uuid] %>
               <% keys << :log_collection if @object.uuid != current_obj.uuid %>
               <% keys << :outputs %>
               <% keys.each do |k| %>
@@ -67,8 +67,8 @@
                          object_for_dataclass(Repository, current_obj.repository, :name))
                  repo = nil unless repo.andand.http_fetch_url
                  %>
-              <% [:script, :repository, :script_version, :supplied_script_version, :nondeterministic,
-                  :command, :cwd, :environment, :mounts, :output_path].each do |k| %>
+              <% [:priority, :script, :repository, :script_version, :supplied_script_version, :nondeterministic,
+                  :runtime_constraints].each do |k| %>
                 <% val = current_obj.send(k) if current_obj.respond_to?(k) %>
                 <% if val %>
                 <tr>
@@ -82,6 +82,8 @@
                       <%= link_to val, show_repository_blob_path(id: repo.uuid, commit: current_obj.script_version, path: 'crunch_scripts/'+current_obj.script) %>
                     <% elsif repo and k == :script_version %>
                       <%= link_to val, show_repository_commit_path(id: repo.uuid, commit: current_obj.script_version) %>
+                    <% elsif k == :runtime_constraints and val.any? %>
+                      <%= render partial: 'work_units/show_table_data', locals: {id: current_obj.uuid, name: k, data_map: val} %>
                     <% else %>
                       <%= val %>
                     <% end %>
@@ -89,6 +91,23 @@
                 </tr>
                 <% end %>
               <% end %>
+
+              <%
+                mounts = current_obj.send(:mounts) if current_obj.respond_to?(:mounts)
+                mount_wf = mounts.andand[:"/var/lib/cwl/workflow.json"]
+                mount_wf_cls = resource_class_for_uuid(mount_wf) if mount_wf
+              %>
+              <tr>
+                <% if mount_wf_cls == Collection %>
+                  <td style="padding-right: 1em">
+                    mount workflow:
+                  </td>
+                  <td>
+                    <%= link_to_if_arvados_object mount_wf, friendly_name: true %>
+                  </td>
+                <% end %>
+              </tr>
+
               <% if current_obj.runtime_constraints.andand[:docker_image] and current_obj.docker_image %>
                 <tr>
                   <td style="padding-right: 1em">
@@ -120,6 +139,52 @@
               <% end %>
             </table>
           </div>
+
+          <div class="col-md-11">
+            <table>
+              <% [:command].each do |k| %>
+                <% val = current_obj.send(k) if current_obj.respond_to?(k) %>
+                <% if val %>
+                <tr>
+                  <td style="padding-right: 1em">
+                    <%= k.to_s %>:
+                  </td>
+                  <td>
+                    <% if k == :command %>
+                      <div style="max-height:200px; border:1px solid; overflow-y:auto; padding-left: 1em; padding-right: 1em">
+                        <%=val%>
+                      </div>
+                    <% else %>
+                      <%= val %>
+                    <% end %>
+                  </td>
+                </tr>
+                <% end %>
+              <% end %>
+
+              <%
+                mounts = current_obj.send(:mounts) if current_obj.respond_to?(:mounts)
+                input_obj =mounts.andand[:"/var/lib/cwl/cwl.input.json"].andand[:content] || mounts || {}
+                mnt_inputs = []
+                cwl_input_collections(input_obj) do |_, path|
+                  mnt_inputs << path
+                end
+                mnt_inputs = mnt_inputs.uniq.compact
+              %>
+              <tr>
+                <% if mnt_inputs.any? %>
+                  <td style="padding-right: 1em">
+                    input_mounts:
+                  </td>
+                  <td>
+                    <%= render partial: 'work_units/show_inputs',
+                                        locals: {id: current_obj.uuid, name: 'mount-inputs', inputs: mnt_inputs} %>
+                  </td>
+                <% end %>
+              </tr>
+            </table>
+          </div>
+
         </div>
 
         <% if current_obj.parameters and !current_obj.parameters.empty? %>
diff --git a/apps/workbench/app/views/work_units/_show_inputs.html.erb b/apps/workbench/app/views/work_units/_show_inputs.html.erb
new file mode 100644
index 0000000..8e66363
--- /dev/null
+++ b/apps/workbench/app/views/work_units/_show_inputs.html.erb
@@ -0,0 +1,12 @@
+<div class="data-table <%=name%>-table" id="<%=name%>-table" style="max-height:300px; border:1px solid; overflow-y:auto;">
+  <table>
+    <% inputs.each do |i|%>
+      <tr>
+        <td style="padding-left: 1em; padding-right: 1em">
+          <%= link_to_if_arvados_object i, friendly_name: true %>
+        </td>
+      </tr>
+    <% end %>
+  </table>
+</div>
+
diff --git a/apps/workbench/app/views/work_units/_show_table_data.html.erb b/apps/workbench/app/views/work_units/_show_table_data.html.erb
new file mode 100644
index 0000000..1e7ca09
--- /dev/null
+++ b/apps/workbench/app/views/work_units/_show_table_data.html.erb
@@ -0,0 +1,14 @@
+<div class="data-table <%=name%>-table" id="<%=name%>-table" style="max-height:200px; border:1px solid; overflow-y:auto;">
+  <table>
+    <% data_map.each do |k, v|%>
+      <tr>
+        <td style="padding-left: 1em; padding-right: 1em">
+          <%= k.to_s %>
+        </td>
+        <td style="padding-left: 1em; padding-right: 1em">
+          <%= v %>
+        </td>
+      </tr>
+    <% end %>
+  </table>
+</div>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list