-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use spot instances for dask workers #605
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,10 +7,9 @@ local clusterRegion = "us-west-2"; | |||||
local masterAzs = ["us-west-2a", "us-west-2b", "us-west-2c"]; | ||||||
local nodeAz = "us-west-2a"; | ||||||
|
||||||
// Node definitions for use with dask and notebook nodes | ||||||
// These are merged in with the defaults for either node type, | ||||||
// and so can contain any overrides. | ||||||
local nodes = [ | ||||||
// Node definitions for notebook nodes. Only `instanceType` is | ||||||
// supported as a property. | ||||||
local notebookNodes = [ | ||||||
{ instanceType: "r5.large" }, | ||||||
{ instanceType: "r5.xlarge" }, | ||||||
{ instanceType: "r5.2xlarge" }, | ||||||
|
@@ -19,6 +18,15 @@ local nodes = [ | |||||
{ instanceType: "x1.32xlarge" } | ||||||
]; | ||||||
|
||||||
// Node definitions for notebook nodes. Only `instanceType` is | ||||||
// supported as a property. | ||||||
local daskNodes = [ | ||||||
{ instanceType: "r5.large" }, | ||||||
{ instanceType: "r5.xlarge" }, | ||||||
{ instanceType: "r5.2xlarge" }, | ||||||
{ instanceType: "r5.8xlarge" }, | ||||||
]; | ||||||
|
||||||
cluster { | ||||||
metadata+: { | ||||||
name: "carbonplanhub", | ||||||
|
@@ -44,10 +52,11 @@ cluster { | |||||
ng { | ||||||
// NodeGroup names can't have a '.' in them, while | ||||||
// instanceTypes always have a . | ||||||
name: "nb-%s" % std.strReplace(self.instanceType, ".", "-"), | ||||||
name: "nb-%s" % std.strReplace(n.instanceType, ".", "-"), | ||||||
availabilityZones: [nodeAz], | ||||||
minSize: 0, | ||||||
maxSize: 500, | ||||||
instanceType: n.instanceType, | ||||||
ssh: { | ||||||
publicKeyPath: 'ssh-keys/carbonplan.key.pub' | ||||||
}, | ||||||
|
@@ -60,12 +69,12 @@ cluster { | |||||
"hub.jupyter.org/dedicated": "user:NoSchedule" | ||||||
}, | ||||||
|
||||||
} + n for n in nodes | ||||||
} + n for n in notebookNodes | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know jsonnet, but there is an inconsistency here. Below it sais
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @consideRatio yeah, I was trying to be 'clever' and just be able to set |
||||||
] + [ | ||||||
ng { | ||||||
// NodeGroup names can't have a '.' in them, while | ||||||
// instanceTypes always have a . | ||||||
name: "dask-%s" % std.strReplace(self.instanceType, ".", "-"), | ||||||
name: "dask-%s" % std.strReplace(n.instanceType, ".", "-"), | ||||||
availabilityZones: [nodeAz], | ||||||
minSize: 0, | ||||||
maxSize: 500, | ||||||
|
@@ -79,8 +88,13 @@ cluster { | |||||
"k8s.dask.org_dedicated" : "worker:NoSchedule", | ||||||
"k8s.dask.org/dedicated" : "worker:NoSchedule" | ||||||
}, | ||||||
|
||||||
} + n for n in nodes | ||||||
instancesDistribution: { | ||||||
instanceTypes: [n.instanceType], | ||||||
onDemandBaseCapacity: 0, | ||||||
onDemandPercentageAboveBaseCapacity: 0, | ||||||
spotAllocationStrategy: "capacity-optimized", | ||||||
}, | ||||||
} for n in daskNodes | ||||||
] | ||||||
|
||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -15,12 +15,12 @@ local makeCloudTaints(taints) = { | |||||
availabilityZones: [], | ||||||
minSize: 0, | ||||||
desiredCapacity: self.minSize, | ||||||
instanceType: '', | ||||||
volumeSize: 80, | ||||||
labels+: { | ||||||
// Add instance type as label to nodegroups, so they | ||||||
// can be picked up by the autoscaler | ||||||
'node.kubernetes.io/instance-type': $.instanceType, | ||||||
// can be picked up by the autoscaler. If using spot instances, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Indentation nitpick |
||||||
// pick the first instancetype | ||||||
'node.kubernetes.io/instance-type': if std.objectHas($, 'instanceType') then $.instanceType else $.instancesDistribution.instanceTypes[0], | ||||||
}, | ||||||
taints+: {}, | ||||||
tags: makeCloudLabels(self.labels) + makeCloudTaints(self.taints), | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.