Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3c999e6
add additional build dependencies in Dockerfile: libstdc++-dev and li…
matteodelucchi Sep 12, 2025
1cfc0e2
update Dockerfile to replace libc++-dev with libc6-dev and adjust C++…
matteodelucchi Sep 12, 2025
5ce49a5
update Dockerfile to replace libstdc++-dev with libstdc++-13-dev for …
matteodelucchi Sep 12, 2025
837cb89
add R-hub container mapping to workflows and update Dockerfiles to us…
matteodelucchi Sep 12, 2025
74d37ac
remove unnecessary dependencies from Dockerfile: libstdc++-13-dev and…
matteodelucchi Sep 12, 2025
3c3bc5f
update R-hub container mapping for fedora
matteodelucchi Sep 12, 2025
d280ba9
update Dockerfile to dynamically set CRAN repository based on R insta…
matteodelucchi Sep 12, 2025
0620fe6
update workflows to use Fedora gcc13 for clang builds and add warning…
matteodelucchi Sep 12, 2025
655fc3e
add libfontconfig1-dev and fontconfig-devel to Dockerfiles for depend…
matteodelucchi Sep 12, 2025
7c2435b
update r-hub image to gcc15 for clang builds and adjust warning message
matteodelucchi Sep 12, 2025
f6c799c
moved installtion of libxml2-dev to an earlier step in the Dockerfile
matteodelucchi Sep 12, 2025
60e2977
fixed correct indentation for libxml2-devel installation in Dockerfile
matteodelucchi Sep 12, 2025
9e9733a
add harfbuzz and fribidi development packages to Dockerfiles for impr…
matteodelucchi Sep 12, 2025
95b80a8
update r-hub image to gcc15 for clang builds and adjust warning message
matteodelucchi Sep 12, 2025
058ee7a
add additional development packages for ragg
matteodelucchi Sep 12, 2025
2a1fd9d
set default compiler to gcc and target OS to fedora for clang builds …
matteodelucchi Sep 12, 2025
6474a9c
exclude fedora with clang compiler in workflow configurations
matteodelucchi Sep 15, 2025
1db3e7b
in build strategy, exclude clang compiler on fedora in workflow confi…
matteodelucchi Sep 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/create-publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ jobs:
r-version: 'release'
- target-os: 'fedora'
r-version: 'patched'
- target-os: 'fedora'
compiler: 'clang' # no clang on fedora (see build map to r-hub images)
- compiler: 'clang'
r-version: 'patched'
- compiler: 'clang'
Expand Down Expand Up @@ -90,6 +92,49 @@ jobs:
# run: |
# echo "${{ secrets.DEVEL_ABN_DEPLOY }}" >> ssh_key
# shell: bash
- name: Map to R-hub container names
id: rhub-mapping
run: |
# Map CRAN-style naming to R-hub container names
# Based on https://r-hub.github.io/containers/ and https://cran.r-project.org/web/checks/check_flavors.html#r-devel-linux-x86_64-fedora-clang

TARGET_OS="${{ matrix.target-os }}"
COMPILER="${{ matrix.compiler }}"
R_VERSION="${{ matrix.r-version }}"

echo "Input: ${TARGET_OS}/${COMPILER}/${R_VERSION}"

# Default fallback
RHUB_IMAGE="ubuntu-clang"

