From 3bc7de3d4697a582c091d1a89c2b5b48d70f9111 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Mon, 23 Jan 2023 10:56:16 -0800 Subject: [PATCH] Set daskNodes = [] if dask isn't specified Use jinja's templating abilities here, as otherwise we get a `if "daskhub" == "daskhub"` in the jsonnet itself that is a little hard to read --- eksctl/template.jsonnet | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/eksctl/template.jsonnet b/eksctl/template.jsonnet index afbf6a1854..98646e927f 100644 --- a/eksctl/template.jsonnet +++ b/eksctl/template.jsonnet @@ -26,20 +26,24 @@ local notebookNodes = [ { instanceType: "m5.2xlarge" }, { instanceType: "m5.8xlarge" }, ]; - -local daskNodes = - if "<< hub_type >>" == "daskhub" then [ +<% if hub_type == "daskhub" %> +local daskNodes = [ // Node definitions for dask worker nodes. Config here is merged // with our dask worker node definition, which uses spot instances. // A `node.kubernetes.io/instance-type label is set to the name of the // *first* item in instanceDistribution.instanceTypes, to match // what we do with notebook nodes. Pods can request a particular // kind of node with a nodeSelector - { instancesDistribution+: { instanceTypes: ["m5.large"] }}, - { instancesDistribution+: { instanceTypes: ["m5.xlarge"] }}, - { instancesDistribution+: { instanceTypes: ["m5.2xlarge"] }}, - { instancesDistribution+: { instanceTypes: ["m5.8xlarge"] }}, - ]; + { instancesDistribution+: { instanceTypes: ["m5.large"] }}, + { instancesDistribution+: { instanceTypes: ["m5.xlarge"] }}, + { instancesDistribution+: { instanceTypes: ["m5.2xlarge"] }}, + { instancesDistribution+: { instanceTypes: ["m5.8xlarge"] }}, +]; +<% else %> +local daskNodes = []; +<% endif %> + + { apiVersion: 'eksctl.io/v1alpha5', kind: 'ClusterConfig', @@ -130,4 +134,4 @@ local daskNodes = } + n for n in daskNodes ] else [] ) -} \ No newline at end of file +}