From e4e43bb34c683e9c3db999589b5a55f10553b23c Mon Sep 17 00:00:00 2001 From: Eli Holmes Date: Wed, 4 Oct 2023 07:54:07 -0700 Subject: [PATCH] add docker bit --- Set-up-centos.Rmd | 36 +++++- ci/iorocker/Dockerfile | 5 + ci/iorocker/instructions.md | 2 +- ci/minimal-jupyter/Dockerfile | 13 +++ ci/py-rocket/Dockerfile | 75 +++++++++++++ ci/rocker-binder/Dockerfile | 9 ++ docs/Set-up-centos.html | 171 +++++++++++++++++------------ docs/ci/iorocker/instructions.html | 2 +- docs/search.json | 21 ++-- docs/sitemap.xml | 20 ++-- 10 files changed, 252 insertions(+), 102 deletions(-) create mode 100644 ci/minimal-jupyter/Dockerfile create mode 100644 ci/py-rocket/Dockerfile create mode 100644 ci/rocker-binder/Dockerfile diff --git a/Set-up-centos.Rmd b/Set-up-centos.Rmd index 94a0646..ce9a6e8 100644 --- a/Set-up-centos.Rmd +++ b/Set-up-centos.Rmd @@ -268,7 +268,7 @@ ls -Z $JHUBENV/bin ``` It got all the binaries but not the simlinks. Nonetheless it seemed to run ok. -## Enable our new service +### Enable our new service ```{bash eval=FALSE} sudo systemctl enable jupyterhub.service @@ -294,7 +294,7 @@ netstat -tuln ``` At this point, you will need to address security if your hub is open to the web, as opposed to being on an internal network and only accessible to that network. Learn about that [here](https://jupyterhub.readthedocs.io/en/1.2.0/installation-guide-hard.html). -## Create the base user environment +## Set up Docker for user environment When you log in the jupyter notebooks will be trying to use the Python environment that was created to install JupyterHub, this is not what we want. We will use a docker image to "spawn" the user environment. Read [here](https://jupyterhub.readthedocs.io/en/1.2.0/installation-guide-hard.html#part-2-conda-environments) for other approaches. @@ -332,7 +332,7 @@ conda install -c conda-forge docker-py ### Jupyter images -The image that we use must have the jupyterhub module installed. Also there seems to be some tweaking needed for the image to work as the image I used in a JupyterHub on Kubernetes did not work for me. +The image that we use must have the jupyterhub and notebook module installed. The jupyterhub version needs to also match what you have on your hub. Check the version on your server: ```{bash eval=FALSE} @@ -368,7 +368,20 @@ docker pull jupyter/scipy-notebook:7e1a19a8427f Now you can restart the service and the user can start a notebook with the specified images. +### Create your own Docker images +Docker images that work with JupyterHub with Kubernetes will work with this set-up with the addition of jupyterhub and notebook. + +Add the following to your Docker image +```{bash eval=FALSE} +RUN pip3 install \ + 'jupyter-rsession-proxy' \ + 'jupyterhub==3.1.*' \ + 'notebook==6.*' \ + 'jupyterlab' + +CMD ["jupyterhub-singleuser"] +```