Skip to content

Commit

Permalink
Bump hub version to 0.11
Browse files Browse the repository at this point in the history
Breaking changes to fix:

- All authenticator config has changed, and must be
  modified - jupyterhub/zero-to-jupyterhub-k8s#1943
- pdb has been disabled - we should file an issue to investigate
  if we want it - jupyterhub/zero-to-jupyterhub-k8s#1938
- Any networkpolicy changes we might need -
https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/master/CHANGELOG.md#breaking-changes-1
  • Loading branch information
yuvipanda authored and GeorgianaElena committed Feb 5, 2021
1 parent af2b7df commit 4639bc9
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 148 deletions.
24 changes: 9 additions & 15 deletions auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,15 @@ def get_client_creds(self, client, connection_name):
if connection_name == 'github':
# Except for GitHub, where we use the username
username_key = 'nickname'
auth = {}
auth['scopes'] = ['openid', 'name', 'profile', 'email']
auth['type'] = 'custom'
auth['custom'] = {
'className': 'oauthenticator.generic.GenericOAuthenticator',
'config': {
'authorize_url': f'https://{self.domain}/authorize',
'token_url': f'https://{self.domain}/oauth/token',
'userdata_url': f'https://{self.domain}/userinfo',
'userdata_method': 'GET',
'username_key': username_key,
'client_id': client['client_id'],
'client_secret': client['client_secret']
}

auth = {
'authorize_url': f'https://{self.domain}/authorize',
'token_url': f'https://{self.domain}/oauth/token',
'userdata_url': f'https://{self.domain}/userinfo',
'userdata_method': 'GET',
'username_key': username_key,
'client_id': client['client_id'],
'client_secret': client['client_secret'],
'scopes': ['openid', 'name', 'profile', 'email']
}

return auth
2 changes: 1 addition & 1 deletion hub-templates/base-hub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ version: 0.0.1
dependencies:
- name: jupyterhub
# REMEMBER TO CHANGE BASE IMAGE OF images/hub/ WHEN CHANGING THIS
version: 0.9.0-n287.hd5f1f881
version: 0.11.1
repository: https://jupyterhub.github.io/helm-chart/
8 changes: 6 additions & 2 deletions hub-templates/base-hub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,13 @@ jupyterhub:
- ports:
- port: 443
protocol: TCP
auth:
type: dummy
hub:
config:
JupyterHub:
authenticator_class: oauthenticator.generic.GenericOAuthenticator
image:
name: quay.io/2i2c/pilot-hub
tag: '0.0.1-n311.h51f02bb'
nodeSelector:
hub.jupyter.org/pool-name: core-pool
networkPolicy:
Expand Down
8 changes: 6 additions & 2 deletions hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def get_generated_config(self, auth_provider, proxy_secret_key):
},
},
'hub': {
'config': {},
'initContainers': [
{
'name': 'templates-clone',
Expand Down Expand Up @@ -239,7 +240,10 @@ def get_generated_config(self, auth_provider, proxy_secret_key):
self.spec['domain'],
self.spec['auth0']['connection']
)
generated_config['jupyterhub']['auth'] = auth_provider.get_client_creds(client, self.spec['auth0']['connection'])
# FIXME: We're hardcoding GenericOAuthenticator here
# We should *not*. We need dictionary merging in code, so
# these can all exist fine.
generated_config['jupyterhub']['hub']['config']['GenericOAuthenticator'] = auth_provider.get_client_creds(client, self.spec['auth0']['connection'])

return self.apply_hub_template_fixes(generated_config, proxy_secret_key)

Expand Down Expand Up @@ -404,7 +408,7 @@ def deploy(self, auth_provider, proxy_secret_key, skip_hub_health_test=False):
generated_values_file.flush()

cmd = [
'helm', 'upgrade', '--install', '--create-namespace', '--wait',
'helm', 'upgrade', '--install', '--create-namespace', '--wait', '--debug', '--dry-run',
'--namespace', self.spec['name'],
self.spec['name'], os.path.join('hub-templates', self.spec['template']),
# Ordering matters here - config explicitly mentioned in `hubs.yaml` should take
Expand Down
204 changes: 76 additions & 128 deletions hubs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,15 @@ clusters:
funded_by:
name: 2i2c
url: https://2i2c.org
auth:
# Admin names need to be listed twice here, unfortunately
# 'whitelist' will be removed by next jupyterhub release
whitelist:
users:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
admin:
users:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
hub:
config:
Authenticator:
allowed_users: &staging_users
- [email protected]
- [email protected]
- [email protected]
- [email protected]
admin_users: *staging_users
- name: dask-staging
cluster: 2i2c
domain: dask-staging.pilot.2i2c.cloud
Expand Down Expand Up @@ -81,21 +75,15 @@ clusters:
image:
name: pangeo/pangeo-notebook
tag: 2020.12.08
auth:
# Admin names need to be listed twice here, unfortunately
# 'whitelist' will be removed by next jupyterhub release
whitelist:
users:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
admin:
users:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
hub:
config:
Authenticator:
allowed_users: &dask_staging_users
- [email protected]
- [email protected]
- [email protected]
- [email protected]
admin_users: *dask_staging_users
- name: ephemeral
cluster: 2i2c
domain: ephemeral.pilot.2i2c.cloud
Expand Down Expand Up @@ -148,25 +136,17 @@ clusters:
funded_by:
name: JROST & IOI
url: https://investinopen.org/blog/jrost-rapid-response-fund-awardees
auth:
# Admin names need to be listed wtice here, unfortunately
# 'whitelist' will be removed by next jupyterhub release
whitelist:
users:
- colliand
- alessandromariaselvitella
- fosterk86
- choldgraf
- yuvipanda
- GeorgianaElena
admin:
users:
- colliand
- alessandromariaselvitella
- fosterk86
- choldgraf
- yuvipanda
- GeorgianaElena
hub:
config:
Authenticator:
allowed_users: &pfw_users
- colliand
- alessandromariaselvitella
- fosterk86
- choldgraf
- yuvipanda
- GeorgianaElena
admin_users: *pfw_users
- name: wageningen
cluster: 2i2c
domain: wur.pilot.2i2c.cloud
Expand Down Expand Up @@ -194,21 +174,15 @@ clusters:
memory:
limit: 2G
guarantee: 2G
auth:
# Admin names need to be listed wtice here, unfortunately
# 'whitelist' will be removed by next jupyterhub release
whitelist:
users:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
admin:
users:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
hub:
config:
Authenticator:
allowed_users: &wur_users
- [email protected]
- [email protected]
- [email protected]
- [email protected]
admin_users: *wur_users
- name: callysto
cluster: 2i2c
domain: callysto.pilot.2i2c.cloud
Expand Down Expand Up @@ -245,6 +219,10 @@ clusters:
connection: github
config:
jupyterhub:
singleuser:
image:
name: quay.io/2i2c/paleohack-2021
tag: 825b105c3425
homepage:
templateVars:
org:
Expand All @@ -260,25 +238,16 @@ clusters:
funded_by:
name: "[TBD]"
url: https://example.com
auth:
# Admin names need to be listed wtice here, unfortunately
# 'whitelist' will be removed by next jupyterhub release
whitelist:
users:
- yuvipanda
- choldgraf
- CommonClimate
- khider
- fzhu2e
- alexkjames
admin:
users:
config:
Authenticator:
allowed_users: &paleohack_users
- yuvipanda
- choldgraf
- CommonClimate
- khider
- fzhu2e
- alexkjames
admin_users: *paleohack_users
- name: peddie
cluster: 2i2c
domain: peddie.pilot.2i2c.cloud
Expand All @@ -302,25 +271,17 @@ clusters:
funded_by:
name: JROST & IOI
url: https://investinopen.org/blog/jrost-rapid-response-fund-awardees
auth:
# Admin names need to be listed wtice here, unfortunately
# 'whitelist' will be removed by next jupyterhub release
whitelist:
users:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
admin:
users:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
hub:
config:
Authenticator:
allowed_users: &peddie_users
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
admin_users: *peddie_users
- name: catalyst-cooperative
cluster: pilot
domain: catalyst-cooperative.pilot.2i2c.cloud
Expand Down Expand Up @@ -352,25 +313,17 @@ clusters:
funded_by:
name: CloudBank
url: http://cloudbank.org/
auth:
# Admin names need to be listed wtice here, unfortunately
# 'whitelist' will be removed by next jupyterhub release
whitelist:
users:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
admin:
users:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
hub:
config:
Authenticator:
allowed_users: &catalyst_users
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
admin_users: *catalyst_users
- name: earthlab
cluster: 2i2c
domain: earthlab.pilot.2i2c.cloud
Expand All @@ -394,19 +347,14 @@ clusters:
funded_by:
name: JROST & IOI
url: https://investinopen.org/blog/jrost-rapid-response-fund-awardees
auth:
# Admin names need to be listed wtice here, unfortunately
# 'whitelist' will be removed by next jupyterhub release
whitelist:
users:
- yuvipanda
- choldgraf
- lwasser
admin:
users:
- yuvipanda
- choldgraf
- lwasser
hub:
config:
Authenticator:
allowed_users: &earthlab_users
- yuvipanda
- choldgraf
- lwasser
admin_users: *earthlab_users

- name: cloudbank
image_repo: "us-central1-docker.pkg.dev/cb-1003-1696/low-touch-hubs/base-user"
Expand Down

0 comments on commit 4639bc9

Please sign in to comment.