Skip to content

Commit

Permalink
Fixing cdsdashboard conda environments being shown (#1025)
Browse files Browse the repository at this point in the history
This is a short term fix for conda-store environments being shown in
cdsdashboards. Longer term we will need to consult the conda-store
rest api or filesystem for available environments (for 0.4.x release).

Fixes #1019
  • Loading branch information
costrouc committed Feb 4, 2022
1 parent 1b26b8b commit 25b2eaa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions qhub/template/stages/07-kubernetes-services/jupyterhub.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ module "jupyterhub" {

conda-store-pvc = module.conda-store-nfs-mount.persistent_volume_claim.name
conda-store-mount = "/home/conda"
conda-store-environments = var.conda-store-environments

extra-mounts = {
"/etc/dask" = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import z2jh

cdsdashboards = z2jh.get_config("custom.cdsdashboards")
conda_store_environments = z2jh.get_config("custom.environments")

if cdsdashboards["enabled"]:
from cdsdashboards.hubextension.spawners.variablekube import VariableKubeSpawner
Expand All @@ -31,9 +32,7 @@
c.CDSDashboardsConfig.spawn_default_options = False

c.CDSDashboardsConfig.conda_envs = [
# {%- for key in cookiecutter.environments %}
# "{{ cookiecutter.environments[key].name }}",
# {%- endfor %}
environment['name'] for _, environment in conda_store_environments.items()
]
else:
c.JupyterHub.allow_named_servers = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ resource "helm_release" "jupyterhub" {
conda-store-pvc = var.conda-store-pvc
conda-store-mount = var.conda-store-mount
extra-mounts = var.extra-mounts
environments = var.conda-store-environments
}

hub = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,9 @@ variable "cdsdashboards" {
cds_hide_user_dashboard_servers = false
}
}

variable "conda-store-environments" {
description = "conda environments from conda-store in filesystem namespace"
type = map(any)
default = {}
}

0 comments on commit 25b2eaa

Please sign in to comment.