# Map debian combinations
if [[ "$TARGET_OS" == "debian" ]]; then
if [[ "$COMPILER" == "clang" && "$R_VERSION" == "devel" ]]; then
RHUB_IMAGE="ubuntu-clang"
elif [[ "$COMPILER" == "gcc" && "$R_VERSION" == "devel" ]]; then
RHUB_IMAGE="ubuntu-gcc12"
elif [[ "$R_VERSION" == "release" ]]; then
RHUB_IMAGE="ubuntu-release"
elif [[ "$R_VERSION" == "patched" ]]; then
RHUB_IMAGE="ubuntu-next"
fi
# Map fedora combinations
elif [[ "$TARGET_OS" == "fedora" ]]; then
# Note: R-hub doesn't have direct fedora equivalents for primary CRAN containers
# Map to closest Ubuntu equivalents or specific Fedora containers
if [[ "$COMPILER" == "gcc" && "$R_VERSION" == "devel" ]]; then
RHUB_IMAGE="gcc15" # Use Fedora-based gcc15 container
elif [[ "$COMPILER" == "clang" && "$R_VERSION" == "devel" ]]; then
RHUB_IMAGE="gcc15" # No Fedora clang equivalent, use Fedora gcc15
echo "Warning: No direct Fedora clang equivalent on r-hub, using gcc15"
fi
# Map valgrind
elif [[ "$TARGET_OS" == "valgrind" ]]; then
RHUB_IMAGE="valgrind"
fi

echo "Mapped to R-hub image: rhub/${RHUB_IMAGE}"
echo "rhub-image=${RHUB_IMAGE}" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
Expand All @@ -101,6 +146,7 @@ jobs:
TARGET_OS=${{ matrix.target-os }}
COMPILER=${{ matrix.compiler }}
R_VERSION=${{ matrix.r-version }}
RHUB_IMAGE=${{ steps.rhub-mapping.outputs.rhub-image }}
PACKAGE_PATH=${{ env.PACKAGE_PATH}}
REPO_PATH=${{ env.REPO_PATH }}
JAGS=${{ env.JAGS }}
Expand Down Expand Up @@ -130,6 +176,8 @@ jobs:
r-version: 'release'
- target-os: 'fedora'
r-version: 'patched'
- target-os: 'fedora'
compiler: 'clang' # no clang on fedora (see build map to r-hub images))
- compiler: 'clang'
r-version: 'patched'
- compiler: 'clang'
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/onlabel_check_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
r-version: 'release'
- target-os: 'fedora'
r-version: 'patched'
- target-os: 'fedora'
compiler: 'clang' # no clang on fedora (see build map to r-hub images)
- compiler: 'clang'
r-version: 'patched'
- compiler: 'clang'
Expand Down Expand Up @@ -77,6 +79,49 @@ jobs:
# run: |
# echo "${{ secrets.DEVEL_ABN_DEPLOY }}" >> ssh_key
# shell: bash
- name: Map to R-hub container names
id: rhub-mapping
run: |
# Map CRAN-style naming to R-hub container names
# Based on https://r-hub.github.io/containers/ and https://cran.r-project.org/web/checks/check_flavors.html#r-devel-linux-x86_64-fedora-clang

TARGET_OS="${{ matrix.target-os }}"
COMPILER="${{ matrix.compiler }}"
R_VERSION="${{ matrix.r-version }}"

echo "Input: ${TARGET_OS}/${COMPILER}/${R_VERSION}"

# Default fallback
RHUB_IMAGE="ubuntu-clang"

# Map debian combinations
if [[ "$TARGET_OS" == "debian" ]]; then
if [[ "$COMPILER" == "clang" && "$R_VERSION" == "devel" ]]; then
RHUB_IMAGE="ubuntu-clang"
elif [[ "$COMPILER" == "gcc" && "$R_VERSION" == "devel" ]]; then
RHUB_IMAGE="ubuntu-gcc12"
elif [[ "$R_VERSION" == "release" ]]; then
RHUB_IMAGE="ubuntu-release"
elif [[ "$R_VERSION" == "patched" ]]; then
RHUB_IMAGE="ubuntu-next"
fi
# Map fedora combinations
elif [[ "$TARGET_OS" == "fedora" ]]; then
# Note: R-hub doesn't have direct fedora equivalents for primary CRAN containers
# Map to closest Ubuntu equivalents or specific Fedora containers
if [[ "$COMPILER" == "gcc" && "$R_VERSION" == "devel" ]]; then
RHUB_IMAGE="gcc15" # Use Fedora-based gcc15 container
elif [[ "$COMPILER" == "clang" && "$R_VERSION" == "devel" ]]; then
RHUB_IMAGE="gcc15" # No Fedora clang equivalent, use Fedora gcc15
echo "Warning: No direct Fedora clang equivalent on r-hub, using gcc15"
fi
# Map valgrind
elif [[ "$TARGET_OS" == "valgrind" ]]; then
RHUB_IMAGE="valgrind"
fi

