[ARVADOS] updated: f088cbbb989c6fb2f0e87f226d1118cb015b06aa

Git user git at public.curoverse.com
Thu Sep 22 14:32:38 EDT 2016


Summary of changes:
 apps/workbench/app/models/container_work_unit.rb   |  4 +-
 apps/workbench/test/unit/work_unit_test.rb         |  4 ++
 .../methods/container_requests.html.textile.liquid |  1 +
 .../schema/ContainerRequest.html.textile.liquid    |  6 +++
 services/api/test/fixtures/container_requests.yml  | 57 ++++++++++++++++++++++
 5 files changed, 71 insertions(+), 1 deletion(-)

       via  f088cbbb989c6fb2f0e87f226d1118cb015b06aa (commit)
       via  1bc10ecc9533ca8b6e3a576b4702eb5e363c6375 (commit)
      from  fe8f132725aea9816447ac8a9804b7942bc5dffd (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 f088cbbb989c6fb2f0e87f226d1118cb015b06aa
Merge: fe8f132 1bc10ec
Author: radhika <radhika at curoverse.com>
Date:   Thu Sep 22 14:32:16 2016 -0400

    closes #10036
    Merge branch '10036-canceled-container-state'


commit 1bc10ecc9533ca8b6e3a576b4702eb5e363c6375
Author: radhika <radhika at curoverse.com>
Date:   Wed Sep 21 22:50:24 2016 -0400

    10036: Use status label "Ready" for a canceled container request (priority 0), when it's container_uuid is in Queued or Locked states.

diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index be526ca..b6e72dc 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -81,7 +81,9 @@ class ContainerWorkUnit < ProxyWorkUnit
   def state_label
     ec = exit_code
     return "Failed" if (ec && ec != 0)
-    get_combined(:state)
+    state = get_combined(:state)
+    return "Ready" if ((priority == 0) and (["Queued", "Locked"].include?(state)))
+    state
   end
 
   def exit_code
diff --git a/apps/workbench/test/unit/work_unit_test.rb b/apps/workbench/test/unit/work_unit_test.rb
index 68bc2fd..550f218 100644
--- a/apps/workbench/test/unit/work_unit_test.rb
+++ b/apps/workbench/test/unit/work_unit_test.rb
@@ -12,6 +12,10 @@ class WorkUnitTest < ActiveSupport::TestCase
     [PipelineInstance, 'pipeline_with_tagged_collection_input', "pwu", 1, "Ready", nil, 0.0],
     [Container, 'requester', 'cwu', 1, "Complete", true, 1.0],
     [ContainerRequest, 'cr_for_requester', 'cwu', 1, "Complete", true, 1.0],
+    [ContainerRequest, 'queued', 'cwu', 0, "Queued", nil, 0.0],   # priority 1
+    [ContainerRequest, 'canceled_with_queued_container', 'cwu', 0, "Ready", nil, 0.0],
+    [ContainerRequest, 'canceled_with_locked_container', 'cwu', 0, "Ready", nil, 0.0],
+    [ContainerRequest, 'canceled_with_running_container', 'cwu', 0, "Running", nil, 0.0],
   ].each do |type, fixture, label, num_children, state, success, progress|
     test "children of #{fixture}" do
       use_token 'active'
diff --git a/doc/api/methods/container_requests.html.textile.liquid b/doc/api/methods/container_requests.html.textile.liquid
index 88a53a2..2603079 100644
--- a/doc/api/methods/container_requests.html.textile.liquid
+++ b/doc/api/methods/container_requests.html.textile.liquid
@@ -71,4 +71,5 @@ table(table table-bordered table-condensed).
 
 {% include 'notebox_begin' %}
 Setting the priority of a committed container_request to 0 may cancel a running container assigned for it.
+See "Canceling a ContainerRequest":{{site.baseurl}}/api/schema/ContainerRequest.html#cancel_container for further details.
 {% include 'notebox_end' %}
diff --git a/doc/api/schema/ContainerRequest.html.textile.liquid b/doc/api/schema/ContainerRequest.html.textile.liquid
index 8abb5b3..48c624a 100644
--- a/doc/api/schema/ContainerRequest.html.textile.liquid
+++ b/doc/api/schema/ContainerRequest.html.textile.liquid
@@ -62,3 +62,9 @@ The system will use the following scheme to determine which Container to conside
 {% include 'notebox_begin' %}
 Currently, container reuse is the default behavior and a mechanism to skip reuse is not supported.
 {% include 'notebox_end' %}
+
+h2(#cancel_container). Canceling a ContainerRequest
+
+A ContainerRequest may be canceled by setting it's priority to 0, using an update call.
+
+When a ContainerRequest is canceled, it will still reflect the state of the Container it is associated with via the container_uuid attribute. If that Container is being reused by any other container_requests that are still active, i.e., not yet canceled, that Container may continue to run or be scheduled to run by the system in future. However, if no other container_requests are using that Contianer, then the Container will get canceled as well.
diff --git a/services/api/test/fixtures/container_requests.yml b/services/api/test/fixtures/container_requests.yml
index f22cc3f..e916e47 100644
--- a/services/api/test/fixtures/container_requests.yml
+++ b/services/api/test/fixtures/container_requests.yml
@@ -189,6 +189,63 @@ cr_for_failed:
     vcpus: 1
     ram: 123
 
+canceled_with_queued_container:
+  uuid: zzzzz-xvhdp-canceledqueuedc
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: canceled with queued container
+  state: Committed
+  priority: 0
+  created_at: 2016-01-11 11:11:11.111111111 Z
+  updated_at: 2016-01-11 11:11:11.111111111 Z
+  modified_at: 2016-01-11 11:11:11.111111111 Z
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  container_image: test
+  cwd: test
+  output_path: test
+  command: ["echo", "hello"]
+  container_uuid: zzzzz-dz642-queuedcontainer
+  runtime_constraints:
+    vcpus: 1
+    ram: 123
+
+canceled_with_locked_container:
+  uuid: zzzzz-xvhdp-canceledlocekdc
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: canceled with locked container
+  state: Committed
+  priority: 0
+  created_at: 2016-01-11 11:11:11.111111111 Z
+  updated_at: 2016-01-11 11:11:11.111111111 Z
+  modified_at: 2016-01-11 11:11:11.111111111 Z
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  container_image: test
+  cwd: test
+  output_path: test
+  command: ["echo", "hello"]
+  container_uuid: zzzzz-dz642-lockedcontainer
+  runtime_constraints:
+    vcpus: 1
+    ram: 123
+
+canceled_with_running_container:
+  uuid: zzzzz-xvhdp-canceledrunning
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: canceled with running container
+  state: Committed
+  priority: 0
+  created_at: 2016-01-11 11:11:11.111111111 Z
+  updated_at: 2016-01-11 11:11:11.111111111 Z
+  modified_at: 2016-01-11 11:11:11.111111111 Z
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  container_image: test
+  cwd: test
+  output_path: test
+  command: ["echo", "hello"]
+  container_uuid: zzzzz-dz642-runningcontainr
+  runtime_constraints:
+    vcpus: 1
+    ram: 123
+
 uncommitted:
   uuid: zzzzz-xvhdp-cr4uncommittedc
   owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list