Skip to content

Repository files navigation

Bioc2u (beta): Ubuntu Binaries for Bioconductor packages

This project aims to extend r2u, in hopes of providing a repository of Ubuntu binaries via apt for all Bioconductor packages.

Bioc2u is currently available for Ubuntu Jammy (22.04) and Noble (24.04) and is still in beta development.

Container Images

We provide two types of container images for different use cases:

  • User containers (bioc2u-user): Minimal environment built on ubuntu:jammy or ubuntu:noble with R, BiocManager, and bioc2u/r2u repositories pre-configured
  • Builder containers (bioc2u-builder): Extended environment based on r2u containers with additional build tools for package development

Available Tags

Container images are available with multiple tagging formats:

  • Ubuntu version: jammy, noble
  • Ubuntu version with R: jammy-r-4.6.1, noble-r-4.6.1
  • Ubuntu version with Bioconductor: jammy-bioc-3.23, noble-bioc-3.23
  • Full version: jammy-bioc-3.23-r-4.6.1, noble-bioc-3.23-r-4.6.1
  • OS version: 22.04, 24.04 (corresponding to Ubuntu versions)
  • OS version with R/Bioc: eg 22.04-r-4.6.1, 24.04-bioc-3.23, 24.04-bioc-3.23-r-4.6.1

Version Strategy and Backward Compatibility

This design allows for old versions to remain accessible by default, under the full tags. For example: when R 4.6.2 comes out, the containers tagged simply jammy-bioc-3.23 become jammy-bioc-3.23-r-4.6.2 but the previous container remains accessible under jammy-bioc-3.23-r-4.6.1. When containers get rebuilt within the same version, old containers can still be used via their hash in the ghcr.io/bioconductor/bioc2u-user@sha256:[hash] format.

This ensures reproducibility by allowing users to pin to specific versions or use the latest versions through the shorter tag names.

The two image types pick up a new R differently. The user containers install R from the CRAN apt repository at build time, so they follow it automatically. The builder containers are built on a pinned r2u base image (R_VERSION in builder.Dockerfile, passed from the workflow matrix), so they only move to a new R when that is bumped.

Documentation

This page covers using bioc2u. For maintaining, deploying or adapting it, start at the documentation index:

build/README.md The build stack — producing the .deb packages and publishing them
docs/architecture.md How the pieces fit together, and how build/ relates to the container images
docs/deployment.md Using bioc2u, building the container images, running your own apt repository
docs/operations.md Publishing a build, the BiocVersion seed, the tagging scheme, health checks, backups
docs/updating.md Release, R, Ubuntu and base image updates: cadence, procedure, rollback
docs/troubleshooting.md Symptom → cause → fix, for users and maintainers
docs/security.md The signing key, the apt pin, and what installing from this repository means
docs/examples/ Worked setups: Dockerfile, CI, bare machine, pinning, build host

Getting started

Using Docker containers

For a minimal R environment with bioc2u pre-configured:

# Ubuntu Jammy (22.04) - latest versions
docker run --rm -it ghcr.io/bioconductor/bioc2u-user:jammy

# Ubuntu Noble (24.04) - latest versions
docker run --rm -it ghcr.io/bioconductor/bioc2u-user:noble

# Specific Bioconductor/R versions for reproducibility
docker run --rm -it ghcr.io/bioconductor/bioc2u-user:jammy-bioc-3.23-r-4.6.1

For package development with build tools:

# Builder container with development tools
docker run --rm -it ghcr.io/bioconductor/bioc2u-builder:jammy

Local installation

In an Ubuntu environment (eg in containers based on ubuntu:jammy and ubuntu:noble), you may use the apt_setup.sh script which will set up the Bioc2u apt repository and install R, and basic packages such as BiocManager. This script leverages the r2u setup scripts from the r2u repository to configure the CRAN apt repository.

