-
Notifications
You must be signed in to change notification settings - Fork 5
Separate r-base image and tested #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
|
|
||
| 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"] | ||
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment.
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