[ARVADOS] updated: 43a6204d0292fc4a41c370a2b77a84bc778fbdae

Git user git at public.curoverse.com
Wed May 3 00:25:40 EDT 2017


Summary of changes:
 .../controllers/container_requests_controller.rb   | 22 ++++++-
 apps/workbench/app/helpers/application_helper.rb   | 24 -------
 .../app/helpers/container_requests_helper.rb       | 26 ++++++++
 apps/workbench/app/models/container_work_unit.rb   |  9 ++-
 .../_extra_tab_line_buttons.html.erb               | 50 ++++++++++++---
 .../views/work_units/_component_detail.html.erb    |  3 +-
 .../app/views/work_units/_show_table_data.html.erb |  2 +-
 .../container_requests_controller_test.rb          | 75 +++++++++++++++++-----
 sdk/python/arvados/commands/put.py                 | 55 +++++++++++++---
 sdk/python/tests/test_arv_put.py                   | 28 ++++++++
 services/api/test/fixtures/container_requests.yml  | 35 +++++++++-
 11 files changed, 267 insertions(+), 62 deletions(-)
 create mode 100644 apps/workbench/app/helpers/container_requests_helper.rb

       via  43a6204d0292fc4a41c370a2b77a84bc778fbdae (commit)
       via  23825c0b5ecf436b29a36a1c27efe1120485827e (commit)
       via  fca805a18c671ccbb03cef640c15172d1f02ffe3 (commit)
       via  613155d587da60dbe04c7635649b1f3694938adc (commit)
       via  be4852ec32e5eeed1af9a62017cfc39ed66ac186 (commit)
       via  fe45b1b66c730f2546d78a7899375707c0816518 (commit)
       via  18f3b51a1795922a5c5c595b5b3fb5ce12978c64 (commit)
       via  4d012b23a4ac88f433986054fc0085ee6714b5b3 (commit)
       via  c6452ff3cf71462a46c3d7584696e0948dcce4dc (commit)
       via  d694a717acb2e577afa396aea140e5284b7f763d (commit)
       via  59b27bcb7fe510ff351dd9d8f71b1d4b56d131b5 (commit)
       via  e289b9ad5959a76795681ca95d310bad2288656a (commit)
       via  3843210bdf340751795b8ce9903cf712661b94e7 (commit)
       via  b92089c1674dcc99184a36b7094ac72ffc787922 (commit)
       via  f517c9897428fd3c50a269b494b6b912cae291df (commit)
       via  65da23323c06079612db9285e0ab2bd1ac9ea253 (commit)
       via  8c948701e887e96f05ffaf0adaec9da9f2533f72 (commit)
       via  fed8ee006cdfc2029f287c656b184f3ce7507847 (commit)
       via  e7b46691f98bf4e7edcf1ea3b98a677273d70b3b (commit)
      from  6f62739bee508c9b2b8c4ce2f2593fe1714cfda6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 43a6204d0292fc4a41c370a2b77a84bc778fbdae
Author: radhika <radhika at curoverse.com>
Date:   Wed May 3 00:24:41 2017 -0400

    10645: add test for container_request display with input mounts

diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 4112802..41b3370 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -584,30 +584,6 @@ 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/helpers/container_requests_helper.rb b/apps/workbench/app/helpers/container_requests_helper.rb
new file mode 100644
index 0000000..ec6c604
--- /dev/null
+++ b/apps/workbench/app/helpers/container_requests_helper.rb
@@ -0,0 +1,26 @@
+module ContainerRequestsHelper
+
+  # yields collection id (pdh or uuid), and full file_path
+  def cr_input_collections(path, &b)
+    case path
+    when ArvadosBase
+      path.class.columns.each do |c|
+        cr_input_collections(path[c.name.to_sym], &b)
+      end
+    when Hash
+      path.each do |k, v|
+        cr_input_collections(v, &b)
+      end
+    when Array
+      path.each do |v|
+        cr_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
+end
diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index ed82f18..8748785 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -163,6 +163,13 @@ class ContainerWorkUnit < ProxyWorkUnit
 
   protected
   def get_combined key
-    get(key, @container) || get(key, @proxied)
+    from_container = get(key, @container)
+    from_proxied = get(key, @proxied)
+
+    if from_container.is_a? Hash or from_container.is_a? Array
+      if from_container.any? then from_container else from_proxied end
+    else
+      from_container || from_proxied
+    end
   end
 end
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 a3a246f..f1baf7b 100644
--- a/apps/workbench/app/views/work_units/_component_detail.html.erb
+++ b/apps/workbench/app/views/work_units/_component_detail.html.erb
@@ -95,6 +95,7 @@
               <%
                 mounts = current_obj.send(:mounts) if current_obj.respond_to?(:mounts)
                 mount_wf = mounts.andand[:"/var/lib/cwl/workflow.json"]
