Skip to content

Commit

Permalink
Added readme, simplified config
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca De Feo committed Jun 19, 2019
1 parent afb8a91 commit f381589
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# A name for this Docker Compose application, it can be whatever you like
COMPOSE_PROJECT_NAME=jupyterhub

# The server where this JupyterHub server is hosted
HOST=jupyter.ens.uvsq.fr
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# JupyterHub deployment in use at Université de Versailles

This is a [JupyterHub](https://jupyter.org/hub) deployment based on
Docker currently in use at [Université de
Versailles](https://jupyter.ens.uvsq.fr/).

## Features

- Containerized single user Jupyter servers, using
[DockerSpawner](https://github.com/jupyterhub/dockerspawner);
- Central authentication to the University CAS server;
- User data persistence;
- HTTPS proxy.

## Learn more

This deployment is described in depth in [this blog
post](https://opendreamkit.org/2018/10/17/jupyterhub-docker/).

### Adapt to your needs

This deployment is ready to clone and roll on your own server. Read
the [blog
post](https://opendreamkit.org/2018/10/17/jupyterhub-docker/) first,
to be sure you understand the configuration.

Then, if you like, clone this repository and apply (at least) the
following changes:

- In [`.env`](.env), set the variable `HOST` to the name of the server you
intend to host your deployment on.
- In [`reverse-proxy/traefik.toml`](reverse-proxy/traefik.toml), edit
the paths in `certFile` and `keyFile` and point them to your own TLS
certificates. Possibly edit the `volumes` section in the
`reverse-proyx` service in
[`docker-compose.yml`](docker-compose.yml).
- In
[`jupyterhub/jupyterhub_config.py`](jupyterhub/jupyterhub_config.py),
edit the *"Authenticator"* section according to your institution
authentication server. If in doubt, [read
here](https://jupyterhub.readthedocs.io/en/stable/getting-started/authenticators-users-basics.html).

Other changes you may like to make:

- Edit [`jupyterlab/Dockerfile`](jupyterlab/Dockerfile) to include the
software you like. Do not forget to change
[`jupyterhub/jupyterhub_config.py`](jupyterhub/jupyterhub_config.py)
accordingly, in particular the *"user data persistence"* section.

### Run!

Once you are ready, build and launch the application with

```
docker-compose build
docker-compose up -d
```

Read the [Docker Compose manual](https://docs.docker.com/compose/) to
learn how to manage your application.

## Acknowledgements

Work partially funded by [OpenDreamKit](https://opendreamkit.org/).
9 changes: 5 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ services:
- /var/run/docker.sock:/var/run/docker.sock
- jupyterhub_data:/srv/jupyterhub
environment:
DOCKER_JUPYTER_CONTAINER: jupyterlab_img
DOCKER_NETWORK_NAME: ${COMPOSE_PROJECT_NAME}_default
HUB_IP: jupyterhub
- DOCKER_JUPYTER_CONTAINER=jupyterlab_img
- DOCKER_NETWORK_NAME=${COMPOSE_PROJECT_NAME}_default
- HUB_IP=jupyterhub
- HOST
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=Host:jupyter.ens.uvsq.fr"
- "traefik.frontend.rule=Host:${HOST}"
restart: on-failure

jupyterlab:
Expand Down
2 changes: 1 addition & 1 deletion jupyterhub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
c.CASAuthenticator.cas_service_validate_url = 'https://cas.uvsq.fr/serviceValidate'

# The service URL the CAS server will redirect the browser back to on successful authentication.
c.CASAuthenticator.cas_service_url = 'https://sage.prism.uvsq.fr/hub/login'
c.CASAuthenticator.cas_service_url = 'https://%s/hub/login' % os.environ['HOST']

c.Authenticator.admin_users = { 'lucadefe' }

Expand Down

0 comments on commit f381589

Please sign in to comment.