From 1d06a52221eb41d4c50c5b383b4afcc12e3a17ab Mon Sep 17 00:00:00 2001 From: pat-s Date: Tue, 3 Jun 2025 22:04:09 +0200 Subject: [PATCH] refactor: containerfile setups --- .crow/images.yaml | 47 ++++++------- Justfile | 32 +++++++-- ...erfile-alpine-321 => Containerfile-alpine} | 21 +++--- docker/Containerfile-alpine-320 | 69 ------------------- docker/Containerfile-alpine-322 | 69 ------------------- docker/Containerfile-alpine-jags | 11 +++ docker/Containerfile-redhat | 68 ++++++++++++++++++ docker/Containerfile-redhat-8 | 62 ----------------- docker/Containerfile-redhat-9 | 61 ---------------- docker/Containerfile-redhat-jags | 13 ++++ ...rfile-ubuntu-2204 => Containerfile-ubuntu} | 45 +++++++----- docker/Containerfile-ubuntu-2404 | 59 ---------------- docker/Containerfile-ubuntu-jags | 7 ++ 13 files changed, 184 insertions(+), 380 deletions(-) rename docker/{Containerfile-alpine-321 => Containerfile-alpine} (78%) delete mode 100644 docker/Containerfile-alpine-320 delete mode 100644 docker/Containerfile-alpine-322 create mode 100644 docker/Containerfile-alpine-jags create mode 100644 docker/Containerfile-redhat delete mode 100644 docker/Containerfile-redhat-8 delete mode 100644 docker/Containerfile-redhat-9 create mode 100644 docker/Containerfile-redhat-jags rename docker/{Containerfile-ubuntu-2204 => Containerfile-ubuntu} (52%) delete mode 100644 docker/Containerfile-ubuntu-2404 create mode 100644 docker/Containerfile-ubuntu-jags diff --git a/.crow/images.yaml b/.crow/images.yaml index a835749..35491ca 100644 --- a/.crow/images.yaml +++ b/.crow/images.yaml @@ -4,27 +4,23 @@ when: matrix: include: - # - PLATFORM: redhat-9 - # ARCH: arm64 - # - PLATFORM: redhat-9 - # ARCH: amd64 - # - PLATFORM: redhat-8 - # ARCH: arm64 - # - PLATFORM: redhat-8 - # ARCH: amd64 - # - PLATFORM: ubuntu-2404 - # ARCH: arm64 - # - PLATFORM: ubuntu-2404 - # ARCH: amd64 - # - PLATFORM: ubuntu-2204 - # ARCH: arm64 - # - PLATFORM: ubuntu-2204 - # ARCH: amd64 - # - PLATFORM: alpine-321 - # ARCH: arm64 - # - PLATFORM: alpine-321 - # ARCH: amd64 - - PLATFORM: alpine-322 + - OS: redhat + OS_VERSION: 8 + R_VERSION: 4.4.3 + - OS: redhat + OS_VERSION: 9 + R_VERSION: 4.4.3 + - OS: ubuntu + OS_VERSION: jammy + R_VERSION: 4.4.3 + - OS: ubuntu + OS_VERSION: noble + R_VERSION: 4.4.3 + - OS: alpine + OS_VERSION: 3.21 + R_VERSION: 4.4.3 + - OS: alpine + OS_VERSION: 3.22 R_VERSION: 4.5.0 steps: @@ -33,9 +29,9 @@ steps: settings: mtu: 1350 platforms: linux/amd64,linux/arm64 - Dockerfile: docker/Containerfile-${PLATFORM} - repo: devxygmbh/rpkgs-build-env-${PLATFORM} - tags: ${R_VERSION} + Dockerfile: docker/Containerfile-${OS} + repo: devxygmbh/rpkgs-build-env-${OS} + tags: ${OS_VERSION}-${R_VERSION} username: devxygmbh password: from_secret: dockerhub_token_devxygmbh @@ -45,7 +41,8 @@ steps: GITHUB_PAT: from_secret: GITHUB_PAT build_args_from_env: - - ARCH + - OS + - OS_VERSION - R_VERSION backend_options: kubernetes: diff --git a/Justfile b/Justfile index 8864dff..72988b1 100644 --- a/Justfile +++ b/Justfile @@ -1,12 +1,36 @@ -image OS ARCH: +# just image alpine 3.20 +# just image alpine 3.21 4.4.3 +# just image alpine 3.22 4.5.0 +# just image ubuntu jammy 4.4.3 +# just image ubuntu noble 4.4.3 +# just image redhat 8 4.4.3 +# just image redhat 9 4.4.3 +# just image redhat 10 +image OS OS_VERSION R_VERSION : if echo "{{OS}}" | grep -qi "redhat"; then \ - docker buildx build --progress plain --build-arg ARCH={{ARCH}} --build-arg GITHUB_PAT="$GITHUB_PAT" --build-arg RED_HAT_DEV_PW="$RED_HAT_DEV_PW" --platform linux/{{ARCH}} -f docker/Containerfile-{{OS}} -t devxygmbh/{{ARCH}}-binaries-r-{{OS}}:latest --push .; \ + docker buildx build --progress plain --build-arg R_VERSION={{R_VERSION}} --build-arg GITHUB_PAT="$GITHUB_PAT" --build-arg OS_VERSION={{OS_VERSION}} --build-arg RED_HAT_DEV_PW="$RED_HAT_DEV_PW" --platform linux/amd64,linux/arm64 -f docker/Containerfile-{{OS}} -t devxygmbh/rpkgs-build-env-{{OS}}:{{OS_VERSION}}-{{R_VERSION}} --push .; \ else \ - docker buildx build --progress plain --build-arg GITHUB_PAT="$GITHUB_PAT" --build-arg ARCH={{ARCH}} -f docker/Containerfile-{{OS}} --platform linux/{{ARCH}} -t devxygmbh/{{ARCH}}-binaries-r-{{OS}}:latest --push .; \ + docker buildx build --progress plain --build-arg R_VERSION={{R_VERSION}} --build-arg OS_VERSION={{OS_VERSION}} --build-arg GITHUB_PAT="$GITHUB_PAT" -f docker/Containerfile-{{OS}} --platform linux/amd64,linux/arm64 -t devxygmbh/rpkgs-build-env-{{OS}}:{{OS_VERSION}}-{{R_VERSION}} --push .; \ + fi + +### JAGS takes forever to build in CI through buildx. Building the binary once and injecting it into the final image +# just image-jags alpine 3.20 +# just image-jags alpine 3.21 +# just image-jags alpine 3.22 +# just image-jags ubuntu jammy +# just image-jags ubuntu noble +# just image-jags redhat 8 +# just image-jags redhat 9 +# just image-jags redhat 10 +image-jags OS OS_VERSION: + if echo "{{OS}}" | grep -qi "redhat"; then \ + docker buildx build --progress plain --platform linux/amd64,linux/arm64 --build-arg OS_VERSION={{OS_VERSION}} --build-arg RED_HAT_DEV_PW="$RED_HAT_DEV_PW" -f docker/Containerfile-{{OS}}-jags --push -t devxygmbh/{{OS}}-jags:{{OS_VERSION}} .; \ + else \ + docker buildx build --progress plain --platform linux/amd64,linux/arm64 --build-arg OS_VERSION={{OS_VERSION}} -f docker/Containerfile-{{OS}}-jags --push -t devxygmbh/{{OS}}-jags:{{OS_VERSION}} .;\ fi preview-docs: cd docs && quarto preview publish-docs: - cd docs && quarto render && rclone sync ./_site hetzner-s3://devxy-r-package-binaries-docs \ No newline at end of file + cd docs && quarto render && rclone sync ./_site hetzner-s3://devxy-r-package-binaries-docs diff --git a/docker/Containerfile-alpine-321 b/docker/Containerfile-alpine similarity index 78% rename from docker/Containerfile-alpine-321 rename to docker/Containerfile-alpine index e655b88..58f7758 100644 --- a/docker/Containerfile-alpine-321 +++ b/docker/Containerfile-alpine @@ -1,13 +1,8 @@ -FROM alpine:3.21 AS jags +ARG OS_VERSION +FROM devxygmbh/alpine-jags:${OS_VERSION} AS jags -RUN apk add -q --no-cache curl tar make lapack lapack-dev blas blas-dev gcc gfortran g++ git cmake tk-dev xz - -# These usually are not packaged in OS repositories and need to be installed from source -# - JAGS (needed for runjags which itself is again a dependency of many packages) -RUN curl -s -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && \ - tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 - -FROM alpine:3.21 AS final +ARG OS_VERSION +FROM alpine:${OS_VERSION} AS final ARG R_VERSION=4.4.3 ENV PATH=/opt/R/${R_VERSION}/bin:$PATH @@ -15,7 +10,6 @@ ENV TZ="Europe/Berlin" ENV R_LIBS_USER=/mnt/cache/R-pkgs ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache -ARG ARCH=arm64 ENV NCPUS=2 ARG GITHUB_PAT @@ -37,8 +31,6 @@ RUN apk add -q --no-cache curl tar make blas blas-dev gcc gfortran g++ htop git RUN apk add -q --no-cache R-dev curl ca-certificates bash g++ tzdata openjdk17 tar sed patch openblas-dev pkgconfig linux-headers ccache libxml2-dev libgit2-dev libpq-dev pkgconfig fftw-dev automake autoconf libtool elfutils-dev # - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes RUN apk add -q --no-cache chromium -# FIXME: https://github.com/dmlc/xgboost/issues/8595 -RUN apk add --no-cache --update --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main/ libexecinfo-dev # https://github.com/RcppCore/Rcpp/issues/448#issuecomment-220148774 # LDFLAGS+=-fPIC -> arrow (https://github.com/r-hub/r-minimal/blob/main/examples/arrow/Dockerfile) @@ -53,7 +45,10 @@ RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.gl RUN bash -c 'echo -e "PKG_SYSREQS=TRUE\nPKG_SYSREQS_VERBOSE=TRUE" > ~/.Renviron' ### INSTALL R -RUN curl -O "https://devxy-r-builds.fsn1.your-objectstorage.com/alpine321/r-${R_VERSION}_1_$(arch).apk" + +ARG OS_VERSION +RUN export OS_VERSION_TRIM=$(echo $OS_VERSION | tr -d '.') && \ + curl -v -O "https://devxy-r-builds.fsn1.your-objectstorage.com/alpine${OS_VERSION_TRIM}/r-${R_VERSION}_1_$(arch).apk" RUN apk add --allow-untrusted "r-${R_VERSION}_1_$(arch).apk" && rm "r-${R_VERSION}_1_$(arch).apk" RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' diff --git a/docker/Containerfile-alpine-320 b/docker/Containerfile-alpine-320 deleted file mode 100644 index a14d649..0000000 --- a/docker/Containerfile-alpine-320 +++ /dev/null @@ -1,69 +0,0 @@ -FROM alpine:3.20 AS jags - -RUN apk add -q --no-cache curl tar make lapack lapack-dev blas blas-dev gcc gfortran g++ git cmake tk-dev xz - -# These usually are not packaged in OS repositories and need to be installed from source -# - JAGS (needed for runjags which itself is again a dependency of many packages) -RUN curl -s -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && \ - tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 - -FROM alpine:3.20 AS final - -ARG R_VERSION=4.4.3 -ENV PATH=/opt/R/${R_VERSION}/bin:$PATH -ENV TZ="Europe/Berlin" -ENV R_LIBS_USER=/mnt/cache/R-pkgs -ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache - -ARG ARCH=arm64 -ENV NCPUS=2 - -ARG GITHUB_PAT - -COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2 - -# Background: JAGS needs lapack & lapack-dev but these conflict with openblas-dev which is required by R-dev -# Solution: first compile JAGS, then remove lapack & lapack-dev again -# # xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk -RUN apk add -q --no-cache curl tar make blas blas-dev gcc gfortran g++ htop git cmake tk-dev xvfb xvfb-run xorg-server xauth xinit xz libdeflate libdeflate-dev - -### CUSTOM DEPENDENCIES - -# linux-headers: ps -# libxml2-dev: xml2 -# libgit2-dev: gert -# libpq-dev: RPostgres -# libfftw3-dev: ravetools -> actually auto-detect but somehow doesn't work in container? -RUN apk add -q --no-cache R-dev curl ca-certificates bash g++ tzdata openjdk17 tar sed patch openblas-dev pkgconfig linux-headers ccache libxml2-dev libgit2-dev libpq-dev pkgconfig fftw-dev automake autoconf libtool elfutils-dev -# - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes -RUN apk add -q --no-cache chromium -# FIXME: https://github.com/dmlc/xgboost/issues/8595 -RUN apk add --no-cache --update --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main/ libexecinfo-dev - -# https://github.com/RcppCore/Rcpp/issues/448#issuecomment-220148774 -# LDFLAGS+=-fPIC -> arrow (https://github.com/r-hub/r-minimal/blob/main/examples/arrow/Dockerfile) -# dbarts: CFLAGS += -flax-vector-conversions (https://github.com/vdorie/dbarts/issues/66) -# CXXFLAGS: -> Rcpp -# -DDMLC_USE_FOPEN64=0 -> xgboost (https://github.com/dmlc/xgboost/issues/8595) -# can't set ccache for gfortran because of https://gitlab.com/roigrp/solver/highs/-/issues/4 -RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCXXFLAGS=-D__MUSL__ -DDMLC_USE_FOPEN64=0\nCPPFLAGS=-D__MUSL__ -DDMLC_USE_FOPEN64=0\nCFLAGS += -flax-vector-conversions\nLDFLAGS+=-fPIC\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" > /root/.R/Makevars' - -# R repos -RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/alpine320/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' -RUN bash -c 'echo -e "PKG_SYSREQS=TRUE\nPKG_SYSREQS_VERBOSE=TRUE" > ~/.Renviron' - -### INSTALL R -RUN curl -O "https://devxy-r-builds.fsn1.your-objectstorage.com/alpine320/r-${R_VERSION}_1_$(arch).apk" -RUN apk add --allow-untrusted "r-${R_VERSION}_1_$(arch).apk" && rm "r-${R_VERSION}_1_$(arch).apk" - -RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' - -# these dirs will later be used by the CI with existing mounts -RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs - -# encoding -> https://github.com/r-hub/r-minimal/blob/fa9c117313e05860a0d20b113e5f794c51be8b8c/Dockerfile#L84 -RUN sed -i 's/,//g' /opt/R/${R_VERSION}/lib/R/library/utils/iconvlist - -RUN R -q -e 'pak::pak("git::https://codefloe.com/rpkgs/bincraftr.git", dependencies = TRUE)' - -CMD ["/bin/bash"] diff --git a/docker/Containerfile-alpine-322 b/docker/Containerfile-alpine-322 deleted file mode 100644 index 82f6c9d..0000000 --- a/docker/Containerfile-alpine-322 +++ /dev/null @@ -1,69 +0,0 @@ -FROM alpine:3.22 AS jags - -RUN apk add -q --no-cache curl tar make lapack lapack-dev blas blas-dev gcc gfortran g++ git cmake tk-dev xz - -# These usually are not packaged in OS repositories and need to be installed from source -# - JAGS (needed for runjags which itself is again a dependency of many packages) -RUN curl -s -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && \ - tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 - -FROM alpine:3.22 AS final - -ARG R_VERSION=4.4.3 -ENV PATH=/opt/R/${R_VERSION}/bin:$PATH -ENV TZ="Europe/Berlin" -ENV R_LIBS_USER=/mnt/cache/R-pkgs -ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache - -ARG ARCH=arm64 -ENV NCPUS=2 - -ARG GITHUB_PAT - -COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2 - -# Background: JAGS needs lapack & lapack-dev but these conflict with openblas-dev which is required by R-dev -# Solution: first compile JAGS, then remove lapack & lapack-dev again -# # xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk -RUN apk add -q --no-cache curl tar make blas blas-dev gcc gfortran g++ htop git cmake tk-dev xvfb xvfb-run xorg-server xauth xinit xz libdeflate libdeflate-dev - -### CUSTOM DEPENDENCIES - -# linux-headers: ps -# libxml2-dev: xml2 -# libgit2-dev: gert -# libpq-dev: RPostgres -# libfftw3-dev: ravetools -> actually auto-detect but somehow doesn't work in container? -RUN apk add -q --no-cache R-dev curl ca-certificates bash g++ tzdata openjdk17 tar sed patch openblas-dev pkgconfig linux-headers ccache libxml2-dev libgit2-dev libpq-dev pkgconfig fftw-dev automake autoconf libtool elfutils-dev -# - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes -RUN apk add -q --no-cache chromium -# FIXME: https://github.com/dmlc/xgboost/issues/8595 -RUN apk add --no-cache --update --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main/ libexecinfo-dev - -# https://github.com/RcppCore/Rcpp/issues/448#issuecomment-220148774 -# LDFLAGS+=-fPIC -> arrow (https://github.com/r-hub/r-minimal/blob/main/examples/arrow/Dockerfile) -# dbarts: CFLAGS += -flax-vector-conversions (https://github.com/vdorie/dbarts/issues/66) -# CXXFLAGS: -> Rcpp -# -DDMLC_USE_FOPEN64=0 -> xgboost (https://github.com/dmlc/xgboost/issues/8595) -# can't set ccache for gfortran because of https://gitlab.com/roigrp/solver/highs/-/issues/4 -RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCXXFLAGS=-D__MUSL__ -DDMLC_USE_FOPEN64=0\nCPPFLAGS=-D__MUSL__ -DDMLC_USE_FOPEN64=0\nCFLAGS += -flax-vector-conversions\nLDFLAGS+=-fPIC\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" > /root/.R/Makevars' - -# R repos -RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cloud.r-project.org\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' -RUN bash -c 'echo -e "PKG_SYSREQS=TRUE\nPKG_SYSREQS_VERBOSE=TRUE" > ~/.Renviron' - -### INSTALL R -RUN curl -O "https://devxy-r-builds.fsn1.your-objectstorage.com/alpine322/r-${R_VERSION}_1_$(arch).apk" -RUN apk add --allow-untrusted "r-${R_VERSION}_1_$(arch).apk" && rm "r-${R_VERSION}_1_$(arch).apk" - -RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' - -# these dirs will later be used by the CI with existing mounts -RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs - -# encoding -> https://github.com/r-hub/r-minimal/blob/fa9c117313e05860a0d20b113e5f794c51be8b8c/Dockerfile#L84 -RUN sed -i 's/,//g' /opt/R/${R_VERSION}/lib/R/library/utils/iconvlist - -RUN R -q -e 'pak::pak("git::https://codefloe.com/rpkgs/bincraftr.git", dependencies = TRUE)' - -CMD ["/bin/bash"] diff --git a/docker/Containerfile-alpine-jags b/docker/Containerfile-alpine-jags new file mode 100644 index 0000000..5e6cc72 --- /dev/null +++ b/docker/Containerfile-alpine-jags @@ -0,0 +1,11 @@ +ARG VERSION +FROM alpine:${VERSION} AS jags + +ARG JAGS_VERSION=4.3.2 + +RUN apk add -q --no-cache curl tar make lapack lapack-dev blas blas-dev gcc gfortran g++ git cmake tk-dev xz + +# These usually are not packaged in OS repositories and need to be installed from source +# - JAGS (needed for runjags which itself is again a dependency of many packages) +RUN curl -s -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-${JAGS_VERSION}.tar.gz && \ + tar -xzf JAGS-${JAGS_VERSION}.tar.gz && cd JAGS-${JAGS_VERSION} && ./configure --enable-silent-rules && make 2>&1 diff --git a/docker/Containerfile-redhat b/docker/Containerfile-redhat new file mode 100644 index 0000000..68aa291 --- /dev/null +++ b/docker/Containerfile-redhat @@ -0,0 +1,68 @@ +ARG OS_VERSION +FROM devxygmbh/redhat-jags:${OS_VERSION} AS jags + +ARG OS_VERSION +FROM redhat/ubi${OS_VERSION} AS final + +ARG R_VERSION +ARG RED_HAT_DEV_PW +ENV PATH=/opt/R/${R_VERSION}/bin:$PATH +ENV TZ="Europe/Berlin" +ENV R_LIBS_USER=/mnt/cache/R-pkgs +ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache + +ENV NCPUS=2 + +ARG GITHUB_PAT + +COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2 + +ARG OS_VERSION +RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-${OS_VERSION}-$(arch)-rpms +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${OS_VERSION}.noarch.rpm && dnf install -y epel-release +# xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk +# ImageMagick-c++-devel ImageMagick-devel: boths are not auto-installed via pak sysreqs +# mecab-devel: RcppMeCab -> no autodetection yet +# libfftw3-dev: ravetools -> actually auto-detect but somehow doesn't work in container? +ARG OS_VERSION +RUN if [ "$OS_VERSION" = "8" ]; then \ + dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel postgresql-devel htop libgit2_1.7-devel libxml2-devel hiredis ccache cmake xorg-x11-server-Xvfb ImageMagick-c++-devel ImageMagick-devel xz pkg-config mecab-devel fftw-devel tk-devel automake readline-devel; \ + elif [ "$OS_VERSION" = "9" ] || [ "$OS_VERSION" = "10" ]; then \ + dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel postgresql-devel htop libgit2-devel libxml2-devel hiredis ccache cmake xorg-x11-server-Xvfb ImageMagick-c++-devel ImageMagick-devel xz pkg-config mecab-devel fftw-devel tk-devel automake readline-devel; \ + fi; + +### CUSTOM DEPENDENCIES +# - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes +RUN dnf install -y chromium + +### INSTALL R +RUN curl -O "https://devxy-r-builds.fsn1.your-objectstorage.com/el${OS_VERSION}/R-${R_VERSION}-1-1.$(arch).rpm" +RUN dnf install -q -y "R-${R_VERSION}-1-1.$(arch).rpm" && rm "R-${R_VERSION}-1-1.$(arch).rpm" +RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' + +RUN if [ "$OS_VERSION" = "8" ]; then \ + export CXX_STD=14; \ + elif [ "$OS_VERSION" = "9" ]; then \ + export CXX_STD=17; \ + elif [ "$OS_VERSION" = "10" ]; then \ + export CXX_STD=20; \ + fi; \ + if [ "$(arch)" = "x86_64" ]; then \ + export ARCH=amd64; \ + elif [ "$(arch)" = "aarch64" ]; then \ + export ARCH=arm64; \ + fi; \ + mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = ${CXX_STD}\nCFLAGS += -flax-vector-conversions\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" >> /root/.R/Makevars' && \ + bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/rhel${OS_VERSION}/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' && \ + bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE\nPKG_SYSREQS_PLATFORM=\"redhat-${OS_VERSION}\"" > /root/.Renviron' + +### Makevars +# dbarts: CFLAGS += -flax-vector-conversions (https://github.com/vdorie/dbarts/issues/66) +# can't set ccache for gfortran because of https://gitlab.com/roigrp/solver/highs/-/issues/4 + +# these dirs will later be used by the CI with existing mounts +RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs + +RUN R -q -e 'getOption("repos"); pak::pak("git::https://codefloe.com/rpkgs/bincraftr.git", dependencies = TRUE)' + +CMD ["/bin/bash"] diff --git a/docker/Containerfile-redhat-8 b/docker/Containerfile-redhat-8 deleted file mode 100644 index f733aa0..0000000 --- a/docker/Containerfile-redhat-8 +++ /dev/null @@ -1,62 +0,0 @@ -FROM redhat/ubi8 AS jags -ARG RED_HAT_DEV_PW - -RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms -RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && dnf install -y epel-release -RUN dnf install -y -q gcc-c++ lapack-devel make git ca-certificates - -# These usually are not packaged in OS repositories and need to be installed from source -# - JAGS (needed for runjags which itself is again a dependency of many packages) -RUN curl -s -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && \ - tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 - -FROM redhat/ubi8 AS final - -# renovate datasource=docker depName=rocker/r-ver -ARG R_VERSION=4.4.3 -ARG RED_HAT_DEV_PW -ENV PATH=/opt/R/${R_VERSION}/bin:$PATH -ENV TZ="Europe/Berlin" -ENV R_LIBS_USER=/mnt/cache/R-pkgs -ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache - -ARG ARCH=arm64 -ENV NCPUS=2 - -ARG GITHUB_PAT - -COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2 - -RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms -RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && dnf install -y epel-release -# xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk -# ImageMagick-c++-devel ImageMagick-devel: boths are not auto-installed via pak sysreqs -# mecab-devel: RcppMeCab -> no autodetection yet -# libfftw3-dev: ravetools -> actually auto-detect but somehow doesn't work in container? -RUN dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel postgresql-devel htop libgit2_1.7-devel libxml2-devel hiredis ccache cmake xorg-x11-server-Xvfb ImageMagick-c++-devel ImageMagick-devel xz pkg-config mecab-devel fftw-devel tk-devel automake readline-devel - -### CUSTOM DEPENDENCIES -# - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes -RUN dnf install -y chromium - -### INSTALL R -RUN curl -O "https://devxy-r-builds.fsn1.your-objectstorage.com/el8/R-${R_VERSION}-1-1.$(arch).rpm" -RUN dnf install -q -y "R-${R_VERSION}-1-1.$(arch).rpm" && rm "R-${R_VERSION}-1-1.$(arch).rpm" -RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' - -### Makevars -# dbarts: CFLAGS += -flax-vector-conversions (https://github.com/vdorie/dbarts/issues/66) -# can't set ccache for gfortran because of https://gitlab.com/roigrp/solver/highs/-/issues/4 -RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" >> /root/.R/Makevars' - -# R repos -RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/rhel8/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' -RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE\nPKG_SYSREQS_PLATFORM=\"redhat-8\"" > /root/.Renviron' - -# these dirs will later be used by the CI with existing mounts -RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs - -RUN R -q -e 'install.packages("gert", repos = "cloud.r-project.org")' -RUN R -q -e 'pak::pak("git::https://codefloe.com/rpkgs/bincraftr.git", dependencies = TRUE)' - -CMD ["/bin/bash"] diff --git a/docker/Containerfile-redhat-9 b/docker/Containerfile-redhat-9 deleted file mode 100644 index e0ef1fd..0000000 --- a/docker/Containerfile-redhat-9 +++ /dev/null @@ -1,61 +0,0 @@ -FROM redhat/ubi9 AS jags -ARG RED_HAT_DEV_PW - -RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms -RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && dnf install -y epel-release -RUN dnf install -y -q gcc-c++ lapack-devel make git ca-certificates - -# These usually are not packaged in OS repositories and need to be installed from source -# - JAGS (needed for runjags which itself is again a dependency of many packages) -RUN curl -s -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && \ - tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 - -FROM redhat/ubi9 AS final - -# renovate datasource=docker depName=rocker/r-ver -ARG R_VERSION=4.4.3 -ARG RED_HAT_DEV_PW -ENV PATH=/opt/R/${R_VERSION}/bin:$PATH -ENV TZ="Europe/Berlin" -ENV R_LIBS_USER=/mnt/cache/R-pkgs -ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache - -ARG ARCH=arm64 -ENV NCPUS=2 - -ARG GITHUB_PAT - -COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2 - -RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms -RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && dnf install -y epel-release -# xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk -# ImageMagick-c++-devel ImageMagick-devel: boths are not auto-installed via pak sysreqs -# mecab-devel: RcppMeCab -> no autodetection yet -# libfftw3-dev: ravetools -> actually auto-detect but somehow doesn't work in container? -RUN dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel postgresql-devel htop libgit2-devel libxml2-devel hiredis ccache cmake xorg-x11-server-Xvfb ImageMagick-c++-devel ImageMagick-devel xz pkg-config mecab-devel fftw-devel tk-devel automake readline-devel - -### CUSTOM DEPENDENCIES -# - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes -RUN dnf install -y chromium - -### INSTALL R -RUN curl -O "https://devxy-r-builds.fsn1.your-objectstorage.com/el9/R-${R_VERSION}-1-1.$(arch).rpm" -RUN dnf install -q -y "R-${R_VERSION}-1-1.$(arch).rpm" && rm "R-${R_VERSION}-1-1.$(arch).rpm" -RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' - -### Makevars -# dbarts: CFLAGS += -flax-vector-conversions (https://github.com/vdorie/dbarts/issues/66) -# can't set ccache for gfortran because of https://gitlab.com/roigrp/solver/highs/-/issues/4 -RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" >> /root/.R/Makevars' - -# R repos -RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/rhel9/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile' -RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE\nPKG_SYSREQS_PLATFORM=\"redhat-9\"" > /root/.Renviron' - -# these dirs will later be used by the CI with existing mounts -RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs - -RUN R -q -e 'pak::pak("git::https://codefloe.com/rpkgs/bincraftr.git", dependencies = TRUE)' - -CMD ["/bin/bash"] diff --git a/docker/Containerfile-redhat-jags b/docker/Containerfile-redhat-jags new file mode 100644 index 0000000..e1e06a5 --- /dev/null +++ b/docker/Containerfile-redhat-jags @@ -0,0 +1,13 @@ +ARG VERSION +FROM redhat/ubi${VERSION} AS jags +ARG RED_HAT_DEV_PW + +ARG VERSION +RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-${VERSION}-$(arch)-rpms +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${VERSION}.noarch.rpm && dnf install -y epel-release +RUN dnf install -y -q gcc-c++ lapack-devel make git ca-certificates + +# These usually are not packaged in OS repositories and need to be installed from source +# - JAGS (needed for runjags which itself is again a dependency of many packages) +RUN curl -s -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && \ + tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 diff --git a/docker/Containerfile-ubuntu-2204 b/docker/Containerfile-ubuntu similarity index 52% rename from docker/Containerfile-ubuntu-2204 rename to docker/Containerfile-ubuntu index 51249f3..70beca1 100644 --- a/docker/Containerfile-ubuntu-2204 +++ b/docker/Containerfile-ubuntu @@ -1,18 +1,14 @@ -FROM ubuntu:jammy AS jags +ARG OS_VERSION +FROM devxygmbh/ubuntu-jags:${OS_VERSION} AS jags -RUN apt update && apt install -y --no-install-recommends curl make ca-certificates gcc g++ gfortran liblapack-dev -# These usually are not packaged in OS repositories and need to be installed from source -# - JAGS (needed for runjags which itself is again a dependency of many packages) -RUN curl -q -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 +ARG OS_VERSION +FROM ubuntu:${OS_VERSION} AS final -FROM ubuntu:jammy AS final - -ARG R_VERSION=4.4.3 +ARG R_VERSION ENV PATH=/opt/R/${R_VERSION}/bin:$PATH ENV TZ="Europe/Berlin" ENV DEBIAN_FRONTEND=noninteractive -ARG ARCH=arm64 ENV NCPUS=2 ENV R_LIBS_USER=/mnt/cache/R-pkgs ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache @@ -34,18 +30,31 @@ RUN apt-get install -y software-properties-common && \ apt update && \ apt install -y chromium -### INSTALL R -RUN curl -O "https://devxy-r-builds.fsn1.your-objectstorage.com/2204/r-${R_VERSION}_1_$(dpkg --print-architecture).deb" -RUN gdebi -n -qq "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && rm "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" -RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' +ARG OS_VERSION +ARG R_VERSION +RUN if [ "$OS_VERSION" = "jammy" ]; then \ + OS_VERSION_TRIM=2204; \ + CXX_STD=14; \ + elif [ "$OS_VERSION" = "noble" ]; then \ + OS_VERSION_TRIM=2404; \ + CXX_STD=17; \ + fi; \ + if [ "$(arch)" = "x86_64" ]; then \ + export ARCH=amd64; \ + elif [ "$(arch)" = "aarch64" ]; then \ + export ARCH=arm64; \ + fi; \ + curl -v -O "https://devxy-r-builds.fsn1.your-objectstorage.com/${OS_VERSION_TRIM}/r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && \ + gdebi -n -qq "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && \ + rm "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && \ + R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' && \ + mkdir -p /root/.R && \ + bash -c 'echo -e "CXX_STD = $CXX_STD\nCFLAGS += -flax-vector-conversions\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" >> /root/.R/Makevars' && \ + bash -c 'echo -e "options(pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/${OS_VERSION}/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile' ### Makevars # dbarts: CFLAGS += -flax-vector-conversions (https://github.com/vdorie/dbarts/issues/66) # can't set ccache for gfortran because of https://gitlab.com/roigrp/solver/highs/-/issues/4 -RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" >> /root/.R/Makevars' - -# R repos -RUN bash -c 'echo -e "options(pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/jammy/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile' # these dirs will later be used by the CI with existing mounts RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs @@ -54,6 +63,6 @@ RUN apt install -y locales && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ && locale-gen en_US.utf8 \ && /usr/sbin/update-locale LANG=en_US.UTF-8 -RUN R -q -e 'pak::pak("git::https://codefloe.com/rpkgs/bincraftr.git", dependencies = TRUE)' +RUN R -q -e 'getOption("repos"); pak::pak("git::https://codefloe.com/rpkgs/bincraftr.git", dependencies = TRUE)' CMD ["/bin/bash"] diff --git a/docker/Containerfile-ubuntu-2404 b/docker/Containerfile-ubuntu-2404 deleted file mode 100644 index c9334fe..0000000 --- a/docker/Containerfile-ubuntu-2404 +++ /dev/null @@ -1,59 +0,0 @@ -FROM ubuntu:noble AS jags - -RUN apt update && apt install -y --no-install-recommends curl make ca-certificates gcc g++ gfortran liblapack-dev -# These usually are not packaged in OS repositories and need to be installed from source -# - JAGS (needed for runjags which itself is again a dependency of many packages) -RUN curl -q -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 - -FROM ubuntu:noble AS final - -ARG R_VERSION=4.4.3 -ENV PATH=/opt/R/${R_VERSION}/bin:$PATH -ENV TZ="Europe/Berlin" -ENV DEBIAN_FRONTEND=noninteractive - -ARG ARCH=arm64 -ENV NCPUS=2 -ENV R_LIBS_USER=/mnt/cache/R-pkgs -ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache - -ARG GITHUB_PAT - -COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2 - -# xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk -# tcl tk tk-dev tk-table: must be available before running xvfb-run (i.e. starting the graphical session) -# libmecab-dev: RcppMeCab -> no autodetection yet -# libfftw3-dev: ravetools -> actually auto-detect but somehow doesn't work in container? -RUN apt update && apt install -y --no-install-recommends gdebi-core g++ gfortran libbz2-dev libblas-dev libicu-dev liblapack-dev liblzma-dev libpaper-utils libpcre2-dev libtcl8.6 libtk8.6 libxt6 unzip zip zlib1g-dev libpcre3-dev libopenblas-dev curl ca-certificates make ccache htop libgit2-dev git libpq-dev libxml2-dev libgit2-dev cmake xvfb libcurl4-openssl-dev xz-utils tcl tk tk-dev tk-table pkg-config libmecab-dev libfftw3-dev automake - -### CUSTOM DEPENDENCIES -# - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes -RUN apt-get install -y software-properties-common && \ - add-apt-repository -y ppa:xtradeb/apps && \ - apt update && \ - apt install -y chromium - -### INSTALL R -RUN curl -O "https://devxy-r-builds.fsn1.your-objectstorage.com/2404/r-${R_VERSION}_1_$(dpkg --print-architecture).deb" -RUN gdebi -n -qq "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && rm "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" -RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))' - -### Makevars -# dbarts: CFLAGS += -flax-vector-conversions (https://github.com/vdorie/dbarts/issues/66) -# can't set ccache for gfortran because of https://gitlab.com/roigrp/solver/highs/-/issues/4 -RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" >> /root/.R/Makevars' - -# R repos -RUN bash -c 'echo -e "options(pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/noble/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile' - -# these dirs will later be used by the CI with existing mounts -RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs - -RUN apt install -y locales && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ - && locale-gen en_US.utf8 \ - && /usr/sbin/update-locale LANG=en_US.UTF-8 - -RUN R -q -e 'pak::pak("git::https://codefloe.com/rpkgs/bincraftr.git", dependencies = TRUE)' - -CMD ["/bin/bash"] diff --git a/docker/Containerfile-ubuntu-jags b/docker/Containerfile-ubuntu-jags new file mode 100644 index 0000000..6842dcb --- /dev/null +++ b/docker/Containerfile-ubuntu-jags @@ -0,0 +1,7 @@ +ARG VERSION +FROM ubuntu:${VERSION} AS jags + +RUN apt update && apt install -y --no-install-recommends curl make ca-certificates gcc g++ gfortran liblapack-dev +# These usually are not packaged in OS repositories and need to be installed from source +# - JAGS (needed for runjags which itself is again a dependency of many packages) +RUN curl -q -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1