Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base_images/2i2c/pangeo/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- pip=25.2
- pip=26.0
- pip:
- rio-tiler==8.0.5
- maap-py==4.2.0
Expand Down
73 changes: 73 additions & 0 deletions base_images/2i2c/r-base/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
FROM ghcr.io/nmfs-opensci/container-images/py-rocket-geospatial-2:2026.01.25
ENV LANG=en_US.UTF-8
ENV TZ=US/Pacific
ARG DEBIAN_FRONTEND=noninteractive

USER root

# Install system R and development libraries
# R will be completely separate from conda
RUN apt-get clean && apt-get update && \
apt-get install -y --no-install-recommends \
gdal-bin=3.8.4+dfsg-3ubuntu3 \
lbzip2=2.5-2.3 \
libfftw3-dev=3.3.10-1ubuntu3 \
libgdal-dev=3.8.4+dfsg-3ubuntu3 \
libgeos-dev=3.12.1-3build1 \
libgl1-mesa-dev=25.0.7-0ubuntu0.24.04.2 \
libglu1-mesa-dev=9.0.2-1.1build1 \
libhdf4-alt-dev=4.2.16-4build1 \
libhdf5-dev=1.10.10+repack-3.1ubuntu4 \
libjq-dev=1.7.1-3ubuntu0.24.04.1 \
libpq-dev=16.11-0ubuntu0.24.04.1 \
libproj-dev=9.4.0-1build2 \
libprotobuf-dev=3.21.12-8.2ubuntu0.2 \
libnetcdf-dev=1:4.9.2-5ubuntu4 \
libsqlite3-dev=3.45.1-1ubuntu2.5 \
libssl-dev=3.0.13-0ubuntu3.6 \
libudunits2-dev=2.2.28-7build1 \
netcdf-bin=1:4.9.2-5ubuntu4 \
postgis=3.4.2+dfsg-1ubuntu3 \
protobuf-compiler=3.21.12-8.2ubuntu0.2 \
sqlite3=3.45.1-1ubuntu2.5 \
tk-dev=8.6.14build1 \
unixodbc-dev=2.3.12-1ubuntu0.24.04.1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

USER ${NB_USER}

# Install additional packages from environment.yml
COPY ./environment.yml /tmp
RUN conda env update -n ${CONDA_ENV} -f "/tmp/environment.yml" \
&& find ${CONDA_DIR}/ -follow -type f -name '*.a' -delete \
&& find ${CONDA_DIR}/ -follow -type f -name '*.js.map' -delete \
&& ${CONDA_DIR}/bin/conda clean -afy

RUN conda init

RUN awscliv2 --install
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix did not work and I need to debug if we want to keep awscliv2, can resolve in another PR along with rgee bug


USER root
SHELL ["/bin/bash", "-c"]
ADD . /
RUN ["chmod", "+x", "/scripts/install_cran_packages_r.sh"]
# Install R packages using SYSTEM R (not conda R)
# Do NOT activate conda environment here
# Clear conda's compiler paths to force use of system compiler
RUN export PATH=/usr/local/bin:/usr/bin:/bin:$PATH && \
/scripts/install_cran_packages_r.sh

RUN PYTHON_PATH=$(which python) && \
R_HOME=$(R RHOME) && \
echo "library(reticulate)" >> "$R_HOME/etc/Rprofile.site" && \
echo "use_python(\"$PYTHON_PATH\", required = TRUE)" >> "$R_HOME/etc/Rprofile.site" && \
echo "py_config()" >> "$R_HOME/etc/Rprofile.site"

COPY scripts/init-user.sh /usr/local/bin/init-user.sh
RUN chmod +x /usr/local/bin/init-user.sh

USER ${NB_USER}

# This script returns control to base image's /srv/start after
ENTRYPOINT ["/usr/local/bin/init-user.sh"]
15 changes: 15 additions & 0 deletions base_images/2i2c/r-base/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: notebook
channels:
- conda-forge
- nodefaults
dependencies:
# Python packages only - NO R packages in conda
- gdal=3.10.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put a comment here indicated why we are pinning this version of gdal from conda?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is because it was the last version the R image was built with and we pin our packages in our environment.ymls for reproducibility
Should I upgrade gdal?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems ok if the idea is to just match the conda gdal to the same version and the system gdal (that R uses). I do anticipate keeping track of that being a hassle later.

- nodejs=20.19.5
- rtree=1.4.1
- unzip=6.0
- pip=26.0
- pip:
# - git+https://github.com/MAAP-Project/stac_ipyleaflet.git@0.3.6
- morecantile==6.1.0
- rio-tiler==7.2.2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Rscript /scripts/install2.r --error --skipmissing --skipinstalled -l "$R_LIB" -r
Rscript /scripts/install2.r --error --skipmissing --skipinstalled -l "$R_LIB" -r "https://cran.r-project.org" -n "$NCPUS" "tidyterra"
Rscript /scripts/install2.r --error --skipmissing --skipinstalled -l "$R_LIB" -r "https://cran.r-project.org" -n "$NCPUS" "BIOMASS"
Rscript /scripts/install2.r --error --skipmissing --skipinstalled -l "$R_LIB" -r "https://cran.r-project.org" -n "$NCPUS" "nlraa"
Rscript /scripts/install2.r --error --skipmissing --skipinstalled -l "$R_LIB" -r "https://cran.r-project.org" -n "$NCPUS" "essentials"
Rscript /scripts/install2.r --error --skipmissing --skipinstalled -l "$R_LIB" -r "https://cran.r-project.org" -n "$NCPUS" "geojsonio"
Rscript /scripts/install2.r --error --skipmissing --skipinstalled -l "$R_LIB" -r "https://cran.r-project.org" -n "$NCPUS" "future"
Rscript /scripts/install2.r --error --skipmissing --skipinstalled -l "$R_LIB" -r "https://r-lidar.r-universe.dev" -n "$NCPUS" "lasR"
Expand Down
58 changes: 1 addition & 57 deletions base_images/2i2c/r/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,8 @@
FROM ghcr.io/nmfs-opensci/container-images/py-rocket-geospatial-2:2026.01.25
FROM mas.dit.maap-project.org/root/maap-workspaces/2i2c/r-base:develop
ENV LANG=en_US.UTF-8
ENV TZ=US/Pacific
ARG DEBIAN_FRONTEND=noninteractive

