Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable unlisted_choice in LEAP hub #3047

Merged
merged 3 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions config/clusters/leap/common.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ basehub:
name: LEAP
url: https://leap-stc.github.io
hub:
image:
name: quay.io/2i2c/unlisted-choice-experiment
tag: "0.0.1-0.dev.git.6801.h3f4f0c4a"
allowNamedServers: true
config:
Authenticator:
Expand Down Expand Up @@ -189,6 +192,13 @@ basehub:
cpu_limit: 16
image: &profile_list_profile_options_image
display_name: Image
unlisted_choice: &profile_list_unlisted_choice
enabled: True
display_name: "Custom image"
validation_regex: "^.+:.+$"
validation_message: "Must be a valid public docker image, including a tag"
kubespawner_override:
image: "{value}"
choices:
pangeo_new:
display_name: Base Pangeo Notebook ("2023.07.05")
Expand Down Expand Up @@ -268,6 +278,7 @@ basehub:
profile_options:
image:
display_name: Image
unlisted_choice: *profile_list_unlisted_choice
choices:
tensorflow_new:
display_name: Pangeo Tensorflow ML Notebook ("2023.07.05")
Expand Down
8 changes: 6 additions & 2 deletions helm-charts/basehub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ jupyterhub:
)
c.Spawner.pre_spawn_hook = ensure_db_pvc
05-gh-teams: |
import copy

from textwrap import dedent
from tornado import gen, web
from oauthenticator.github import GitHubOAuthenticator
Expand Down Expand Up @@ -745,8 +747,10 @@ jupyterhub:
print(f"User {spawner.user.name} is part of teams {' '.join(teams)}")
allowed_profiles = []


for profile in original_profile_list:
# Make a copy of the original profile_list dict,
# otherwise we might end up modifying it by mistake
profile_list_copy = copy.deepcopy(original_profile_list)
for profile in profile_list_copy:
# If there is no ':' in allowed_teams, it's an org and we should check that
# differently
allowed_orgs = set([o for o in profile.get('allowed_teams', []) if ':' not in o])
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/images/hub/unlisted-choice-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +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
git+https://github.com/jupyterhub/kubespawner@934ef321f72e58bd680d35ea5fd6780b2b8b52c7