Skip to content

Commit

Permalink
Add cloud provider to the dask config.json file (#2266)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelovilla authored Feb 20, 2024
2 parents 195738e + 8f7d933 commit 5463e8d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/_nebari/stages/kubernetes_services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ class JupyterhubInputVars(schema.Base):
class DaskGatewayInputVars(schema.Base):
dask_worker_image: ImageNameTag = Field(alias="dask-worker-image")
dask_gateway_profiles: Dict[str, Any] = Field(alias="dask-gateway-profiles")
cloud_provider: str = Field(alias="cloud-provider")


class MonitoringInputVars(schema.Base):
Expand Down Expand Up @@ -518,6 +519,7 @@ def input_vars(self, stage_outputs: Dict[str, Dict[str, Any]]):
self.config.default_images.dask_worker
),
dask_gateway_profiles=self.config.profiles.dict()["dask_worker"],
cloud_provider=cloud_provider,
)

monitoring_vars = MonitoringInputVars(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ variable "dask-gateway-profiles" {
description = "Dask Gateway profiles to expose to user"
}


# =================== RESOURCES =====================
module "dask-gateway" {
source = "./modules/kubernetes/services/dask-gateway"
Expand Down Expand Up @@ -39,4 +38,6 @@ module "dask-gateway" {

# profiles
profiles = var.dask-gateway-profiles

cloud-provider = var.cloud-provider
}
5 changes: 0 additions & 5 deletions src/_nebari/stages/kubernetes_services/template/jupyterhub.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ variable "idle-culler-settings" {
type = any
}

variable "cloud-provider" {
description = "Name of cloud provider."
type = string
}

module "kubernetes-nfs-server" {
count = var.jupyterhub-shared-endpoint == null ? 1 : 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,9 @@ def list_dask_environments():

def base_node_group(options):
key = config["worker-node-group"]["key"]
if config.provider.value == "aws":
if config.get("provider", "") == "aws":
key = "dedicated"
default_node_group = {
key: config["worker-node-group"]["value"],
# config["worker-node-group"]["key"]: config["worker-node-group"]["value"],
}
default_node_group = {key: config["worker-node-group"]["value"]}

# check `worker_extra_pod_config` first
worker_node_group = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ resource "kubernetes_secret" "gateway" {
conda-store-api-token = var.conda-store-api-token
conda-store-service-name = var.conda-store-service-name
conda-store-namespace = var.namespace
provider = var.cloud-provider
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,8 @@ variable "conda-store-service-name" {
description = "internal service-name:port where conda-store can be reached"
type = string
}

variable "cloud-provider" {
description = "Name of the cloud provider to deploy to."
type = string
}
6 changes: 6 additions & 0 deletions src/_nebari/stages/kubernetes_services/template/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ variable "jupyterlab-pioneer-log-format" {
description = "Logging format for JupyterLab Pioneer"
type = string
}

variable "jhub-apps-enabled" {
description = "Enable JupyterHub Apps"
type = bool
}

variable "cloud-provider" {
description = "Name of cloud provider."
type = string
}

0 comments on commit 5463e8d

Please sign in to comment.