[ARVADOS] created: 1.3.0-720-g30fc42873

Git user git at public.curoverse.com
Thu Apr 18 18:18:41 UTC 2019


        at  30fc42873b2c82e72a95393eb053abf1f7052618 (commit)


commit 30fc42873b2c82e72a95393eb053abf1f7052618
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Fri Apr 12 09:55:33 2019 -0400

    15002: Adds admin feature for cancelling completed containers
    
    - Adds documentation and fixed dispatchcloud container test
    
    Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti at veritasgenetics.com>

diff --git a/doc/_config.yml b/doc/_config.yml
index 2ac80f828..510fcc726 100644
--- a/doc/_config.yml
+++ b/doc/_config.yml
@@ -174,6 +174,7 @@ navbar:
     - Other:
       - admin/collection-versioning.html.textile.liquid
       - admin/federation.html.textile.liquid
+      - admin/controlling-container-reuse.html.textile.liquid
       - admin/logs-table-management.html.textile.liquid
   installguide:
     - Overview:
diff --git a/doc/admin/controlling-container-reuse.html.textile.liquid b/doc/admin/controlling-container-reuse.html.textile.liquid
new file mode 100644
index 000000000..76f57f31a
--- /dev/null
+++ b/doc/admin/controlling-container-reuse.html.textile.liquid
@@ -0,0 +1,21 @@
+---
+layout: default
+navsection: admin
+title: Controlling container reuse
+...
+
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: CC-BY-SA-3.0
+{% endcomment %}
+
+This page describes how an admin can control container reuse using the @arv@ command. This can be utilized to avoid reusing a completed container without disabling reuse for the corresponding steps in affected workflows. For example, if a container exited successfully but produced bad output, it may not be feasible to update the workflow immediately. Meanwhile, changing the state of the container from @Complete@ to @Cancelled@ will prevent it from being used in subsequent workflows.
+
+If a container is in the @Complete@ state, the following @arv@ command will change its state to @Cancelled@, where @xxxxx-xxxxx-xxxxxxxxxxxxxxx@ is the @UUID@ of the container:
+
+<pre>arv container update -u xxxxx-xxxxx-xxxxxxxxxxxxxxx -c '{"state":"Cancelled"}'</pre>
+
+Use the following command to list all containers that exited with 0 and were then cancelled:
+
+<pre>arv container list --filters='[["state", "=", "Cancelled"], ["exit_code", "=", 0]]'</pre>See the "arv CLI tool overview":{{site.baseurl}}/sdk/cli/index.html for more details about using the @arv@ command.
diff --git a/doc/api/methods/containers.html.textile.liquid b/doc/api/methods/containers.html.textile.liquid
index f0ce8e362..d59c66edc 100644
--- a/doc/api/methods/containers.html.textile.liquid
+++ b/doc/api/methods/containers.html.textile.liquid
@@ -65,9 +65,11 @@ table(table table-bordered table-condensed).
 |Queued|Waiting for a dispatcher to lock it and try to run the container.|Locked, Cancelled|
 |Locked|A dispatcher has "taken" the container and is allocating resources for it. The container has not started yet.|Queued, Running, Cancelled|
 |Running|Resources have been allocated and the contained process has been started (or is about to start). Crunch-run _must_ set state to Running _before_ there is any possibility that user code will run in the container.|Complete, Cancelled|
-|Complete|Container was running, and the contained process/command has exited.|-|
+|Complete|Container was running, and the contained process/command has exited.|Cancelled|
 |Cancelled|The container did not run long enough to produce an exit code. This includes cases where the container didn't even start, cases where the container was interrupted/killed before it exited by itself (e.g., priority changed to 0), and cases where some problem prevented the system from capturing the contained process's exit status (exit code and output).|-|
 
+See "Controlling container reuse":{{site.baseurl}}/admin/controlling-container-reuse.html for details about changing state from @Complete@ to @Cancelled@
+
 h2(#mount_types). {% include 'mount_types' %}
 
 h2(#runtime_constraints). {% include 'container_runtime_constraints' %}
diff --git a/lib/dispatchcloud/container/queue_test.go b/lib/dispatchcloud/container/queue_test.go
index 3c63fe51e..daf7977ad 100644
--- a/lib/dispatchcloud/container/queue_test.go
+++ b/lib/dispatchcloud/container/queue_test.go
@@ -74,6 +74,7 @@ func (suite *IntegrationSuite) TestGetLockUnlockCancel(c *check.C) {
 			defer wg.Done()
 			err := cq.Unlock(uuid)
 			c.Check(err, check.NotNil)
+			c.Check(err, check.ErrorMatches, ".*cannot unlock when Queued*.")
 
 			err = cq.Lock(uuid)
 			c.Check(err, check.IsNil)
@@ -101,9 +102,6 @@ func (suite *IntegrationSuite) TestGetLockUnlockCancel(c *check.C) {
 		}()
 	}
 	wg.Wait()
-
-	err = cq.Cancel(arvadostest.CompletedContainerUUID)
-	c.Check(err, check.ErrorMatches, `.*State cannot change from Complete to Cancelled.*`)
 }
 
 func (suite *IntegrationSuite) TestCancelIfNoInstanceType(c *check.C) {
diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index 26fdadbd4..d251f8827 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -89,7 +89,8 @@ class Container < ArvadosModel
     nil => [Queued],
     Queued => [Locked, Cancelled],
     Locked => [Queued, Running, Cancelled],
-    Running => [Complete, Cancelled]
+    Running => [Complete, Cancelled],
+    Complete => [Cancelled]
   }
 
   def self.limit_index_columns_read

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list