From 2e2d5e0bafcf38900e9598561c391b9bf9d9a2e6 Mon Sep 17 00:00:00 2001 From: Adam-D-Lewis <23342526+Adam-D-Lewis@users.noreply.github.com> Date: Fri, 30 Jun 2023 16:59:47 -0500 Subject: [PATCH 01/11] update to JHub chart v2 --- .../modules/kubernetes/services/jupyterhub/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/main.tf b/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/main.tf index 4d2ced25c..19255c098 100644 --- a/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/main.tf +++ b/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/main.tf @@ -17,7 +17,7 @@ resource "helm_release" "jupyterhub" { repository = "https://jupyterhub.github.io/helm-chart/" chart = "jupyterhub" - version = "1.2.0" + version = "2.0.0" values = concat([ file("${path.module}/values.yaml"), From 1b17da543a16eef325b5337d414a6e8fa4bcff72 Mon Sep 17 00:00:00 2001 From: Adam-D-Lewis <23342526+Adam-D-Lewis@users.noreply.github.com> Date: Tue, 4 Jul 2023 08:43:10 -0500 Subject: [PATCH 02/11] ignore taint changes so we don't have to delete and recreate gpu node groups all the time on GCP --- .../stages/02-infrastructure/gcp/modules/kubernetes/main.tf | 6 ++++++ .../modules/nvidia-installer/gcp-nvidia-installer.tf | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf index da66989bc..19ac6d02d 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf @@ -106,4 +106,10 @@ resource "google_container_node_pool" "main" { } } } + + lifecycle { + ignore_changes = [ + node_config[0].taint + ] + } } diff --git a/src/_nebari/template/stages/03-kubernetes-initialize/modules/nvidia-installer/gcp-nvidia-installer.tf b/src/_nebari/template/stages/03-kubernetes-initialize/modules/nvidia-installer/gcp-nvidia-installer.tf index 544aed0b8..294fbd2e6 100644 --- a/src/_nebari/template/stages/03-kubernetes-initialize/modules/nvidia-installer/gcp-nvidia-installer.tf +++ b/src/_nebari/template/stages/03-kubernetes-initialize/modules/nvidia-installer/gcp-nvidia-installer.tf @@ -74,8 +74,9 @@ resource "kubernetes_daemonset" "gcp_nvidia_installer" { } } init_container { - image = "cos-nvidia-installer:fixed" - name = "nvidia-driver-installer" + image = "cos-nvidia-installer:fixed" + name = "nvidia-driver-installer" + command = ["/cos-gpu-installer", "install", "--version=latest"] resources { requests = { cpu = 0.15 From a8d48f3c031ab52f69c639c41db6e4aa2c42e21e Mon Sep 17 00:00:00 2001 From: Adam-D-Lewis <23342526+Adam-D-Lewis@users.noreply.github.com> Date: Wed, 5 Jul 2023 11:16:27 -0500 Subject: [PATCH 03/11] add tags to node pools --- src/_nebari/template/stages/02-infrastructure/gcp/main.tf | 1 + .../stages/02-infrastructure/gcp/modules/kubernetes/main.tf | 2 +- .../02-infrastructure/gcp/modules/kubernetes/variables.tf | 6 ++++++ .../template/stages/02-infrastructure/gcp/variables.tf | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/main.tf b/src/_nebari/template/stages/02-infrastructure/gcp/main.tf index 758e4f53e..95d1c91a3 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/main.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/main.tf @@ -34,4 +34,5 @@ module "kubernetes" { private_cluster_config = var.private_cluster_config kubernetes_version = var.kubernetes_version release_channel = var.release_channel + tags = var.tags } diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf index 19ac6d02d..ac253509e 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf @@ -57,7 +57,6 @@ resource "google_container_cluster" "main" { } } - lifecycle { ignore_changes = [ node_locations @@ -105,6 +104,7 @@ resource "google_container_node_pool" "main" { count = guest_accelerator.value.count } } + tags = var.tags } lifecycle { diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/variables.tf b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/variables.tf index 03ef5a8a3..9cc3d4b13 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/variables.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/variables.tf @@ -144,3 +144,9 @@ variable "private_cluster_config" { })) default = null } + +variable "tags" { + description = "Google Cloud Platform tags to assign to resources" + type = list(string) + default = [] +} diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/variables.tf b/src/_nebari/template/stages/02-infrastructure/gcp/variables.tf index 18607c7b6..c56f62c03 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/variables.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/variables.tf @@ -38,8 +38,8 @@ variable "kubeconfig_filename" { variable "tags" { description = "Google Cloud Platform tags to assign to resources" - type = map(string) - default = {} + type = list(string) + default = [] } variable "kubernetes_version" { From 98ba4520b558e1cafeddc2389e89b5ea3c55bcce Mon Sep 17 00:00:00 2001 From: Adam-D-Lewis <23342526+Adam-D-Lewis@users.noreply.github.com> Date: Wed, 5 Jul 2023 11:23:06 -0500 Subject: [PATCH 04/11] fix unusable terraform overrides for gcp --- src/_nebari/stages/input_vars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_nebari/stages/input_vars.py b/src/_nebari/stages/input_vars.py index 85859cd2b..cddf4358d 100644 --- a/src/_nebari/stages/input_vars.py +++ b/src/_nebari/stages/input_vars.py @@ -89,7 +89,7 @@ def stage_02_infrastructure(stage_outputs, config): "kubeconfig_filename": os.path.join( tempfile.gettempdir(), "NEBARI_KUBECONFIG" ), - **config.get("gcp", {}).get("terraform_overrides", {}), + **config.get("google_cloud_platform", {}).get("terraform_overrides", {}), } elif config["provider"] == "azure": return { From a17b01802dff30069fcc784070e7eaaa11834a73 Mon Sep 17 00:00:00 2001 From: Adam-D-Lewis <23342526+Adam-D-Lewis@users.noreply.github.com> Date: Wed, 5 Jul 2023 12:11:01 -0500 Subject: [PATCH 05/11] remove cds dashboards integration from nebari --- src/_nebari/initialize.py | 6 -- src/_nebari/schema.py | 13 ---- src/_nebari/stages/input_vars.py | 7 -- .../07-kubernetes-services/jupyterhub.tf | 27 ++----- .../jupyterhub/files/jupyterhub/01-theme.py | 4 - .../jupyterhub/files/jupyterhub/02-spawner.py | 74 +------------------ .../kubernetes/services/jupyterhub/main.tf | 2 - .../services/jupyterhub/variables.tf | 19 ----- .../07-kubernetes-services/variables.tf | 9 +-- .../qhub-config-do-310-customauth.yaml | 8 +- 10 files changed, 12 insertions(+), 157 deletions(-) diff --git a/src/_nebari/initialize.py b/src/_nebari/initialize.py index f00288baa..de051058f 100644 --- a/src/_nebari/initialize.py +++ b/src/_nebari/initialize.py @@ -63,11 +63,6 @@ def base_configuration(): "kbatch": { "enabled": True, }, - "cdsdashboards": { - "enabled": True, - "cds_hide_user_named_servers": True, - "cds_hide_user_dashboard_servers": False, - }, } @@ -101,7 +96,6 @@ def default_environments(): "channels": ["conda-forge"], "dependencies": [ "python=3.10", - "cdsdashboards-singleuser=0.6.3", "cufflinks-py=0.17.3", "dash=2.8.1", "geopandas=0.12.2", diff --git a/src/_nebari/schema.py b/src/_nebari/schema.py index 6966e3b5b..cc930f83a 100644 --- a/src/_nebari/schema.py +++ b/src/_nebari/schema.py @@ -447,18 +447,6 @@ class CondaEnvironment(Base): dependencies: typing.List[typing.Union[str, typing.Dict[str, typing.List[str]]]] -# =============== CDSDashboards ============== - - -class CDSDashboards(Base): - enabled: bool - cds_hide_user_named_servers: typing.Optional[bool] - cds_hide_user_dashboard_servers: typing.Optional[bool] - - -# =============== Extensions = = ============== - - class NebariExtensionEnv(Base): name: str value: str @@ -588,7 +576,6 @@ class Main(Base): certificate: Certificate helm_extensions: typing.Optional[typing.List[HelmExtension]] prefect: typing.Optional[Prefect] - cdsdashboards: CDSDashboards security: Security external_container_reg: typing.Optional[ExtContainerReg] default_images: DefaultImages diff --git a/src/_nebari/stages/input_vars.py b/src/_nebari/stages/input_vars.py index cddf4358d..3b487fac7 100644 --- a/src/_nebari/stages/input_vars.py +++ b/src/_nebari/stages/input_vars.py @@ -288,12 +288,6 @@ def stage_07_kubernetes_services(stage_outputs, config): "conda-store-environments": config["environments"], "conda-store-filesystem-storage": config["storage"]["conda_store"], "conda-store-service-token-scopes": { - "cdsdashboards": { - "primary_namespace": "cdsdashboards", - "role_bindings": { - "*/*": ["viewer"], - }, - }, "dask-gateway": { "primary_namespace": "", "role_bindings": { @@ -314,7 +308,6 @@ def stage_07_kubernetes_services(stage_outputs, config): "image_tag", DEFAULT_CONDA_STORE_IMAGE_TAG ), # jupyterhub - "cdsdashboards": config["cdsdashboards"], "jupyterhub-theme": jupyterhub_theme, "jupyterhub-image": _split_docker_image_name( config["default_images"]["jupyterhub"] diff --git a/src/_nebari/template/stages/07-kubernetes-services/jupyterhub.tf b/src/_nebari/template/stages/07-kubernetes-services/jupyterhub.tf index 25875e62c..cb331eb02 100644 --- a/src/_nebari/template/stages/07-kubernetes-services/jupyterhub.tf +++ b/src/_nebari/template/stages/07-kubernetes-services/jupyterhub.tf @@ -1,17 +1,3 @@ -variable "cdsdashboards" { - description = "Enable CDS Dashboards" - type = object({ - enabled = bool - cds_hide_user_named_servers = bool - cds_hide_user_dashboard_servers = bool - }) - default = { - enabled = true - cds_hide_user_named_servers = true - cds_hide_user_dashboard_servers = false - } -} - variable "jupyterhub-theme" { description = "JupyterHub theme" type = map(any) @@ -98,12 +84,11 @@ module "jupyterhub" { shared-pvc = module.jupyterhub-nfs-mount.persistent_volume_claim.name - conda-store-pvc = module.conda-store-nfs-mount.persistent_volume_claim.name - conda-store-mount = "/home/conda" - conda-store-environments = var.conda-store-environments - default-conda-store-namespace = var.conda-store-default-namespace - conda-store-cdsdashboard-token = module.kubernetes-conda-store-server.service-tokens.cdsdashboards - conda-store-service-name = module.kubernetes-conda-store-server.service_name + conda-store-pvc = module.conda-store-nfs-mount.persistent_volume_claim.name + conda-store-mount = "/home/conda" + conda-store-environments = var.conda-store-environments + default-conda-store-namespace = var.conda-store-default-namespace + conda-store-service-name = module.kubernetes-conda-store-server.service_name extra-mounts = { "/etc/dask" = { @@ -127,8 +112,6 @@ module "jupyterhub" { jupyterhub-image = var.jupyterhub-image jupyterlab-image = var.jupyterlab-image - cdsdashboards = var.cdsdashboards - theme = var.jupyterhub-theme profiles = var.jupyterlab-profiles diff --git a/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/files/jupyterhub/01-theme.py b/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/files/jupyterhub/01-theme.py index 1a81ba51d..c57be0f57 100644 --- a/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/files/jupyterhub/01-theme.py +++ b/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/files/jupyterhub/01-theme.py @@ -6,11 +6,7 @@ import z2jh # noqa: E402 jupyterhub_theme = z2jh.get_config("custom.theme") -cdsdashboards = z2jh.get_config("custom.cdsdashboards") c.JupyterHub.template_vars = { **jupyterhub_theme, - "cdsdashboards_enabled": cdsdashboards["enabled"], - "cds_hide_user_named_servers": cdsdashboards["cds_hide_user_named_servers"], - "cds_hide_user_dashboard_servers": cdsdashboards["cds_hide_user_dashboard_servers"], } diff --git a/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/files/jupyterhub/02-spawner.py b/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/files/jupyterhub/02-spawner.py index e607f504c..2ce8b3b16 100644 --- a/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/files/jupyterhub/02-spawner.py +++ b/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/files/jupyterhub/02-spawner.py @@ -14,8 +14,6 @@ import z2jh # noqa: E402 from kubespawner import KubeSpawner # noqa: E402 -cdsdashboards = z2jh.get_config("custom.cdsdashboards") - @gen.coroutine def get_username_hook(spawner): @@ -31,73 +29,5 @@ def get_username_hook(spawner): c.Spawner.pre_spawn_hook = get_username_hook -if cdsdashboards["enabled"]: - from cdsdashboards.app import CDS_TEMPLATE_PATHS - from cdsdashboards.builder.kubebuilder import KubeBuilder - from cdsdashboards.hubextension import cds_extra_handlers - from cdsdashboards.hubextension.spawners.variablekube import VariableKubeSpawner - - c.JupyterHub.allow_named_servers = True - c.JupyterHub.extra_handlers.extend(cds_extra_handlers) - c.JupyterHub.template_paths.extend(CDS_TEMPLATE_PATHS) - c.JupyterHub.spawner_class = VariableKubeSpawner - c.CDSDashboardsConfig.builder_class = KubeBuilder - c.VariableMixin.default_presentation_cmd = [ - "python3", - "-m", - "jhsingle_native_proxy.main", - ] - c.JupyterHub.default_url = "/hub/home" - - # Force dashboard creator to select an instance size - c.CDSDashboardsConfig.spawn_default_options = False - - def get_conda_store_environments(query_package: str = ""): - external_url = z2jh.get_config("custom.conda-store-service-name") - token = z2jh.get_config("custom.conda-store-cdsdashboards") - endpoint = "conda-store/api/v1/environment" - - url = yarl.URL(f"http://{external_url}/{endpoint}/") - - if query_package: - url = url % {"packages": query_package} - - http = urllib3.PoolManager() - response = http.request( - "GET", str(url), headers={"Authorization": f"Bearer {token}"} - ) - - # parse response - j = json.loads(response.data.decode("UTF-8")) - return [ - f"{env['namespace']['name']}-{env['name']}" for env in j.get("data", []) - ] - - c.CDSDashboardsConfig.conda_envs = partial( - get_conda_store_environments, query_package="cdsdashboards-singleuser" - ) - - # TODO: make timeouts configurable - c.VariableMixin.proxy_ready_timeout = 300 - c.VariableMixin.proxy_request_timeout = 300 - - home_username = f"/home/{os.getenv('PREFERRED_USERNAME')}" - c.CDSDashboardsConfig.extra_presentation_types = ["panel-serve"] - c.VariableMixin.extra_presentation_launchers = { - "panel-serve": { - "args": [ - "python3", - "{presentation_path}", - "{--}port", - "{port}", - "{--}address", - "{origin_host}", - ], - "debug_args": [], - "env": {"PYTHONPATH": f"{home_username}/{{presentation_dirname}}"}, - } - } - -else: - c.JupyterHub.allow_named_servers = False - c.JupyterHub.spawner_class = KubeSpawner +c.JupyterHub.allow_named_servers = False +c.JupyterHub.spawner_class = KubeSpawner diff --git a/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/main.tf b/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/main.tf index 19255c098..fe1ef1321 100644 --- a/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/main.tf +++ b/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/main.tf @@ -26,14 +26,12 @@ resource "helm_release" "jupyterhub" { custom = { theme = var.theme profiles = var.profiles - cdsdashboards = var.cdsdashboards home-pvc = var.home-pvc shared-pvc = var.shared-pvc conda-store-pvc = var.conda-store-pvc conda-store-mount = var.conda-store-mount default-conda-store-namespace = var.default-conda-store-namespace conda-store-service-name = var.conda-store-service-name - conda-store-cdsdashboards = var.conda-store-cdsdashboard-token skel-mount = { name = kubernetes_config_map.etc-skel.metadata.0.name namespace = kubernetes_config_map.etc-skel.metadata.0.namespace diff --git a/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/variables.tf b/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/variables.tf index 63ad161ce..42ef65190 100644 --- a/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/variables.tf +++ b/src/_nebari/template/stages/07-kubernetes-services/modules/kubernetes/services/jupyterhub/variables.tf @@ -97,20 +97,6 @@ variable "profiles" { default = [] } -variable "cdsdashboards" { - description = "Enable CDS Dashboards" - type = object({ - enabled = bool - cds_hide_user_named_servers = bool - cds_hide_user_dashboard_servers = bool - }) - default = { - enabled = true - cds_hide_user_named_servers = true - cds_hide_user_dashboard_servers = false - } -} - variable "conda-store-service-name" { description = "Name of conda-store service" type = string @@ -122,11 +108,6 @@ variable "conda-store-environments" { default = {} } -variable "conda-store-cdsdashboard-token" { - description = "Token for cdsdashboards to use conda-store" - type = string - default = "" -} variable "jupyterhub-logout-redirect-url" { description = "Next redirect destination following a Keycloak logout" diff --git a/src/_nebari/template/stages/07-kubernetes-services/variables.tf b/src/_nebari/template/stages/07-kubernetes-services/variables.tf index fd96f4fd0..b368860c7 100644 --- a/src/_nebari/template/stages/07-kubernetes-services/variables.tf +++ b/src/_nebari/template/stages/07-kubernetes-services/variables.tf @@ -47,14 +47,7 @@ variable "conda-store-default-namespace" { variable "conda-store-service-token-scopes" { description = "Map of services tokens and scopes for conda-store" type = map(any) - default = { - "cdsdashboards" = { - "primary_namespace" : "cdsdashboards", - "role_bindings" : { - "*/*" : ["viewer"], - } - } - } + default = {} } diff --git a/tests/qhub-config-yaml-files-for-upgrade/qhub-config-do-310-customauth.yaml b/tests/qhub-config-yaml-files-for-upgrade/qhub-config-do-310-customauth.yaml index e01e3ea6b..30a9d1fa0 100644 --- a/tests/qhub-config-yaml-files-for-upgrade/qhub-config-do-310-customauth.yaml +++ b/tests/qhub-config-yaml-files-for-upgrade/qhub-config-do-310-customauth.yaml @@ -45,10 +45,10 @@ theme: text_color: '#111111' h1_color: '#652e8e' h2_color: '#652e8e' -cdsdashboards: - enabled: true - cds_hide_user_named_servers: true - cds_hide_user_dashboard_servers: false +# cdsdashboards: +# enabled: true +# cds_hide_user_named_servers: true +# cds_hide_user_dashboard_servers: false terraform_state: type: remote namespace: dev From 69f62280fcddff5c26fad30deac8025378216807 Mon Sep 17 00:00:00 2001 From: Adam-D-Lewis <23342526+Adam-D-Lewis@users.noreply.github.com> Date: Wed, 5 Jul 2023 16:45:08 -0500 Subject: [PATCH 06/11] fix labels issue --- src/_nebari/template/stages/02-infrastructure/gcp/main.tf | 1 + .../02-infrastructure/gcp/modules/kubernetes/main.tf | 2 +- .../02-infrastructure/gcp/modules/kubernetes/variables.tf | 6 ++++++ .../template/stages/02-infrastructure/gcp/variables.tf | 7 +++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/main.tf b/src/_nebari/template/stages/02-infrastructure/gcp/main.tf index 95d1c91a3..4411cac40 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/main.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/main.tf @@ -35,4 +35,5 @@ module "kubernetes" { kubernetes_version = var.kubernetes_version release_channel = var.release_channel tags = var.tags + labels = var.labels } diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf index ac253509e..c4b18f32a 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf @@ -95,7 +95,7 @@ resource "google_container_node_pool" "main" { metadata = { disable-legacy-endpoints = "true" } - labels = local.merged_node_groups[count.index].labels + labels = merge(local.merged_node_groups[count.index].labels, var.labels) dynamic "guest_accelerator" { for_each = local.merged_node_groups[count.index].guest_accelerators diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/variables.tf b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/variables.tf index 9cc3d4b13..cef536303 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/variables.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/variables.tf @@ -150,3 +150,9 @@ variable "tags" { type = list(string) default = [] } + +variable "labels" { + description = "Google Cloud Platform labels to assign to resources" + type = map(string) + default = {} +} diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/variables.tf b/src/_nebari/template/stages/02-infrastructure/gcp/variables.tf index c56f62c03..3b48b525b 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/variables.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/variables.tf @@ -42,6 +42,13 @@ variable "tags" { default = [] } +variable "labels" { + description = "Google Cloud Platform labels to assign to resources" + type = map(string) + default = {} +} + + variable "kubernetes_version" { description = "Kubernetes version for GKE cluster" type = string From 9d5053d73e6a6eb53a4450e7f7f248b4dc5f8bce Mon Sep 17 00:00:00 2001 From: Adam-D-Lewis <23342526+Adam-D-Lewis@users.noreply.github.com> Date: Thu, 6 Jul 2023 14:50:37 -0500 Subject: [PATCH 07/11] enable cost allocation by default --- .../stages/02-infrastructure/gcp/modules/kubernetes/main.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf index c4b18f32a..69c5ca4df 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf @@ -57,6 +57,8 @@ resource "google_container_cluster" "main" { } } + cost_management_config = true + lifecycle { ignore_changes = [ node_locations From c91464e4e4fefd0305c700ca02cdb2975a738bdb Mon Sep 17 00:00:00 2001 From: Adam-D-Lewis <23342526+Adam-D-Lewis@users.noreply.github.com> Date: Thu, 6 Jul 2023 15:25:48 -0500 Subject: [PATCH 08/11] update gke provider and enable cost allocation by default --- .../stages/02-infrastructure/gcp/modules/kubernetes/main.tf | 4 +++- src/_nebari/template/stages/02-infrastructure/gcp/versions.tf | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf index 69c5ca4df..f16bae35e 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/modules/kubernetes/main.tf @@ -57,7 +57,9 @@ resource "google_container_cluster" "main" { } } - cost_management_config = true + cost_management_config { + enabled = true + } lifecycle { ignore_changes = [ diff --git a/src/_nebari/template/stages/02-infrastructure/gcp/versions.tf b/src/_nebari/template/stages/02-infrastructure/gcp/versions.tf index ddea3c185..9641dfac9 100644 --- a/src/_nebari/template/stages/02-infrastructure/gcp/versions.tf +++ b/src/_nebari/template/stages/02-infrastructure/gcp/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = "4.8.0" + version = "4.72.0" } } required_version = ">= 1.0" From 2adbe74c3ede734e96af77416d565db39cc04e00 Mon Sep 17 00:00:00 2001 From: iameskild Date: Mon, 21 Aug 2023 10:31:38 -0700 Subject: [PATCH 09/11] Add extra var back --- .../stages/kubernetes_services/template/jupyterhub.tf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/_nebari/stages/kubernetes_services/template/jupyterhub.tf b/src/_nebari/stages/kubernetes_services/template/jupyterhub.tf index 293317cd6..9cf3cdbb5 100644 --- a/src/_nebari/stages/kubernetes_services/template/jupyterhub.tf +++ b/src/_nebari/stages/kubernetes_services/template/jupyterhub.tf @@ -92,11 +92,12 @@ module "jupyterhub" { shared-pvc = module.jupyterhub-nfs-mount.persistent_volume_claim.name - conda-store-pvc = module.conda-store-nfs-mount.persistent_volume_claim.name - conda-store-mount = "/home/conda" - conda-store-environments = var.conda-store-environments - default-conda-store-namespace = var.conda-store-default-namespace - conda-store-service-name = module.kubernetes-conda-store-server.service_name + conda-store-pvc = module.conda-store-nfs-mount.persistent_volume_claim.name + conda-store-mount = "/home/conda" + conda-store-environments = var.conda-store-environments + default-conda-store-namespace = var.conda-store-default-namespace + conda-store-argo-workflows-jupyter-scheduler-token = module.kubernetes-conda-store-server.service-tokens.argo-workflows-jupyter-scheduler + conda-store-service-name = module.kubernetes-conda-store-server.service_name extra-mounts = { "/etc/dask" = { From 2ea33c95628f2be524e3b2ef37e271c76ab742f8 Mon Sep 17 00:00:00 2001 From: iameskild Date: Mon, 21 Aug 2023 14:02:20 -0700 Subject: [PATCH 10/11] Remove cds section from test config file --- .../qhub-config-do-310.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/tests_unit/qhub-config-yaml-files-for-upgrade/qhub-config-do-310.yaml b/tests/tests_unit/qhub-config-yaml-files-for-upgrade/qhub-config-do-310.yaml index 903537161..90637724d 100644 --- a/tests/tests_unit/qhub-config-yaml-files-for-upgrade/qhub-config-do-310.yaml +++ b/tests/tests_unit/qhub-config-yaml-files-for-upgrade/qhub-config-do-310.yaml @@ -42,10 +42,10 @@ theme: text_color: '#111111' h1_color: '#652e8e' h2_color: '#652e8e' -cdsdashboards: - enabled: true - cds_hide_user_named_servers: true - cds_hide_user_dashboard_servers: false +# cdsdashboards: +# enabled: true +# cds_hide_user_named_servers: true +# cds_hide_user_dashboard_servers: false terraform_state: type: remote namespace: dev From 23e8f0aa113f71ae9097c32d3a2aed4ba16177c8 Mon Sep 17 00:00:00 2001 From: iameskild Date: Tue, 22 Aug 2023 17:41:07 -0700 Subject: [PATCH 11/11] Update tests for jhub upgrade changes --- tests/common/navigator.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/common/navigator.py b/tests/common/navigator.py index b906822dc..dc2adc9eb 100644 --- a/tests/common/navigator.py +++ b/tests/common/navigator.py @@ -191,25 +191,23 @@ def start_server(self) -> None: logout_button = self.page.get_by_text("Logout", exact=True) logout_button.wait_for(state="attached", timeout=90000) + # if the server is already running + start_locator = self.page.get_by_role("button", name="My Server", exact=True) + if start_locator.is_visible(): + start_locator.click() + # if server is not yet running start_locator = self.page.get_by_role("button", name="Start My Server") if start_locator.is_visible(): start_locator.click() + server_options = self.page.get_by_role("heading", name="Server Options") + if server_options.is_visible(): # select instance type (this will fail if this instance type is not # available) self.page.locator(f"#profile-item-{self.instance_name}").click() self.page.get_by_role("button", name="Start").click() - else: - # if the server is already running - start_locator = self.page.get_by_role( - "button", - name="My Server", - exact=True, - ) - start_locator.click() - # wait for server spinup self.page.wait_for_url( urllib.parse.urljoin(self.nebari_url, f"user/{self.username}/*"),