|
| 1 | +# Jupyterhub Build |
| 2 | + |
| 3 | +For building Jupyterhub, you need to recover the build container here : |
| 4 | +https://github.com/TOSIT-IO/TDP/build-env-python |
| 5 | + |
| 6 | +## Start the container |
| 7 | + |
| 8 | +Next, start the container with specific values regarding your environment but with the official build image above. |
| 9 | + |
| 10 | +For example : |
| 11 | + |
| 12 | +```sh |
| 13 | +DCT_GIT="$HOME/git" |
| 14 | +DCT_PIP="$HOME/.cache/pip" |
| 15 | +DCT_BUILD="$HOME/build" |
| 16 | +``` |
| 17 | + |
| 18 | +And the command : |
| 19 | + |
| 20 | +```sh |
| 21 | +docker run --rm=true -it --env "USER_UID=$(id -u)" --env "USER_GID=$(id -g)" --volume "$DCT_PIP:/home/builder/.cache/pip/" --volume "$DCT_GIT:/home/builder/git/" --volume "$DCT_TDP:/home/builder/build" --workdir /home/builder/ <image> |
| 22 | +``` |
| 23 | + |
| 24 | +## Sourcing the NodeJS environment |
| 25 | + |
| 26 | +```sh |
| 27 | +source /usr/local/nvm/nvm.sh |
| 28 | +source /usr/local/nvm/bash_completion |
| 29 | +``` |
| 30 | + |
| 31 | +## Configuration |
| 32 | + |
| 33 | +If you haven't cloned the repository before, do it, otherwise, it should be mounted with a volume. Verify that you're using the default branch of the repository. |
| 34 | + |
| 35 | +In addition to the git repository, create the requirement file to generate wheel files. The requirement file must contain : |
| 36 | + |
| 37 | +```sh |
| 38 | +pip>=21.3.1 |
| 39 | +jupyterhub-traefik-proxy==0.3.0 |
| 40 | +jupyterhub_ldapauthenticator==1.3.2 |
| 41 | +oauthenticator==15.1.0 |
| 42 | +jupyterhub_yarnspawner==0.4.0 |
| 43 | +psycopg2-binary==2.8.6 |
| 44 | +``` |
| 45 | + |
| 46 | +## Generate wheels |
| 47 | + |
| 48 | +```sh |
| 49 | +python3.6 -m pip wheel --wheel-dir $HOME/build/dependencies/ --requirement $HOME/build/requirements.txt $HOME/git/jupyterhub/ |
| 50 | +``` |
| 51 | + |
| 52 | +## Traeffik |
| 53 | + |
| 54 | +Get the binary for traeffik and change its permissions |
| 55 | + |
| 56 | +```sh |
| 57 | +curl -L --output $HOME/build/bin/traefik "https://github.com/traefik/traefik/releases/download/v1.7.29/traefik_linux-amd64" |
| 58 | +chmod 755 $HOME/build/bin/traefik |
| 59 | +``` |
| 60 | + |
| 61 | +## Modify requirement files for installation |
| 62 | + |
| 63 | +Add the next line : |
| 64 | + |
| 65 | +```sh |
| 66 | +jupyterhub==2.3.1 |
| 67 | +``` |
| 68 | + |
| 69 | +## Create archive |
| 70 | + |
| 71 | +Create the archive with wheel files, the requirement file and the traeffik binary, then create the checksum |
| 72 | + |
| 73 | +```sh |
| 74 | +tar cf jupyterhub-2.3.1-0.0.tar.gz $HOME/build |
| 75 | +sha256sum jupyterhub-2.3.1-0.0.tar.gz | sed 's#.*/# #' > jupyterhub-2.3.1-0.0.tar.gz.sha256 |
| 76 | +``` |
| 77 | + |
0 commit comments