Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revisionBoth sides next revision | ||
doku:jupyterhub [2023/04/03 08:23] – [BYOI: Bring your own (Singularity) Image] katrin | doku:jupyterhub [2023/04/03 08:42] – katrin | ||
---|---|---|---|
Line 76: | Line 76: | ||
==== Necessary Packages ==== | ==== Necessary Packages ==== | ||
- | To get your custom | + | A good starting point for creating |
+ | |||
+ | Apart from adding your own software the image also needs to have at least the following packages for it to be able to run in our JupyterHub environment: | ||
< | < | ||
# This package pulls in all the necessary dependencies to start a jupyter server | # This package pulls in all the necessary dependencies to start a jupyter server | ||
+ | # Make sure this always matches the current JupyterHub version used by VSC | ||
jupyterhub==3.1.1 | jupyterhub==3.1.1 | ||
Line 92: | Line 95: | ||
**An up 2 date list of packages can always be found in our repo: [[https:// | **An up 2 date list of packages can always be found in our repo: [[https:// | ||
- | ==== Via Docker Container ==== | + | === Run hooks from / |
- | + | ||
- | A good starting point for your own container are the official JupyterHub Docker Stacks Images @ [[https:// | + | |
- | + | ||
- | In order to be able to use the image with JupyterHub you also have to convert it to a **singularity image** (or build it as a singularity image in the first place) and place it into a folder that is accessible from the VSC compute nodes. | + | |
- | + | ||
- | Building a singularity image from e.g. a docker container can easily be done with the `singularity build` command. See the singularity documentation for examples: [[https:// | + | |
- | + | ||
- | ==== Run hooks from / | + | |
If your image needs to run hooks before startup (e.g. the pyspark image depends on this [[https:// | If your image needs to run hooks before startup (e.g. the pyspark image depends on this [[https:// | ||
Line 110: | Line 105: | ||
Note: Contact us to get read rights to the repository. | Note: Contact us to get read rights to the repository. | ||
+ | ==== Build your own custom image from a docker image ==== | ||
+ | [[https:// | ||
+ | |||
+ | If you already have a docker image you want to start from or if you are more familiar with docker image creation you can just use that image and create it into a singularity image after you are finished. | ||
+ | |||
+ | Note: Make sure that you use the right versions for the current version of our JupyterHub (the version is displayed at the bottom of the [[http:// | ||
+ | |||
+ | After selecting / building the docker image all that needs to be done is to convert it into a **singularity image**. | ||
+ | |||
+ | You can do this by executing the following lines (assuming your docker image is named " | ||
+ | < | ||
+ | singularity build my_image.sif docker:// | ||
+ | </ | ||
+ | |||
+ | See the documentation for more examples: [[https:// | ||
+ | |||
+ | When the conversion process has finished make sure that the resulting " | ||
+ | |||
+ | Note: the conversion can be done on our cluster since we have singularity installed on our nodes. | ||
+ | |||
+ | ==== Directly build a singularity/ | ||
+ | |||
+ | Instead of starting with docker you can also directly build a singularity image that is ready to use with our JupyterHub instance. | ||
+ | |||
+ | For this you need to create a so called " | ||
+ | |||
+ | Here is a minimal example using the datascience docker stacks image as a basis: | ||
+ | < | ||
+ | BootStrap: docker | ||
+ | From: jupyter/ | ||
+ | %post | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | If we save the file as " | ||
+ | |||
+ | < | ||
+ | singularity build my_image.sif my_image.def | ||
+ | </ | ||