+                mount_wf = mount_wf[5..-1] if mount_wf.andand.start_with?('keep:')
                 mount_wf_cls = resource_class_for_uuid(mount_wf) if mount_wf
               %>
               <tr>
@@ -166,7 +167,7 @@
                 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|
+                cr_input_collections(input_obj) do |_, path|
                   mnt_inputs << path
                 end
                 mnt_inputs = mnt_inputs.uniq.compact
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
index 1e7ca09..96658b6 100644
--- a/apps/workbench/app/views/work_units/_show_table_data.html.erb
+++ b/apps/workbench/app/views/work_units/_show_table_data.html.erb
@@ -1,4 +1,4 @@
-<div class="data-table <%=name%>-table" id="<%=name%>-table" style="max-height:200px; border:1px solid; overflow-y:auto;">
+<div class="data-table <%=name%>-table" id="<%=name%>-table" style="max-height:150px; border:1px solid; overflow-y:auto;">
   <table>
     <% data_map.each do |k, v|%>
       <tr>
diff --git a/apps/workbench/test/controllers/container_requests_controller_test.rb b/apps/workbench/test/controllers/container_requests_controller_test.rb
index bd2f6be..381bd5b 100644
--- a/apps/workbench/test/controllers/container_requests_controller_test.rb
+++ b/apps/workbench/test/controllers/container_requests_controller_test.rb
@@ -106,4 +106,20 @@ class ContainerRequestsControllerTest < ActionController::TestCase
       end
     end
   end
+
+  test "container request display" do
+    use_token 'active'
+
+    cr = api_fixture('container_requests')['completed_with_input_mounts']
+
+    get :show, {id: cr['uuid']}, session_for(:active)
+    assert_response :success
+
+    assert_includes @response.body, CGI.escapeHTML(cr['command'].to_s)
+    assert_includes @response.body, "href=\"\/collections/acbd18db4cc2f85cedef654fccc4a4d8+3%2Ffoo" # mount input1
+    assert_includes @response.body, "href=\"\/collections/37b51d194a7513e45b56f6524f2d51f2+3%2Fbar" # mount input2
+    assert_includes @response.body, "href=\"\/collections/1fd08fc162a5c6413070a8bd0bffc818+150" # mount workflow
+    assert_includes @response.body, "href=\"#Log\""
+    assert_includes @response.body, "href=\"#Provenance\""
+  end
 end
diff --git a/services/api/test/fixtures/container_requests.yml b/services/api/test/fixtures/container_requests.yml
index d5bb47f..ef65fb2 100644
--- a/services/api/test/fixtures/container_requests.yml
+++ b/services/api/test/fixtures/container_requests.yml
@@ -268,6 +268,39 @@ canceled_with_running_container:
     vcpus: 1
     ram: 123
 
+completed_with_input_mounts:
+  uuid: zzzzz-xvhdp-crwithinputmnts
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: completed container request
+  state: Final
+  priority: 1
+  created_at: <%= 24.hour.ago.to_s(:db) %>
+  updated_at: <%= 24.hour.ago.to_s(:db) %>
+  modified_at: <%= 24.hour.ago.to_s(:db) %>
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  container_image: test
+  cwd: test
+  output_path: test
+  command: ["echo", "hello"]
+  runtime_constraints:
+    vcpus: 1
+    ram: 123
+  container_uuid: zzzzz-dz642-compltcontainer
+  log_uuid: zzzzz-4zz18-y9vne9npefyxh8g
+  output_uuid: zzzzz-4zz18-znfnqtbbv4spc3w
+  mounts:
+    /var/lib/cwl/cwl.input.json:
+      content:
+        input1:
+          basename: foo
+          class: File
+          location: "keep:acbd18db4cc2f85cedef654fccc4a4d8+3/foo"
+        input2:
+          basename: bar
+          class: File
+          location: "keep:37b51d194a7513e45b56f6524f2d51f2+3/bar"
+    /var/lib/cwl/workflow.json: "keep:1fd08fc162a5c6413070a8bd0bffc818+150"
+
 uncommitted:
   uuid: zzzzz-xvhdp-cr4uncommittedc
   owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz

commit 23825c0b5ecf436b29a36a1c27efe1120485827e
Merge: 6f62739 fca805a
Author: radhika <radhika at curoverse.com>
Date:   Tue May 2 21:05:25 2017 -0400

    Merge branch 'master' into 10645-cr-mounts-display


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


hooks/post-receive
-- 




More information about the arvados-commits mailing list