build-cran-binaries/.woodpecker/build.yaml
2024-09-13 11:23:21 +02:00

135 lines
7 KiB
YAML

when:
event: [manual]
skip_clone: true
depends_on:
- warm_up_build
matrix:
include:
# - PLATFORM: redhat-9
# BLOCK: 20099:21169
# ARCH: arm64
# NCPUS: 2
# MEMORY: 29Gi
# STRATEGY: multisession
# - PLATFORM: redhat-8
# BLOCK: 20099:21169
# ARCH: arm64
# NCPUS: 2
# MEMORY: 29Gi
# STRATEGY: multisession
# - PLATFORM: ubuntu-2404
# BLOCK: 20099:21169
# ARCH: arm64
# NCPUS: 2
# MEMORY: 29Gi
# STRATEGY: multisession
# - PLATFORM: ubuntu-2204
# BLOCK: 20099:21169
# ARCH: arm64
# NCPUS: 2
# MEMORY: 29Gi
# STRATEGY: multisession
- PLATFORM: alpine-320
BLOCK: 7065:length(pkgs)
ARCH: arm64
NCPUS: 2
MEMORY: 29Gi
STRATEGY: multisession
### AMD
- PLATFORM: redhat-9
BLOCK: 1:length(pkgs)
ARCH: amd64
NCPUS: 2
MEMORY: 29Gi
STRATEGY: multisession
- PLATFORM: redhat-8
BLOCK: 1:length(pkgs)
ARCH: amd64
NCPUS: 2
MEMORY: 29Gi
STRATEGY: multisession
- PLATFORM: ubuntu-2404
BLOCK: 1:length(pkgs)
ARCH: amd64
NCPUS: 2
MEMORY: 29Gi
STRATEGY: multisession
- PLATFORM: ubuntu-2204
BLOCK: 1:length(pkgs)
ARCH: amd64
NCPUS: 2
MEMORY: 29Gi
STRATEGY: multisession
- PLATFORM: alpine-320
BLOCK: 1090:length(pkgs)
ARCH: amd64
NCPUS: 2
MEMORY: 29Gi
STRATEGY: multisession
steps:
- name: 'Build binaries (${PLATFORM}: ${BLOCK})'
secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token, GITHUB_PAT]
image: docker.io/devxygmbh/${ARCH}-binaries-r-${PLATFORM}
pull: true
# to ensure the PACKAGES upload step is being executed
failure: ignore
environment:
GIT_USER: pat-s
# set the location of the 'pkgcache' cache dir which persists the R package dependencies needed to install the packages themselves
R_PKG_CACHE_DIR: /mnt/cache/pkgcache
R_LIBS_USER: /mnt/cache/R-pkgs
CCACHE_DIR: /mnt/cache/ccache
volumes:
- ${ARCH}-binaries-r-dep-cache-${PLATFORM}:/mnt/cache
commands:
# download latest package version (avoid having to rebuild image every time)
# rscript_startup arg: required to pass down global option to future workers https://github.com/HenrikBengtsson/future/issues/134#issuecomment-2245666169
- git clone https://pat-s:$$git_ro_token@git.devxy.io/devxy/r-pkg-binaries.git .
- rm -rf /mnt/cache/R-pkgs/00LOCK-r-pkg-binaries /mnt/cache/R-pkgs/00LOCK-bincraftR
# for some reason paks pkgcache is often corrupt
- rm -rf /mnt/cache/R-pkgs/pkgcache/ /mnt/cache/pkgcache/ /root/.cache/R/
- R -q -e 'pak::meta_update()'
- R CMD INSTALL .
# more complicated system dependencies which pak cannot resolve
- mkdir -p /mnt/cache/pkgcache /mnt/cache/R-pkgs /mnt/cache/ccache /mnt/cache/packages
# set additional repos: important as otherwise some packages cannot be resolved (e.g. INLA). Also: setting our own binary repos so we can make use of them for dep installation at some point
# - R -q -e 'options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL); pkgs = tools::CRAN_package_db()[[1]]; pkgs = setdiff(pkgs[${BLOCK}], c("biplotbootGUI", "BlockmodelingGUI", "cncaGUI", "EventDetectGUI", "irtGUI", "KappaGUI", "magickGUI", "miniGUI", "multibiplotGUI", "TextMiningGUI", "later", "RclusTool", "Rcmdr", "RcmdrMisc", "RcmdrPlugin.aRnova", "RcmdrPlugin.BiclustGUI", "RcmdrPlugin.BWS1", "RcmdrPlugin.BWS2", "RcmdrPlugin.BWS3", "RcmdrPlugin.cpd", "RcmdrPlugin.DCCV", "RcmdrPlugin.DCE", "RcmdrPlugin.depthTools", "RcmdrPlugin.DoE", "RcmdrPlugin.EACSPIR", "RcmdrPlugin.EBM", "RcmdrPlugin.EcoVirtual", "RcmdrPlugin.Export", "RcmdrPlugin.EZR", "RcmdrPlugin.FactoMineR", "RcmdrPlugin.GWRM", "RcmdrPlugin.HH", "RcmdrPlugin.KMggplot2", "RcmdrPlugin.MA", "RcmdrPlugin.MPAStats", "RcmdrPlugin.NMBU", "RcmdrPlugin.orloca", "RcmdrPlugin.PcaRobust", "RcmdrPlugin.RiskDemo", "RcmdrPlugin.RMTCJags", "RcmdrPlugin.ROC", "RcmdrPlugin.sos" , "RcmdrPlugin.survival", "RcmdrPlugin.TeachingDemos", "RcmdrPlugin.TeachStat", "RcmdrPlugin.temis", "RcmdrPlugin.UCA", "RcmdrPlugin.WorldFlora", "StratigrapheR", "tcltk2", "TVMM", "uHMM", "RInno", "webshot2")); library(bincraftR); future::plan("${STRATEGY}", workers = ${NCPUS}, rscript_startup = quote(options(crayon.enabled = TRUE))); options(progressr.enable = TRUE); progressr::handlers('cli'); progressr::handlers(global = TRUE); pkgs = foo = lapply(pkgs, function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE, platform = "${PLATFORM}"))'
### Manual pkg builds
# webshot2: wait for https://github.com/rstudio/r-system-requirements/pull/178
- xvfb-run R -q -e 'options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL); pkgs = c("WH", "ymd"); pkgs = setdiff(pkgs, c("biplotbootGUI", "cncaGUI", "dynBiplotGUI", "ade4TkGUI", "BlockmodelingGUI", "cncaGUI", "EventDetectGUI", "irtGUI", "KappaGUI", "magickGUI", "miniGUI", "multibiplotGUI", "TextMiningGUI", "later", "RclusTool", "Rcmdr", "RcmdrMisc", "RcmdrPlugin.aRnova", "RcmdrPlugin.BiclustGUI", "RcmdrPlugin.BWS1", "RcmdrPlugin.BWS2", "RcmdrPlugin.BWS3", "RcmdrPlugin.cpd", "RcmdrPlugin.DCCV", "RcmdrPlugin.DCE", "RcmdrPlugin.depthTools", "RcmdrPlugin.DoE", "RcmdrPlugin.EACSPIR", "RcmdrPlugin.EBM", "RcmdrPlugin.EcoVirtual", "RcmdrPlugin.Export", "RcmdrPlugin.EZR", "RcmdrPlugin.FactoMineR", "RcmdrPlugin.GWRM", "RcmdrPlugin.HH", "RcmdrPlugin.KMggplot2", "RcmdrPlugin.MA", "RcmdrPlugin.MPAStats", "RcmdrPlugin.NMBU", "RcmdrPlugin.orloca", "RcmdrPlugin.PcaRobust", "RcmdrPlugin.RiskDemo", "RcmdrPlugin.RMTCJags", "RcmdrPlugin.ROC", "RcmdrPlugin.sos" , "RcmdrPlugin.survival", "RcmdrPlugin.TeachingDemos", "RcmdrPlugin.TeachStat", "RcmdrPlugin.temis", "RcmdrPlugin.UCA", "RcmdrPlugin.WorldFlora", "sf", "StratigrapheR", "tcltk2", "TVMM", "uHMM", "RInno")); library(bincraftR); future::plan("${STRATEGY}", workers = ${NCPUS}, rscript_startup = quote(options(crayon.enabled = TRUE))); options(progressr.enable = TRUE); progressr::handlers(global = TRUE); progressr::handlers("cli"); foo = lapply(pkgs, function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE, platform = "${PLATFORM}"))'
backend_options:
kubernetes:
### PROD-parallel
resources:
requests:
memory: ${MEMORY}
cpu: 12000m
limits:
memory: ${MEMORY}
cpu: 16000m
### PROD-sequential
# resources:
# requests:
# memory: ${MEMORY}
# cpu: 2000m
# limits:
# memory: 29Gi
# cpu: 4000m
# DEBUG
# resources:
# requests:
# memory: 4Gi
# cpu: 2000m
# limits:
# memory: 4Gi
# cpu: 2000m
nodeSelector:
kubernetes.io/arch: "${ARCH}"
tolerations:
- key: "CI"
operator: "Equal"
value: "true"
effect: "NoSchedule"