-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2851 from GeorgianaElena/hub_test_image
Add a new "hub-experimental" hub image and enable unlisted choices for leap hub
- Loading branch information
Showing
12 changed files
with
199 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Allow users to setup custom, free-form user profile choices | ||
|
||
Sometimes it is useful to allow users to specify their own, free-form choice for an option. | ||
We can make this possible by enabling and configuring [`KubeSpawner.profile_list.<profile>.profile_options.<option>.unlisted_choice`](https://jupyterhub-kubespawner.readthedocs.io/en/latest/spawner.html#kubespawner.KubeSpawner.profile_list). | ||
|
||
If enabled, when the user selects “Other” as a choice, a free form input is enabled. An optional regex can be configured that the free form input should match - eg. `^pangeo/.*$`. | ||
|
||
Example configuration that allows a custom free-form, user specified image: | ||
|
||
```yaml | ||
jupyterhub: | ||
singleuser: | ||
profileList: | ||
- display_name: "CPU only" | ||
description: "Start a container limited to a chosen share of capacity on a node of this type" | ||
profile_options: | ||
image: | ||
display_name: Image | ||
unlisted_choice: | ||
enabled: True | ||
display_name: "Custom image" | ||
validation_regex: "^.+:.+$" | ||
validation_message: "Must be an image location, matching ^.+:.+$" | ||
kubespawner_override: | ||
image: "{value}" | ||
choices: | ||
pangeo_new: | ||
display_name: Base Pangeo Notebook ("2023.05.18") | ||
default: true | ||
slug: "pangeo_new" | ||
kubespawner_override: | ||
image: "pangeo/pangeo-notebook:2023.05.18" | ||
pangeo_old: (...) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This image tag should match the dependent JupyterHub Helm chart's version as | ||
# declared in basehub/Chart.yaml. | ||
# | ||
# If you make an update to this tag and the JupyterHub Helm chart's version, | ||
# then first commit those changes. | ||
# Then, from the `helm-charts` directory where the `chartpress.yaml` is located, | ||
# perform `chartpress --push` with your quay.io container registry credentials | ||
# configured to have access to https://quay.io/repository/2i2c/pilot-hub. | ||
# | ||
# Note: if on macOs with M1, you need to run chartpress with docker buildx under the hood and specify | ||
# the architecture to use. | ||
# `chartpress --push --builder docker-buildx --platform linux/amd64` | ||
# Ref: https://cloudolife.com/2022/03/05/Infrastructure-as-Code-IaC/Container/Docker/Docker-buildx-support-multiple-architectures-images/ | ||
# | ||
FROM jupyterhub/k8s-hub:3.0.0-beta.1 | ||
|
||
COPY requirements.txt /tmp/ | ||
|
||
RUN pip install -r /tmp/requirements.txt | ||
|
||
USER root | ||
RUN mkdir -p /usr/local/etc/jupyterhub-configurator | ||
|
||
COPY jupyterhub_configurator_config.py /usr/local/etc/jupyterhub-configurator/jupyterhub_configurator_config.py | ||
USER $NB_USER |
15 changes: 15 additions & 0 deletions
15
helm-charts/images/hub-experimental/jupyterhub_configurator_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import json | ||
import os | ||
from glob import glob | ||
|
||
CONFIGURATOR_BASE_PATH = "/usr/local/etc/jupyterhub-configurator" | ||
|
||
schema_files = sorted(glob(os.path.join(CONFIGURATOR_BASE_PATH, "*.schema.json"))) | ||
|
||
schemas = {} | ||
|
||
for sf in schema_files: | ||
with open(sf) as f: | ||
schemas[sf] = json.load(f) | ||
|
||
c.Configurator.schemas = schemas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
git+https://github.com/yuvipanda/jupyterhub-configurator@ed7e3a0df1e3d625d10903ef7d7fd9c2fbb548db | ||
# Brings on using `unlisted_choice` in profile options per https://github.com/2i2c-org/infrastructure/issues/2146 | ||
git+https://github.com/jupyterhub/kubespawner@def501f1d60b8e5629745acb0bcc45b151b1decc |