EPEL (Extra Packages for Enterprise Linux) is a repository of additional packages for Enterprise Linux, including Red Hat Enterprise Linux, AlmaLinux, Oracle Linux, Rocky Linux and others. By integrating SingularityCE with EPEL, starting with release 3.10.4, users may...
Jupyter Notebook is an open source web application environment used to create and share documents containing code, equations, visualizations and narrative text. Use cases include data visualization, statistical modeling and machine learning.
Singularity provides a basis for repeatability with a container runtime that does not require root owned daemon or allow escalation of user privilege when ran. With it’s single file image format (SIF) Singularity is ideal for BYOE science (bring your own environment) and for the mobility of compute with deep learning applications.
We’ll use the following Singularity definition file when building Jupyter:
Bootstrap: library From: debian:9 %help Container with Anaconda (Conda 4.5.11) and Jupyter Notebook 5.6.0 for Debian 9.x (Stretch). This installation is based on Python 2.7.15 %setup #Create the .condarc file where the environments/channels from conda are specified, #these are pulled with preference to root cd / touch .condarc %post #Installing all dependencies apt-get update && apt-get -y upgrade apt-get -y install \ build-essential \ wget \ bzip2 \ ca-certificates \ libglib2.0-0 \ libxext6 \ libsm6 \ libxrender1 \ git rm -rf /var/lib/apt/lists/* apt-get clean #Installing Anaconda 2 and Conda 4.5.11 wget -c https://repo.continuum.io/archive/Anaconda2-5.3.0-Linux-x86_64.sh /bin/bash Anaconda2-5.3.0-Linux-x86_64.sh -bfp /usr/local #Conda configuration of channels from .condarc file conda config --file /.condarc --add channels defaults conda config --file /.condarc --add channels conda-forge conda update conda #List installed environments conda list %runscript jupyter notebook --allow-root "$@"
To build the image run the following command:
$ sudo singularity build jupyter.sif jupyter.def
The definition file above has a %post section in which all the dependencies are installed at build time. After that, you can start the container and, it will listen on localhost:8888 by default.
$ singularity run jupyter.sif
If you would like to run it on another port (e.g. 9000) instead you can do so by:
$ singularity run jupyter.sif --port=9000
This will run Jupyter Notebook on localhost:9000.
And if you would like to set another hostname use ––ip when running the image:
$ singularity run jupyter.sif --ip=126.96.36.199 --port=9000
This will run Jupyter Notebook on 188.8.131.52:9000
For the files used in this example, see our GitHub repository at:
Join Our Mailing List
Bills of materials or BOMs are nothing new, but they are new in the software industry. They have been part of many supply chains for decades. When you purchase a car or a pharmaceutical device, the manufacturer of those products maintains a list of...
There are many different approaches that can be taken when building software. At one end of the spectrum is the extreme caution and conservatism that’s appropriate, for example, of safety critical code used in vehicles or in real-time operating systems. At the other...