[ARVADOS] updated: 1.1.1-120-g0910e85

Git user git at public.curoverse.com
Mon Dec 4 12:57:59 EST 2017


Summary of changes:
 services/crunch-dispatch-slurm/crunch-dispatch-slurm.go  |  4 +++-
 .../crunch-dispatch-slurm/crunch-dispatch-slurm_test.go  | 16 ++++++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)

       via  0910e857cbde6a23802ba026c3e5811e9d7b1d97 (commit)
      from  1cd144fe8da5fdc1d2e2e0ba2a3dcf47fc717251 (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 0910e857cbde6a23802ba026c3e5811e9d7b1d97
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Mon Dec 4 11:36:35 2017 -0500

    12573: Fix tests.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index c6ef47c..9dea3cb 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -158,7 +158,8 @@ func niceness(priority int) int {
 	if priority < 0 {
 		priority = 0
 	}
-	return (1000 - priority) * 1000
+	// Niceness range 1-10000
+	return (1000 - priority) * 10
 }
 
 // sbatchCmd
@@ -296,6 +297,7 @@ func run(disp *dispatch.Dispatcher, ctr arvados.Container, status <-chan arvados
 				scancel(ctr)
 			} else if niceness(updated.Priority) != sqCheck.GetNiceness(ctr.UUID) && sqCheck.GetNiceness(ctr.UUID) != -1 {
 				// dynamically adjust priority
+				log.Printf("Container priority %v != %v", niceness(updated.Priority), sqCheck.GetNiceness(ctr.UUID))
 				scontrolUpdate(updated)
 			}
 		}
diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
index 33cfdfc..a823755 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
@@ -166,7 +166,7 @@ func (s *TestSuite) TestIntegrationNormal(c *C) {
 			if done {
 				return exec.Command("true")
 			} else {
-				return exec.Command("echo", "zzzzz-dz642-queuedcontainer 999000")
+				return exec.Command("echo", "zzzzz-dz642-queuedcontainer 9990 100")
 			}
 		},
 		nil,
@@ -192,7 +192,7 @@ func (s *TestSuite) TestIntegrationCancel(c *C) {
 			if cmd != nil && cmd.ProcessState != nil {
 				return exec.Command("true")
 			} else {
-				return exec.Command("echo", "zzzzz-dz642-queuedcontainer 999000")
+				return exec.Command("echo", "zzzzz-dz642-queuedcontainer 9990 100")
 			}
 		},
 		func(container arvados.Container) *exec.Cmd {
@@ -230,7 +230,7 @@ func (s *TestSuite) TestIntegrationMissingFromSqueue(c *C) {
 			fmt.Sprintf("--mem=%d", 11445),
 			fmt.Sprintf("--cpus-per-task=%d", 4),
 			fmt.Sprintf("--tmp=%d", 45777),
-			fmt.Sprintf("--nice=%d", 999000)},
+			fmt.Sprintf("--nice=%d", 9990)},
 		func(dispatcher *dispatch.Dispatcher, container arvados.Container) {
 			dispatcher.UpdateState(container.UUID, dispatch.Running)
 			time.Sleep(3 * time.Second)
@@ -398,7 +398,7 @@ func testSbatchFuncWithArgs(c *C, args []string) {
 	var expected []string
 	expected = append(expected, "sbatch")
 	expected = append(expected, theConfig.SbatchArguments...)
-	expected = append(expected, "--job-name=123", "--mem=239", "--cpus-per-task=2", "--tmp=0", "--nice=999000")
+	expected = append(expected, "--job-name=123", "--mem=239", "--cpus-per-task=2", "--tmp=0", "--nice=9990")
 
 	c.Check(sbatchCmd.Args, DeepEquals, expected)
 }
@@ -414,7 +414,7 @@ func (s *MockArvadosServerSuite) TestSbatchPartition(c *C) {
 
 	var expected []string
 	expected = append(expected, "sbatch")
-	expected = append(expected, "--job-name=123", "--mem=239", "--cpus-per-task=1", "--tmp=0", "--nice=999000", "--partition=blurb,b2")
+	expected = append(expected, "--job-name=123", "--mem=239", "--cpus-per-task=1", "--tmp=0", "--nice=9990", "--partition=blurb,b2")
 
 	c.Check(sbatchCmd.Args, DeepEquals, expected)
 }
@@ -426,9 +426,9 @@ func (s *TestSuite) TestIntegrationChangePriority(c *C) {
 	container := s.integrationTest(c,
 		func() *exec.Cmd {
 			if step == 0 {
-				return exec.Command("echo", "zzzzz-dz642-queuedcontainer 999000")
+				return exec.Command("echo", "zzzzz-dz642-queuedcontainer 9990 100")
 			} else if step == 1 {
-				return exec.Command("echo", "zzzzz-dz642-queuedcontainer 400000")
+				return exec.Command("echo", "zzzzz-dz642-queuedcontainer 4000 100")
 			} else {
 				return exec.Command("echo")
 			}
@@ -453,5 +453,5 @@ func (s *TestSuite) TestIntegrationChangePriority(c *C) {
 			dispatcher.UpdateState(container.UUID, dispatch.Complete)
 		})
 	c.Check(container.State, Equals, arvados.ContainerStateComplete)
-	c.Check(scontrolCmdLine, DeepEquals, []string{"scontrol", "update", "JobName=zzzzz-dz642-queuedcontainer", "Nice=400000"})
+	c.Check(scontrolCmdLine, DeepEquals, []string{"scontrol", "update", "JobName=zzzzz-dz642-queuedcontainer", "Nice=4000"})
 }

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list