Skip to content

Commit

Permalink
Merge pull request #6 from ryanlovett/spring-2025
Browse files Browse the repository at this point in the history
Update for Spring 2025
  • Loading branch information
ryanlovett authored Jan 1, 2025
2 parents c1370db + a97df4b commit 7f769a0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 33 deletions.
35 changes: 21 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
FROM rocker/geospatial:4.4.1
FROM rocker/geospatial:4.4.2
# https://github.com/rocker-org/rocker-versioned2/wiki/geospatial_69e6b17dd7e3

ENV NB_USER rstudio
ENV NB_UID 1000
ENV CONDA_DIR /srv/conda
ENV NB_USER=rstudio
ENV NB_UID=1000
ENV CONDA_DIR=/srv/conda

# Set ENV for all programs...
ENV PATH ${CONDA_DIR}/bin:$PATH
ENV PATH=${CONDA_DIR}/bin:$PATH

# Pick up rocker's default TZ
ENV TZ=Etc/UTC

# And set ENV for R! It doesn't read from the environment...
RUN echo "TZ=${TZ}" >> /usr/local/lib/R/etc/Renviron.site
RUN echo "PATH=${PATH}" >> /usr/local/lib/R/etc/Renviron.site

# Add PATH to /etc/profile so it gets picked up by the terminal
RUN echo "PATH=${PATH}" >> /etc/profile
RUN echo "export PATH" >> /etc/profile

ENV HOME /home/${NB_USER}
ENV HOME=/home/${NB_USER}

WORKDIR ${HOME}

Expand All @@ -28,7 +33,6 @@ RUN apt-get update > /dev/null && \
libx11-xcb1 \
libxtst6 \
libxrandr2 \
libasound2 \
libpangocairo-1.0-0 \
libatk1.0-0 \
libatk-bridge2.0-0 \
Expand All @@ -48,22 +52,25 @@ RUN apt-get update > /dev/null && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY --chown=1000:1000 install-miniforge.bash /tmp/install-miniforge.bash
RUN /tmp/install-miniforge.bash
RUN rm -f /tmp/install-miniforge.bash

# needed for building on mac see DH-394
RUN chown -Rh ${NB_USER}:${NB_USER} ${HOME}
RUN install -d -o ${NB_USER} -g ${NB_USER} ${CONDA_DIR}

USER ${NB_USER}
COPY --chown=1000:1000 install-mambaforge.bash /tmp/install-mambaforge.bash
RUN /tmp/install-mambaforge.bash
RUN rm -f /tmp/install-mambaforge.bash

USER root
RUN rm -rf ${HOME}/.cache

USER ${NB_USER}
COPY --chown=1000:1000 environment.yml /tmp/environment.yml

RUN mamba env update -p ${CONDA_DIR} -f /tmp/environment.yml && \
mamba clean -afy
RUN rm -f /tmp/environment.yml

# DH-327, very similar to what was done for datahub in DH-164
ENV PLAYWRIGHT_BROWSERS_PATH ${CONDA_DIR}
ENV PLAYWRIGHT_BROWSERS_PATH=${CONDA_DIR}
RUN playwright install chromium

# Install IRKernel
Expand Down
20 changes: 9 additions & 11 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ channels:
dependencies:
# Items required for basic level functionality
- gh-scoped-creds==4.1
- git==2.47.0
- git==2.47.1
- jupyter-archive=3.4.0
- jupyter-resource-usage=1.1.0
- jupyterhub==4.1.6
- jupyterlab==4.2.5
- jupyter_server==2.14.2
- jupyterlab-git==0.50.1
- jupytext==1.16.4
- jupyterlab==4.3.4
- jupyter_server==2.15.0
- jupyterlab-git==0.50.2
- jupytext==1.16.6
- nbgitpuller==1.2.1
- notebook==7.2.2
- python==3.11.*
- notebook==7.3.2
- python==3.12.*

# vscode
- code-server==4.23.1
Expand All @@ -39,9 +40,6 @@ dependencies:
- nb2pdf==0.6.2
- nbpdfexport==0.2.1
# from infra-requirements
- jupyter-archive==3.4.0
- rise==5.7.1
- git+https://github.com/shaneknapp/python-popularity-contest.git@add-error-handling
- git-credential-helpers==0.2
- jupyter-tree-download==1.0.1

- rise==5.7.1
16 changes: 8 additions & 8 deletions install-miniforge.bash → install-mambaforge.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
set -ex

cd $(dirname $0)
MINIFORGE_VERSION='24.7.1-2'
MAMBAFORGE_VERSION='24.11.0-0'

URL="https://github.com/conda-forge/miniforge/releases/download/${MINIFORGE_VERSION}/Miniforge3-${MINIFORGE_VERSION}-Linux-x86_64.sh"
INSTALLER_PATH=/tmp/miniforge-installer.sh
URL="https://github.com/conda-forge/miniforge/releases/download/${MAMBAFORGE_VERSION}/Miniforge3-${MAMBAFORGE_VERSION}-Linux-x86_64.sh"
INSTALLER_PATH=/tmp/mambaforge-installer.sh

export XDG_CACHE_HOME=$(mktemp)

wget --quiet $URL -O ${INSTALLER_PATH}
chmod +x ${INSTALLER_PATH}

bash ${INSTALLER_PATH} -b -p ${CONDA_DIR}
bash ${INSTALLER_PATH} -f -b -p ${CONDA_DIR}
export PATH="${CONDA_DIR}/bin:$PATH"

# Do not attempt to auto update conda or dependencies
Expand All @@ -22,7 +24,7 @@ conda config --system --set show_channel_urls true
# which seems to result in some effective pinning of packages in the initial env,
# which we don't intend.
# this file must not be *removed*, however
echo '' > ${CONDA_DIR}/conda-meta/history
echo > ${CONDA_DIR}/conda-meta/history

# Clean things out!
conda clean --all -f -y
Expand All @@ -31,8 +33,6 @@ conda clean --all -f -y
rm ${INSTALLER_PATH}

# Remove the pip cache created as part of installing mambaforge
rm -rf /root/.cache

chown -Rh $NB_USER:$NB_USER ${CONDA_DIR}
rm -rf ${XDG_CACHE_HOME}

conda list -n root

0 comments on commit 7f769a0

Please sign in to comment.