# Install curl if missing
sudo apt update -qq
sudo apt install -y --no-install-recommends curl ca-certificates
# Run apt script with specific Bioconductor version
curl https://raw.githubusercontent.com/Bioconductor/bioc2u/devel/apt_setup.sh | sudo bash -s 3.23

In a container based on ubuntu:jammy or ubuntu:noble, which runs as root and has no sudo, run the same commands without sudo.

After the initial setup, you may use apt or install.packages() freely. Installing packages through apt can be done in any shell session, by using the r-bioc- prefix and the all-lowercase name of the package, eg sudo apt install -y r-bioc-genomicranges. You may alternatively continue to use R traditionally, as you would in any other environment, and observe the speedup resulting from R using the apt package manager under the hood.

Uninstalling

The uninstall.sh script reverses apt_setup.sh:

curl -O https://raw.githubusercontent.com/Bioconductor/bioc2u/devel/uninstall.sh
sudo bash uninstall.sh            # remove the bioc2u repository configuration
sudo bash uninstall.sh --purge    # also remove installed r-bioc-* packages
sudo bash uninstall.sh --all      # also remove the r2u/CRAN apt layer and bspm setup

By default, installed packages are kept and keep working; they stop receiving updates from the removed repository. --all additionally reverses the r2u/CRAN layer set up by the r2u scripts (both the jammy and noble file layouts are handled) and removes the bspm lines from Rprofile.site. On jammy, r2u's script also adds two keys to /etc/apt/trusted.gpg with apt-key, which --all leaves in place; remove them with sudo apt-key del 67C2D66C4B1D4339 and sudo apt-key del 51716619E084DAB9. R itself is never removed by the script — use sudo apt remove r-base-core for that. Containers need no uninstall: remove the container and image instead (docker rmi ghcr.io/bioconductor/bioc2u-user:noble).

Upgrading to a new Bioconductor release

Check first that the new release has been published to the repository (it is built after a release is cut, not on the same day): after sudo apt update, apt-cache policy r-bioc-biocversion shows a candidate that starts with the new version, eg 3.24. Then:

  • Containers: pull the new release's tag, eg docker pull ghcr.io/bioconductor/bioc2u-user:noble-bioc-<release>-r-<R>. Previous full tags remain available, so existing pinned setups are unaffected.
  • Native installs: re-run the setup with the new version, then upgrade in place:
curl https://raw.githubusercontent.com/Bioconductor/bioc2u/devel/apt_setup.sh | sudo bash -s <release>   # re-points BiocManager and refreshes R
sudo apt full-upgrade                  # moves installed packages to the new release's builds
Rscript -e 'BiocManager::valid()'      # flags anything left behind

Re-running the setup adds its repository line a second time, which apt reports as configured multiple times; see troubleshooting.

To compare before and after, record the package versions: dpkg -l 'r-bioc-*' 'r-cran-*' > versions.txt.

Building the packages

The .deb packages served by the repository are produced by the build stack in build/, which runs the whole Bioconductor package graph through the bioc2u-builder containers with Docker Compose:

cd build
docker compose up        # builds jammy and noble

See build/README.md for configuration, resuming an interrupted run, and publishing the result with deb-s3.

Automated Builds

Container images are automatically built every 2 days and pushed to GitHub Container Registry (GHCR). The build process:

  • Builds both user and builder containers for Ubuntu Jammy and Noble
  • Builds linux/amd64 images, and linux/arm64 for Noble
  • Automatically extracts R and OS version information for comprehensive tagging
  • Creates multi-platform manifests with various tag combinations

Acknowledgments

This project builds upon and extends the r2u project. Our apt_setup.sh script directly uses the r2u setup scripts to configure the CRAN apt repository, and our builder containers are based on the r2u containers.

About

Building containers and holding some code for bioc2u, an attempt at extending r2u to all bioc packages, and provide precompiled binaries for ubuntu systems

Resources

Security policy

Stars

6 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages