Skip to content

Commit

Permalink
Update dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
briank-git committed Aug 1, 2024
1 parent 8424d58 commit 67ed12b
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 <brian.kim@stat.ubc.ca>"

# 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/datateachr@v0.2.1')" && \
Rscript -e "devtools::install_github('UBC-MDS/taxyvr@0.1.0')"
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/datateachr@v0.2.1')" \
&& Rscript -e "devtools::install_github('UBC-MDS/taxyvr@0.1.0')"

# 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 67ed12b

Please sign in to comment.