Skip to content

Commit

Permalink
daskhub: attempt to update scratch bucket env that have failed
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Jul 10, 2021
1 parent b7c862e commit cacc5e5
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion hub-templates/daskhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit cacc5e5

Please sign in to comment.