Skip to content

feat: Speed up R builds#67

Merged
m1so merged 2 commits intomainfrom
mb/speed-up-r-builds
Jan 25, 2026
Merged

feat: Speed up R builds#67
m1so merged 2 commits intomainfrom
mb/speed-up-r-builds

Conversation

@m1so
Copy link
Contributor

@m1so m1so commented Jan 23, 2026

Summary by CodeRabbit

  • Chores
    • Switched R package installs to the Posit Package Manager CRAN mirror for faster, more reliable binary installs (including IR kernel setup).
    • Consolidated per-package R installs into a single, parameterized bulk installation and simplified OS package flow to streamline builds and improve maintainability.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

Two Dockerfiles updated to change how R packages are installed. ir/ir-base/Dockerfile.ir now installs IRkernel from the Posit Package Manager CRAN mirror and calls IRkernel::installspec(). ir/ir-with-libs/Dockerfile.ir replaces many per-package R install commands with environment variables CRAN_REPO and R_PACKAGES and a single R -e invocation to install all packages, and consolidates apt-get into a single update/install/clean sequence while removing explicit per-package installation blocks.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Speed up R builds' directly matches the main changes: both Dockerfiles now use Posit Package Manager for faster installations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@ir/ir-with-libs/Dockerfile.ir`:
- Around line 66-78: The Dockerfile removes Java runtime when purging
${BUILDDEPS}, breaking rJava at runtime; ensure a JRE package remains by
installing default-jre-headless separately and not removing it: add
default-jre-headless to the apt-get install step (outside of ${BUILDDEPS}) or
install it in the same RUN before the apt-get remove --purge -y ${BUILDDEPS}
line, and keep the apt-get remove call targeting only ${BUILDDEPS} so
default-jre-headless (needed by rJava) is preserved.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@ir/ir-with-libs/Dockerfile.ir`:
- Around line 50-52: The CRAN repo is set to a moving "latest" snapshot via the
ENV CRAN_REPO variable; replace that value with a dated Posit Package Manager
snapshot URL to pin binaries for reproducible builds (update the ENV CRAN_REPO
entry in Dockerfile.ir to a specific snapshot date, e.g. use the Posit snapshot
path with a YYYY-MM-DD segment instead of "latest"). Ensure the ENV CRAN_REPO
assignment is updated wherever it appears so builds use the fixed dated
snapshot.
♻️ Duplicate comments (1)
ir/ir-with-libs/Dockerfile.ir (1)

66-81: rJava will miss a runtime Java after purge.
default-jdk is removed with ${BUILDDEPS}, leaving no JRE for rJava. Keep a runtime JRE outside the purge.

🔧 Minimal fix
+ENV RUNTIME_DEPS="default-jre-headless"
 RUN apt-get update \
-  && apt-get install -y ${BUILDDEPS} \
+  && apt-get install -y ${RUNTIME_DEPS} ${BUILDDEPS} \
   && R -e " \
     options( \
       Ncpus = 4, \
       HTTPUserAgent = sprintf('R/%s R (%s)', getRversion(), paste(getRversion(), R.version['platform'], R.version['arch'], R.version['os'])) \
     ); \
     install.packages( \
       strsplit(Sys.getenv('R_PACKAGES'), '\\\\s+')[[1]], \
       repos = Sys.getenv('CRAN_REPO'), \
       dependencies = TRUE \
     ) \
   " \
   && apt-get clean \
   && apt-get remove --purge -y ${BUILDDEPS} \
   && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

@m1so m1so marked this pull request as ready for review January 25, 2026 11:42
@m1so m1so merged commit 8cab3f8 into main Jan 25, 2026
26 checks passed
@m1so m1so deleted the mb/speed-up-r-builds branch January 25, 2026 11:49
@m1so m1so mentioned this pull request Jan 25, 2026
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.

1 participant

Comments