diff --git a/providers/kubernetes/daskhub.yaml b/providers/kubernetes/daskhub.yaml index f27ab52..115671a 100644 --- a/providers/kubernetes/daskhub.yaml +++ b/providers/kubernetes/daskhub.yaml @@ -19,23 +19,27 @@ dask-gateway: c.ClusterConfig.cluster_max_workers = 4 c.ClusterConfig.idle_timeout = 1800 optionHandler: | - from dask_gateway_server.options import Options, Integer, Float, String + from dask_gateway_server.options import Options, Integer, Float, String, Mapping - def options_handler(options): - if ":" not in options.image: - raise ValueError("When specifying an image you must also provide a tag") - return { - "worker_cores": options.worker_cores, - "worker_memory": int(options.worker_memory * 2 ** 30), - "image": options.image, - } + def cluster_options(user): + def option_handler(options): + if ":" not in options.image: + raise ValueError("When specifying an image you must also provide a tag") - c.Backend.cluster_options = Options( - Integer("worker_cores", default=1, min=1, max=8, label="Worker Cores"), - Float("worker_memory", default=2, min=2, max=32, label="Worker Memory (GiB)"), - String("image", default="quay.io/pangeo/pangeo-notebook:2025.06.02", label="Image"), - handler=options_handler, - ) + return { + "worker_cores": options.worker_cores, + "worker_memory": int(options.worker_memory * 2 ** 30), + "image": options.image, + "environment_vars": options.environment_vars, + } + return Options( + Integer("worker_cores", default=1, min=1, max=1, label="Worker Cores"), + Float("worker_memory", default=2, min=2, max=7, label="Worker Memory (GiB)"), + String("image", default="quay.io/pangeo/pangeo-notebook:2025.06.02", label="Image"), + Mapping("environment_vars", {}, label="Environment Variables"), + handler=options_handler, + ) + c.Backend.cluster_options = cluster_options prefix: /services/dask-gateway backend: scheduler: