Skip to content
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

Do not try and add argo envs when disabled #1926

Merged
merged 10 commits into from
Sep 11, 2023
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 @@ -371,6 +371,7 @@ class JupyterhubInputVars(schema.Base):
jupyterhub_image: ImageNameTag = Field(alias="jupyterhub-image")
jupyterhub_hub_extraEnv: str = Field(alias="jupyterhub-hub-extraEnv")
idle_culler_settings: Dict[str, Any] = Field(alias="idle-culler-settings")
argo_workflows_enabled: bool = Field(alias="argo-workflows-enabled")


class DaskGatewayInputVars(schema.Base):
Expand Down Expand Up @@ -508,6 +509,7 @@ def input_vars(self, stage_outputs: Dict[str, Dict[str, Any]]):
self.config.jupyterhub.overrides.get("hub", {}).get("extraEnv", [])
),
idle_culler_settings=self.config.jupyterlab.idle_culler.dict(),
argo_workflows_enabled=self.config.argo_workflows.enabled,
)

dask_gateway_vars = DaskGatewayInputVars(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# ======================= VARIABLES ======================
variable "argo-workflows-enabled" {
description = "Argo Workflows enabled"
type = bool
}

variable "argo-workflows-overrides" {
description = "Argo Workflows helm chart overrides"
type = list(string)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ module "jupyterhub" {
conda-store-mount = "/home/conda"
conda-store-environments = var.conda-store-environments
default-conda-store-namespace = var.conda-store-default-namespace
argo-workflows-enabled = var.argo-workflows-enabled
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ def configure_user(username, groups, uid=1000, gid=100):
def profile_argo_token(groups):
# TODO: create a more robust check user's Argo-Workflow role

if not z2jh.get_config("custom.argo-workflows-enabled"):
return {}

domain = z2jh.get_config("custom.external-url")
namespace = z2jh.get_config("custom.namespace")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ resource "helm_release" "jupyterhub" {
external-url = var.external-url
theme = var.theme
profiles = var.profiles
argo-workflows-enabled = var.argo-workflows-enabled
home-pvc = var.home-pvc
shared-pvc = var.shared-pvc
conda-store-pvc = var.conda-store-pvc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,8 @@ variable "idle-culler-settings" {
terminal_cull_interval = number
})
}

variable "argo-workflows-enabled" {
description = "Enable Argo Workflows"
type = bool
}
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 @@ -38,3 +38,9 @@ variable "conda-store-default-namespace" {
description = "Default conda-store namespace name"
type = string
}


variable "argo-workflows-enabled" {
description = "Enable Argo Workflows"
type = bool
}