[ARVADOS] created: b1422acdaf10b223bdcae9c9c574d11bd9eb7ffc

Git user git at public.curoverse.com
Thu Oct 6 14:54:03 EDT 2016


        at  b1422acdaf10b223bdcae9c9c574d11bd9eb7ffc (commit)


commit b1422acdaf10b223bdcae9c9c574d11bd9eb7ffc
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Oct 6 14:53:57 2016 -0400

    10186: Add PartitionRequirement

diff --git a/sdk/cwl/arvados_cwl/arv-cwl-schema.yml b/sdk/cwl/arvados_cwl/arv-cwl-schema.yml
index ee18347..7112ddc 100644
--- a/sdk/cwl/arvados_cwl/arv-cwl-schema.yml
+++ b/sdk/cwl/arvados_cwl/arv-cwl-schema.yml
@@ -60,6 +60,14 @@ $graph:
         Preferred backing store for output staging.  If not specified, the
         system may choose which one to use.
 
+- name: PartitionRequirement
+  type: record
+  doc: |
+    Select preferred compute partition on which to run jobs.
+  fields:
+    - name: partition
+      type: string
+
 - name: APIRequirement
   type: record
   doc: |
diff --git a/sdk/cwl/arvados_cwl/arvcontainer.py b/sdk/cwl/arvados_cwl/arvcontainer.py
index fa32456..3cfc306 100644
--- a/sdk/cwl/arvados_cwl/arvcontainer.py
+++ b/sdk/cwl/arvados_cwl/arvcontainer.py
@@ -98,6 +98,10 @@ class ArvadosContainer(object):
         if runtime_req:
             logger.warn("RuntimeConstraints not yet supported by container API")
 
+        partition_req, _ = get_feature(self, "http://arvados.org/cwl#PartitionRequirement")
+        if partition_req:
+            runtime_constraints["partition"] = partition_req["partition"]
+
         container_request["mounts"] = mounts
         container_request["runtime_constraints"] = runtime_constraints
 

commit f35e22ef4abc012cad2260149657b95bfbcbac5d
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Oct 6 14:38:30 2016 -0400

    10186: Add support for "partition" in runtime_constraints.  Add --all to squeue to ensure that it sees all paritions.

diff --git a/sdk/go/arvados/container.go b/sdk/go/arvados/container.go
index bb36b17..140dbf4 100644
--- a/sdk/go/arvados/container.go
+++ b/sdk/go/arvados/container.go
@@ -30,9 +30,10 @@ type Mount struct {
 // RuntimeConstraints specify a container's compute resources (RAM,
 // CPU) and network connectivity.
 type RuntimeConstraints struct {
-	API   *bool
-	RAM   int `json:"ram"`
-	VCPUs int `json:"vcpus"`
+	API       *bool
+	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 5a1ebc5..f06e0b3 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -127,6 +127,9 @@ 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))
+	}
 
 	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 e7ccf25..ae91192 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
@@ -305,13 +305,25 @@ func (s *MockArvadosServerSuite) TestSbatchFuncWithConfigArgs(c *C) {
 func testSbatchFuncWithArgs(c *C, args []string) {
 	theConfig.SbatchArguments = append(theConfig.SbatchArguments, args...)
 
-	container := arvados.Container{UUID: "123", RuntimeConstraints: arvados.RuntimeConstraints{RAM: 1000000, VCPUs: 2}}
+	container := arvados.Container{UUID: "123", RuntimeConstraints: arvados.RuntimeConstraints{RAM: 250000000, VCPUs: 2}}
 	sbatchCmd := sbatchFunc(container)
 
 	var expected []string
 	expected = append(expected, "sbatch", "--share")
 	expected = append(expected, theConfig.SbatchArguments...)
-	expected = append(expected, "--job-name=123", "--mem-per-cpu=1", "--cpus-per-task=2")
+	expected = append(expected, "--job-name=123", "--mem-per-cpu=120", "--cpus-per-task=2")
+
+	c.Check(sbatchCmd.Args, DeepEquals, expected)
+}
+
+func (s *MockArvadosServerSuite) TestSbatchPartition(c *C) {
+	theConfig.SbatchArguments = nil
+	container := arvados.Container{UUID: "123", RuntimeConstraints: arvados.RuntimeConstraints{RAM: 250000000, VCPUs: 1, Partition: "blurb"}}
+	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")
 
 	c.Check(sbatchCmd.Args, DeepEquals, expected)
 }
diff --git a/services/crunch-dispatch-slurm/squeue.go b/services/crunch-dispatch-slurm/squeue.go
index 34e6632..fafa3c3 100644
--- a/services/crunch-dispatch-slurm/squeue.go
+++ b/services/crunch-dispatch-slurm/squeue.go
@@ -19,7 +19,7 @@ type Squeue struct {
 
 // squeueFunc
 func squeueFunc() *exec.Cmd {
-	return exec.Command("squeue", "--format=%j")
+	return exec.Command("squeue", "--all", "--format=%j")
 }
 
 var squeueCmd = squeueFunc

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list