nmfs-opensci / py-rocket-base

base jupyterhub image with Python and R. See packages for the images.
https://github.com/nmfs-opensci/py-rocket-base/pkgs/container/py-rocket-base
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

py-rocket-base: JupyterHub base image

Build and push container imageDOI

The py-rocket-base image is a base image for the JupyterHubs with Python and RStudio. The py-rocket-base image is designed to install the Jupyter and JupyterHub environment with repo2docker and the R environment with Rocker installation scripts. You can scroll through the Rocker installation scripts to see how the environment is set up.

There are many ways to install R and RStudio into an image designed for JupyterHubs. The objective of py-rocket-base is to create a JupyterHub (or binder) image such when you click the RStudio button in the JupyterLab UI to enter the RStudio UI (/rstudio), you enter an environment that is the same as if you had used a Rocker image but if you are in the JupyterLab UI (/lab), the environment is the same as if you had used repo2docker to create the environment. There are many other ways to install R and RStudio in a JupyterHub image. See History below for other approaches we have used.

The base image has the following support:

Where are the images

The .github/workflows/build.yaml is a GitHub Action to build the image with repo2docker-action. It builds to GitHub packages and you will find it in the packages for the repo. The URL will look like Your image URL in your repo will look like one of these

ghcr.io/nmfs-opensci/repo-name/image-name:latest
ghcr.io/nmfs-opensci/image-name:latest

For example, for this repo the image is ghcr.io/nmfs-opensci/py-rocket-base:latest.

Using this in a JupyterHub

If the JupyterHub has the Bring your own image feature, then you can paste in ghcr.io/nmfs-opensci/py-rocket-base:latest to the image and a server with your image will spin up.

image

History and motivation

The original py-rocket 1.0 was developed by Luis Lopez and was built off a Rocker base image. Carl Boettiger and Eli Holmes later altered the image (py-rocket 2.0) so that the Python environment matched the Pangeo image structure but the image was still built off a Rocker image. Subsequently, Carl Boettiger developed repo2docker-r that creates a JupyterHub-compatible image that uses a Jupyter docker stack image as base. For py-rocker 3.0, Eli Holmes used Carl's ideas but used repo2docker and repo2docker-action to build the base image. To do this, the CryoCloud hub image repo was used for the basic structure and approach. Eli added the rocker.sh script and appendix modifications to install R and RStudio via the Rocker scripts (rather than using a Rocker image as base). Yuvi Panda (repo2docker) gave input throughout the process as snags were hit.

Why Rocker for the R/RStudio environment? The Rocker images are the standard for R/RStudio contanier images. They are heavily tested and regularly updated. There is a large developer community that fixes problems and bugs. The stack has gone through major revisions to improve modularity and they constantly innovating (integration for machine-learning, CUDA, BLAS, spatial, etc., etc.). py-rocker is building off that work without using the images directly. Instead it uses the Dockerfile code and the installation scripts. There are many other approaches to adding R and RStudio to images that work in JupyterHubs. See repo2docker-r that Carl developed and r-conda for a conda native approach using repo2docker. py-rocket is not intended to create small images; it is intended to create images that emulate Rocker in the /rstudio environment on a JupyterHub.