mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-08 10:34:10 +00:00
add managed notebook service example
This commit is contained in:
10
examples/service-notebook/README.md
Normal file
10
examples/service-notebook/README.md
Normal 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.
|
||||||
|
|
38
examples/service-notebook/managed/jupyterhub_config.py
Normal file
38
examples/service-notebook/managed/jupyterhub_config.py
Normal 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),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
Reference in New Issue
Block a user