USER root

# Install system R and development libraries
# R will be completely separate from conda
RUN apt-get clean && apt-get update && \
apt-get install -y --no-install-recommends \
gdal-bin=3.8.4+dfsg-3ubuntu3 \
lbzip2=2.5-2.3 \
libfftw3-dev=3.3.10-1ubuntu3 \
libgdal-dev=3.8.4+dfsg-3ubuntu3 \
libgeos-dev=3.12.1-3build1 \
libgl1-mesa-dev=25.0.7-0ubuntu0.24.04.2 \
libglu1-mesa-dev=9.0.2-1.1build1 \
libhdf4-alt-dev=4.2.16-4build1 \
libhdf5-dev=1.10.10+repack-3.1ubuntu4 \
libjq-dev=1.7.1-3ubuntu0.24.04.1 \
libpq-dev=16.11-0ubuntu0.24.04.1 \
libproj-dev=9.4.0-1build2 \
libprotobuf-dev=3.21.12-8.2ubuntu0.2 \
libnetcdf-dev=1:4.9.2-5ubuntu4 \
libsqlite3-dev=3.45.1-1ubuntu2.5 \
libssl-dev=3.0.13-0ubuntu3.6 \
libudunits2-dev=2.2.28-7build1 \
netcdf-bin=1:4.9.2-5ubuntu4 \
postgis=3.4.2+dfsg-1ubuntu3 \
protobuf-compiler=3.21.12-8.2ubuntu0.2 \
sqlite3=3.45.1-1ubuntu2.5 \
tk-dev=8.6.14build1 \
unixodbc-dev=2.3.12-1ubuntu0.24.04.1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

USER ${NB_USER}

# Install additional packages from environment.yml
Expand All @@ -45,27 +13,3 @@ RUN conda env update -n ${CONDA_ENV} -f "/tmp/environment.yml" \
&& ${CONDA_DIR}/bin/conda clean -afy

RUN conda init

USER root
SHELL ["/bin/bash", "-c"]
ADD . /
RUN ["chmod", "+x", "/scripts/install_cran_packages_r.sh"]
# Install R packages using SYSTEM R (not conda R)
# Do NOT activate conda environment here
# Clear conda's compiler paths to force use of system compiler
RUN export PATH=/usr/local/bin:/usr/bin:/bin:$PATH && \
/scripts/install_cran_packages_r.sh

RUN PYTHON_PATH=$(which python) && \
R_HOME=$(R RHOME) && \
echo "library(reticulate)" >> "$R_HOME/etc/Rprofile.site" && \
echo "use_python(\"$PYTHON_PATH\", required = TRUE)" >> "$R_HOME/etc/Rprofile.site" && \
echo "py_config()" >> "$R_HOME/etc/Rprofile.site"

COPY scripts/init-user.sh /usr/local/bin/init-user.sh
RUN chmod +x /usr/local/bin/init-user.sh

USER ${NB_USER}

# This script returns control to base image's /srv/start after
ENTRYPOINT ["/usr/local/bin/init-user.sh"]
18 changes: 2 additions & 16 deletions base_images/2i2c/r/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,13 @@ channels:
- conda-forge
- nodefaults
dependencies:
# Python packages only - NO R packages in conda
- gdal=3.10.2
- nodejs=20.19.5
- rtree=1.4.1
- unzip=6.0
- pip=25.2
- pip=26.0
- pip:
# - git+https://github.com/MAAP-Project/stac_ipyleaflet.git@0.3.6
- morecantile==6.1.0
- rio-tiler==7.2.2
- maap-py==4.2.0
- maap-algorithms-jupyter-extension==0.5.1
- maap-jupyter-server-extension==3.0.0
- maap-dps-jupyter-extension==0.7.7
# - maap-edsc-jupyter-extension==1.1.1
- maap-help-jupyter-extension==2.0.2
- maap-libs-jupyter-extension==1.2.5
- maap-user-workspace-management-jupyter-extension==1.0.0
variables:
TITILER_STAC_ENDPOINT: 'https://openveda.cloud/api/stac'
TITILER_ENDPOINT: 'https://openveda.cloud/api/raster'
STAC_CATALOG_NAME: 'VEDA STAC'
STAC_CATALOG_URL: 'https://openveda.cloud/api/stac'
STAC_BROWSER_URL: 'https://openveda.cloud/'
- maap-user-workspace-management-jupyter-extension==1.0.0