From cacc5e54f44e46a56fdc0390e44c54c40fa199dc Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Wed, 2 Jun 2021 22:41:15 +0200 Subject: [PATCH] daskhub: attempt to update scratch bucket env that have failed --- hub-templates/daskhub/values.yaml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/hub-templates/daskhub/values.yaml b/hub-templates/daskhub/values.yaml index 22c16b26ef..74680482c5 100644 --- a/hub-templates/daskhub/values.yaml +++ b/hub-templates/daskhub/values.yaml @@ -50,8 +50,36 @@ basehub: blockWithIptables: false serviceAccountName: user-sa extraEnv: - # The default worker image matches the singleuser image. + # About DASK_ prefixed variables we set: + # + # 1. k8s native variable expansion is applied with $(MY_ENV) syntax. The + # order variables are defined matters though and we are under the + # mercy of how KubeSpawner renders our passed dictionaries. + # + # 2. Dask loads local YAML config. + # + # 3. Dask loads environment variables prefixed DASK_. + # - DASK_ is stripped + # - Capitalization is ignored + # - Double underscore means a nested configuration + # - `ast.literal_eval` is used to parse values + # + # 4. dask-gateway and dask-distributed looks at its config and expands + # expressions in {} again, sometimes only with the environment + # variables as context but sometimes also with additional variables. + # + # References: + # - K8s expansion: https://kubernetes.io/docs/tasks/inject-data-application/define-interdependent-environment-variables/ + # - KubeSpawner issue: https://github.com/jupyterhub/kubespawner/issues/491 + # - Dask config: https://docs.dask.org/en/latest/configuration.html + # - Exploration issue: https://github.com/2i2c-org/pilot-hubs/issues/442 + # DASK_GATEWAY__CLUSTER__OPTIONS__IMAGE: '{JUPYTER_IMAGE_SPEC}' + # Try make this show up before SCRATCH_BUCKET but after JUPYTERHUB_USER + # by naming its entry. + SCRATCH_A: + name: DASK_GATEWAY__CLUSTER__OPTIONS__ENVIRONMENT + value: '{"SCRATCH_BUCKET": "$(SCRATCH_BUCKET)"}' DASK_DISTRIBUTED__DASHBOARD_LINK: '/user/{JUPYTERHUB_USER}/proxy/{port}/status' DASK_LABEXTENSION__FACTORY__MODULE: 'dask_gateway' DASK_LABEXTENSION__FACTORY__CLASS: 'GatewayCluster'