diff --git a/.woodpecker/images.yaml b/.woodpecker/images.yaml index 42dad18..b3562bb 100644 --- a/.woodpecker/images.yaml +++ b/.woodpecker/images.yaml @@ -2,6 +2,9 @@ when: - event: cron cron: images +depends_on: + - warm_up_images + matrix: include: - PLATFORM: redhat-9 diff --git a/.woodpecker/warm_up_images.yaml b/.woodpecker/warm_up_images.yaml new file mode 100644 index 0000000..214ba77 --- /dev/null +++ b/.woodpecker/warm_up_images.yaml @@ -0,0 +1,44 @@ +when: + event: [manual] + +skip_clone: true + +matrix: + include: + - PLATFORM: redhat-9 + ARCH: arm64 + - PLATFORM: redhat-8 + ARCH: arm64 + - PLATFORM: ubuntu-2404 + ARCH: arm64 + - PLATFORM: ubuntu-2204 + ARCH: arm64 + - PLATFORM: alpine-320 + ARCH: arm64 + - PLATFORM: alpine-320 + ARCH: amd64 + +steps: + - name: 'Warming up' + image: busybox:latest + failure: ignore + commands: + - sleep 300 + - echo "Warmed Up" + backend_options: + kubernetes: + ### PROD-sequential + resources: + requests: + memory: 500Mi + cpu: 1000m + limits: + memory: 800Mi + cpu: 1000m + nodeSelector: + kubernetes.io/arch: "${ARCH}" + tolerations: + - key: "CI" + operator: "Equal" + value: "true" + effect: "NoSchedule" diff --git a/docker/Dockerfile-alpine-320 b/docker/Dockerfile-alpine-320 index 22605d7..4745ab4 100644 --- a/docker/Dockerfile-alpine-320 +++ b/docker/Dockerfile-alpine-320 @@ -3,6 +3,14 @@ FROM alpine:3.20 ENV PATH=/opt/R/4.4.1/bin:$PATH ENV TZ="Europe/Berlin" +ENV ARCH=arm64 +ENV NCPUS=2 + +ENV AWS_ACCESS_KEY_ID="" +ENV AWS_SECRET_ACCESS_KEY="" +ENV PGPASS="" + + ARG GITHUB_PAT # Background: JAGS needs lapack & lapack-dev but these conflict with openblas-dev which is required by R-dev @@ -23,7 +31,13 @@ RUN apk add -q --no-cache R-dev curl ca-certificates bash g++ tzdata openjdk17 t # https://github.com/RcppCore/Rcpp/issues/448#issuecomment-220148774 # LDFLAGS+=-fPIC -> arrow (https://github.com/r-hub/r-minimal/blob/main/examples/arrow/Dockerfile) -RUN mkdir ~/.R && echo -e "CXXFLAGS+=-D__MUSL__\nCPPFLAGS+= -D__MUSL__\nLDFLAGS+=-fPIC" >> ~/.R/Makevars +# Makevars +RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCC=ccache gcc\nCPP=ccache gcc\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=ccache /usr/bin/gfortran\nFC=ccache /usr/bin/gfortran" >> /root/.R/Makevars' +RUN mkdir -p ~/.R && bash -c 'echo -e "CXXFLAGS+=-D__MUSL__\nCPPFLAGS+= -D__MUSL__\nLDFLAGS+=-fPIC" >> root/.R/Makevars' + +# R repos +RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(devxy = \"https://cran.devxy.io/${ARCH}/alpine320/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\", CRAN = \"https://cloud.r-project.org\")))" > /root/.Rprofile' +RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE" > /root/.Renviron' ### INSTALL R RUN curl -O https://devxy-r-builds.s3.eu-central-2.amazonaws.com/alpine320/r-4.4.1_1_$(arch).apk @@ -31,11 +45,11 @@ RUN apk add --allow-untrusted r-4.4.1_1_$(arch).apk && rm r-4.4.1_1_$(arch).apk RUN R -q -e 'install.packages("remotes", repo = "cloud.r-project.org"); remotes::install_github("pat-s/pak@alpine")' -COPY . . -RUN apk add libxml2-dev # FIXME: switch to pak after https://github.com/r-lib/pak/issues/628 -RUN export ARCH=$(echo $(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/')) && \ - R -q -e 'Sys.setenv(PKG_SYSREQS = TRUE, PKG_SYSREQS_VERBOSE = TRUE); options(Ncpus = 4, repos = structure(c(devxy = sprintf("https://cran.devxy.io/%s/alpine320/latest", Sys.getenv("ARCH")), CRAN = "https://cloud.r-project.org"))); install.packages("remotes"); remotes::install_deps()' -RUN rm -rf r-pkg-binaries +# deps from pak::pkg_deps(".")$package +RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "pat-s/desc@description-from-remote", "digest", "dplyr", "fansi", "fs", "future.apply", "future", "generics", "gert", "globals", "glue", "hms", "httr", "jsonlite", "lgr", "lifecycle", "listenv", "lubridate", "magrittr", "mime", "openssl", "parallelly", "paws.common", "paws.storage", "pillar", "pkgbuild", "pkgconfig", "processx", "progressr", "ps", "purrr", "rlang", "rstudioapi","s3fs", "stringi", "stringr", "sys", "tibble", "tidyselect", "timechange", "utf8", "vctrs", "withr", "xml2", "zip", "codetools", "pat-s/cranlike@s3", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise"))' + +COPY . . +RUN R CMD INSTALL . && rm -rf r-pkg-binaries CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/Dockerfile-redhat-8 b/docker/Dockerfile-redhat-8 index 9471737..13f984b 100644 --- a/docker/Dockerfile-redhat-8 +++ b/docker/Dockerfile-redhat-8 @@ -4,12 +4,18 @@ ARG RED_HAT_DEV_PW ENV PATH=/opt/R/4.4.1/bin:$PATH ENV TZ="Europe/Berlin" +ENV ARCH=arm64 +ENV NCPUS=2 + +ENV AWS_ACCESS_KEY_ID="" +ENV AWS_SECRET_ACCESS_KEY="" +ENV PGPASS="" + ARG GITHUB_PAT RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-8-aarch64-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 make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel postgresql-devel htop libgit2-devel libxml2-devel -RUN dnf install -y -q https://dl.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/h/hiredis-0.13.3-13.el8.aarch64.rpm && dnf install -y -q https://dl.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/c/ccache-3.7.7-1.el8.aarch64.rpm +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 ### CUSTOM DEPENDENCIES # These usually are not packaged in OS repositories and need to be installed from source @@ -21,9 +27,18 @@ RUN curl -O https://devxy-r-builds.s3.eu-central-2.amazonaws.com/el8/R-4.4.1-1-1 RUN dnf install -q -y R-4.4.1-1-1.aarch64.rpm 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))' -COPY . . +# Makevars +RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCC=ccache gcc\nCPP=ccache gcc\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=ccache /usr/bin/gfortran\nFC=ccache /usr/bin/gfortran" >> /root/.R/Makevars' + +# R repos +RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(devxy = \"https://cran.devxy.io/${ARCH}/rhel8/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\", CRAN = \"https://cloud.r-project.org\")))" > /root/.Rprofile' +RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE" > /root/.Renviron' + # FIXME: switch to pak after https://github.com/r-lib/pak/issues/628 -RUN R -q -e 'Sys.setenv(PKG_SYSREQS = TRUE, PKG_SYSREQS_VERBOSE = TRUE); options(Ncpus = 4, repos = structure(c(devxy = "https://cran.devxy.io/arm64/rhel8/latest", CRAN = "https://cloud.r-project.org"))); install.packages("remotes"); remotes::install_deps()' -RUN rm -rf r-pkg-binaries +# deps from pak::pkg_deps(".")$package +RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "pat-s/desc@description-from-remote", "digest", "dplyr", "fansi", "fs", "future.apply", "future", "generics", "gert", "globals", "glue", "hms", "httr", "jsonlite", "lgr", "lifecycle", "listenv", "lubridate", "magrittr", "mime", "openssl", "parallelly", "paws.common", "paws.storage", "pillar", "pkgbuild", "pkgconfig", "processx", "progressr", "ps", "purrr", "rlang", "rstudioapi","s3fs", "stringi", "stringr", "sys", "tibble", "tidyselect", "timechange", "utf8", "vctrs", "withr", "xml2", "zip", "codetools", "pat-s/cranlike@s3", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise"))' + +COPY . . +RUN R CMD INSTALL . && rm -rf r-pkg-binaries CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/Dockerfile-redhat-9 b/docker/Dockerfile-redhat-9 index 8f566bd..3f9d6b9 100644 --- a/docker/Dockerfile-redhat-9 +++ b/docker/Dockerfile-redhat-9 @@ -4,11 +4,18 @@ ARG RED_HAT_DEV_PW ENV PATH=/opt/R/4.4.1/bin:$PATH ENV TZ="Europe/Berlin" +ENV ARCH=arm64 +ENV NCPUS=2 + +ENV AWS_ACCESS_KEY_ID="" +ENV AWS_SECRET_ACCESS_KEY="" +ENV PGPASS="" + ARG GITHUB_PAT -RUN subscription-manager register --username devxy --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-9-aarch64-rpms +RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-9-aarch64-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 lapack-devel git gcc g++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel htop libgit2-devel hiredis ccache libpq-devel libxml2-devel libgit2-devel +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 ### CUSTOM DEPENDENCIES # These usually are not packaged in OS repositories and need to be installed from source @@ -20,9 +27,18 @@ RUN curl -O https://devxy-r-builds.s3.eu-central-2.amazonaws.com/el9/R-4.4.1-1-1 RUN dnf install -q -y R-4.4.1-1-1.aarch64.rpm 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))' -COPY . . +# Makevars +RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCC=ccache gcc\nCPP=ccache gcc\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=ccache /usr/bin/gfortran\nFC=ccache /usr/bin/gfortran" >> /root/.R/Makevars' + +# R repos +RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(devxy = \"https://cran.devxy.io/${ARCH}/rhel9/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\", CRAN = \"https://cloud.r-project.org\")))" > /root/.Rprofile' +RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE" > /root/.Renviron' + # FIXME: switch to pak after https://github.com/r-lib/pak/issues/628 -RUN R -q -e 'Sys.setenv(PKG_SYSREQS = TRUE, PKG_SYSREQS_VERBOSE = TRUE); options(Ncpus = 4, repos = structure(c(devxy = "https://cran.devxy.io/arm64/rhel9/latest", CRAN = "https://cloud.r-project.org"))); install.packages("remotes"); remotes::install_deps()' -RUN rm -rf r-pkg-binaries +# deps from pak::pkg_deps(".")$package +RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "pat-s/desc@description-from-remote", "digest", "dplyr", "fansi", "fs", "future.apply", "future", "generics", "gert", "globals", "glue", "hms", "httr", "jsonlite", "lgr", "lifecycle", "listenv", "lubridate", "magrittr", "mime", "openssl", "parallelly", "paws.common", "paws.storage", "pillar", "pkgbuild", "pkgconfig", "processx", "progressr", "ps", "purrr", "rlang", "rstudioapi","s3fs", "stringi", "stringr", "sys", "tibble", "tidyselect", "timechange", "utf8", "vctrs", "withr", "xml2", "zip", "codetools", "pat-s/cranlike@s3", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise"))' + +COPY . . +RUN R CMD INSTALL . && rm -rf r-pkg-binaries CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/Dockerfile-ubuntu-2204 b/docker/Dockerfile-ubuntu-2204 index 77dac31..e8f1283 100644 --- a/docker/Dockerfile-ubuntu-2204 +++ b/docker/Dockerfile-ubuntu-2204 @@ -4,6 +4,13 @@ ENV PATH=/opt/R/4.4.1/bin:$PATH ENV TZ="Europe/Berlin" ENV DEBIAN_FRONTEND=noninteractive +ENV ARCH=arm64 +ENV NCPUS=2 + +ENV AWS_ACCESS_KEY_ID="" +ENV AWS_SECRET_ACCESS_KEY="" +ENV PGPASS="" + ARG GITHUB_PAT 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 @@ -18,9 +25,18 @@ RUN curl -O https://devxy-r-builds.s3.eu-central-2.amazonaws.com/2204/r-4.4.1_1_ RUN gdebi -n -qq r-4.4.1_1_arm64.deb && rm r-4.4.1_1_arm64.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))' -COPY . . +# Makevars +RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCC=ccache gcc\nCPP=ccache gcc\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=ccache /usr/bin/gfortran\nFC=ccache /usr/bin/gfortran" >> /root/.R/Makevars' + +# R repos +RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(devxy = \"https://cran.devxy.io/${ARCH}/jammy/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\", CRAN = \"https://cloud.r-project.org\")))" > /root/.Rprofile' +RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE" > /root/.Renviron' + # FIXME: switch to pak after https://github.com/r-lib/pak/issues/628 -RUN R -q -e 'Sys.setenv(PKG_SYSREQS = TRUE, PKG_SYSREQS_VERBOSE = TRUE); options(Ncpus = 4, repos = structure(c(devxy = "https://cran.devxy.io/arm64/jammy/latest", CRAN = "https://cloud.r-project.org"))); install.packages("remotes"); remotes::install_deps()' -RUN rm -rf r-pkg-binaries +# deps from pak::pkg_deps(".")$package +RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "pat-s/desc@description-from-remote", "digest", "dplyr", "fansi", "fs", "future.apply", "future", "generics", "gert", "globals", "glue", "hms", "httr", "jsonlite", "lgr", "lifecycle", "listenv", "lubridate", "magrittr", "mime", "openssl", "parallelly", "paws.common", "paws.storage", "pillar", "pkgbuild", "pkgconfig", "processx", "progressr", "ps", "purrr", "rlang", "rstudioapi","s3fs", "stringi", "stringr", "sys", "tibble", "tidyselect", "timechange", "utf8", "vctrs", "withr", "xml2", "zip", "codetools", "pat-s/cranlike@s3", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise"))' + +COPY . . +RUN R CMD INSTALL . && rm -rf r-pkg-binaries CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/Dockerfile-ubuntu-2404 b/docker/Dockerfile-ubuntu-2404 index e88e5d2..ab186e0 100644 --- a/docker/Dockerfile-ubuntu-2404 +++ b/docker/Dockerfile-ubuntu-2404 @@ -4,6 +4,13 @@ ENV PATH=/opt/R/4.4.1/bin:$PATH ENV TZ="Europe/Berlin" ENV DEBIAN_FRONTEND=noninteractive +ENV ARCH=arm64 +ENV NCPUS=2 + +ENV AWS_ACCESS_KEY_ID="" +ENV AWS_SECRET_ACCESS_KEY="" +ENV PGPASS="" + ARG GITHUB_PAT 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 @@ -18,9 +25,18 @@ RUN curl -O https://devxy-r-builds.s3.eu-central-2.amazonaws.com/2404/r-4.4.1_1_ RUN gdebi -n -qq r-4.4.1_1_arm64.deb && rm r-4.4.1_1_arm64.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))' -COPY . . +# Makevars +RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCC=ccache gcc\nCPP=ccache gcc\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=ccache /usr/bin/gfortran\nFC=ccache /usr/bin/gfortran" >> /root/.R/Makevars' + +# R repos +RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(devxy = \"https://cran.devxy.io/${ARCH}/noble/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\", CRAN = \"https://cloud.r-project.org\")))" > /root/.Rprofile' +RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE" > /root/.Renviron' + # FIXME: switch to pak after https://github.com/r-lib/pak/issues/628 -RUN R -q -e 'Sys.setenv(PKG_SYSREQS = TRUE, PKG_SYSREQS_VERBOSE = TRUE); options(Ncpus = 4, repos = structure(c(devxy = "https://cran.devxy.io/arm64/noble/latest", CRAN = "https://cloud.r-project.org"))); install.packages("remotes"); remotes::install_deps()' -RUN rm -rf r-pkg-binaries +# deps from pak::pkg_deps(".")$package +RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "pat-s/desc@description-from-remote", "digest", "dplyr", "fansi", "fs", "future.apply", "future", "generics", "gert", "globals", "glue", "hms", "httr", "jsonlite", "lgr", "lifecycle", "listenv", "lubridate", "magrittr", "mime", "openssl", "parallelly", "paws.common", "paws.storage", "pillar", "pkgbuild", "pkgconfig", "processx", "progressr", "ps", "purrr", "rlang", "rstudioapi","s3fs", "stringi", "stringr", "sys", "tibble", "tidyselect", "timechange", "utf8", "vctrs", "withr", "xml2", "zip", "codetools", "pat-s/cranlike@s3", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise"))' + +COPY . . +RUN R CMD INSTALL . && rm -rf r-pkg-binaries CMD ["/bin/bash"] \ No newline at end of file