[ARVADOS] created: e7b46691f98bf4e7edcf1ea3b98a677273d70b3b

Git user git at public.curoverse.com
Tue Apr 25 22:07:06 EDT 2017


        at  e7b46691f98bf4e7edcf1ea3b98a677273d70b3b (commit)


commit e7b46691f98bf4e7edcf1ea3b98a677273d70b3b
Author: Lucas Di Pentima <lucas at curoverse.com>
Date:   Tue Apr 25 23:04:49 2017 -0300

    11185: Added "Re-run without reuse" button to the completed CR page, so that it
    copies the CR modifying the arvados-cwl-runner arguments to avoid container
    reuse.
    Expanded related test.

diff --git a/apps/workbench/app/controllers/container_requests_controller.rb b/apps/workbench/app/controllers/container_requests_controller.rb
index b286a94..75bcebd 100644
--- a/apps/workbench/app/controllers/container_requests_controller.rb
+++ b/apps/workbench/app/controllers/container_requests_controller.rb
@@ -64,7 +64,15 @@ class ContainerRequestsController < ApplicationController
 
     @object = ContainerRequest.new
 
-    @object.command = src.command
+    # If "no reuse" requested, pass the correct argument to arvados-cwl-runner command.
+    if params[:no_reuse] and src.command[0] == 'arvados-cwl-runner'
+      command = src.command - ['--enable-reuse']
+      command.insert(1, '--disable-reuse')
+    else
+      command = src.command
+    end
+
+    @object.command = command
     @object.container_image = src.container_image
     @object.cwd = src.cwd
     @object.description = src.description
diff --git a/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb b/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb
index fd79535..46f4bc9 100644
--- a/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb
+++ b/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb
@@ -1,7 +1,13 @@
 <% if @object.state == 'Final' %>
+  <%= link_to(copy_container_request_path('id' => @object.uuid, 'no_reuse' => true),
+      class: 'btn btn-sm btn-primary',
+      data: {toggle: :tooltip, placement: :top}, title: 'This will make a copy and take you there. You can then make any needed changes and run it without container reuse',
+      method: :post,
+      ) do %>
+    <i class="fa fa-fw fa-play"></i> Re-run without reuse
+  <% end %>
   <%= link_to(copy_container_request_path('id' => @object.uuid),
       class: 'btn btn-sm btn-primary',
-      title: 'Re-run',
       data: {toggle: :tooltip, placement: :top}, title: 'This will make a copy and take you there. You can then make any needed changes and run it',
       method: :post,
       ) do %>
diff --git a/apps/workbench/test/controllers/container_requests_controller_test.rb b/apps/workbench/test/controllers/container_requests_controller_test.rb
index 70e042c..6a0dd30 100644
--- a/apps/workbench/test/controllers/container_requests_controller_test.rb
+++ b/apps/workbench/test/controllers/container_requests_controller_test.rb
@@ -30,7 +30,7 @@ class ContainerRequestsControllerTest < ActionController::TestCase
     assert_select 'Download the log', false
   end
 
-  test "completed container request offers re-run option" do
+  test "completed container request offers re-run options" do
     use_token 'active'
 
     uuid = api_fixture('container_requests')['completed']['uuid']
@@ -39,6 +39,7 @@ class ContainerRequestsControllerTest < ActionController::TestCase
     assert_response :success
 
    assert_includes @response.body, "href=\"/container_requests/#{uuid}/copy\""
+   assert_includes @response.body, "href=\"/container_requests/#{uuid}/copy?no_reuse=true\""
   end
 
   test "container request copy" do

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list