Skip to content

Add v3 r and rstudio images with R 4.5.3 and updated packages#195

Open
remlapmot wants to merge 15 commits intoopensafely-core:mainfrom
remlapmot:create-v3
Open

Add v3 r and rstudio images with R 4.5.3 and updated packages#195
remlapmot wants to merge 15 commits intoopensafely-core:mainfrom
remlapmot:create-v3

Conversation

@remlapmot
Copy link
Copy Markdown
Contributor

@remlapmot remlapmot commented Mar 18, 2026

Paging @bloodearnest

R 4.5.3, which according to the R-Core team will be the last patch release of R 4.5 https://stat.ethz.ch/pipermail/r-announce/2026/000718.html, was released last week on the 11th March. So I'd say it makes sense to have v3 r and rstudio images including that - which is what this does (and the v2 image is about 1 year old now - which is my personal limit for R related stuff).

The v3 additions are essentially a copy of what we do for v2 with the updated R and updated CRAN_DATE:

  • The updated CRAN_DATE gets us the current versions of the packages notably including ggplot2 version 4.
  • In a few places I've had to generalise the code to swap a hardcoded v2 for using the MAJOR_VERSION env var.
  • Comparing the number of R packages - v2 has 544 - v3 has 540 (due to different dependency requirements). I think the only notable difference is that on the new v3 CRAN_DATE the parglm R package is no longer available on CRAN https://cran.r-project.org/package=parglm, and the parglm GitHub repo has been untouched for 5 years https://github.com/boennecd/parglm, so in v3 I have replaced parglm with the fastglm package https://cran.r-project.org/package=fastglm.
  • And I realised we never switched from the netlib BLAS/LAPACK to the faster OpenBLAS and its LAPACK - I've made that switch in v3 - running sessionInfo() this is reported in the following lines
    ❯ docker run -it --rm --platform linux/amd64 r:v3
    
    R version 4.5.3 (2026-03-11) -- "Reassured Reassurer"
    Copyright (C) 2026 The R Foundation for Statistical Computing
    Platform: x86_64-pc-linux-gnu
    
    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type 'license()' or 'licence()' for distribution details.
    
    R is a collaborative project with many contributors.
    Type 'contributors()' for more information and
    'citation()' on how to cite R or R packages in publications.
    
    Type 'demo()' for some demos, 'help()' for on-line help, or
    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.
    
    > sessionInfo()
    R version 4.5.3 (2026-03-11)
    Platform: x86_64-pc-linux-gnu
    Running under: Ubuntu 22.04.5 LTS
    
    Matrix products: default
    BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
    LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
    
  • I also bumped the version of rstudio-server in v2.

As usual there was a nice summary of what's new in R 4.5 by Jumping Rivers https://www.jumpingrivers.com/blog/whats-new-r45/.

I don't believe I touched anything to do with v1 - so its epic 2hr build should still run. I have run the v2 and v3 r and rstudio builds and tests locally.

Maybe the opensafely CLI would need checking to see if it allows r:v3 and rstudio:v3?

Also - remember I have no permissions - so I can't formally 'request review' - and you'll have to trigger CI builds etc.

Add v3 dependencies for httpgd via unigd
Remove parglm from v3 as no longer on CRAN. parglm was archived on CRAN on 2026-01-29. I believe that fastglm is its closest replacement on CRAN on the v3 CRAN_DATE.
Only run `just check` for v2 and v3 since packages.toml does not exist for v1

Allow for v3 in else condition

Protect against v#/pkg.lock file not existing on first run
And pass version to `just check` in CI
Use MAJOR_VERSION instead of hardcoded v2

Create .local_pkg_dir object as a hidden object - as its name begins with a dot.

Convert local-packages-README.md to Rmd to pass version

Delete typo

Amends for v3 when writing package list
Add MAJOR_VERSION ENV for rprofile-site-append-2.R

Ensure MAJOR_VERSION is available to R and rstudio-server
Amend hardcoded v2 to use MAJOR_VERSION environment variable

In tests/test-loading-packages.R issue a more informative message (which
will likely reveal which runtime system dependency package is missing)
if a package fails to load
Since OpenBLAS (which includes its own LAPACK) is typically 4–6× faster
for linear algebra operations than the reference netlib BLAS/LAPACK that
Debian ships by default.
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