Skip to content

Conversation

@mishaschwartz
Copy link
Collaborator

@mishaschwartz mishaschwartz commented Dec 22, 2025

Overview

Previously the jupyterhub configuration was defined in components/jupyterhub/jupyterhub_config.py.template except for the custom authenticator which was included in the pavics/jupyterhub docker image. This was fine, except that the configuration was split across two projects and as the configuration got more complex, maintaining these was getting more difficult.

This moves all configuration code including the authenticator to a python package named jupyterhub_custom located at components/jupyterhub/jupyterhub_custom/. It moves all configurations for the authenticator to the magpie_authenticator.py file and all the configurations for the spawner to the custom_spawner.py file. All variables that are settable by environment variables are moved to the constants.py file. This makes it much easier to see which variables are configurable using environment variables all in one place.

This change introduces unit tests and style policies (enforced by ruff and pre-commit) for this package to encourage better code practices.

This change should be fully backwards compatible with the exception of the change to how settings for deprecated-components/catalog is handled (see below). However, it does deprecate some environment variables in favour of better configuration solutions:

  • using the JUPYTERHUB_ENABLE_MULTI_NOTEBOOKS variable to set the DockerSpawner.allowed_images variable is deprecated.
    • why?: this variable could be used to insert any python code into the middle of the jupyterhub_config.py.template file. This makes it too easy to accidentally insert code that breaks the configuration settings later on. We should avoid code insertion like this whenever possible.
    • new method: by default DockerSpawner.allowed_images will be set based on the values of JUPYTERHUB_IMAGE_SELECTION_NAMES and JUPYTERHUB_DOCKER_NOTEBOOK_IMAGES. If more than one image is specified by those variables then the user will be able to select which one they want. If you want to specify images other than those in the default those can be set using the JUPYTERHUB_ALLOWED_IMAGES which is a yaml or JSON mapping of image names to jupyterlab docker image tags.
  • using the JUPYTERHUB_ADMIN_USERS variable to set the DockerSpawner.admin_users variable is deprecated.
    • why?: this also executes arbitrary code (like above). Also, jupyterhub encourages assigning admin permissions
      based on roles, not by assigning them to the admin_users attribute. This makes it possible to easily revoke admin permissions as well and does not require us to restart Jupyterhub to do so.
    • new method: a new Magpie group is created. Its name is determined by the JUPYTERHUB_ADMIN_GROUP_NAME variable (default is "jupyterhub-admin"). Add users to this group in Magpie in order to give them admin permissions on Jupyterhub.
  • using lowercase constants in JUPYTERHUB_CONFIG_OVERRIDE is deprecated.
    • why?: PEP8 recommends constants be written with capitals with underscores separating them.
    • new method: all the constants that were previously named with lowercase have an uppercase equivalent in constants.py. For example: notebook_dir == constants.NOTEBOOK_DIR. The uppercase version is preferred.

Note: if your deployment is still using the deprecated-components/catalog component. You may want to manually set the following in JUPYTERHUB_CONFIG_OVERRIDE since the automatic addition of the the CATALOG_USERNAME to the blocked_users set is no longer part of the default settings (since the deprecated-components/catalog component has been deprecated for a long time):

c.MagpieAuthenticator.blocked_users.add("${CATALOG_USERNAME}")

Changes

Non-breaking changes

  • refactoring

Breaking changes

  • if deprecated-components/catalog is still used, then it needs to be manually configured (see above)
  • if JUPYTERHUB_ADMIN_USERS is not set in the local environment file, the default was to automatically add the magpie admin user as a jupyterhub admin. Now the default is to add no users as an admin automatically and users must be added by being included in the JUPYTERHUB_ADMIN_GROUP_NAME magpie group.

Related Issue / Discussion

Additional Information

CI Operations

birdhouse_daccs_configs_branch: master
birdhouse_skip_ci: false

@github-actions github-actions bot added documentation Improvements or additions to documentation ci/operations Continuous Integration components component/magpie Related to https://github.com/Ouranosinc/Magpie component/jupyterhub Related to JupyterHub as development frontend with notebooks ci/tests Issues or changes related to tests scripts labels Dec 22, 2025
@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

Build URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/3913/
ResultFAILURE

BIRDHOUSE_DEPLOY_BRANCH : refactor-jupyterhub-customization
DACCS_IAC_BRANCH : master
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

DESTROY_INFRA_ON_EXIT : true
PAVICS_HOST : https://host-140-216.rdext.crim.ca

PAVICS-e2e-workflow-tests Pipeline Results

Tests URL : http://daccs-jenkins.crim.ca:80/job/PAVICS-e2e-workflow-tests/job/master/586/

NOTEBOOK TEST RESULTS
    
