Skip to content

build: remove R dependencies from stats image - #56

Merged
malteos merged 1 commit into
masterfrom
feat/remove-r-from-image
Sep 23, 2026
Merged

malteos merged 1 commit into
masterfrom
feat/remove-r-from-image

Conversation

@malteos

@malteos malteos commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Since #25 replaced ggplot2 with matplotlib and #26 made matplotlib the default plot library, the R toolchain in the stats image has been dead weight. This PR removes it.

  • stats.Dockerfile: drop r-base, r-cran-ggplot2 and python3-rpy2; merge the two apt layers so rm -rf /var/lib/apt/lists/* takes effect; add --no-install-recommends and pip --no-cache-dir.
  • requirements_plot.txt: drop rpy2 (needs R to build) and the deprecated ggplot package.

git, jq, awscli, graphviz-dev (pygraphviz) and the fonts used by matplotlib are kept. No Python code is changed; the rpy2.ggplot2 branches are lazily imported and never run with PLOTLIB=matplotlib.

Image size

Local podman builds of the same commit (linux/arm64, uncompressed):

Image Size
before (master) 5.67 GB
after (this PR) 1.75 GB

Verification

  • No R/Rscript in the image; pip list shows no rpy2/ggplot; matplotlib, pandas, pygraphviz, fsspec import fine; Liberation Sans is resolved by matplotlib.
  • Unit tests pass inside the image (python -m pytest -s tests/, as in CI).
  • Ran the full get_stats_and_plot.sh pipeline over all 128 crawls in both the old and the new image. All 30 PNGs and every CSV/HTML/MD output are byte-identical to the committed files.

The plots have been generated with matplotlib since #25 and #26 made it
the default. Drop r-base, r-cran-ggplot2 and python3-rpy2 from the apt
install and rpy2/ggplot from requirements_plot.txt, merge the apt layers
so the list cleanup takes effect, and skip the pip cache.

Image size (local build): 5.67 GB -> 1.75 GB

@sebastian-nagel sebastian-nagel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 Thanks, @malteos!

@malteos
malteos merged commit 57a3c6c into master Sep 23, 2026
2 checks passed
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