Skip to content

Commit 6db529b

Browse files
authored
Merge pull request #97 from emiliom/ohwes24-nov-event
R image: update python, pangeo-notebook and rstudio-server
2 parents 41445c1 + 4e7a337 commit 6db529b

File tree

4 files changed

+231
-149
lines changed

4 files changed

+231
-149
lines changed

.github/workflows/build-image.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ jobs:
6666
image_ref: ${{ steps.env_var.outputs.image_ref }}
6767

6868
steps:
69+
- name: Delete huge unnecessary tools folder
70+
run: rm -rf /opt/hostedtoolcache
71+
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
72+
6973
- name: Checkout Repository
7074
uses: actions/checkout@v2
7175

r/Dockerfile

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#syntax=docker/dockerfile:1.3
2-
FROM continuumio/miniconda3:4.12.0@sha256:58b1c7df8d69655ffec017ede784a075e3c2e9feff0fc50ef65300fc75aa45ae
2+
# FROM continuumio/miniconda3:4.12.0@sha256:58b1c7df8d69655ffec017ede784a075e3c2e9feff0fc50ef65300fc75aa45ae
3+
# 11/14/24: Use a miniconda image that's a bit older than the rstudio-server package; just in case
4+
FROM continuumio/miniconda3:24.7.1-0@sha256:f37f8c7db26ae7ec0098df530e96c9cde139026b9faf3914800d1522c47a49b1
35

46
ENV NB_USER jovyan
57
ENV NB_UID 1000
@@ -11,6 +13,7 @@ ENV R_LIBS_USER /opt/r
1113

1214
# Explicitly add littler to PATH
1315
# See https://github.com/conda-forge/r-littler-feedstock/issues/6
16+
# 11/14/2024: The littler path appears to be solved already
1417
ENV PATH ${CONDA_DIR}/lib/R/library/littler/bin:${CONDA_DIR}/bin:$PATH
1518

1619
# Output logging faster
@@ -38,8 +41,12 @@ RUN --mount=type=cache,id=ohw_r_apt,target=/var/cache/apt \
3841
locales \
3942
psmisc \
4043
sudo \
44+
# 11/14/24: should this lib version be udpated?
4145
libapparmor1 \
46+
libfmt-dev \
47+
# 11/14/24: should this lib version be udpated?
4248
libpq5 \
49+
libssl-dev \
4350
lsb-release \
4451
ca-certificates \
4552
libclang-dev > /dev/null \
@@ -51,8 +58,16 @@ RUN echo "${LC_ALL} UTF-8" > /etc/locale.gen && \
5158

5259
# # Set path where R packages are installed
5360
# # Download and install rstudio manually
61+
# 11/13/2024: (using $ cat /etc/os-release) 2i2c hub currently runs on Ubuntu jammy (22), not bionic (18).
62+
# Drilling down to jammy at https://posit.co/download/rstudio-server/, it looks like the latest rstudio-server deb is:
63+
ENV RSTUDIO_URL https://download2.rstudio.org/server/jammy/amd64/rstudio-server-2024.09.1-394-amd64.deb
64+
65+
# 11/19/2024: Tried Ubuntu focal (20). It didn't make a difference
66+
# ENV RSTUDIO_URL https://download2.rstudio.org/server/focal/amd64/rstudio-server-2024.09.1-394-amd64.deb
67+
68+
# # (11/13/2024: The comment below is at from 2022 or earlier)
5469
# # Newer one has bug that doesn't work with jupyter-rsession-proxy
55-
ENV RSTUDIO_URL https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.07.1-554-amd64.deb
70+
# ENV RSTUDIO_URL https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.07.1-554-amd64.deb
5671
# ENV RSTUDIO_URL https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.2.5042-amd64.deb
5772
RUN curl --silent --location --fail ${RSTUDIO_URL} > /tmp/rstudio.deb && \
5873
dpkg -i /tmp/rstudio.deb && \
@@ -65,9 +80,13 @@ USER ${USER}
6580

6681
COPY ./conda-linux-64.lock /tmp/
6782

68-
RUN --mount=type=cache,id=ohw_r,target=/opt/conda/pkgs,uid=${NB_UID},gid=${NB_UID} \
83+
RUN --mount=type=cache,id=ohw_r,target=${CONDA_DIR}/pkgs,uid=${NB_UID},gid=${NB_UID} \
84+
# https://github.com/jupyterhub/jupyterhub-deploy-docker/issues/91#issuecomment-525563836
85+
# To avoid libmamba and libarchive channel conflicts, make sure conda-forge is the only channel
86+
# https://github.com/conda/conda-libmamba-solver/issues/283#issuecomment-1949560105
87+
conda config --add channels conda-forge && \
88+
conda update --all && \
6989
conda install --name ${CONDA_ENV} --file /tmp/conda-linux-64.lock && \
70-
# micromamba install --name ${CONDA_ENV} --file environment.yml && \
7190
find -name '*.a' -delete && \
7291
# rm -rf /opt/conda/conda-meta && \
7392
rm -rf ${CONDA_DIR}/include && \
@@ -79,9 +98,10 @@ ARG MAMBA_DOCKERFILE_ACTIVATE=1
7998
# 2024-10-10: Have there been improvements in install_cran and install_github such that
8099
# dependencies, upgrade_dependencies, upgrade could now be set to TRUE or the default?
81100
# RUN installGithub.R BigelowLab/rasf BigelowLab/ohwobpg # not working on GH but works locally :-/
82-
RUN Rscript -e "remotes::install_cran('assertthat', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
83-
Rscript -e "remotes::install_cran('forecast', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
84-
Rscript -e "remotes::install_cran('ggspatial', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
101+
RUN \
102+
# -- Dependencies to the target packages, not already installed via the conda environment
103+
Rscript -e "remotes::install_cran('PBSmapping', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
104+
# -- Target packages
85105
Rscript -e "remotes::install_cran('plot.matrix', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
86106
Rscript -e "remotes::install_cran('isdparser', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
87107
Rscript -e "remotes::install_cran('geonames', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
@@ -101,16 +121,17 @@ RUN Rscript -e "remotes::install_cran('assertthat', dependencies=FALSE, upgrade_
101121
Rscript -e "remotes::install_github('hvillalo/echogram', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
102122
Rscript -e "remotes::install_github('hvillalo/periods', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
103123
Rscript -e "remotes::install_github('hvillalo/satin', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
104-
Rscript -e "remotes::install_github('kwstat/pals', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
105124
Rscript -e "remotes::install_github('JorGarMol/VoCC', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)"
106125

107126
COPY CONDARC ./.condarc
108-
COPY Rprofile.site /opt/conda/lib/R/etc/
127+
COPY Rprofile.site ${CONDA_DIR}/lib/R/etc/
109128

110129
ENV PATH /usr/lib/rstudio-server/bin/:${PATH}
111130

112131
ENV LD_LIBRARY_PATH=${CONDA_DIR}/lib
113132

114133
# USER root
115134
# RUN chown -R jovyan ${CONDA_DIR}
135+
# https://github.com/oceanhackweek/jupyter-image/pull/97#issuecomment-2488105625
136+
RUN chown -R ${NB_USER} ${HOME}/.cache
116137
USER ${NB_USER}

0 commit comments

Comments
 (0)