shashankmc / jupyterlab

πŸͺ JupyterLab for data science and knowledge graphs build from jupyter/docker-stacks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JupyterLab for knowledge graphs and data science

Publish Docker image Publish GPU image

JupyterLab image based on the jupyter/docker-stacks scipy image, with additional packages and kernels installed for data science and knowledge graphs.

This image is compatible with OpenShift security constraints, see below for more information to deploy on OpenShift, or on the Data Science Research Infrastructure (DSRI) at Maastricht University πŸŒ‰

Installed kernels

🐍 Python 3.8 kernel with autocomplete and suggestions (jupyterlab-lsp πŸ’¬)

β˜•οΈ IJava kernel with current default OpenJDK

✨️ SPARQL kernel to query RDF knowledge graphs

Installed extensions

Additional programs

Some .jar programs for knowledge graph processing are pre-downloaded in /opt in the image: RDF4J, Apache Jena, OWLAPI, RML mapper, etc.

Customize your JupyterLab image

Choose which image fits your need: base image, gpu, FSL, FreeSurfer, Python2,7

  1. Fork this repository.

  2. Clone the fork repository

  3. Edit the Dockerfile for this image to install the packages you need. Preferably use conda to install new packages, you can also install with apt-get (need to run as root or with sudo) and pip

  4. Go to the folder and rebuild the Dockerfile:

docker build -t jupyterlab .
  1. Run the docker image built on http://localhost:8888
docker run -it --rm -p 8888:8888 -e JUPYTER_TOKEN=yourpassword ghcr.io/maastrichtu-ids/jupyterlab:latest

If the built Docker image works well feel free to send a pull request to get your changes merged to the main repository and integrated in the corresponding published Docker image.

Run with Docker 🐳

Volumes can be mounted into /home/jovyan or /home/jovyan/work folder.

Run as jovyan user with sudo privileges, use JUPYTER_TOKEN to define your password:

docker run --rm -it --user root -p 8888:8888 -e GRANT_SUDO=yes -e JUPYTER_TOKEN=password -v $(pwd)/data:/home/jovyan ghcr.io/maastrichtu-ids/jupyterlab

You should now be able to install anything in the JupyterLab container, try:

sudo apt-get update

You can check the docker-compose.yml file to run it easily with Docker Compose.

Run with a restricted jovyan user, without sudo privileges:

docker run --rm -it --user $(id -u) -p 8888:8888 -e CHOWN_HOME=yes -e CHOWN_HOME_OPTS='-R' -e JUPYTER_TOKEN=password -v $(pwd)/data:/home/jovyan ghcr.io/maastrichtu-ids/jupyterlab

Potential permission issue when running locally ⚠️

The official jupyter/docker-stacks images use the jovyan user by default which does not grant admin rights (sudo). This can cause issues when writing to the shared volumes, to fix it you can change the owner of the folder, or start JupyterLab as root user.

Create the folder with the right permissions, replace 1000 by your username

mkdir -p data/
sudo chown -R 1000:1000 data/

Deploy on OpenShift ☁️

If you are working or studying at Maastricht University you can easily deploy this notebook on the Data Science Research Infrastructure (DSRI).

Build and publish πŸ“¦

This repository contains multiple folders with Dockerfile to build various flavor of JupyterLab for Data Science.

JupyterLab for knowledge graphs

With Python 3+, Java and SPARQL kernel

Build:

docker build -t ghcr.io/maastrichtu-ids/jupyterlab .

Run:

docker run --rm -it --user root -p 8888:8888 -e JUPYTER_TOKEN=password -v $(pwd)/data:/home/jovyan ghcr.io/maastrichtu-ids/jupyterlab

Push:

docker push ghcr.io/maastrichtu-ids/jupyterlab

JupyterLab on GPU

To deploy JupyterLab on GPU we use the official Nvidia images with conda and jupyterlab,

You can use other images from Nvidia by changing the NVIDIA_IMAGE build argument, popular images are:

  • Tensorflow: nvcr.io/nvidia/tensorflow:21.08-tf2-py3
  • PyTorch: nvcr.io/nvidia/pytorch:21.08-py3
  • CUDA: nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04

To build an image, change the build-arg and run from the root folder of this repository:

docker build --build-arg NVIDIA_IMAGE=nvcr.io/nvidia/tensorflow:21.08-tf2-py3 -f gpu/Dockerfile -t ghcr.io/maastrichtu-ids/jupyterlab:tensorflow .

Run an image on http://localhost:8888

docker run --rm -it -p 8888:8888 -e JUPYTER_TOKEN=password -v $(pwd)/data:/root ghcr.io/maastrichtu-ids/jupyterlab:tensorflow

Python 2.7

With a python2.7 kernel (python3 not installed)

Build:

cd python2.7
docker build -t ghcr.io/maastrichtu-ids/jupyterlab:python2.7 .

Run (workdir is /root):

docker run --rm -it -p 8888:8888 -e JUPYTER_TOKEN=password ghcr.io/maastrichtu-ids/jupyterlab:python2.7

Ricopili

Based on https://github.com/bruggerk/ricopili_docker

Build:

cd ricopili
docker build -t ghcr.io/maastrichtu-ids/jupyterlab:ricopili .

Run (workdir is /root):

docker run --rm -it -p 8888:8888 -v $(pwd)/data:/root -e JUPYTER_TOKEN=password ghcr.io/maastrichtu-ids/jupyterlab:ricopili

FSL on CPU

Built with https://github.com/ReproNim/neurodocker

Build:

cd fsl
docker build -t ghcr.io/maastrichtu-ids/jupyterlab:fsl .

Run (workdir is /root):

docker run --rm -it -p 8888:8888 -v $(pwd)/data:/root -e JUPYTER_TOKEN=password ghcr.io/maastrichtu-ids/jupyterlab:fsl

About

πŸͺ JupyterLab for data science and knowledge graphs build from jupyter/docker-stacks

License:MIT License


Languages

Language:Dockerfile 70.7%Language:Python 19.5%Language:Shell 9.8%