Setting up Development Environment#
The easiest & safest way to develop & test TLJH is with Docker.
Install Docker Community Edition by following the instructions on their website.
Clone the git repo (or your fork of it).
Build a docker image that has a functional systemd in it.
docker build -t tljh-systemd . -f integration-tests/Dockerfile
Run a docker container with the image in the background, while bind mounting your TLJH repository under
docker run \ --privileged \ --detach \ --name=tljh-dev \ --publish 12000:80 \ --mount type=bind,source="$(pwd)",target=/srv/src \ tljh-systemd
Get a shell inside the running docker container.
docker exec -it tljh-dev /bin/bash
Run the bootstrapper from inside the container (see step above): The container image is already set up to default to a
devinstall, so it’ll install from your local repo rather than from github.
python3 /srv/src/bootstrap/bootstrap.py --admin admin
Or, if you would like to setup the admin’s password during install, you can use this command (replace “admin” with the desired admin username and “password” with the desired admin password):
python3 /srv/src/bootstrap/bootstrap.py --admin admin:password
The primary hub environment will also be in your PATH already for convenience.
You should be able to access the JupyterHub from your browser now at http://localhost:12000. Congratulations, you are set up to develop TLJH!
Make some changes to the repository. You can test easily depending on what you changed.
If you changed the
bootstrap/bootstrap.pyscript or any of its dependencies, you can test it by running
If you changed the
tljh/installer.pycode (or any of its dependencies), you can test it by running
python3 -m tljh.installer.
If you changed
/opt/tljh/config/or any of their dependencies, you only need to restart jupyterhub for them to take effect.
tljh-config reload hubshould do that.
Looking at Logs has information on looking at various logs in the container to debug issues you might have.