Bioc323#520
Open
vjcitn wants to merge 20 commits into
Open
Conversation
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
There was a problem hiding this comment.
Pull request overview
Adds a new terra-rstudio-anvil image definition and supporting install/init scripts to build R from source and run RStudio Server (plus optional components like Python/reticulate, TensorFlow/Keras, geospatial, TeX, Quarto, etc.). The PR also modifies terra-jupyter-bioconductor in a way that appears to switch it away from being a Jupyter/Leonardo-focused image.
Changes:
- Introduce a new
terra-rstudio-anvil/Dockerfilethat builds R from source, installs littler tooling, and installs/configures RStudio Server via s6-overlay. - Add a large suite of
terra-rstudio-anvil/scripts/*installer and init scripts (R, RStudio, s6 init, Python venv/reticulate, tidyverse/verse/geospatial, TeX, Pandoc/Quarto, CUDA helpers, etc.), plus a couple of ad-hoc R test scripts. - Replace
terra-jupyter-bioconductor/Dockerfilewith a new build that installs RStudio/s6 rather than extendingterra-jupyter-r.
Reviewed changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| terra-rstudio-anvil/scripts/tests/nvblas.R | Adds an R snippet intended to test NVBLAS via LD_PRELOAD. |
| terra-rstudio-anvil/scripts/tests/examples_tf.R | Adds an example Keras MNIST training script. |
| terra-rstudio-anvil/scripts/setup_R.sh | Sets CRAN defaults, HTTP user agent, OpenBLAS switching, and installs littler. |
| terra-rstudio-anvil/scripts/rsession.sh | Adds a standalone rsession launcher script. |
| terra-rstudio-anvil/scripts/install_wgrib2.sh | Installs wgrib2 from upstream tarball. |
| terra-rstudio-anvil/scripts/install_verse.sh | Installs broader “verse” dependencies incl. TeX tooling and R packages. |
| terra-rstudio-anvil/scripts/install_tidyverse.sh | Installs tidyverse and common DB/IO-related packages. |
| terra-rstudio-anvil/scripts/install_tf1_cuda_10_0.sh | Installs CUDA 10.0 runtime libs needed for TF 1.x compatibility. |
| terra-rstudio-anvil/scripts/install_texlive.sh | Installs TeX Live via CTAN and configures PATH/permissions. |
| terra-rstudio-anvil/scripts/install_tensorflow.sh | Installs Python support + R keras. |
| terra-rstudio-anvil/scripts/install_shiny_server.sh | Installs Shiny Server and configures it under s6. |
| terra-rstudio-anvil/scripts/install_s6init.sh | Installs s6-overlay. |
| terra-rstudio-anvil/scripts/install_rstudio.sh | Installs RStudio Server, configures rserver/rsession, and s6 services. |
| terra-rstudio-anvil/scripts/install_R_source.sh | Builds and installs R from source tarball. |
| terra-rstudio-anvil/scripts/install_R_ppa.sh | Installs R from CRAN Ubuntu repo via apt (PPA-style approach). |
| terra-rstudio-anvil/scripts/install_quarto.sh | Installs or symlinks Quarto CLI (bundled or standalone). |
| terra-rstudio-anvil/scripts/install_python.sh | Creates a Python venv, installs reticulate, and adjusts BLAS on focal. |
| terra-rstudio-anvil/scripts/install_pyenv.sh | Installs pyenv and pipenv to enable multiple Python versions. |
| terra-rstudio-anvil/scripts/install_pandoc.sh | Installs or symlinks Pandoc (bundled or standalone) plus templates. |
| terra-rstudio-anvil/scripts/install_nvtop.sh | Builds and installs nvtop from source. |
| terra-rstudio-anvil/scripts/install_jupyter.sh | Installs Jupyter + IRkernel and TeX deps for nbconvert. |
| terra-rstudio-anvil/scripts/install_julia.sh | Installs Julia and R bindings (JuliaCall, JuliaConnectoR). |
| terra-rstudio-anvil/scripts/install_geospatial.sh | Installs system geospatial libs and a wide set of R geospatial packages. |
| terra-rstudio-anvil/scripts/install_cuda-11.1.sh | Installs/pins CUDA 11.1 runtime+dev packages and some TensorRT symlinks. |
| terra-rstudio-anvil/scripts/install_cuda-10.1.sh | Installs/pins CUDA 10.1 packages and TF-related dependencies. |
| terra-rstudio-anvil/scripts/init_userconf.sh | s6 cont-init script to manage user creation/rootless behavior/passwords. |
| terra-rstudio-anvil/scripts/init_set_env.sh | s6 cont-init script to propagate selected env vars into Renviron.site. |
| terra-rstudio-anvil/scripts/experimental/install_rl.sh | Experimental: creates a venv and installs RL-related Python packages. |
| terra-rstudio-anvil/scripts/experimental/install_R_binary.sh | Experimental: installs R via apt in a separate script variant. |
| terra-rstudio-anvil/scripts/experimental/install_geospatial_unstable.sh | Experimental: adds ubuntugis-unstable and installs geospatial stack. |
| terra-rstudio-anvil/scripts/experimental/install_dev_osgeo.sh | Experimental: builds GDAL/GEOS/PROJ from source and installs R packages. |
| terra-rstudio-anvil/scripts/experimental/cuda10.2-tf.sh | Experimental: ad-hoc CUDA/TensorRT installation commands. |
| terra-rstudio-anvil/scripts/experimental/batch_user_creation.sh | Experimental: create multiple OS users from an env var. |
| terra-rstudio-anvil/scripts/default_user.sh | Creates default rstudio user and sets baseline RStudio prefs. |
| terra-rstudio-anvil/scripts/config_R_cuda.sh | Configures CUDA/NVBLAS environment for R and RStudio. |
| terra-rstudio-anvil/scripts/bin/install2.r | Adds install2.r helper (littler-based) for installing R packages. |
| terra-rstudio-anvil/Dockerfile | New Dockerfile building the RStudio Anvil image. |
| terra-rstudio-anvil/CHECK/o4 | Adds captured diagnostic output (docker inspect excerpt). |
| terra-rstudio-anvil/CHECK/chk4 | Adds a diagnostic command snippet (docker inspect/grep env). |
| terra-rstudio-anvil/CHECK/chk3 | Adds a diagnostic command snippet (docker pull). |
| terra-rstudio-anvil/CHECK/chk2 | Adds a diagnostic command snippet (docker inspect/grep env). |
| terra-rstudio-anvil/CHECK/chk1 | Adds a diagnostic command snippet (docker pull/inspect labels). |
| terra-jupyter-bioconductor/Dockerfile | Replaces prior base image with a new build flow that installs R/RStudio tooling. |
Comments suppressed due to low confidence (1)
terra-rstudio-anvil/scripts/experimental/install_dev_osgeo.sh:120
apt_installis designed to accept package names, but it’s being called with apt flags and a local.debpath (apt_install -y -V ./apache-arrow-apt-source-...deb).dpkg -swill treat-yas a package name, and the install step may fail. Install the local .deb withdpkg -i(orapt-get install ./file.deb) outside ofapt_install, then runapt-get update.
## geoparquet support
wget https://apache.jfrog.io/artifactory/arrow/"$(lsb_release --id --short | tr '[:upper:]' '[:lower:]')"/apache-arrow-apt-source-latest-"$(lsb_release --codename --short)".deb
apt_install -y -V ./apache-arrow-apt-source-latest-"$(lsb_release --codename --short)".deb
apt-get update && apt-get install -y -V libarrow-dev libparquet-dev libarrow-dataset-dev
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+7
to
+10
| CUDA_HOME=${CUDA_HOME:-/usr/local/cuda} | ||
| PATH={$PATH:-$PATH:$CUDA_HOME/bin} | ||
| LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64} | ||
| NVBLAS_CONFIG_FILE=${NVBLAS_CONFIG_FILE:-/etc/nvblas.conf} |
Comment on lines
+20
to
+21
| ## ensure Renviron.site is only readable/writable by its owner: | ||
| chmod 600 "${R_HOME}/etc/Renviron.site" |
Comment on lines
+3
to
+9
| 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 | ||
| PATH=$PATH:/usr/lib/rstudio-server/bin | ||
| rsession --standalone=1 \ |
Comment on lines
+94
to
+97
|
|
||
| echo "session-default-working-dir=/home/jupyter" >> /etc/rstudio/rsession.conf | ||
| echo "session-default-new-project-dir=/home/jupyter" >> /etc/rstudio/rsession.conf | ||
|
|
Comment on lines
+41
to
+42
| ENV PASSWORD="bioc" | ||
|
|
| 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" |
Comment on lines
+9
to
+22
| COPY scripts/install_R_source.sh /rocker_scripts/install_R_source.sh | ||
| RUN /rocker_scripts/install_R_source.sh | ||
|
|
||
| ENV CRAN="https://cloud.r-project.org" | ||
| ENV LANG=en_US.UTF-8 | ||
|
|
||
| COPY scripts/bin/ /rocker_scripts/bin/ | ||
| COPY scripts/setup_R.sh /rocker_scripts/setup_R.sh | ||
| RUN <<EOF | ||
| if grep -q "1000" /etc/passwd; then | ||
| userdel --remove "$(id -un 1000)"; | ||
| fi | ||
| /rocker_scripts/setup_R.sh | ||
| EOF |
Comment on lines
+1
to
+4
| FROM us.gcr.io/broad-dsp-gcr-public/terra-base:1.0.0 | ||
|
|
||
| USER root | ||
|
|
Comment on lines
+1
to
+5
| "Env": [ | ||
| "PATH=/opt/venv/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin", | ||
| "NVARCH=x86_64", | ||
| "NVIDIA_REQUIRE_CUDA=cuda>=12.6 brand=unknown,driver>=470,driver<471 brand=grid,driver>=470,driver<471 brand=tesla,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=vapps,driver>=470,driver<471 brand=vpc,driver>=470,driver<471 brand=vcs,driver>=470,driver<471 brand=vws,driver>=470,driver<471 brand=cloudgaming,driver>=470,driver<471 brand=unknown,driver>=535,driver<536 brand=grid,driver>=535,driver<536 brand=tesla,driver>=535,driver<536 brand=nvidia,driver>=535,driver<536 brand=quadro,driver>=535,driver<536 brand=quadrortx,driver>=535,driver<536 brand=nvidiartx,driver>=535,driver<536 brand=vapps,driver>=535,driver<536 brand=vpc,driver>=535,driver<536 brand=vcs,driver>=535,driver<536 brand=vws,driver>=535,driver<536 brand=cloudgaming,driver>=535,driver<536 brand=unknown,driver>=550,driver<551 brand=grid,driver>=550,driver<551 brand=tesla,driver>=550,driver<551 brand=nvidia,driver>=550,driver<551 brand=quadro,driver>=550,driver<551 brand=quadrortx,driver>=550,driver<551 brand=nvidiartx,driver>=550,driver<551 brand=vapps,driver>=550,driver<551 brand=vpc,driver>=550,driver<551 brand=vcs,driver>=550,driver<551 brand=vws,driver>=550,driver<551 brand=cloudgaming,driver>=550,driver<551", | ||
| "NV_CUDA_CUDART_VERSION=12.6.77-1", |
Comment on lines
+5
to
+16
| git clone https://github.com/Syllo/nvtop.git | ||
| cd nvtop | ||
| # Pin to a specific known-good version to ensure reproducible builds | ||
| git checkout v3.0.0 | ||
| mkdir -p build && cd build | ||
| cmake .. -DNVML_RETRIEVE_HEADER_ONLINE=True | ||
| make | ||
| make install | ||
| cd ../.. | ||
|
|
||
| # Clean up | ||
| rm -rf /var/lib/apt/lists/* nvtop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dockerfile and scripts in this branch create R 4.6.0 and can install Bioconductor 3.23. Rstudio starts up but we have seen problems:
