[ARVADOS] created: 10441f4b9de13a1f9e1dc6c0f025b26d2d25ab10

Git user git at public.curoverse.com
Tue May 2 23:16:30 EDT 2017


        at  10441f4b9de13a1f9e1dc6c0f025b26d2d25ab10 (commit)


commit 10441f4b9de13a1f9e1dc6c0f025b26d2d25ab10
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Tue May 2 22:53:28 2017 -0400

    11369: Fix tests.  Tweak test fixture to include a mounts entry with capacity.

diff --git a/services/api/test/fixtures/containers.yml b/services/api/test/fixtures/containers.yml
index d1f4c7b..863309d 100644
--- a/services/api/test/fixtures/containers.yml
+++ b/services/api/test/fixtures/containers.yml
@@ -12,6 +12,10 @@ queued:
   runtime_constraints:
     ram: 12000000000
     vcpus: 4
+  mounts:
+    /tmp:
+      kind: tmp
+      capacity: 24000000000
 
 running:
   uuid: zzzzz-dz642-runningcontainr
diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
index e6abb16..e1e8c79 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
@@ -118,10 +118,11 @@ func (s *TestSuite) TestIntegrationCancel(c *C) {
 }
 
 func (s *TestSuite) TestIntegrationMissingFromSqueue(c *C) {
-	container := s.integrationTest(c, func() *exec.Cmd { return exec.Command("echo") }, []string{"sbatch", "--share",
+	container := s.integrationTest(c, func() *exec.Cmd { return exec.Command("echo") }, []string{"sbatch",
 		fmt.Sprintf("--job-name=%s", "zzzzz-dz642-queuedcontainer"),
-		fmt.Sprintf("--mem-per-cpu=%d", 2862),
-		fmt.Sprintf("--cpus-per-task=%d", 4)},
+		fmt.Sprintf("--mem=%d", 11445),
+		fmt.Sprintf("--cpus-per-task=%d", 4),
+		fmt.Sprintf("--tmp=%d", 22889)},
 		func(dispatcher *dispatch.Dispatcher, container arvados.Container) {
 			dispatcher.UpdateState(container.UUID, dispatch.Running)
 			time.Sleep(3 * time.Second)
@@ -327,9 +328,9 @@ func testSbatchFuncWithArgs(c *C, args []string) {
 	sbatchCmd := sbatchFunc(container)
 
 	var expected []string
-	expected = append(expected, "sbatch", "--share")
+	expected = append(expected, "sbatch")
 	expected = append(expected, theConfig.SbatchArguments...)
-	expected = append(expected, "--job-name=123", "--mem-per-cpu=120", "--cpus-per-task=2")
+	expected = append(expected, "--job-name=123", "--mem=239", "--cpus-per-task=2", "--tmp=0")
 
 	c.Check(sbatchCmd.Args, DeepEquals, expected)
 }
@@ -340,8 +341,8 @@ func (s *MockArvadosServerSuite) TestSbatchPartition(c *C) {
 	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,b2")
+	expected = append(expected, "sbatch")
+	expected = append(expected, "--job-name=123", "--mem=239", "--cpus-per-task=1", "--tmp=0", "--partition=blurb,b2")
 
 	c.Check(sbatchCmd.Args, DeepEquals, expected)
 }

commit 9350a0562776be66a099dce1c3e825b32f5a8907
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Tue May 2 22:21:36 2017 -0400

    11369: RAM request includes keep cache RAM.  Add request for temp disk.

diff --git a/sdk/go/arvados/container.go b/sdk/go/arvados/container.go
index 36d9af1..d59a57c 100644
--- a/sdk/go/arvados/container.go
+++ b/sdk/go/arvados/container.go
@@ -27,6 +27,7 @@ type Mount struct {
 	Path              string      `json:"path"`
 	Content           interface{} `json:"content"`
 	ExcludeFromOutput bool        `json:"exclude_from_output"`
+	Capacity          int64       `json:capacity`
 }
 
 // RuntimeConstraints specify a container's compute resources (RAM,
diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index d84d461..71852bf 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -149,14 +149,20 @@ func checkSqueueForOrphans(dispatcher *dispatch.Dispatcher, sqCheck *SqueueCheck
 
 // sbatchCmd
 func sbatchFunc(container arvados.Container) *exec.Cmd {
-	memPerCPU := math.Ceil(float64(container.RuntimeConstraints.RAM) / (float64(container.RuntimeConstraints.VCPUs) * 1048576))
+	mem := int64(math.Ceil(float64(container.RuntimeConstraints.RAM+container.RuntimeConstraints.KeepCacheRAM) / float64(1048576)))
+
+	var disk int64
+	for _, m := range container.Mounts {
+		disk += m.Capacity
+	}
+	disk = int64(math.Ceil(float64(disk) / float64(1048576)))
 
 	var sbatchArgs []string
-	sbatchArgs = append(sbatchArgs, "--share")
 	sbatchArgs = append(sbatchArgs, theConfig.SbatchArguments...)
 	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("--mem=%d", mem))
 	sbatchArgs = append(sbatchArgs, fmt.Sprintf("--cpus-per-task=%d", container.RuntimeConstraints.VCPUs))
+	sbatchArgs = append(sbatchArgs, fmt.Sprintf("--tmp=%d", disk))
 	if len(container.SchedulingParameters.Partitions) > 0 {
 		sbatchArgs = append(sbatchArgs, fmt.Sprintf("--partition=%s", strings.Join(container.SchedulingParameters.Partitions, ",")))
 	}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list