deployment updates
This commit is contained in:
parent
9ab1511bcb
commit
5b055bbd1d
4
.env
4
.env
@ -24,7 +24,7 @@ DOCKER_NETWORK_NAME=hub-network
|
||||
#DOCKER_NOTEBOOK_IMAGE=jupyter/tensorflow-notebook:4d9c9bd9ced0
|
||||
# d0bfe4b38f78: tensorflow==2.4.1 python==3.9.2 lab==3.0.15 notebook==6.3.0 hub==1.4.1
|
||||
# 23ac04200f8f: tensorflow==2.6.0 python==3.9.7 lab==3.2.3 notebook==6.4.5 hub==1.5.0
|
||||
DOCKER_NOTEBOOK_IMAGE=jupyter/tensorflow-notebook:hub-1.5.0
|
||||
DOCKER_NOTEBOOK_IMAGE=jupyter/scipy-notebook:hub-1.5.0
|
||||
|
||||
# the local image we use, after pinning jupyterhub version
|
||||
#LOCAL_NOTEBOOK_IMAGE=jupyterhub-user
|
||||
@ -44,6 +44,6 @@ DOCKER_SPAWN_CMD=start-singleuser.sh
|
||||
# afterwards, you can visit /hub/login_list (if enabled and you are an admin) to see everyone's passwords.
|
||||
# by default, hub-admin will be an admin user (defined in jupyterhub_config.py).
|
||||
# you can print the password for this hub-admin user with 'bash show_login.sh'
|
||||
USERNAME=`whoami`
|
||||
USERNAME=mm
|
||||
PASSWORD_LENGTH=6
|
||||
HUB_LOC=`pwd`
|
||||
|
@ -6,7 +6,7 @@ FROM jupyterhub/jupyterhub-onbuild:$JUPYTERHUB_VERSION
|
||||
# Install dockerspawner, oauth, postgres
|
||||
RUN pip install psycopg2-binary~=2.7 && \
|
||||
pip install --no-cache-dir \
|
||||
oauthenticator==0.8.*
|
||||
oauthenticator~=14.2.0
|
||||
|
||||
RUN pip install jupyterhub-hashauthenticator dockerspawner~=12.0
|
||||
RUN pip install jupyterhub-idle-culler
|
||||
|
@ -6,7 +6,7 @@ version: "3"
|
||||
|
||||
services:
|
||||
hub-db:
|
||||
image: postgres:9.5
|
||||
image: postgres:14.1
|
||||
container_name: ${HUB_NAME}-db
|
||||
restart: always
|
||||
environment:
|
||||
@ -37,8 +37,8 @@ services:
|
||||
- ./jupyterhub_config.py:/srv/jupyterhub/jupyterhub_config.py
|
||||
- ./userlist:/srv/jupyterhub/userlist
|
||||
# - "/tmp/.X11-unix:/tmp/.X11-unix"
|
||||
ports:
|
||||
- "${PORT_NUM}:8000"
|
||||
# ports:
|
||||
# - "${PORT_NUM}:8000"
|
||||
links:
|
||||
- hub-db
|
||||
environment:
|
||||
|
@ -118,8 +118,9 @@ class MyDockerSpawner(DockerSpawner):
|
||||
self.default_url = '/lab'
|
||||
|
||||
def update_volumes(self, group_list):
|
||||
for group_id in group_list:
|
||||
mode = 'rw' if 'admin' in group_list else 'ro'
|
||||
for group_id in group_list: # do not want "shared-admin" folder.
|
||||
if group_id != 'admin':
|
||||
volume = create_volume_mount(group_id, mode, 'jovyan')
|
||||
self.volumes.update(volume)
|
||||
|
||||
@ -184,12 +185,13 @@ c.DockerSpawner.debug = True
|
||||
# User containers will access hub by container name on the Docker network
|
||||
c.JupyterHub.hub_ip = HUB_NAME
|
||||
# The hub will be hosted at example.com/HUB_NAME/
|
||||
c.JupyterHub.base_url = u'/%s/'%HUB_NAME
|
||||
#c.JupyterHub.base_url = u'/%s/'%HUB_NAME
|
||||
c.JupyterHub.base_url = u'/'
|
||||
#c.JupyterHub.hub_port = 8001
|
||||
|
||||
## Authentication
|
||||
# Whitlelist users and admins
|
||||
c.Authenticator.allowed_users = whitelist = set()
|
||||
c.Authenticator.allowed_users = allowed_users = set()
|
||||
c.Authenticator.admin_users = admin = set()
|
||||
|
||||
# add default user so that first-time log in is easy.
|
||||
@ -197,12 +199,14 @@ admin.add('hub-admin')
|
||||
for name in GROUP_MAP:
|
||||
if 'admin' in GROUP_MAP[name]:
|
||||
admin.add(name)
|
||||
else:
|
||||
whitelist.add(name)
|
||||
allowed_users.add(name)
|
||||
|
||||
# Authenticate users with GitHub OAuth
|
||||
c.JupyterHub.authenticator_class = 'oauthenticator.GitHubOAuthenticator'
|
||||
c.GitHubOAuthenticator.oauth_callback_url = os.environ['OAUTH_CALLBACK_URL']
|
||||
#c.GitHubOAuthenticator.allowed_organizations = {'ml-starter-packs', 'mindthemath', 'mindthegrow'}
|
||||
#c.GitHubOAuthenticator.scope = ['read:org', 'user:email']
|
||||
|
||||
|
||||
# Authenticate with thedataincubator/jupyterhub-hashauthenticator
|
||||
##c.JupyterHub.authenticator_class = 'hashauthenticator.HashAuthenticator'
|
||||
|
Loading…
Reference in New Issue
Block a user