Skip to content

Commit

Permalink
Merge pull request #3047 from yuvipanda/unlisted-choice-take-2
Browse files Browse the repository at this point in the history
Enable `unlisted_choice` in LEAP hub
  • Loading branch information
yuvipanda authored Aug 29, 2023
2 parents 5dad1da + b62a46a commit ec38063
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
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 @@ -698,6 +698,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 @@ -746,8 +748,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

0 comments on commit ec38063

Please sign in to comment.