Skip to content

Commit

Permalink
Merge pull request #11 from UBC-STAT/dockerfile-updates-2024W1
Browse files Browse the repository at this point in the history
Update dockerfiles
  • Loading branch information
briank-git authored Aug 15, 2024
2 parents 2d1578b + 67ed12b commit 5254a62
Show file tree
Hide file tree
Showing 6 changed files with 417 additions and 455 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish_docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
paths:
- 'dockerfiles/r-stat-201/Dockerfile'
- 'dockerfiles/r-stat-201/conda-linux-64.lock'
- 'dockerfiles/r-stat-201-grading/Dockerfile'
jobs:
build:
Expand Down
10 changes: 2 additions & 8 deletions dockerfiles/r-stat-201-grading/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# Copyright (c) UBC-STAT Development Team.
# Distributed under the terms of the Modified BSD License.
# TODO: For testing purposes only, change to ubcstat/r-stat-201:latest
FROM ubcstatit/r-stat-201-student:latest
FROM ubcstat/r-stat-201:latest

LABEL maintainer="Brian Kim <[email protected]>"

# install rise slides extension, nbgrader, clean cache
RUN mamba install --quiet --yes \
'nbgrader=0.8.2' && \
mamba clean --all -f -y

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

# Allow all shortcuts
RUN rm -f /home/${NB_USER}/.jupyter/lab/user-settings/\@jupyterlab/shortcuts-extension/shortcuts.jupyterlab-settings
Expand Down
18 changes: 11 additions & 7 deletions dockerfiles/r-stat-201/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ ENV PYDEVD_DISABLE_FILE_VALIDATION=1
COPY conda-linux-64.lock /tmp/conda-linux-64.lock

# Install R packages from lock file.
RUN mamba update --quiet --file /tmp/conda-linux-64.lock && \
mamba clean --all -y -f && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}" && \
Rscript -e "devtools::install_github('UBC-MDS/[email protected]')" && \
Rscript -e "devtools::install_github('UBC-MDS/[email protected]')"
RUN mamba update --quiet --file /tmp/conda-linux-64.lock \
&& mamba clean --all -y -f \
&& fix-permissions "${CONDA_DIR}" \
&& fix-permissions "/home/${NB_USER}" \
&& Rscript -e "devtools::install_github('UBC-MDS/[email protected]')" \
&& Rscript -e "devtools::install_github('UBC-MDS/[email protected]')"

# Install pexpect from main branch to fix asyncio issue with jupyterlab_git
RUN pip install --ignore-installed git+https://github.com/pexpect/pexpect.git@master
RUN pip install --no-cache pexpect==4.9.0

# Disable the cell toolbar (which ignores metadata and students often accidentally click + delete grading cells)
RUN jupyter labextension disable @jupyterlab/cell-toolbar-extension
Expand All @@ -57,6 +57,10 @@ COPY config/jupyter_server_config.py /home/${NB_USER}/.jupyter
# Copy gitconfig that sets global default pull strategy to rebase
COPY config/.gitconfig /home/${NB_USER}/

# install rise from fork wheel with fixed CSS
COPY jupyterlab_rise-0.42.0-py3-none-any.whl ./
RUN pip install wheel && pip install jupyterlab_rise-0.42.0-py3-none-any.whl && rm -f jupyterlab_rise-0.42.0-py3-none-any.whl

# Make sure everything in the home folder is owned by NB_USER for running docker image locally.
USER root
RUN chown -R ${NB_USER} /home/${NB_USER}
Expand Down
Loading

0 comments on commit 5254a62

Please sign in to comment.