Skip to content

define container that runs R 4.6.1 and Rstudio in terra - #524

Closed
vjcitn wants to merge 23 commits into
DataBiosphere:masterfrom
vjcitn:master
Closed

vjcitn wants to merge 23 commits into
DataBiosphere:masterfrom
vjcitn:master

Conversation

@vjcitn

@vjcitn vjcitn commented Oct 8, 2026

Copy link
Copy Markdown

This was blocked in May for various reasons possibly related to changes in Rstudio stack.
Now this Dockerfile defines a container that can be used as a community-contributed cloud
environment for terra/anvil.

vjcitn and others added 23 commits March 18, 2026 12:08
Explicit build of rstudio on the sudo-enabled base
Following suggestion of using 3.0.0, but noting existence of 3.3.2 at this time.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Removed pam-helper.sh script from Dockerfile.
Removed copying of pam-helper.sh to rstudio-server bin.
A secret was used in an ARG or ENV ... allowing this for now
… rstudio

in a jetstream vm.  however, the user identity is jupyter and it starts in /home/jupyter
when we try to use this as a custom env under "rstudio"  terra env control, the build
process jumps to the jupyter type environment build process
R452brokenterra can be used in terra but only the console works
Copilot AI balanced review requested due to automatic review settings October 8, 2026 11:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Missing build inputs, lost Bioconductor functionality, and runtime configuration defects remain unresolved.

11 open findings
What changed in this PR

Adds a community-contributed R 4.6.1 and RStudio environment for Terra/AnVIL alongside the existing notebook images.

Changes:

  • Defines the RStudio container and its startup configuration.
  • Adds installation helpers, examples, and image-inspection scripts.
  • Revises the Jupyter R and Bioconductor Dockerfiles.