echo "Mapped to R-hub image: rhub/${RHUB_IMAGE}"
echo "rhub-image=${RHUB_IMAGE}" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
Expand All @@ -88,6 +133,7 @@ jobs:
TARGET_OS=${{ matrix.target-os }}
COMPILER=${{ matrix.compiler }}
R_VERSION=${{ matrix.r-version }}
RHUB_IMAGE=${{ steps.rhub-mapping.outputs.rhub-image }}
PACKAGE_PATH=${{ env.PACKAGE_PATH}}
REPO_PATH=${{ env.REPO_PATH }}
JAGS=${{ env.JAGS }}
Expand Down Expand Up @@ -119,6 +165,8 @@ jobs:
r-version: 'release'
- target-os: 'fedora'
r-version: 'patched'
- target-os: 'fedora'
compiler: 'clang' # no clang on fedora (see build map to r-hub images))
- compiler: 'clang'
r-version: 'patched'
- compiler: 'clang'
Expand Down
37 changes: 30 additions & 7 deletions containers/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
ARG TARGET_OS
ARG COMPILER
ARG R_VERSION
ARG RHUB_IMAGE=ubuntu-clang

FROM rhub/${TARGET_OS}-${COMPILER}-${R_VERSION}
# Use the mapped R-hub image name from the workflow
FROM rhub/${RHUB_IMAGE}

# Build stage: ARGs need to be redeclared
ARG TARGET_OS
Expand All @@ -19,16 +21,36 @@ ARG REPO_PATH
RUN apt-get update --allow-releaseinfo-change && apt-get install -y --no-install-recommends \
libssl-dev \
libcurl4-openssl-dev \
gfortran
gfortran \
libfontconfig1-dev \
libxml2-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
libwebp-dev

# add R to PATH
# NOTE: For R-release this is not needed
ENV PATH="/opt/R-$R_VERSION/bin:${PATH}"

# Configure clang C++ compilation environment
ENV CPLUS_INCLUDE_PATH="/usr/include/c++/13:/usr/include/x86_64-linux-gnu/c++/13"
ENV C_INCLUDE_PATH="/usr/include"

# ENV PATH "$PATH:/opt/R-devel/bin/"
# Set a mirror for CRAN
RUN if [ "$R_VERSION" = "release" ]; then RPATH=""; else RPATH=/opt/R-$R_VERSION; fi \
&& echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' >> ${RPATH}/lib/R/library/base/R/Rprofile
# Find where R is installed and set the CRAN repository
RUN R_HOME=$(R RHOME) && \
if [ -d "${R_HOME}/library/base/R" ]; then \
echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' >> ${R_HOME}/library/base/R/Rprofile; \
elif [ -d "${R_HOME}/etc" ]; then \
echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' >> ${R_HOME}/etc/Rprofile.site; \
else \
echo "Warning: Could not find R profile location, skipping CRAN mirror setup"; \
fi

# Get and install packages for local debugging
RUN R -e "install.packages('devtools')" \
Expand Down Expand Up @@ -81,9 +103,6 @@ RUN R -e "install.packages('INLA',repos=c(getOption('repos'),INLA='https://inla.
# - Magick++
RUN apt-get update --allow-releaseinfo-change && apt-get install -y --no-install-recommends \
libmagick++-dev
# - libxml-2.0
RUN apt-get update --allow-releaseinfo-change && apt-get install -y --no-install-recommends \
libxml2-dev
# glmmTMB:
RUN R -e "install.packages('glmmTMB')" # Workaround for glmmTMB installation issue. Should be installed automatically below in the future.
###
Expand All @@ -100,3 +119,7 @@ WORKDIR target/
# Install all dependencies of PACKAGE_NAME but not the package it self
RUN R -e "renv::deactivate()"
RUN R -e "package<-desc::desc()\$get_field('Package');pckgs<-unique(renv::dependencies('$PACKAGE_PATH')[,'Package']);pres_pckgs<-installed.packages()[,'Package'];install.packages(pckgs[!(pckgs %in% pres_pckgs) & !(pckgs == package)])"