[2025-12-22T20:40:35.436Z] ============================= test session starts ==============================
[2025-12-22T20:40:35.436Z] platform linux -- Python 3.11.12, pytest-8.3.5, pluggy-1.5.0
[2025-12-22T20:40:35.436Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master
[2025-12-22T20:40:35.436Z] plugins: anyio-4.9.0, dash-3.0.3, nbval-0.11.0, tornasync-0.6.0.post2, xdist-3.6.1
[2025-12-22T20:40:35.436Z] collected 537 items
[2025-12-22T20:40:35.436Z] 
[2025-12-22T20:40:43.759Z] notebooks-auth/geoserver.ipynb ..................                        [  3%]
[2025-12-22T20:40:54.534Z] notebooks-auth/test_cowbird_jupyter.ipynb ......FFF.                     [  5%]
[2025-12-22T20:41:00.264Z] notebooks-auth/test_thredds.ipynb ...........                            [  7%]
[2025-12-22T20:43:07.825Z] pavics-sdi-master/docs/source/notebooks/CaSR_basic.ipynb ......          [  8%]
[2025-12-22T20:58:22.677Z] pavics-sdi-master/docs/source/notebooks/FAQ_dask_parallel.ipynb ..s..... [  9%]
[2025-12-22T20:59:59.125Z] .                                                                        [ 10%]
[2025-12-22T21:00:01.032Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb ......         [ 11%]
[2025-12-22T21:00:09.701Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb .....          [ 12%]
[2025-12-22T21:16:26.783Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ...........         [ 14%]
[2025-12-22T21:16:26.783Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 14%]
[2025-12-22T21:16:36.227Z] ...............                                                          [ 17%]
[2025-12-22T21:16:48.191Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 18%]
[2025-12-22T21:17:03.428Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ....              [ 18%]
[2025-12-22T21:17:19.718Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 19%]
[2025-12-22T21:22:28.153Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .FFFFFF            [ 21%]
[2025-12-22T21:22:28.153Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 22%]
[2025-12-22T21:25:07.064Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 24%]
[2025-12-22T21:26:12.191Z] .............                                                            [ 27%]
[2025-12-22T21:26:15.294Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 28%]
[2025-12-22T21:26:18.696Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 29%]
[2025-12-22T21:26:42.085Z] .................                                                        [ 32%]
[2025-12-22T21:26:51.073Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 33%]
[2025-12-22T21:26:52.452Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 33%]
[2025-12-22T21:27:03.786Z] .........                                                                [ 35%]
[2025-12-22T21:27:15.475Z] finch-main/docs/source/notebooks/dap_subset.ipynb ...........            [ 37%]
[2025-12-22T21:27:25.595Z] finch-main/docs/source/notebooks/finch-usage.ipynb ......                [ 38%]
[2025-12-22T21:27:26.973Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 38%]
[2025-12-22T21:27:31.633Z] .....                                                                    [ 39%]
[2025-12-22T21:28:18.336Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 40%]
[2025-12-22T21:28:46.316Z] ............                                                             [ 42%]
[2025-12-22T21:29:12.872Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 42%]
[2025-12-22T21:29:49.734Z] .....s.                                                                  [ 43%]
[2025-12-22T21:29:56.303Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 43%]
[2025-12-22T21:30:03.046Z] ..                                                                       [ 44%]
[2025-12-22T21:30:13.040Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 44%]
[2025-12-22T21:31:19.184Z] .........                                                                [ 46%]
[2025-12-22T21:31:27.314Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-6Regridding_Conversion.ipynb . [ 46%]
[2025-12-22T21:33:17.227Z] ....                                                                     [ 47%]
[2025-12-22T21:33:17.227Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-01_Intro.ipynb . [ 47%]
[2025-12-22T21:33:22.843Z] ....                                                                     [ 48%]
[2025-12-22T21:33:27.048Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-02_Calibration.ipynb . [ 48%]
[2025-12-22T21:33:38.451Z] .....                                                                    [ 49%]
[2025-12-22T21:33:42.712Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-03_Watershed_properties.ipynb . [ 49%]
[2025-12-22T21:33:47.787Z] .............                                                            [ 51%]
[2025-12-22T21:33:53.062Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-04_Time_series_analysis.ipynb . [ 51%]
[2025-12-22T21:33:54.169Z] ......                                                                   [ 53%]
[2025-12-22T21:34:04.898Z] raven-main/docs/source/notebooks/Region_selection.ipynb .........        [ 54%]
[2025-12-22T21:34:06.806Z] raven-main/docs/source/notebooks/Subset_climate_data_over_watershed.ipynb . [ 54%]
[2025-12-22T21:34:29.339Z] ......                                                                   [ 56%]
[2025-12-22T21:34:30.979Z] RavenPy-main/docs/notebooks/00_Introduction_to_JupyterLab.ipynb ......   [ 57%]
[2025-12-22T21:34:42.384Z] RavenPy-main/docs/notebooks/01_Getting_watershed_boundaries.ipynb ...... [ 58%]
[2025-12-22T21:34:42.385Z] ..                                                                       [ 58%]
[2025-12-22T21:34:48.957Z] RavenPy-main/docs/notebooks/02_Extract_geographical_watershed_properties.ipynb . [ 58%]
[2025-12-22T21:34:54.055Z] .............                                                            [ 61%]
[2025-12-22T21:36:34.258Z] RavenPy-main/docs/notebooks/03_Extracting_forcing_data.ipynb ........... [ 63%]
[2025-12-22T21:36:34.258Z]                                                                          [ 63%]
[2025-12-22T21:36:36.742Z] RavenPy-main/docs/notebooks/04_Emulating_hydrological_models.ipynb ..... [ 64%]
[2025-12-22T21:36:43.317Z] ...............                                                          [ 67%]
[2025-12-22T21:36:49.886Z] RavenPy-main/docs/notebooks/05_Advanced_RavenPy_configuration.ipynb .... [ 67%]
[2025-12-22T21:36:57.661Z] .........                                                                [ 69%]
[2025-12-22T21:37:11.397Z] RavenPy-main/docs/notebooks/06_Raven_calibration.ipynb ......            [ 70%]
[2025-12-22T21:37:18.558Z] RavenPy-main/docs/notebooks/07_Making_and_using_hotstart_files.ipynb ... [ 71%]
[2025-12-22T21:37:21.143Z] ...                                                                      [ 71%]
[2025-12-22T21:37:27.742Z] RavenPy-main/docs/notebooks/08_Getting_and_bias_correcting_CMIP6_data.ipynb . [ 71%]
[2025-12-22T21:45:02.903Z] ...............                                                          [ 74%]
[2025-12-22T21:45:09.541Z] RavenPy-main/docs/notebooks/09_Hydrological_impacts_of_climate_change.ipynb . [ 74%]
[2025-12-22T21:45:16.285Z] ....                                                                     [ 75%]
[2025-12-22T21:45:55.987Z] RavenPy-main/docs/notebooks/10_Data_assimilation.ipynb ........          [ 77%]
[2025-12-22T21:46:06.095Z] RavenPy-main/docs/notebooks/11_Climatological_ESP_forecasting.ipynb .... [ 77%]
[2025-12-22T21:46:32.620Z] ....                                                                     [ 78%]
[2025-12-22T21:46:40.752Z] RavenPy-main/docs/notebooks/12_Performing_hindcasting_experiments.ipynb . [ 78%]
[2025-12-22T21:46:51.029Z] .......                                                                  [ 80%]
[2025-12-22T21:47:18.339Z] RavenPy-main/docs/notebooks/Assess_probabilistic_flood_risk.ipynb ...... [ 81%]
[2025-12-22T21:47:18.339Z] .                                                                        [ 81%]
[2025-12-22T21:47:26.468Z] RavenPy-main/docs/notebooks/Comparing_hindcasts_and_ESP_forecasts.ipynb . [ 81%]
[2025-12-22T21:47:47.065Z] .......                                                                  [ 82%]
[2025-12-22T21:47:53.699Z] RavenPy-main/docs/notebooks/Distributed_hydrological_modelling.ipynb ... [ 83%]
[2025-12-22T21:48:13.705Z] ....                                                                     [ 84%]
[2025-12-22T21:48:27.700Z] RavenPy-main/docs/notebooks/Hydrological_realtime_forecasting.ipynb .... [ 84%]
[2025-12-22T21:48:33.913Z] ..                                                                       [ 85%]
[2025-12-22T21:49:13.847Z] RavenPy-main/docs/notebooks/Managing_Jupyter_Environments.ipynb ...      [ 85%]
[2025-12-22T21:49:42.638Z] RavenPy-main/docs/notebooks/Perform_Regionalization.ipynb .......        [ 87%]
[2025-12-22T21:49:50.771Z] RavenPy-main/docs/notebooks/Running_HMETS_with_CANOPEX_dataset.ipynb ... [ 87%]
[2025-12-22T21:50:05.839Z] ..........                                                               [ 89%]
[2025-12-22T21:50:30.574Z] RavenPy-main/docs/notebooks/Sensitivity_analysis.ipynb ......            [ 90%]
[2025-12-22T21:50:35.760Z] RavenPy-main/docs/notebooks/time_series_analysis.ipynb ...........       [ 92%]
[2025-12-22T21:50:43.912Z] RavenPy-main/docs/notebooks/paper/Perform_a_climate_change_impact_study_on_a_watershed.ipynb . [ 92%]
[2025-12-22T21:56:21.089Z] .............Fxxxxxx                                                     [ 96%]
[2025-12-22T21:56:21.089Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2025-12-22T21:59:00.699Z] notebooks/stress-tests.ipynb ......                                      [100%]
[2025-12-22T21:59:00.699Z] 
[2025-12-22T21:59:00.699Z] =================================== FAILURES ===================================
    
  

@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

Build URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/3914/
ResultFAILURE

BIRDHOUSE_DEPLOY_BRANCH : refactor-jupyterhub-customization
DACCS_IAC_BRANCH : master
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

DESTROY_INFRA_ON_EXIT : true
PAVICS_HOST : https://host-140-91.rdext.crim.ca

PAVICS-e2e-workflow-tests Pipeline Results

Tests URL : http://daccs-jenkins.crim.ca:80/job/PAVICS-e2e-workflow-tests/job/master/587/

NOTEBOOK TEST RESULTS
    
[2025-12-22T20:51:20.998Z] ============================= test session starts ==============================
[2025-12-22T20:51:20.998Z] platform linux -- Python 3.11.12, pytest-8.3.5, pluggy-1.5.0
[2025-12-22T20:51:20.998Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master@2
[2025-12-22T20:51:20.998Z] plugins: anyio-4.9.0, dash-3.0.3, nbval-0.11.0, tornasync-0.6.0.post2, xdist-3.6.1
[2025-12-22T20:51:20.998Z] collected 537 items
[2025-12-22T20:51:20.998Z] 
[2025-12-22T20:51:30.633Z] notebooks-auth/geoserver.ipynb ..................                        [  3%]
[2025-12-22T20:51:41.807Z] notebooks-auth/test_cowbird_jupyter.ipynb ......FFF.                     [  5%]
[2025-12-22T20:51:48.351Z] notebooks-auth/test_thredds.ipynb ...........                            [  7%]
[2025-12-22T20:54:05.856Z] pavics-sdi-master/docs/source/notebooks/CaSR_basic.ipynb ......          [  8%]
[2025-12-22T21:14:01.618Z] pavics-sdi-master/docs/source/notebooks/FAQ_dask_parallel.ipynb ..s..... [  9%]
[2025-12-22T21:15:09.337Z] .                                                                        [ 10%]
[2025-12-22T21:15:14.441Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb ......         [ 11%]
[2025-12-22T21:15:21.193Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb .....          [ 12%]
[2025-12-22T21:25:02.664Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ...........         [ 14%]
[2025-12-22T21:25:02.664Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 14%]
[2025-12-22T21:25:02.664Z] ...............                                                          [ 17%]
[2025-12-22T21:25:11.650Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 18%]
[2025-12-22T21:25:22.322Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ....              [ 18%]
[2025-12-22T21:25:36.287Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 19%]
[2025-12-22T21:30:44.774Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .FFFFFF            [ 21%]
[2025-12-22T21:30:44.774Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 22%]
[2025-12-22T21:33:09.592Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 24%]
[2025-12-22T21:34:14.251Z] .............                                                            [ 27%]
[2025-12-22T21:34:18.169Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 28%]
[2025-12-22T21:34:19.945Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 29%]
[2025-12-22T21:34:46.680Z] .................                                                        [ 32%]
[2025-12-22T21:34:54.424Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 33%]
[2025-12-22T21:34:55.800Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 33%]
[2025-12-22T21:35:12.522Z] .........                                                                [ 35%]
[2025-12-22T21:35:22.525Z] finch-main/docs/source/notebooks/dap_subset.ipynb ...........            [ 37%]
[2025-12-22T21:35:32.349Z] finch-main/docs/source/notebooks/finch-usage.ipynb ......                [ 38%]
[2025-12-22T21:35:33.733Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 38%]
[2025-12-22T21:35:39.144Z] .....                                                                    [ 39%]
[2025-12-22T21:36:25.903Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 40%]
[2025-12-22T21:36:56.034Z] ............                                                             [ 42%]
[2025-12-22T21:37:22.576Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 42%]
[2025-12-22T21:38:01.346Z] .....s.                                                                  [ 43%]
[2025-12-22T21:38:07.929Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 43%]
[2025-12-22T21:38:14.089Z] ..                                                                       [ 44%]
[2025-12-22T21:38:22.215Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 44%]
[2025-12-22T21:39:37.795Z] .........                                                                [ 46%]
[2025-12-22T21:39:47.779Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-6Regridding_Conversion.ipynb . [ 46%]
[2025-12-22T21:42:03.026Z] ....                                                                     [ 47%]
[2025-12-22T21:42:03.026Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-01_Intro.ipynb . [ 47%]
[2025-12-22T21:42:03.026Z] ....                                                                     [ 48%]
[2025-12-22T21:42:04.932Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-02_Calibration.ipynb . [ 48%]
[2025-12-22T21:42:17.147Z] .....                                                                    [ 49%]
[2025-12-22T21:42:21.336Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-03_Watershed_properties.ipynb . [ 49%]
[2025-12-22T21:42:28.125Z] .............                                                            [ 51%]
[2025-12-22T21:42:34.721Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-04_Time_series_analysis.ipynb . [ 51%]
[2025-12-22T21:42:35.253Z] ......                                                                   [ 53%]
[2025-12-22T21:42:49.882Z] raven-main/docs/source/notebooks/Region_selection.ipynb .........        [ 54%]
[2025-12-22T21:42:51.835Z] raven-main/docs/source/notebooks/Subset_climate_data_over_watershed.ipynb . [ 54%]
[2025-12-22T21:43:18.288Z] ......                                                                   [ 56%]
[2025-12-22T21:43:20.195Z] RavenPy-main/docs/notebooks/00_Introduction_to_JupyterLab.ipynb ......   [ 57%]
[2025-12-22T21:43:30.484Z] RavenPy-main/docs/notebooks/01_Getting_watershed_boundaries.ipynb ...... [ 58%]
[2025-12-22T21:43:30.484Z] ..                                                                       [ 58%]
[2025-12-22T21:43:37.052Z] RavenPy-main/docs/notebooks/02_Extract_geographical_watershed_properties.ipynb . [ 58%]
[2025-12-22T21:43:42.733Z] .............                                                            [ 61%]
[2025-12-22T21:45:22.594Z] RavenPy-main/docs/notebooks/03_Extracting_forcing_data.ipynb ........... [ 63%]
[2025-12-22T21:45:22.594Z]                                                                          [ 63%]
[2025-12-22T21:45:27.027Z] RavenPy-main/docs/notebooks/04_Emulating_hydrological_models.ipynb ..... [ 64%]
[2025-12-22T21:45:34.076Z] ...............                                                          [ 67%]
[2025-12-22T21:45:40.636Z] RavenPy-main/docs/notebooks/05_Advanced_RavenPy_configuration.ipynb .... [ 67%]
[2025-12-22T21:45:48.269Z] .........                                                                [ 69%]
[2025-12-22T21:46:00.264Z] RavenPy-main/docs/notebooks/06_Raven_calibration.ipynb ......            [ 70%]
[2025-12-22T21:46:07.055Z] RavenPy-main/docs/notebooks/07_Making_and_using_hotstart_files.ipynb ... [ 71%]
[2025-12-22T21:46:09.903Z] ...                                                                      [ 71%]
[2025-12-22T21:46:16.467Z] RavenPy-main/docs/notebooks/08_Getting_and_bias_correcting_CMIP6_data.ipynb . [ 71%]
[2025-12-22T21:54:50.051Z] ...............                                                          [ 74%]
[2025-12-22T21:54:51.430Z] RavenPy-main/docs/notebooks/09_Hydrological_impacts_of_climate_change.ipynb . [ 74%]
[2025-12-22T21:54:58.936Z] ....                                                                     [ 75%]
[2025-12-22T21:55:42.017Z] RavenPy-main/docs/notebooks/10_Data_assimilation.ipynb ........          [ 77%]
[2025-12-22T21:55:51.800Z] RavenPy-main/docs/notebooks/11_Climatological_ESP_forecasting.ipynb .... [ 77%]
[2025-12-22T21:56:20.155Z] ....                                                                     [ 78%]
[2025-12-22T21:56:28.284Z] RavenPy-main/docs/notebooks/12_Performing_hindcasting_experiments.ipynb . [ 78%]
[2025-12-22T21:56:39.727Z] .......                                                                  [ 80%]
[2025-12-22T21:57:07.695Z] RavenPy-main/docs/notebooks/Assess_probabilistic_flood_risk.ipynb ...... [ 81%]
[2025-12-22T21:57:07.696Z] .                                                                        [ 81%]
[2025-12-22T21:57:14.277Z] RavenPy-main/docs/notebooks/Comparing_hindcasts_and_ESP_forecasts.ipynb . [ 81%]
[2025-12-22T21:57:35.668Z] .......                                                                  [ 82%]
[2025-12-22T21:57:43.797Z] RavenPy-main/docs/notebooks/Distributed_hydrological_modelling.ipynb ... [ 83%]
[2025-12-22T21:58:03.282Z] ....                                                                     [ 84%]
[2025-12-22T21:58:14.294Z] RavenPy-main/docs/notebooks/Hydrological_realtime_forecasting.ipynb .... [ 84%]
[2025-12-22T21:58:21.432Z] ..                                                                       [ 85%]
[2025-12-22T21:58:44.922Z] RavenPy-main/docs/notebooks/Managing_Jupyter_Environments.ipynb ...      [ 85%]
[2025-12-22T21:59:18.322Z] RavenPy-main/docs/notebooks/Perform_Regionalization.ipynb .......        [ 87%]
[2025-12-22T21:59:22.195Z] RavenPy-main/docs/notebooks/Running_HMETS_with_CANOPEX_dataset.ipynb ... [ 87%]
[2025-12-22T21:59:35.815Z] ..........                                                               [ 89%]
[2025-12-22T21:59:57.270Z] RavenPy-main/docs/notebooks/Sensitivity_analysis.ipynb ......            [ 90%]
[2025-12-22T22:00:03.894Z] RavenPy-main/docs/notebooks/time_series_analysis.ipynb ...........       [ 92%]
[2025-12-22T22:00:12.033Z] RavenPy-main/docs/notebooks/paper/Perform_a_climate_change_impact_study_on_a_watershed.ipynb . [ 92%]
[2025-12-22T22:04:58.594Z] ....................                                                     [ 96%]
[2025-12-22T22:05:01.064Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2025-12-22T22:07:32.680Z] notebooks/stress-tests.ipynb ......                                      [100%]
[2025-12-22T22:07:32.680Z] 
[2025-12-22T22:07:32.680Z] =================================== FAILURES ===================================
    
  

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not at the project root?

If a pyproject.toml was defined there, we could also do the .bumpversion.toml, pytest.ini and tests/requirements.* file migration under one location.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could and that could be a good next step but it seemed out of scope for this PR. Once I start applying these changes for the whole project we need to start updating all the other python code including twitcher hooks for a bunch of different components.

That starts to make this PR really really big and I think those changes should be handled elsewhere.

`deprecated-components/catalog` is handled (see below). However, it does deprecate some environment variables in
favour of better configuration solutions:

- using the `JUPYTERHUB_ENABLE_MULTI_NOTEBOOKS` variable to set the `DockerSpawner.allowed_images` variable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the change, but I guess it could have been used for setting other definitions? If such custom overrides were applied/needed, should they be moved to JUPYTERHUB_CONFIG_OVERRIDE? (i.e.: should we recommend using it over JUPYTERHUB_ENABLE_MULTI_NOTEBOOKS?).

Will the effect be equivalent, or other considerations would be necessary (eg: overrides not applying the same way since more changes could happen in between the "allowe_image" step and the final config object)? Some guidances along those lines could be relevant here if there is anything notable to consider.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could have been used for setting other definitions?

It could have but I hope that it wasn't since any changes made there were prone to being overridden later on in the file.

should we recommend using it over JUPYTERHUB_ENABLE_MULTI_NOTEBOOKS?

Yes for sure, by deprecating JUPYTERHUB_ENABLE_MULTI_NOTEBOOKS we should be communicating that but we can be more explicit about that if you think that people are adding additional code to JUPYTERHUB_ENABLE_MULTI_NOTEBOOKS instead of JUPYTERHUB_CONFIG_OVERRIDE.

Will the effect be equivalent

It should be unless they're using that to set a variable that is interpreted differently later on in the code. But I would definitely consider that a hack since the rest of the code could change later on and break any customizations done there. It's much safer to add in any custom overrides at the end of the configuration so that you know for sure that your changes are applied last.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I guess let's see if @tlvu was using it in such way.
If not, I am fine with having limited/no details about unintended usage to keep the changes concise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlvu do you have a situation where you're using JUPYTERHUB_ENABLE_MULTI_NOTEBOOKS like this?

@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

Build URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/3935/
ResultFAILURE

BIRDHOUSE_DEPLOY_BRANCH : refactor-jupyterhub-customization
DACCS_IAC_BRANCH : master
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

DESTROY_INFRA_ON_EXIT : true
PAVICS_HOST : https://host-140-91.rdext.crim.ca

PAVICS-e2e-workflow-tests Pipeline Results

Tests URL : http://daccs-jenkins.crim.ca:80/job/PAVICS-e2e-workflow-tests/job/master/603/

NOTEBOOK TEST RESULTS
    
[2026-01-05T20:06:58.905Z] ============================= test session starts ==============================
[2026-01-05T20:06:58.905Z] platform linux -- Python 3.11.12, pytest-8.3.5, pluggy-1.5.0
[2026-01-05T20:06:58.905Z] rootdir: /home/jenkins/agent/workspace/PAVICS-e2e-workflow-tests_master@2
[2026-01-05T20:06:58.906Z] plugins: anyio-4.9.0, dash-3.0.3, nbval-0.11.0, tornasync-0.6.0.post2, xdist-3.6.1
[2026-01-05T20:06:58.906Z] collected 537 items
[2026-01-05T20:06:58.906Z] 
[2026-01-05T20:07:07.261Z] notebooks-auth/geoserver.ipynb ..................                        [  3%]
[2026-01-05T20:07:15.961Z] notebooks-auth/test_cowbird_jupyter.ipynb ......FFF.                     [  5%]
[2026-01-05T20:07:22.059Z] notebooks-auth/test_thredds.ipynb ...........                            [  7%]
[2026-01-05T20:09:53.184Z] pavics-sdi-master/docs/source/notebooks/CaSR_basic.ipynb ......          [  8%]
[2026-01-05T20:27:37.267Z] pavics-sdi-master/docs/source/notebooks/FAQ_dask_parallel.ipynb ..s..... [  9%]
[2026-01-05T20:28:44.978Z] .                                                                        [ 10%]
[2026-01-05T20:28:48.608Z] pavics-sdi-master/docs/source/notebooks/WCS_example.ipynb ......         [ 11%]
[2026-01-05T20:28:55.450Z] pavics-sdi-master/docs/source/notebooks/WFS_example.ipynb .....          [ 12%]
[2026-01-05T20:38:04.446Z] pavics-sdi-master/docs/source/notebooks/climex.ipynb ...........         [ 14%]
[2026-01-05T20:38:04.446Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-climate-stations.ipynb . [ 14%]
[2026-01-05T20:38:04.706Z] ...............                                                          [ 17%]
[2026-01-05T20:38:16.135Z] pavics-sdi-master/docs/source/notebooks/eccc-geoapi-xclim.ipynb .....    [ 18%]
[2026-01-05T20:38:25.259Z] pavics-sdi-master/docs/source/notebooks/esgf-dap.ipynb ....              [ 18%]
[2026-01-05T20:38:39.712Z] pavics-sdi-master/docs/source/notebooks/forecasts.ipynb ......           [ 19%]
[2026-01-05T20:38:46.155Z] pavics-sdi-master/docs/source/notebooks/opendap.ipynb .......            [ 21%]
[2026-01-05T20:38:50.869Z] pavics-sdi-master/docs/source/notebooks/pavics_thredds.ipynb .....       [ 22%]
[2026-01-05T20:41:34.630Z] pavics-sdi-master/docs/source/notebooks/regridding.ipynb ............... [ 24%]
[2026-01-05T20:42:43.228Z] .............                                                            [ 27%]
[2026-01-05T20:42:47.732Z] pavics-sdi-master/docs/source/notebooks/rendering.ipynb ....             [ 28%]
[2026-01-05T20:42:49.492Z] pavics-sdi-master/docs/source/notebooks/subset-user-input.ipynb ........ [ 29%]
[2026-01-05T20:43:11.578Z] .................                                                        [ 32%]
[2026-01-05T20:43:20.555Z] pavics-sdi-master/docs/source/notebooks/subsetting.ipynb .....           [ 33%]
[2026-01-05T20:43:21.939Z] pavics-sdi-master/docs/source/notebook-components/weaver_example.ipynb . [ 33%]
[2026-01-05T20:43:31.954Z] .........                                                                [ 35%]
[2026-01-05T20:43:44.319Z] finch-main/docs/source/notebooks/dap_subset.ipynb ...........            [ 37%]
[2026-01-05T20:43:54.319Z] finch-main/docs/source/notebooks/finch-usage.ipynb ......                [ 38%]
[2026-01-05T20:43:55.701Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-1DataAccess.ipynb . [ 38%]
[2026-01-05T20:44:00.734Z] .....                                                                    [ 39%]
[2026-01-05T20:44:39.469Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-2Subsetting.ipynb . [ 40%]
[2026-01-05T20:45:06.984Z] ............                                                             [ 42%]
[2026-01-05T20:45:33.549Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-3Climate-Indicators.ipynb . [ 42%]
[2026-01-05T20:46:05.648Z] .....s.                                                                  [ 43%]
[2026-01-05T20:46:12.237Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-4Ensembles.ipynb . [ 43%]
[2026-01-05T20:46:18.987Z] ..                                                                       [ 44%]
[2026-01-05T20:46:28.977Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb . [ 44%]
[2026-01-05T20:47:42.479Z] .........                                                                [ 46%]
[2026-01-05T20:47:52.468Z] PAVICS-landing-master/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-6Regridding_Conversion.ipynb . [ 46%]
[2026-01-05T20:50:15.495Z] ....                                                                     [ 47%]
[2026-01-05T20:50:15.495Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-01_Intro.ipynb . [ 47%]
[2026-01-05T20:50:15.495Z] ..F.                                                                     [ 48%]
[2026-01-05T20:50:18.039Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-02_Calibration.ipynb . [ 48%]
[2026-01-05T20:50:29.032Z] .....                                                                    [ 49%]
[2026-01-05T20:50:33.231Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-03_Watershed_properties.ipynb . [ 49%]
[2026-01-05T20:50:39.600Z] .............                                                            [ 51%]
[2026-01-05T20:50:46.171Z] PAVICS-landing-master/content/notebooks/hydrology/PAVICStutorial_Hydrology-04_Time_series_analysis.ipynb . [ 51%]
[2026-01-05T20:50:46.436Z] ......                                                                   [ 53%]
[2026-01-05T20:50:58.569Z] raven-main/docs/source/notebooks/Region_selection.ipynb .........        [ 54%]
[2026-01-05T20:51:01.103Z] raven-main/docs/source/notebooks/Subset_climate_data_over_watershed.ipynb . [ 54%]
[2026-01-05T20:51:23.240Z] ......                                                                   [ 56%]
[2026-01-05T20:51:25.162Z] RavenPy-main/docs/notebooks/00_Introduction_to_JupyterLab.ipynb ......   [ 57%]
[2026-01-05T20:51:34.283Z] RavenPy-main/docs/notebooks/01_Getting_watershed_boundaries.ipynb ...... [ 58%]
[2026-01-05T20:51:34.549Z] ..                                                                       [ 58%]
[2026-01-05T20:51:41.116Z] RavenPy-main/docs/notebooks/02_Extract_geographical_watershed_properties.ipynb . [ 58%]
[2026-01-05T20:51:46.915Z] .............                                                            [ 61%]
[2026-01-05T20:53:25.368Z] RavenPy-main/docs/notebooks/03_Extracting_forcing_data.ipynb ........... [ 63%]
[2026-01-05T20:53:25.368Z]                                                                          [ 63%]
[2026-01-05T20:53:31.783Z] RavenPy-main/docs/notebooks/04_Emulating_hydrological_models.ipynb ..... [ 64%]
[2026-01-05T20:53:39.140Z] ...............                                                          [ 67%]
[2026-01-05T20:53:45.707Z] RavenPy-main/docs/notebooks/05_Advanced_RavenPy_configuration.ipynb .... [ 67%]
[2026-01-05T20:53:53.600Z] .........                                                                [ 69%]
[2026-01-05T20:54:06.862Z] RavenPy-main/docs/notebooks/06_Raven_calibration.ipynb ......            [ 70%]
[2026-01-05T20:54:14.382Z] RavenPy-main/docs/notebooks/07_Making_and_using_hotstart_files.ipynb ... [ 71%]
[2026-01-05T20:54:16.978Z] ...                                                                      [ 71%]
[2026-01-05T20:54:23.546Z] RavenPy-main/docs/notebooks/08_Getting_and_bias_correcting_CMIP6_data.ipynb . [ 71%]
[2026-01-05T21:02:46.266Z] ...............                                                          [ 74%]
[2026-01-05T21:02:50.463Z] RavenPy-main/docs/notebooks/09_Hydrological_impacts_of_climate_change.ipynb . [ 74%]
[2026-01-05T21:02:57.487Z] ....                                                                     [ 75%]
[2026-01-05T21:03:40.178Z] RavenPy-main/docs/notebooks/10_Data_assimilation.ipynb ........          [ 77%]
[2026-01-05T21:03:50.466Z] RavenPy-main/docs/notebooks/11_Climatological_ESP_forecasting.ipynb .... [ 77%]
[2026-01-05T21:04:18.515Z] ....                                                                     [ 78%]
[2026-01-05T21:04:26.651Z] RavenPy-main/docs/notebooks/12_Performing_hindcasting_experiments.ipynb . [ 78%]
[2026-01-05T21:04:37.343Z] .......                                                                  [ 80%]
[2026-01-05T21:05:04.584Z] RavenPy-main/docs/notebooks/Assess_probabilistic_flood_risk.ipynb ...... [ 81%]
[2026-01-05T21:05:04.584Z] .                                                                        [ 81%]
[2026-01-05T21:05:12.724Z] RavenPy-main/docs/notebooks/Comparing_hindcasts_and_ESP_forecasts.ipynb . [ 81%]
[2026-01-05T21:05:33.067Z] .......                                                                  [ 82%]
[2026-01-05T21:05:39.904Z] RavenPy-main/docs/notebooks/Distributed_hydrological_modelling.ipynb ... [ 83%]
[2026-01-05T21:05:59.389Z] ....                                                                     [ 84%]
[2026-01-05T21:06:11.057Z] RavenPy-main/docs/notebooks/Hydrological_realtime_forecasting.ipynb .... [ 84%]
[2026-01-05T21:06:17.892Z] ..                                                                       [ 85%]
[2026-01-05T21:06:41.233Z] RavenPy-main/docs/notebooks/Managing_Jupyter_Environments.ipynb ...      [ 85%]
[2026-01-05T21:07:14.377Z] RavenPy-main/docs/notebooks/Perform_Regionalization.ipynb .......        [ 87%]
[2026-01-05T21:07:19.153Z] RavenPy-main/docs/notebooks/Running_HMETS_with_CANOPEX_dataset.ipynb ... [ 87%]
[2026-01-05T21:07:33.498Z] ..........                                                               [ 89%]
[2026-01-05T21:07:55.209Z] RavenPy-main/docs/notebooks/Sensitivity_analysis.ipynb ......            [ 90%]
[2026-01-05T21:08:01.801Z] RavenPy-main/docs/notebooks/time_series_analysis.ipynb ...........       [ 92%]
[2026-01-05T21:08:09.928Z] RavenPy-main/docs/notebooks/paper/Perform_a_climate_change_impact_study_on_a_watershed.ipynb . [ 92%]
[2026-01-05T21:12:40.782Z] .............Fxxxxxx                                                     [ 96%]
[2026-01-05T21:12:40.783Z] notebooks/hummingbird.ipynb ............                                 [ 98%]
[2026-01-05T21:15:03.985Z] notebooks/stress-tests.ipynb ......                                      [100%]
[2026-01-05T21:15:03.985Z] 
[2026-01-05T21:15:03.985Z] =================================== FAILURES ===================================
    
  

@crim-jenkins-bot
Copy link
Collaborator

E2E Test Results

DACCS-iac Pipeline Results

Build URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/3942/
Result 🆘 ABORTED

BIRDHOUSE_DEPLOY_BRANCH : refactor-jupyterhub-customization
DACCS_IAC_BRANCH : master
DACCS_CONFIGS_BRANCH : master
PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master
PAVICS_SDI_BRANCH : master

DESTROY_INFRA_ON_EXIT : true
PAVICS_HOST : https://host-140-216.rdext.crim.ca

⚠️ Infrastructure deployment failed. ⚠️
Instance destroyed due to CI execution.
To debug, launch an instance manually with PR reference
refactor-jupyterhub-customization.

Copy link
Collaborator

@tlvu tlvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow that's some massive refactoring ! Took me 2 passes before I grasp the extend of it.

I'll have to deploy this on my test server to see if the shuffling of the existing templating vars do not break our current setup.

One quick observation is that most of the previous configs being set directly in jupyterhub_config.py.template migrate to custom_dockerspawner.py. But some are left behind, so I wonder the ones left behind are because they can not be moved simply because they do not belongs to the docker spawner or because of other reasons?

@@ -0,0 +1,182 @@
import json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the same with some additions. Once this PR has been approved we will remove the duplicate code from that repository.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you happen to have a diff? If that file has changed, the diff should be reviewed as well.

Also, with this PR using the existing jupyterhub image with that old file, the new file here will take precedence?

Asking because I'll need to deploy this PR to test. If there is any special step to do to get this PR working properly, I'd like to know.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you happen to have a diff?

diff <(curl -s https://raw.githubusercontent.com/bird-house/birdhouse-deploy/445bd8d112b70744249c8bddc8039ee44b050190/birdhouse/components/jupyterhub/jupyterhub_custom/jupyterhub_custom/magpie_authenticator.py) <(curl -s https://raw.githubusercontent.com/Ouranosinc/jupyterhub/refs/heads/master/jupyterhub_magpie_authenticator/jupyterhub_magpie_authenticator.py)

Also, with this PR using the existing jupyterhub image with that old file, the new file here will take precedence?

Yes

If there is any special step to do to get this PR working properly, I'd like to know.

There are no special steps

c4i: false
type: api
sync_type: api

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, this rename from .cfg to .yml is just to clarify the file format or there are other reasons for the rename?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magpie doc used to have permissions.cfg and providers.cfg separately (still allowed and used by birdhouse-deploy), but later introduced config.yml that allows defining everything together since some users/groups permissions are often relevant along the specific services (providers) that get defined.

YAML was used at that point to reflect the actual data structure.

You can actually use many extensions interchangeably. Magpie doesn't care as long as it loads as JSON-like. https://pavics-magpie.readthedocs.io/en/latest/configuration.html#configuration-file-formats

USER_WORKSPACE_GID: ${USER_WORKSPACE_GID}
JUPYTERHUB_CRYPT_KEY: ${JUPYTERHUB_CRYPT_KEY}
JUPYTERHUB_DOCKER_EXTRA_HOSTS: ${JUPYTERHUB_DOCKER_EXTRA_HOSTS:-}
JUPYTERHUB_AUTHENTICATOR_AUTHORIZATION_URL: ${JUPYTERHUB_AUTHENTICATOR_AUTHORIZATION_URL:-}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the new env vars here redefine a default value different than in default.env, is there a reason? And some do not redefine default value here, is there a reason to break the consistency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give an example?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example this JUPYTERHUB_AUTHENTICATOR_AUTHORIZATION_URL:${JUPYTERHUB_AUTHENTICATOR_AUTHORIZATION_URL:-} default here is empty string but the default in default.env is

export JUPYTERHUB_AUTHENTICATOR_AUTHORIZATION_URL='http://twitcher:8000/ows/verify/jupyterhub'

Then example JUPYTERHUB_ADMIN_GROUP_NAME: ${JUPYTERHUB_ADMIN_GROUP_NAME} do not redefine a default here.

So the consistency question is 2 folds. Why sometime we redefine the default and sometime we don't? And then when we do redefine the default, why it is not the same value as in default.env?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see.
The default is still what is in default.env but docker compose will log a warning if an environment variable is missing in a docker-compose.yml file.
One way to tell docker compose that this variable is allowed to be empty is to use the :- syntax. That way it will not log the warning if this variable happens to be empty.

@tlvu tlvu self-requested a review January 22, 2026 03:23
# To get the same settings as the (deprecated) JUPYTERHUB_ENABLE_MULTI_NOTEBOOKS settings above you can
# set the variable as:
#
#export JUPYTERHUB_ALLOWED_IMAGES='
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same JUPYTERHUB_ALLOWED_IMAGES var as the one right above. I do not understand what's the difference?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example contains different jupyterlab images. These are the images that are used in the example for JUPYTERHUB_ENABLE_MULTI_NOTEBOOKS further up in the env.local.example file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/operations Continuous Integration components ci/tests Issues or changes related to tests scripts component/jupyterhub Related to JupyterHub as development frontend with notebooks component/magpie Related to https://github.com/Ouranosinc/Magpie documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants