A hackathon-friendly JupyterHub deployment with Docker & NGINX.
Includes example Jupyter notebook to push data to MongoDB, and a mongo-express admin interface. Runs the Jupyter Data Science Notebook container with an installation of Zipline.
-
Clone this repository and
cdinto the directory:git clone https://github.com/aeksco/hackathon_jupyterhub.gitcd hackathon_jupyterhub -
Create GitHub OAuth Application:
Go to github.com/settings/developers and create a new OAuth application.
-
Create the
jupyterhub_config.pyfile:Copy the
jupyterhub/jupyterhub_config.example.pyfile tojupyterhub/jupyterhub_config.pyChange the following fields to match your GitHub OAuth Application:
c.GitHubOAuthenticator.oauth_callback_urlc.GitHubOAuthenticator.client_idc.GitHubOAuthenticator.client_secretc.Authenticator.whitelist = {'torvalds', 'aeksco'}c.Authenticator.admin_users = {'torvalds'}c.JupyterHub.base_url = '/jupyterhub'
-
Create the
jupyterhub/internals/users.txtfile:Copy the
jupyterhub/internals/users.example.txtfile tojupyterhub/internals/users.txtThis file should contain the GitHub usernames of all users who will be using the system. Every user defined in
jupyterhub_config.pymust be listed here for the server to work properly. Please ensure that there is no trailing whitespace or newlines in this file! -
Start the docker containers:
docker-compose up
- Jupyter server running at http://localhost:8888
-
You may run a command inside the
hackathon_jupyterhubdocker container as the root user with the following command:docker-compose run --user="root" hackathon_jupyterhub pip install pandas -
Installation instructions for Python 2.7 Jupyter kernel were found here.
-
Run the following to setup an NGINX reverse-proxy to the Jupyter Notebook server
sudo apt-get update sudo apt-get install nginx -
Copy the contents of
NGINX_EXAMPLEinto/etc/nginx/sites-available/my_site -
Simlink the file from
sites-availabletosites-enabledln -s /etc/nginx/sites-available/my_site /etc/nginx/sites-enabled/my_site -
Control NGINX with the following system commands:
sudo systemctl start nginx sudo systemctl stop nginx sudo systemctl restart nginx
-
Use RSYNC to sync files into shared directory?
-
TODO - Preload examples, traning sets, datasets, images.