[ARVADOS] updated: a5ce43cd7493e17fe1bb5f67451957b283881228

Git user git at public.curoverse.com
Fri Oct 7 14:57:23 EDT 2016


Summary of changes:
 doc/_includes/_container_runtime_constraints.liquid          | 1 +
 sdk/cwl/arvados_cwl/arv-cwl-schema.yml                       | 6 ++++--
 sdk/cwl/arvados_cwl/arvcontainer.py                          | 3 ++-
 sdk/cwl/tests/test_container.py                              | 2 +-
 sdk/go/arvados/container.go                                  | 6 +++---
 services/crunch-dispatch-slurm/crunch-dispatch-slurm.go      | 4 ++--
 services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go | 4 ++--
 7 files changed, 15 insertions(+), 11 deletions(-)

       via  a5ce43cd7493e17fe1bb5f67451957b283881228 (commit)
      from  8d0f1cbda7cb58b15923813d5fca0448cb7b330e (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 a5ce43cd7493e17fe1bb5f67451957b283881228
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri Oct 7 14:57:05 2016 -0400

    10186: "partition" container runtime constraint takes array of strings instead
    of single name.

diff --git a/doc/_includes/_container_runtime_constraints.liquid b/doc/_includes/_container_runtime_constraints.liquid
index fbf4b74..06bfb4f 100644
--- a/doc/_includes/_container_runtime_constraints.liquid
+++ b/doc/_includes/_container_runtime_constraints.liquid
@@ -7,3 +7,4 @@ table(table table-bordered table-condensed).
 |ram|integer|Number of ram bytes to be used to run this process.|Optional. However, a ContainerRequest that is in "Committed" state must provide this.|
 |vcpus|integer|Number of cores to be used to run this process.|Optional. However, a ContainerRequest that is in "Committed" state must provide this.|
 |API|boolean|When set, ARVADOS_API_HOST and ARVADOS_API_TOKEN will be set, and container will have networking enabled to access the Arvados API server.|Optional.|
+|partition|array of strings|Specify the names of one or more compute partitions that may run this container.  If not provided, the system chooses where to run the container.|Optional.|
diff --git a/sdk/cwl/arvados_cwl/arv-cwl-schema.yml b/sdk/cwl/arvados_cwl/arv-cwl-schema.yml
index 7112ddc..3a6eb47 100644
--- a/sdk/cwl/arvados_cwl/arv-cwl-schema.yml
+++ b/sdk/cwl/arvados_cwl/arv-cwl-schema.yml
@@ -63,10 +63,12 @@ $graph:
 - name: PartitionRequirement
   type: record
   doc: |
-    Select preferred compute partition on which to run jobs.
+    Select preferred compute partitions on which to run jobs.
   fields:
     - name: partition
-      type: string
+      type:
+        - string
+        - string[]
 
 - name: APIRequirement
   type: record
diff --git a/sdk/cwl/arvados_cwl/arvcontainer.py b/sdk/cwl/arvados_cwl/arvcontainer.py
index 3cfc306..a3220f9 100644
--- a/sdk/cwl/arvados_cwl/arvcontainer.py
+++ b/sdk/cwl/arvados_cwl/arvcontainer.py
@@ -5,6 +5,7 @@ import os
 from cwltool.errors import WorkflowException
 from cwltool.process import get_feature, UnsupportedRequirement, shortname
 from cwltool.pathmapper import adjustFiles
+from cwltool.utils import aslist
 
 import arvados.collection
 
@@ -100,7 +101,7 @@ class ArvadosContainer(object):
 
         partition_req, _ = get_feature(self, "http://arvados.org/cwl#PartitionRequirement")
         if partition_req:
-            runtime_constraints["partition"] = partition_req["partition"]
+            runtime_constraints["partition"] = aslist(partition_req["partition"])
 
         container_request["mounts"] = mounts
         container_request["runtime_constraints"] = runtime_constraints
diff --git a/sdk/cwl/tests/test_container.py b/sdk/cwl/tests/test_container.py
index 54639a4..b549997 100644
--- a/sdk/cwl/tests/test_container.py
+++ b/sdk/cwl/tests/test_container.py
@@ -117,7 +117,7 @@ class TestContainer(unittest.TestCase):
                     'vcpus': 3,
                     'ram': 3145728000,
                     'API': True,
-                    'partition': 'blurb'
+                    'partition': ['blurb']
                 }, 'priority': 1,
                 'mounts': {
                     '/var/spool/cwl': {'kind': 'tmp'}
diff --git a/sdk/go/arvados/container.go b/sdk/go/arvados/container.go
index 140dbf4..e5050cb 100644
--- a/sdk/go/arvados/container.go
+++ b/sdk/go/arvados/container.go
@@ -31,9 +31,9 @@ type Mount struct {
 // CPU) and network connectivity.
 type RuntimeConstraints struct {
 	API       *bool
-	RAM       int    `json:"ram"`
-	VCPUs     int    `json:"vcpus"`
-	Partition string `json:"partition"`
+	RAM       int      `json:"ram"`
+	VCPUs     int      `json:"vcpus"`
+	Partition []string `json:"partition"`
 }
 
 // ContainerList is an arvados#containerList resource.
diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index f06e0b3..b65ed22 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -127,8 +127,8 @@ func sbatchFunc(container arvados.Container) *exec.Cmd {
 	sbatchArgs = append(sbatchArgs, fmt.Sprintf("--job-name=%s", container.UUID))
 	sbatchArgs = append(sbatchArgs, fmt.Sprintf("--mem-per-cpu=%d", int(memPerCPU)))
 	sbatchArgs = append(sbatchArgs, fmt.Sprintf("--cpus-per-task=%d", container.RuntimeConstraints.VCPUs))
-	if container.RuntimeConstraints.Partition != "" {
-		sbatchArgs = append(sbatchArgs, fmt.Sprintf("--partition=%s", container.RuntimeConstraints.Partition))
+	if container.RuntimeConstraints.Partition != nil {
+		sbatchArgs = append(sbatchArgs, fmt.Sprintf("--partition=%s", strings.Join(container.RuntimeConstraints.Partition, ",")))
 	}
 
 	return exec.Command("sbatch", sbatchArgs...)
diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
index ae91192..c9208a6 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
@@ -318,12 +318,12 @@ func testSbatchFuncWithArgs(c *C, args []string) {
 
 func (s *MockArvadosServerSuite) TestSbatchPartition(c *C) {
 	theConfig.SbatchArguments = nil
-	container := arvados.Container{UUID: "123", RuntimeConstraints: arvados.RuntimeConstraints{RAM: 250000000, VCPUs: 1, Partition: "blurb"}}
+	container := arvados.Container{UUID: "123", RuntimeConstraints: arvados.RuntimeConstraints{RAM: 250000000, VCPUs: 1, Partition: []string{"blurb", "b2"}}}
 	sbatchCmd := sbatchFunc(container)
 
 	var expected []string
 	expected = append(expected, "sbatch", "--share")
-	expected = append(expected, "--job-name=123", "--mem-per-cpu=239", "--cpus-per-task=1", "--partition=blurb")
+	expected = append(expected, "--job-name=123", "--mem-per-cpu=239", "--cpus-per-task=1", "--partition=blurb,b2")
 
 	c.Check(sbatchCmd.Args, DeepEquals, expected)
 }

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list