Docker Image for Jupyterhub loaded with Coffea - ComputeCanada/ahep_interactive_analysis_facility GitHub Wiki
Creating and Obtaining Docker Image for Jupyterhub loaded with ROOT, MAT and Coffea
Docker containers provide isolated environments for both development and deployment. This wiki page will go through the procedure to produce a docker image containing the following packages based on the Scientific Linux 7 used at Fermilab.
- Miniconda3 -- providing python3.8
- Coffea
- ROOT 6.24.02
- MAT -- MINERvA's analysis framework
- Jupyterhub with dummy authenticator
The final image can be downloaded at
docker pull tejinc/dune_iaf:jupyterhub-dev
The following section refers to the Dockerfile
The SL7 base image
The first stage of docker image build is to create an SL7 image with all the necessary software. This stage (builder) begins at FROM fermilab/fnal-wn-sl7:latest AS builder
and ends before FROM builder AS builder1
All the ROOT dependencies are installed via yum
. Miniconda3 with python3.8 is downloaded and installed. To set Miniconda3 as the default python distro, I adapted the image instructions from the Miniconda official docker repo here.
Next, I set the default environment variables using the ENV
command.
This concludes the creation of the SL7 base image.
The SL7 ROOT build image
Building ROOT inside the docker image is both time and space-consuming. I elect to build ROOT and MAT in a separate image, and copy the final products over for the final image. You can follow the instructions in the Dockerfile from FROM builder AS builder1
to just before FROM builder AS final
.
The SL7 Jupyterhub-dev image
The base image is the SL7 base image (builder)
I created in the first step. I copy ROOT and MAT install folders from the SL7 ROOT image
and set the necessary ENV
variables.
Finally, I copied a dummy Jupyterhub configuration file into the image. This is the final image I created and tested on my local computer.
There are some caveats about setting the Jupyterhub environment that may cause ROOT to fail to load on spawning a server. The cause and solution will be discussed on the next page.