File Description
terra-rstudio-anvil/​scripts/​tests/​nvblas.R Adds a GPU matrix benchmark.
terra-rstudio-anvil/​scripts/​tests/​examples_tf.R Adds a Keras training example.
terra-rstudio-anvil/​scripts/​setup_R.sh Configures R, OpenBLAS, and littler.
terra-rstudio-anvil/​scripts/​rsession.sh Adds standalone RStudio session startup.
terra-rstudio-anvil/​scripts/​install_wgrib2.sh Adds weather-data tooling installation.
terra-rstudio-anvil/​scripts/​install_verse.sh Adds publishing packages and dependencies.
terra-rstudio-anvil/​scripts/​install_tidyverse.sh Adds tidyverse and database packages.
terra-rstudio-anvil/​scripts/​install_tf1_cuda_10_0.sh Adds legacy TensorFlow CUDA dependencies.
terra-rstudio-anvil/​scripts/​install_texlive.sh Adds TeX Live installation.
terra-rstudio-anvil/​scripts/​install_tensorflow.sh Adds Python and R Keras setup.
terra-rstudio-anvil/​scripts/​install_shiny_server.sh Adds Shiny Server installation and startup.
terra-rstudio-anvil/​scripts/​install_s6init.sh Installs the s6 supervisor.
terra-rstudio-anvil/​scripts/​install_rstudio.sh Installs and configures RStudio Server.
terra-rstudio-anvil/​scripts/​install_R_source.sh Builds R from source.
terra-rstudio-anvil/​scripts/​install_R_ppa.sh Adds repository-based R installation.
terra-rstudio-anvil/​scripts/​install_quarto.sh Installs or exposes Quarto.
terra-rstudio-anvil/​scripts/​install_python.sh Configures Python and reticulate.
terra-rstudio-anvil/​scripts/​install_pyenv.sh Adds Python version-management setup.
terra-rstudio-anvil/​scripts/​install_pandoc.sh Installs Pandoc and templates.
terra-rstudio-anvil/​scripts/​install_nvtop.sh Builds GPU monitoring tooling.
terra-rstudio-anvil/​scripts/​install_jupyter.sh Adds Jupyter and R kernel setup.
terra-rstudio-anvil/​scripts/​install_julia.sh Adds Julia and R integration packages.
terra-rstudio-anvil/​scripts/​install_geospatial.sh Adds geospatial libraries and packages.
terra-rstudio-anvil/​scripts/​install_cuda-11.1.sh Adds CUDA 11.1 installation.
terra-rstudio-anvil/​scripts/​install_cuda-10.1.sh Adds CUDA 10.1 installation.
terra-rstudio-anvil/​scripts/​init_userconf.sh Configures runtime users and preferences.
terra-rstudio-anvil/​scripts/​init_set_env.sh Propagates selected environment settings.
terra-rstudio-anvil/​scripts/​experimental/​install_rl.sh Adds reinforcement-learning environment setup.
terra-rstudio-anvil/​scripts/​experimental/​install_R_binary.sh Adds experimental binary R installation.
terra-rstudio-anvil/​scripts/​experimental/​install_geospatial_unstable.sh Adds unstable geospatial repository setup.
terra-rstudio-anvil/​scripts/​experimental/​install_dev_osgeo.sh Builds geospatial libraries from source.
terra-rstudio-anvil/​scripts/​experimental/​cuda10.2-tf.sh Adds experimental CUDA dependency setup.
terra-rstudio-anvil/​scripts/​experimental/​batch_user_creation.sh Adds batch account creation.
terra-rstudio-anvil/​scripts/​default_user.sh Creates the default application user.
terra-rstudio-anvil/​scripts/​config_R_cuda.sh Configures CUDA paths and NVBLAS.
terra-rstudio-anvil/​scripts/​bin/​install2.r Adds an R package installation helper.
terra-rstudio-anvil/​Dockerfile Defines the Terra RStudio image.
terra-rstudio-anvil/​CHECK/​o4 Records reference image metadata.
terra-rstudio-anvil/​CHECK/​chk4 Inspects reference image environment settings.
terra-rstudio-anvil/​CHECK/​chk3 Pulls the newer reference image.
terra-rstudio-anvil/​CHECK/​chk2 Inspects older reference image settings.
terra-rstudio-anvil/​CHECK/​chk1 Pulls and inspects the older image.
terra-jupyter-r/​Dockerfile Updates package versions and dependency installation.
terra-jupyter-bioconductor/​Dockerfile Replaces inheritance with an RStudio-oriented build.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@@ -1 +1,45 @@
FROM us.gcr.io/broad-dsp-gcr-public/terra-jupyter-r:2.2.7
FROM us.gcr.io/broad-dsp-gcr-public/terra-base:1.0.0
ENV R_HOME="/usr/local/lib/R"
ENV TZ="Etc/UTC"

COPY scripts/install_R_source.sh /rocker_scripts/install_R_source.sh
RUN /rocker_scripts/install_rstudio.sh

EXPOSE 8787
CMD ["/init"]
Comment on lines +8 to +9
PATH={$PATH:-$PATH:$CUDA_HOME/bin}
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64}

if [ "${RUNROOTLESS}" = "true" ]; then
echo "deleting the default user ($DEFAULT_USER) since it is not needed."
userdel "$DEFAULT_USER"
@@ -0,0 +1,36 @@

## Tensorflow:
install.packages('keras', repos='http://cran.us.r-project.org')
Comment on lines +20 to +21
## ensure Renviron.site is only readable/writable by its owner:
chmod 600 "${R_HOME}/etc/Renviron.site"
fi
}

echo "PYTHON_CONFIGURE_OPTS=${PYTHON_CONFIGURE_OPTS}" >>"${R_HOME}/etc/R_environ"
Comment on lines +37 to +38
# Upgrade version of pip inside the virtualenv
python3 -m pip --no-cache-dir install --upgrade \
Comment on lines +95 to +96
echo "session-default-working-dir=/home/jupyter" >> /etc/rstudio/rsession.conf
echo "session-default-new-project-dir=/home/jupyter" >> /etc/rstudio/rsession.conf
@vjcitn vjcitn closed this Oct 8, 2026
@vjcitn

vjcitn commented Oct 8, 2026

Copy link
Copy Markdown
Author

I had only intended to submit changes on one Dockerfile. I will refresh my fork and resubmit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants