Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ansible-roles
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jocelyn Delalande
ansible-roles
Commits
fdd29ae8
Commit
fdd29ae8
authored
Aug 30, 2018
by
Jocelyn Delalande
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jupyterhub: Bring the role to a working state
parent
36017fff
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
197 additions
and
17 deletions
+197
-17
jupyterhub/README.md
jupyterhub/README.md
+35
-3
jupyterhub/tasks/ijavascript.yml
jupyterhub/tasks/ijavascript.yml
+14
-1
jupyterhub/tasks/main.yml
jupyterhub/tasks/main.yml
+10
-7
jupyterhub/tasks/notebook.yml
jupyterhub/tasks/notebook.yml
+57
-0
jupyterhub/templates/js-startup.js
jupyterhub/templates/js-startup.js
+69
-0
jupyterhub/templates/jupyterhub_config.py.j2
jupyterhub/templates/jupyterhub_config.py.j2
+12
-6
No files found.
jupyterhub/README.md
View file @
fdd29ae8
WIP JupyterHUB role
===================
JupyterHub deployment to learn programming with JS
===================
===============================
**Work in progress, cannot be used as-is.**
-
Deploy JupyterHub
-
Deploy IJavasScript kernel to allow JS notebooks
-
Tweak IJavaScript config to add
`prompt()`
and
`alert()`
synchronous
functions
-
Set up a locale (translation)
*see also: jupyter*
## Security warning
Be conscious that JupyterHub gives a remote (unprivilleged) shell access to
logged-in users, and that this implementation is not using docker isolation.
## Performance warning
JupyterHub can be quite intensive on resources, by experience, a group of 10
people toying with a few notebooks will quickly require 2G RAM dedicated to
Jupyter. If you experience killed notebooks or notebooks refusing to start as
more users connect, you should give a look at RAM usage and consider adding
more.
Variables
---------
### Optional (interface language)
Use both or use none, note that you have to use one of
jupyter
[
supported languages
](
https://github.com/JocelynDelalande/notebook/blob/jd-french-i18n/notebook/i18n/nbjs.json#L3-L6
)
. Left
those settings unchanged to use plain old English.
-
*jupyterhub_locale*
: a unix locale (ex:
`fr_FR`
)
-
*jupyterhub_system_locale*
: a unix locale with charset indication (ex:
`fr_FR.utf8`
)
jupyterhub/tasks/ijavascript.yml
View file @
fdd29ae8
...
...
@@ -3,5 +3,18 @@
# Not that it seems not required for Debian stretch
-
name
:
Install npm deps
npm
:
name
:
ijavascript
name
:
"
{{
item
}}"
global
:
yes
with_items
:
-
ijavascript
-
fibers
# for synchronous functions
-
name
:
Install ijavascript kernel for notebooks
shell
:
"
ijsinstall
--install=global
--startup-script=/opt/jupyterhub/js-startup.js"
environment
:
PATH
:
"
/opt/jupyterhub/venv/bin:{{
ansible_env.PATH
}}"
-
name
:
Deploy custom startup script (with custom sync functions for learning)
template
:
src
:
js-startup.js
dest
:
/opt/jupyterhub/js-startup.js
\ No newline at end of file
jupyterhub/tasks/main.yml
View file @
fdd29ae8
# This first task is actually required by ijavascript
# to get a recent version of node (jessie-backports contains one, but with no
# npm…)
# Seems un-needed on strecth (but not tested)
-
name
:
Install node from nodesource as ijs wont run with node 0.10x
# This first task is actually required by ijavascript to get a recent version
# of node (jessie-backports and stretch contains a recent one, but lacking npm)
#
-
name
:
Install node from nodesource
import_tasks
:
nodesource.yml
-
name
:
install apt dependencies
...
...
@@ -35,6 +34,9 @@
become
:
jupyterhub
notify
:
restart jupyterhub
-
name
:
install jupyter notebook (with french translation)
include
:
notebook.yml
-
name
:
Install npm deps
npm
:
name
:
configurable-http-proxy
...
...
@@ -78,6 +80,9 @@
dest
:
/etc/jupyterhub/jupyterhub_config.py
notify
:
restart jupyterhub
-
name
:
Install ijavascript notebook kernel
import_tasks
:
ijavascript.yml
-
name
:
systemd script is in place
template
:
src
:
jupyterhub.service.j2
...
...
@@ -89,5 +94,3 @@
-
name
:
jupyterhub is started
service
:
name=jupyterhub state=started
-
name
:
Install ijavascript notebook kernel
import_tasks
:
ijavascript.yml
jupyterhub/tasks/notebook.yml
0 → 100644
View file @
fdd29ae8
-
name
:
Install jupyter notebook
pip
:
# Could switch to stable release once PR is merged
# https://github.com/jupyter/notebook/pull/3888
name
:
"
git+https://github.com/JocelynDelalande/notebook.git@jd-french-i18n#egg=notebook"
virtualenv
:
/opt/jupyterhub/venv
become
:
jupyterhub
notify
:
restart jupyterhub
register
:
updated_notebook
-
name
:
Install pybabel
# Could drop this step once issue is fixed
# https://github.com/jupyter/notebook/issues/3102
pip
:
name
:
babel
virtualenv
:
/opt/jupyterhub/venv
become
:
jupyterhub
when
:
jupyterhub_locale
-
name
:
Install po2json