# Check if the dependencies were installed correctly
RUN R -e "renv::deactivate()"
RUN R -e "package<-desc::desc()\$get_field('Package');pckgs<-unique(renv::dependencies('$PACKAGE_PATH')[,'Package']);pres_pckgs<-installed.packages()[,'Package'];if(any(!(pckgs %in% pres_pckgs) & !(pckgs == package))) { stop(paste0('Some dependencies were not installed correctly. Missing: ', paste(pckgs[!(pckgs %in% pres_pckgs) & !(pckgs == package)], collapse=', '))) } else { cat('All dependencies were installed correctly.\n') }"
30 changes: 22 additions & 8 deletions containers/fedora/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
ARG TARGET_OS
ARG COMPILER
ARG R_VERSION
ARG RHUB_IMAGE=ubuntu-gcc12

FROM rhub/${TARGET_OS}-${COMPILER}-${R_VERSION}
# Use the mapped R-hub image name from the workflow
FROM rhub/${RHUB_IMAGE}

# Build stage: ARGs need to be redeclared
ARG TARGET_OS
Expand All @@ -19,16 +21,31 @@ ARG JAGS
# Update package repositories
RUN dnf check-update && dnf -y install \
openssl-devel \
libcurl-devel
libcurl-devel \
fontconfig-devel \
libxml2-devel \
harfbuzz-devel \
fribidi-devel \
freetype-devel \
libpng-devel \
libtiff-devel \
libjpeg-devel \
libwebp-devel

# add R to PATH
ENV PATH="/opt/R-$R_VERSION/bin:${PATH}"

# diff to debian: /lib/ > /lib64/
# ENV PATH "$PATH:/opt/R-devel/bin/"
# Set a mirror for CRAN
RUN if [ "$R_VERSION" = "release" ]; then RPATH=""; else RPATH=/opt/R-$R_VERSION; fi \
&& echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' >> ${RPATH}/lib64/R/library/base/R/Rprofile
# Find where R is installed and set the CRAN repository
RUN R_HOME=$(R RHOME) && \
if [ -d "${R_HOME}/library/base/R" ]; then \
echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' >> ${R_HOME}/library/base/R/Rprofile; \
elif [ -d "${R_HOME}/etc" ]; then \
echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' >> ${R_HOME}/etc/Rprofile.site; \
else \
echo "Warning: Could not find R profile location, skipping CRAN mirror setup"; \
fi

# rjags:
RUN dnf -y install \
Expand Down Expand Up @@ -95,9 +112,6 @@ RUN R -e "install.packages('INLA',repos=c(getOption('repos'),INLA='https://inla.
# - Magick++
RUN dnf -y install \
ImageMagick-c++-devel
# - libxml-2.0
RUN dnf -y install \
libxml2-devel

###
# install all package dependencies
Expand Down
8 changes: 4 additions & 4 deletions containers/valgrind/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
ARG TARGET_OS
ARG COMPILER
ARG R_VERSION
ARG RHUB_IMAGE=valgrind

# For the valgrind container, target_os, compiler and r_vresion are not specified
# Hovever, the valgrind container is fedora, gcc, devel
# For the valgrind container, target_os, compiler and r_version are not specified
# However, the valgrind container is fedora, gcc, devel
# see https://r-hub.github.io/containers/containers.html#valgrind
# FROM rhub/${TARGET_OS}
FROM ghcr.io/r-hub/containers/valgrind:latest
FROM rhub/${RHUB_IMAGE}

# Build stage: ARGs need to be redeclared
ARG TARGET_OS
Expand Down