From 95307726ab7110233e3f86ed4ecd986aba8086db Mon Sep 17 00:00:00 2001 From: Trevor Campbell Date: Wed, 30 Aug 2023 16:33:03 -0700 Subject: [PATCH] updated dockerfiles to jupyterlab 4, notebook 7, nbgrader 0.9.x (w/ autotest) --- docker/py-dsci-100-grading/Dockerfile | 18 +++--------------- docker/py-dsci-100/Dockerfile | 14 ++------------ docker/r-dsci-100-grading/Dockerfile | 13 +++---------- docker/r-dsci-100/Dockerfile | 13 +++---------- 4 files changed, 11 insertions(+), 47 deletions(-) diff --git a/docker/py-dsci-100-grading/Dockerfile b/docker/py-dsci-100-grading/Dockerfile index f5e6bb8..103b79c 100644 --- a/docker/py-dsci-100-grading/Dockerfile +++ b/docker/py-dsci-100-grading/Dockerfile @@ -3,22 +3,10 @@ FROM ubcdsci/py-dsci-100:latest # install the rise slides extension -RUN mamba install --quiet --yes "rise" +RUN pip install jupyterlab-rise -# install a particular version of nodejs required by nbgrader -RUN mamba install --quiet --yes nodejs=16.17.1 - -# install nbgrader (autotest-with-limit-cell-height-ext) -RUN git clone -b autotest-with-limit-cell-height-ext https://github.com/UBC-DSCI/nbgrader \ - && cd nbgrader \ - && pip install . \ - && jupyter nbextension install --sys-prefix --py nbgrader --overwrite \ - && jupyter nbextension enable --sys-prefix --py nbgrader \ - && jupyter serverextension enable --sys-prefix --py nbgrader +# install nbgrader +RUN pip install "git+https://github.com/ubc-dsci/nbgrader.git@autotest-0.9.x" # Clean the cache RUN mamba clean --all -f -y - -# re-upgrade jupyter-server (mamba downgrades it) -RUN pip install --upgrade jupyter-server - diff --git a/docker/py-dsci-100/Dockerfile b/docker/py-dsci-100/Dockerfile index 423d744..5b989fd 100644 --- a/docker/py-dsci-100/Dockerfile +++ b/docker/py-dsci-100/Dockerfile @@ -28,30 +28,20 @@ RUN mamba install --quiet --yes \ 'click' \ 'ghp-import' \ 'ibis-framework' \ - 'jupytext' \ 'nodejs' \ 'psycopg2' \ && mamba clean --all -f -y \ && fix-permissions "${CONDA_DIR}" \ && fix-permissions "/home/${NB_USER}" -# Currently (July 2023) -- need to install this separately via pip to avoid version conflicts -RUN pip install jupyter_contrib_nbextensions - -# upgrade jupyter-server -RUN pip install --upgrade jupyter-server - -# Install nbgitpuller, jupytext, jlab-git -RUN pip install nbgitpuller \ - && jupyter serverextension enable --sys-prefix nbgitpuller \ - && pip install jupyterlab-git \ +# Install nbgitpuller, jlab-git +RUN pip install nbgitpuller jupyterlab-git \ && jupyter lab build # Disable the cell toolbar (which ignores metadata and students often accidentally click + delete grading cells) RUN jupyter labextension disable @jupyterlab/cell-toolbar-extension # Install the extension to remove the shift+M merge shortcut -# RUN mkdir -p /home/${NB_USER}/.jupyter/lab/user-settings/\@jupyterlab/shortcuts-extension COPY shortcuts.jupyterlab-settings /home/${NB_USER}/.jupyter/lab/user-settings/\@jupyterlab/shortcuts-extension/shortcuts.jupyterlab-settings # Make sure everything in the home folder is owned by NB_USER diff --git a/docker/r-dsci-100-grading/Dockerfile b/docker/r-dsci-100-grading/Dockerfile index 8cd21a5..711d0bd 100644 --- a/docker/r-dsci-100-grading/Dockerfile +++ b/docker/r-dsci-100-grading/Dockerfile @@ -1,19 +1,12 @@ # Copyright (c) UBC-DSCI Development Team. # Distributed under the terms of the Modified BSD License. -FROM ubcdsci/r-dsci-100 +FROM ubcdsci/r-dsci-100:latest # install the rise slides extension -RUN mamba install --quiet --yes "rise" +RUN pip install jupyterlab-rise # install nbgrader -RUN mamba install --quiet --yes nbgrader \ - && jupyter nbextension install --sys-prefix --py nbgrader --overwrite \ - && jupyter nbextension enable --sys-prefix --py nbgrader \ - && jupyter serverextension enable --sys-prefix --py nbgrader +RUN pip install "git+https://github.com/ubc-dsci/nbgrader.git@autotest-0.9.x" # Clean the cache RUN mamba clean --all -f -y - -# re-upgrade jupyter-server (mamba downgrades it) -RUN pip install --upgrade jupyter-server - diff --git a/docker/r-dsci-100/Dockerfile b/docker/r-dsci-100/Dockerfile index b67d346..ea40ef5 100644 --- a/docker/r-dsci-100/Dockerfile +++ b/docker/r-dsci-100/Dockerfile @@ -4,7 +4,7 @@ FROM jupyter/r-notebook USER root -# install vim +# install vim and libgsl (for tidyclust) RUN apt-get update && apt-get install -y vim libgsl27 USER ${NB_UID} @@ -32,21 +32,14 @@ RUN mamba install --quiet --yes \ && Rscript -e "install.packages('tidyclust', repos='http://cran.us.r-project.org')" \ && Rscript -e "install.packages('janitor', repos='http://cran.us.r-project.org')" -# upgrade jupyter server -RUN pip install --upgrade jupyter-server - -# Install nbgitpuller, jupytext, jlab-git -RUN pip install nbgitpuller \ - && jupyter serverextension enable --sys-prefix nbgitpuller \ - && pip install jupyterlab-git \ - && pip install jupytext --upgrade \ +# Install nbgitpuller, jlab-git +RUN pip install nbgitpuller jupyterlab-git \ && jupyter lab build # Disable the cell toolbar (which ignores metadata and students often accidentally click + delete grading cells) RUN jupyter labextension disable @jupyterlab/cell-toolbar-extension # Install the extension to remove the shift+M merge shortcut -RUN mkdir -p /home/${NB_USER}/.jupyter/lab/user-settings/\@jupyterlab/shortcuts-extension COPY shortcuts.jupyterlab-settings /home/${NB_USER}/.jupyter/lab/user-settings/\@jupyterlab/shortcuts-extension/shortcuts.jupyterlab-settings # Make sure everything in the home folder is owned by NB_USER