Skip to content

this is for a fresh fork of terra-docker - #525

Open
vjcitn wants to merge 2 commits into
DataBiosphere:masterfrom
vjcitn:master
Open

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

Conversation

@vjcitn

@vjcitn vjcitn commented Oct 9, 2026

Copy link
Copy Markdown

the terra-rstudio-anvil folder includes a Dockerfile defining a container that works with current Rstudio and R 4.6.1. In May the various stacks did not align, and Rstudio started in a crippled state. Updates in various parts of the stack seem to have resolved the problem.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 01:50

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

The image has a build-blocking package installation, disabled authentication, unreadable runtime R configuration, and missing publishing integration.

7 open findings
What changed in this PR

Adds a fresh Terra-compatible RStudio image using R 4.6.1 and supporting installation scripts.

Changes:

  • Builds and configures R and RStudio Server.
  • Adds optional CUDA, Python, geospatial, publishing, and scientific tooling.
  • Adds image-inspection helpers and example tests.
File Description
terra-rstudio-anvil/​Dockerfile Defines the RStudio image.
terra-rstudio-anvil/​CHECK/​chk1 Pulls and inspects an older image.
terra-rstudio-anvil/​CHECK/​chk2 Inspects the older image environment.
terra-rstudio-anvil/​CHECK/​chk3 Pulls the newer reference image.
terra-rstudio-anvil/​CHECK/​chk4 Inspects the newer image environment.
terra-rstudio-anvil/​CHECK/​o4 Stores reference inspection output.
terra-rstudio-anvil/​scripts/​bin/​install2.r Installs R packages from the command line.
terra-rstudio-anvil/​scripts/​config_R_cuda.sh Configures CUDA for R.
terra-rstudio-anvil/​scripts/​default_user.sh Creates the default RStudio user.
terra-rstudio-anvil/​scripts/​experimental/​batch_user_creation.sh Creates multiple RStudio users.
terra-rstudio-anvil/​scripts/​experimental/​cuda10.2-tf.sh Adds experimental TensorFlow CUDA dependencies.
terra-rstudio-anvil/​scripts/​experimental/​install_R_binary.sh Installs experimental binary R.
terra-rstudio-anvil/​scripts/​experimental/​install_dev_osgeo.sh Builds development OSGeo libraries.
terra-rstudio-anvil/​scripts/​experimental/​install_geospatial_unstable.sh Enables unstable geospatial packages.
terra-rstudio-anvil/​scripts/​experimental/​install_rl.sh Adds reinforcement-learning packages.
terra-rstudio-anvil/​scripts/​init_set_env.sh Propagates selected runtime variables.
terra-rstudio-anvil/​scripts/​init_userconf.sh Configures the runtime user.
terra-rstudio-anvil/​scripts/​install_R_ppa.sh Installs R from a CRAN repository.
terra-rstudio-anvil/​scripts/​install_R_source.sh Builds R from source.
terra-rstudio-anvil/​scripts/​install_cuda-10.1.sh Installs CUDA 10.1.
terra-rstudio-anvil/​scripts/​install_cuda-11.1.sh Installs CUDA 11.1.
terra-rstudio-anvil/​scripts/​install_geospatial.sh Installs geospatial dependencies.
terra-rstudio-anvil/​scripts/​install_julia.sh Installs Julia and R integrations.
terra-rstudio-anvil/​scripts/​install_jupyter.sh Installs Jupyter and an R kernel.
terra-rstudio-anvil/​scripts/​install_nvtop.sh Builds the GPU monitor.
terra-rstudio-anvil/​scripts/​install_pandoc.sh Installs or links Pandoc.
terra-rstudio-anvil/​scripts/​install_pyenv.sh Installs pyenv and pipenv.
terra-rstudio-anvil/​scripts/​install_python.sh Creates the shared Python environment.
terra-rstudio-anvil/​scripts/​install_quarto.sh Installs or links Quarto.
terra-rstudio-anvil/​scripts/​install_rstudio.sh Installs and configures RStudio Server.
terra-rstudio-anvil/​scripts/​install_s6init.sh Installs the S6 supervisor.
terra-rstudio-anvil/​scripts/​install_shiny_server.sh Installs Shiny Server.
terra-rstudio-anvil/​scripts/​install_tensorflow.sh Adds R TensorFlow tooling.
terra-rstudio-anvil/​scripts/​install_texlive.sh Installs TeX Live.
terra-rstudio-anvil/​scripts/​install_tf1_cuda_10_0.sh Adds TensorFlow 1 CUDA libraries.
terra-rstudio-anvil/​scripts/​install_tidyverse.sh Installs tidyverse packages.
terra-rstudio-anvil/​scripts/​install_verse.sh Adds publishing and development tools.
terra-rstudio-anvil/​scripts/​install_wgrib2.sh Builds the GRIB utility.
terra-rstudio-anvil/​scripts/​rsession.sh Launches a standalone R session.
terra-rstudio-anvil/​scripts/​setup_R.sh Configures R and littler.
terra-rstudio-anvil/​scripts/​tests/​examples_tf.R Exercises an MNIST Keras model.
terra-rstudio-anvil/​scripts/​tests/​nvblas.R Exercises CUDA-backed BLAS.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

echo "rsession-which-r=${R_BIN}" > /etc/rstudio/rserver.conf
## use more robust file locking to avoid errors when using shared volumes:
echo "lock-type=advisory" >> /etc/rstudio/file-locks
echo "auth-none=1" >> /etc/rstudio/rserver.conf
@@ -0,0 +1,47 @@
# check=skip=SecretsUsedInArgOrEnv
FROM us.gcr.io/broad-dsp-gcr-public/terra-base:1.0.1
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}
GEOS_VERSION=${GEOS_VERSION:-"latest"}

CRAN_SOURCE=${CRAN_SOURCE:-"https://cloud.r-project.org"}
echo "options(repos = c(CRAN = '${CRAN}'))" >>"${R_HOME}/etc/Rprofile.site"
done

## 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 +3 to +7
R_DOC_DIR=$R_HOME/doc
R_INCLUDE_DIR=$R_HOME/include
R_SHARE_DIR=$R_HOME/share
RSTUDIO_DEFAULT_R_VERSION_HOME=$R_HOME
RSTUDIO_DEFAULT_R_VERSION=$R_VERSION
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