From 61e498b3b77a0d78a481d90621a6f647ac416c4a Mon Sep 17 00:00:00 2001 From: Jonathan Felder Date: Wed, 9 Oct 2024 18:13:19 -0700 Subject: [PATCH 1/3] [DH-394] fix publichealth --- Dockerfile | 12 +++------- environment.yml | 39 ++++++++++++++++++++++++------- infra-requirements.txt | 29 ----------------------- install-mambaforge.bash | 2 +- r-packages/2021-spring-phw-272a.r | 0 r-packages/ph-142.r | 4 ++-- r-packages/ph-252.r | 2 +- 7 files changed, 38 insertions(+), 50 deletions(-) delete mode 100644 infra-requirements.txt mode change 100644 => 100755 r-packages/2021-spring-phw-272a.r diff --git a/Dockerfile b/Dockerfile index 802e5ba..c18dc70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,15 +54,15 @@ RUN apt-get update > /dev/null && \ COPY install-mambaforge.bash /tmp/install-mambaforge.bash RUN /tmp/install-mambaforge.bash +RUN chown -Rh rstudio:rstudio /home/rstudio +RUN chown -Rh rstudio:rstudio /srv/conda + USER ${NB_USER} COPY environment.yml /tmp/environment.yml RUN mamba env update -p ${CONDA_DIR} -f /tmp/environment.yml && \ mamba clean -afy -COPY infra-requirements.txt /tmp/infra-requirements.txt -RUN pip install --no-cache-dir -r /tmp/infra-requirements.txt - # DH-331, very similar to what was done for datahub in DH-164 ENV PLAYWRIGHT_BROWSERS_PATH ${CONDA_DIR} RUN playwright install chromium @@ -74,12 +74,6 @@ RUN R --quiet -e "install.packages('IRkernel', quiet = TRUE)" && \ COPY class-libs.R /tmp/class-libs.R RUN mkdir -p /tmp/r-packages -# Workaround to install ottr, issue 3342 -#RUN wget https://github.com/ucbds-infra/ottr/archive/refs/tags/0.1.0.tar.gz -O /tmp/ottr.tar.gz && R CMD INSTALL /tmp/ottr.tar.gz && rm /tmp/ottr.tar.gz - -#COPY install.R /tmp/install.R -#RUN /tmp/install.R && rm -rf /tmp/downloaded_packages - COPY r-packages/ottr.r /tmp/r-packages/ RUN r /tmp/r-packages/ottr.r diff --git a/environment.yml b/environment.yml index e55c3d4..198c0f4 100644 --- a/environment.yml +++ b/environment.yml @@ -1,16 +1,39 @@ +channels: +- conda-forge + dependencies: -- pip -- syncthing==1.18.6 -- jupyter-server-proxy==4.2.0 -- jupyter-rsession-proxy==2.2.0 +# Items required for basic level functionality +- gh-scoped-creds==4.1 +- git==2.47.0 +- jupyter-resource-usage==1.1.0 +- jupyter_server==2.14.2 +- jupyterhub==4.1.6 +- jupyterlab==4.2.5 +- jupyterlab-git==0.50.1 +- jupytext==1.16.4 +- nbgitpuller==1.2.1 +- notebook==7.2.2 +- python==3.11.* + +# Other items +- jupyter-server-proxy==4.4.0 +- syncthing==1.27.12 +- jupyter-rsession-proxy==2.2.1 +- jupyter-syncthing-proxy==1.0.3 +- traitlets==5.14.3 +- appmode==1.0.0 + +# pip installed packages, conda is preferred +- pip==24.2 - pip: - # bug w/notebook and traitlets: https://github.com/jupyter/notebook/issues/7048 - - traitlets==5.9.0 # RStudio support - otter-grader==2.2.7 # for notebook exporting - nbconvert[webpdf]==7.16.4 - nb2pdf==0.6.2 - nbpdfexport==0.2.1 - # pulled in by ottr, if not pinned to 1.16.2, 1.16.3 causes DH-323 - - jupytext==1.16.2 + - 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 diff --git a/infra-requirements.txt b/infra-requirements.txt deleted file mode 100644 index 0fb0bd9..0000000 --- a/infra-requirements.txt +++ /dev/null @@ -1,29 +0,0 @@ -# WARNING: Original source at scripts/infra-packages/requirements.txt -# PLEASE DO NOT EDIT ELSEWHERE -# After editing scripts/infra-packages/requirements.txt, please run -# scripts/infra-packages/sync.bash. - -# This file pins versions of notebook related python packages we want -# across all hubs. This makes sure we don't need to upgrade them -# everwhere one by one. - -# FIXME: Freeze this to get exact versions of all dependencies -notebook==7.0.7 -jupyterlab==4.0.11 -nbgitpuller==1.2.1 -jupyter-resource-usage==1.0.1 -# Matches version in images/hub/Dockerfile -jupyterhub==4.1.6 -appmode==0.8.0 -ipywidgets==8.0.7 -jupyter-tree-download==1.0.1 -git-credential-helpers==0.2 -# Measure popularity of different packages in our hubs -# https://discourse.jupyter.org/t/request-for-implementation-instrument-libraries-actively-used-by-users-on-a-jupyterhub/7994?u=yuvipanda -git+https://github.com/shaneknapp/python-popularity-contest.git@add-error-handling -# RISE is useful for presentations - see https://github.com/berkeley-dsep-infra/datahub/issues/2527 -RISE==5.7.1 -# syncthing for dropbox-like functionality -jupyter-syncthing-proxy==1.0.3 -# jupyter archival tool for easy user downloads -jupyter-archive==3.4.0 diff --git a/install-mambaforge.bash b/install-mambaforge.bash index 812319e..c27ba02 100755 --- a/install-mambaforge.bash +++ b/install-mambaforge.bash @@ -3,7 +3,7 @@ set -ex cd $(dirname $0) -MAMBAFORGE_VERSION=22.9.0-2 +MAMBAFORGE_VERSION=24.7.1-0 URL="https://github.com/conda-forge/miniforge/releases/download/${MAMBAFORGE_VERSION}/Mambaforge-${MAMBAFORGE_VERSION}-Linux-x86_64.sh" INSTALLER_PATH=/tmp/mambaforge-installer.sh diff --git a/r-packages/2021-spring-phw-272a.r b/r-packages/2021-spring-phw-272a.r old mode 100644 new mode 100755 diff --git a/r-packages/ph-142.r b/r-packages/ph-142.r index b83c95c..75e3c7b 100755 --- a/r-packages/ph-142.r +++ b/r-packages/ph-142.r @@ -18,8 +18,8 @@ class_libs = c( "measurements", "1.4.0", "dagitty", "0.3-0", "cowplot", "1.1.1", - "patchwork", "1.1.1", - "tigris", "1.0", + "patchwork", "1.3.0", + "tigris", "2.1", "googlesheets4", "1.0.0", "coxed", "0.3.3" ) diff --git a/r-packages/ph-252.r b/r-packages/ph-252.r index 41e2665..76afe16 100755 --- a/r-packages/ph-252.r +++ b/r-packages/ph-252.r @@ -18,7 +18,7 @@ class_libs = c( "epitools", "0.5-10.1", "rms", "6.2-0", "lmtest","0.9-38", - "car","3.0-10", + "car","3.1-3", "SurvRegCensCov","1.4", "ProfileLikelihood","1.1", "biostat3","0.1.5" From bd48eb9df75887a47af59f5cdabd0073221587b5 Mon Sep 17 00:00:00 2001 From: Jonathan Felder Date: Wed, 9 Oct 2024 18:46:03 -0700 Subject: [PATCH 2/3] [DH-394] fixing publichealth --- install.R | 6 ------ 1 file changed, 6 deletions(-) delete mode 100755 install.R diff --git a/install.R b/install.R deleted file mode 100755 index 2f337bd..0000000 --- a/install.R +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env r - -source("/tmp/class-libs.R") - -# install ottr, needs to go first issue #3216, #3263 -devtools::install_github('ucbds-infra/ottr', ref='0.1.0', upgrade_dependencies=FALSE, quiet=FALSE) From ae0d3c79404df54757952c748bbccf6e5098cef2 Mon Sep 17 00:00:00 2001 From: Jonathan Felder Date: Thu, 10 Oct 2024 11:10:30 -0700 Subject: [PATCH 3/3] [DH-394] just a couple of minor tweaks --- Dockerfile | 8 ++++++-- install-mambaforge.bash | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c18dc70..44db757 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,8 +54,8 @@ RUN apt-get update > /dev/null && \ COPY install-mambaforge.bash /tmp/install-mambaforge.bash RUN /tmp/install-mambaforge.bash -RUN chown -Rh rstudio:rstudio /home/rstudio -RUN chown -Rh rstudio:rstudio /srv/conda +# needed for building on mac see DH-394 +RUN chown -Rh ${NB_USER}:${NB_USER} ${HOME} USER ${NB_USER} @@ -92,4 +92,8 @@ RUN r /tmp/r-packages/2021-spring-phw-272a.r # Use simpler locking strategy COPY file-locks /etc/rstudio/file-locks +# Doing a little cleanup +RUN rm -rf /tmp/downloaded_packages +RUN rm -rf ${HOME}/.cache + ENTRYPOINT ["tini", "--"] diff --git a/install-mambaforge.bash b/install-mambaforge.bash index c27ba02..42e86ae 100755 --- a/install-mambaforge.bash +++ b/install-mambaforge.bash @@ -37,6 +37,6 @@ rm ${INSTALLER_PATH} # Remove the pip cache created as part of installing mambaforge rm -rf /root/.cache -chown -R $NB_USER:$NB_USER ${CONDA_DIR} +chown -Rh $NB_USER:$NB_USER ${CONDA_DIR} conda list -n root