Skip to content

Commit 38a5f25

Browse files
committed
Merge pull request ipython#29 from rgbkrk/multiuser
Explore multi user notebook launch modes.
2 parents 6d77356 + 2be7d33 commit 38a5f25

File tree

1 file changed

+126
-7
lines changed

1 file changed

+126
-7
lines changed

examples/Notebook/Running the Notebook Server.ipynb

Lines changed: 126 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,24 @@
315315
"```"
316316
]
317317
},
318+
{
319+
"cell_type": "markdown",
320+
"metadata": {},
321+
"source": [
322+
"## Known issues"
323+
]
324+
},
325+
{
326+
"cell_type": "markdown",
327+
"metadata": {},
328+
"source": [
329+
"When behind a proxy, especially if your system or browser is set to autodetect the proxy, the notebook web application might fail to connect to the server's websockets, and present you with a warning at startup. In this case, you need to configure your system not to use the proxy for the server's address.\n",
330+
"\n",
331+
"For example, in Firefox, go to the Preferences panel, Advanced section,\n",
332+
"Network tab, click 'Settings...', and add the address of the notebook server\n",
333+
"to the 'No proxy for' field."
334+
]
335+
},
318336
{
319337
"cell_type": "markdown",
320338
"metadata": {},
@@ -340,22 +358,123 @@
340358
"cell_type": "markdown",
341359
"metadata": {},
342360
"source": [
343-
"## Known issues"
361+
"# Multi-User Notebook Servers"
344362
]
345363
},
346364
{
347365
"cell_type": "markdown",
348366
"metadata": {},
349367
"source": [
350-
"When behind a proxy, especially if your system or browser is set to autodetect the proxy, the notebook web application might fail to connect to the server's websockets, and present you with a warning at startup. In this case, you need to configure your system not to use the proxy for the server's address.\n",
368+
"## JupyterHub"
369+
]
370+
},
371+
{
372+
"cell_type": "markdown",
373+
"metadata": {},
374+
"source": [
375+
"JupyterHub is a multi-user server that manages and proxies multiple instances of the single-user IPython/Jupyter Notebook server.\n",
351376
"\n",
352-
"For example, in Firefox, go to the Preferences panel, Advanced section,\n",
353-
"Network tab, click 'Settings...', and add the address of the notebook server\n",
354-
"to the 'No proxy for' field."
377+
"<img src=\"https://c2a32ff18d23c8f567f0-e44b0df73868b5d567b1e58e01681d15.ssl.cf5.rackcdn.com/2015-03-24-deploying-jupyterhub-for-education/jupyterhub-9efc59baf33d2640641cb4a1fd9145ff.gif\" width=\"800px\" />\n",
378+
"\n",
379+
"### Components\n",
380+
"\n",
381+
"* multi-user Hub (tornado process)\n",
382+
"* configurable http proxy (node-http-proxy)\n",
383+
"* multiple single-user IPython notebook servers (Python/IPython/tornado)\n",
384+
"\n",
385+
"#### [Configurable Proxy](https://github.com/jupyter/configurable-http-proxy)\n",
386+
"\n",
387+
"* Based on node-http-proxy\n",
388+
"* Proxy routes to localhost, external IPs, etc.\n",
389+
"\n",
390+
"```\n",
391+
"/user/123/ -> 127.0.0.1:56790\n",
392+
"```\n",
393+
"\n",
394+
"* Provides an administrative API for adding routes\n",
395+
"\n",
396+
"```\n",
397+
"POST /api/routes/[:path]\n",
398+
"```\n",
399+
"\n",
400+
"#### [JupyterHub](https://github.com/jupyter/jupyterhub)\n",
401+
"\n",
402+
"* Hub spawns proxy\n",
403+
"* Proxy forwards ~all requests to hub by default\n",
404+
"* Hub handles login, and spawns single-user servers on demand\n",
405+
"* Hub configures proxy to forward url prefixes to single-user servers\n"
406+
]
407+
},
408+
{
409+
"cell_type": "markdown",
410+
"metadata": {},
411+
"source": [
412+
"## Authentication models\n",
413+
"\n",
414+
"* PAM/Unix (Default)\n",
415+
"* [GitHub OAuth](https://github.com/jupyter/oauthenticator) - Demo at demohub.jupyter.org\n",
416+
"\n",
417+
"This is extensible enough to implement other authentication methods, the simplest being any involving OAuth (follow the GitHub OAuthenticator for a skeleton)."
418+
]
419+
},
420+
{
421+
"cell_type": "markdown",
422+
"metadata": {},
423+
"source": [
424+
"## Spawners\n",
425+
"\n",
426+
"By default, notebook servers are spawned in the context of the user as a process on the host machine. One alternative for spawning is the [DockerSpawner](https://github.com/jupyter/dockerspawner) which runs each user in their own environment inside a Docker container.\n"
427+
]
428+
},
429+
{
430+
"cell_type": "markdown",
431+
"metadata": {},
432+
"source": [
433+
"## Real world implementations of JupyterHub\n",
434+
"\n",
435+
"The Computational Models class at UC Berkeley ran a JupyterHub installation for ~220 students in Winter/Spring of 2015.\n",
436+
"\n",
437+
"* Docker Spawner\n",
438+
"* Multiple compute nodes\n",
439+
"* GitHub Authentication\n",
440+
"* NFS backed for student data, assignments, notebooks, etc.\n",
441+
"\n",
442+
"![](https://c2a32ff18d23c8f567f0-e44b0df73868b5d567b1e58e01681d15.ssl.cf5.rackcdn.com/2015-03-24-deploying-jupyterhub-for-education/setup-2e74d935ee0c874e66a9b53359493ceb.png)\n"
443+
]
444+
},
445+
{
446+
"cell_type": "markdown",
447+
"metadata": {},
448+
"source": [
449+
"## tmpnb\n",
450+
"\n",
451+
"tmpnb is a temporary notebook system. Visit [try.jupyter.org](https://try.jupyter.org) for a demo.\n",
452+
"\n",
453+
"Similar to JupyterHub with the DockerSpawner, tmpnb uses a proxy to route to notebook servers. The difference is that there is no login and notebook servers get deleted after a period of (configurable) inactivity.\n",
454+
"\n",
455+
"<img src=\"https://cloud.githubusercontent.com/assets/836375/5911140/c53e3978-a587-11e4-86a5-695469ef23a5.png\" width=\"800px\" />\n"
355456
]
356457
}
357458
],
358-
"metadata": {},
459+
"metadata": {
460+
"kernelspec": {
461+
"display_name": "Python 3",
462+
"language": "python",
463+
"name": "python3"
464+
},
465+
"language_info": {
466+
"codemirror_mode": {
467+
"name": "ipython",
468+
"version": 3
469+
},
470+
"file_extension": ".py",
471+
"mimetype": "text/x-python",
472+
"name": "python",
473+
"nbconvert_exporter": "python",
474+
"pygments_lexer": "ipython3",
475+
"version": "3.4.3"
476+
}
477+
},
359478
"nbformat": 4,
360479
"nbformat_minor": 0
361-
}
480+
}

0 commit comments

Comments
 (0)