add managed notebook service example

This commit is contained in:
Min RK
2017-01-06 11:24:11 +01:00
parent 5d41376c2e
commit dcfe71e7f0
2 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
# Running a shared notebook as a service
This directory contains two examples of running a shared notebook server as a service,
one as a 'managed' service, and one as an external service with supervisor.
A single-user notebook server is run as a service,
and uses groups to authenticate a collection of users with the Hub.
These examples require jupyterhub >= 0.7.2.

View File

@@ -0,0 +1,38 @@
# our user list
c.Authenticator.whitelist = [
'minrk',
'ellisonbg',
'willingc',
]
# ellisonbg and willingc have access to a shared server:
c.JupyterHub.load_groups = {
'shared': [
'ellisonbg',
'willingc',
]
}
hub_ip = '127.0.0.1'
hub_api_port = 8081
service_name = 'shared-notebook'
group_name = 'shared'
service_port = 9999
# start the notebook server as a service
c.JupyterHub.services = [
{
'name': service_name,
'url': 'http://127.0.0.1:{}'.format(service_port),
'command': [
'jupyterhub-singleuser',
'--cookie-name=jupyterhub-services',
'--port={}'.format(service_port),
'--group={}'.format(group_name),
'--base-url=/services/{}'.format(service_name),
'--hub-prefix=/hub/',
'--hub-api-url=http://{}:{}/hub/api'.format(hub_ip, hub_api_port),
]
}
]