[ARVADOS] updated: 1.1.4-282-g7cc2336

Git user git at public.curoverse.com
Wed May 23 15:25:39 EDT 2018


Summary of changes:
 lib/dispatchcloud/node_size.go      |  1 +
 lib/dispatchcloud/node_size_test.go | 28 ++++++++++++++++++++++++++++
 sdk/go/arvados/config.go            |  1 +
 sdk/go/arvados/container.go         |  3 ++-
 4 files changed, 32 insertions(+), 1 deletion(-)

       via  7cc2336a974945d03649d924cf805fedf92bad41 (commit)
      from  f7029eca4ddc301167078827a6bed2219dd282a6 (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 7cc2336a974945d03649d924cf805fedf92bad41
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Wed May 23 16:13:04 2018 -0300

    7478: Preemptable instances support on GoSDK & dispatchcloud instance chooser
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/lib/dispatchcloud/node_size.go b/lib/dispatchcloud/node_size.go
index 2ca4050..f145901 100644
--- a/lib/dispatchcloud/node_size.go
+++ b/lib/dispatchcloud/node_size.go
@@ -47,6 +47,7 @@ func ChooseInstanceType(cc *arvados.Cluster, ctr *arvados.Container) (best arvad
 		case it.Scratch < needScratch:
 		case it.RAM < needRAM:
 		case it.VCPUs < needVCPUs:
+		case it.Preemptable != ctr.SchedulingParameters.Preemptable:
 		case it.Price == best.Price && (it.RAM < best.RAM || it.VCPUs < best.VCPUs):
 			// Equal price, but worse specs
 		default:
diff --git a/lib/dispatchcloud/node_size_test.go b/lib/dispatchcloud/node_size_test.go
index 0c02a0e..9a5e704 100644
--- a/lib/dispatchcloud/node_size_test.go
+++ b/lib/dispatchcloud/node_size_test.go
@@ -91,3 +91,31 @@ func (*NodeSizeSuite) TestChoose(c *check.C) {
 		c.Check(best.Scratch >= 2*GiB, check.Equals, true)
 	}
 }
+
+func (*NodeSizeSuite) TestChoosePreemptable(c *check.C) {
+	menu := []arvados.InstanceType{
+		{Price: 4.4, RAM: 4000000000, VCPUs: 8, Scratch: 2 * GiB, Preemptable: true, Name: "costly"},
+		{Price: 2.2, RAM: 2000000000, VCPUs: 4, Scratch: 2 * GiB, Name: "almost best"},
+		{Price: 2.2, RAM: 2000000000, VCPUs: 4, Scratch: 2 * GiB, Preemptable: true, Name: "best"},
+		{Price: 1.1, RAM: 1000000000, VCPUs: 2, Scratch: 2 * GiB, Preemptable: true, Name: "small"},
+	}
+	best, err := ChooseInstanceType(&arvados.Cluster{InstanceTypes: menu}, &arvados.Container{
+		Mounts: map[string]arvados.Mount{
+			"/tmp": {Kind: "tmp", Capacity: 2 * GiB},
+		},
+		RuntimeConstraints: arvados.RuntimeConstraints{
+			VCPUs:        2,
+			RAM:          987654321,
+			KeepCacheRAM: 123456789,
+		},
+		SchedulingParameters: arvados.SchedulingParameters{
+			Preemptable: true,
+		},
+	})
+	c.Check(err, check.IsNil)
+	c.Check(best.Name, check.Equals, "best")
+	c.Check(best.RAM >= 1234567890, check.Equals, true)
+	c.Check(best.VCPUs >= 2, check.Equals, true)
+	c.Check(best.Scratch >= 2*GiB, check.Equals, true)
+	c.Check(best.Preemptable, check.Equals, true)
+}
diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go
index 9ed0eac..b0c7069 100644
--- a/sdk/go/arvados/config.go
+++ b/sdk/go/arvados/config.go
@@ -62,6 +62,7 @@ type InstanceType struct {
 	RAM          int64
 	Scratch      int64
 	Price        float64
+	Preemptable  bool
 }
 
 // GetThisSystemNode returns a SystemNode for the node we're running
diff --git a/sdk/go/arvados/container.go b/sdk/go/arvados/container.go
index daafc49..e71bcd5 100644
--- a/sdk/go/arvados/container.go
+++ b/sdk/go/arvados/container.go
@@ -52,7 +52,8 @@ type RuntimeConstraints struct {
 // SchedulingParameters specify a container's scheduling parameters
 // such as Partitions
 type SchedulingParameters struct {
-	Partitions []string `json:"partitions"`
+	Partitions  []string `json:"partitions"`
+	Preemptable bool     `json:"preemptable"`
 }
 
 // ContainerList is an arvados#containerList resource.

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list