Skip to content

Commit

Permalink
Merge branch 'main' into docs-update-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshCasper authored Dec 14, 2021
2 parents d386eb3 + 0326eb4 commit afd3c17
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repos:
rev: v2.3.0
hooks:
- id: check-yaml
exclude: 'qhub/template/\{\{ cookiecutter\.repo_directory \}\}/\.github/.*'
exclude: 'qhub/template/\{\{ cookiecutter\.repo_directory \}\}/(\.github/.*|infrastructure/jupyterhub.yaml)'
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
Expand Down
4 changes: 4 additions & 0 deletions docs/source/admin_guide/jupyterhub.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ jupyterhub:
```

Where it's possible to influence a value using 'native' QHub configuration, you should use that as a preference. For example, you would not set `jupyterhub.overrides.hub.image.name` to use a custom JupyterHub Docker image. Instead you would set `default_images.jupyterhub`.

There is special behavior for the values `jupyterhub.overrides.hub.extraEnv` and `jupyterhub.overrides.hub.extraConfig`. Setting these would have naturally seen them be overridden in their entirety by QHub's own values, but there is special treatment whereby QHub's values are merged into the list of any values that you might have set as overrides.

In general, it is possible that other overrides will always be lost where QHub sets its own values, so caution must be taken, and in debugging ensure that you are prepared for unexpected results when using overrides.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ hub:
{% include "templates/jupyterhub_config.py.j2" %}
{% endfilter %}

{% if cookiecutter.jupyterhub is defined and cookiecutter.jupyterhub.overrides is defined and cookiecutter.jupyterhub.overrides.hub is defined and cookiecutter.jupyterhub.overrides.hub.extraConfig is defined %}
{% filter indent(width=4) %}
{{ cookiecutter.jupyterhub.overrides.hub.extraConfig | default({}) | yamlify -}}
{% endfilter %}
{% endif %}

singleuser:
storage:
homeMountPath: /home/jovyan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ module "qhub" {
{%- endif %}
)

{%- if cookiecutter.jupyterhub is defined and cookiecutter.jupyterhub.overrides is defined and cookiecutter.jupyterhub.overrides.hub is defined and cookiecutter.jupyterhub.overrides.hub.extraEnv is defined %}
jupyterhub-hub-extraEnv = {{- cookiecutter.jupyterhub.overrides.hub.extraEnv | default({}) | jsonify -}}
{%- endif %}

dask_gateway_extra_config = file("dask_gateway_config.py.j2")

forwardauth-callback-url-path = local.forwardauth-callback-url-path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module "kubernetes-jupyterhub" {
overrides = concat(var.jupyterhub-overrides, [
jsonencode({
hub = {
extraEnv = [
extraEnv = concat( var.jupyterhub-hub-extraEnv,
[
{
name = "OAUTH_CLIENT_ID",
value = var.OAUTH_CLIENT_ID
Expand Down Expand Up @@ -57,7 +58,7 @@ module "kubernetes-jupyterhub" {
name = "KEYCLOAK_PASSWORD"
value = var.keycloak_password
}
]
])
nodeSelector = {
(var.general-node-group.key) = var.general-node-group.value
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ variable "jupyterhub-overrides" {
type = list(string)
}

variable "jupyterhub-hub-extraEnv" {
description = "Extracted overrides to merge with jupyterhub.hub.extraEnv"
type = list(map(any))
default = []
}

variable "dask_gateway_extra_config" {
description = "dask gateway extra configuration"
type = string
Expand Down

0 comments on commit afd3c17

Please sign in to comment.