Skip to content

Commit

Permalink
Merge pull request #27 from UBC-DSCI/jlab4-nb7-nbgrader0.9.x
Browse files Browse the repository at this point in the history
Update to Lab 4, Notebook 7, NbGrader 0.9.x
  • Loading branch information
trevorcampbell committed Aug 30, 2023
2 parents 6aa40fa + 9530772 commit 12627e4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 47 deletions.
18 changes: 3 additions & 15 deletions docker/py-dsci-100-grading/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]"

# Clean the cache
RUN mamba clean --all -f -y

# re-upgrade jupyter-server (mamba downgrades it)
RUN pip install --upgrade jupyter-server

14 changes: 2 additions & 12 deletions docker/py-dsci-100/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 3 additions & 10 deletions docker/r-dsci-100-grading/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/[email protected]"

# Clean the cache
RUN mamba clean --all -f -y

# re-upgrade jupyter-server (mamba downgrades it)
RUN pip install --upgrade jupyter-server

13 changes: 3 additions & 10 deletions docker/r-dsci-100/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 12627e4

Please sign in to comment.