Deploy the provided notebooks
In order to make the Data Science Notebooks work with Projects and Jobs we had to make some adjustments to the original Docker images. For instance, the saagie/jupyter-python-nbk:v2 docker image comes from the original saagie/jupyter-python-nbk image where the entrypoint script has been updated.
You should soon be able to launch Notebooks in one click but in the meantime, you need to deploy them as Docker images and provide some parameters such as the volume to persist (where your notebook files will be stored) and the port to expose. In the Apps tab of your project, simply create a new App and select Docker image :
The following table lists all compatible notebooks along with the parameters to use in order to launch them :
|Notebook||Docker image||Port||Base path variable to inject||Rewrite?||Volumes||Dockerfile||Comments|
Add a PASSWORD environment variable with your password. This password will be for the user rstudio
Create your custom notebook
With Saagie Apps inside Projects and Jobs you can create your own custom notebook (including all the libraries you want) and to deploy it to Saagie.
Example with Jupyter
The https://github.com/saagie/jupyter-python-nbk/tree/v2-app repository provides a Dockerfile and an entrypoint script using the jupyter-python-nbk image used originally in Saagie Manager.
But you can also completely customise your Docker image as long as you keep the entrypoint.sh script.
For that simply choose the base image you want to use (https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html) and add your own libraries.
The following Dockerfile shows an example :
- using the latest image of jupyter/scipy-notebook
- adding the python-hdfs and impyla libraries
Remember : if you want it to work on Saagie, you mustn't update the last lines of this Dockerfile nor update the entrypoint.sh script provided in the Github repository.
# Use your own base jupyter image here
# INSERT LIBS INSTALLATION HERE #
RUN conda install --quiet --yes \
'impyla' && \
rm -rf $CONDA_DIR/share/jupyter/lab/staging && \
# DO NOT UPDATE THE FOLLOWING LINES #
RUN mkdir /notebooks-dir && chown 1000:100 /notebooks-dir
COPY entrypoint.sh /entrypoint.sh
Once your Dockerfile is ready, build and push your image and use this image in the parameters of your app (the other parameters such as the volume to persist must be the same as Jupyter in the table above).