build in new root, upload PACKAGES file at the end

This commit is contained in:
Patrick Schratz 2024-07-26 12:23:52 +02:00
commit 4e24f4e743
Signed by: pat-s
GPG key ID: 3C6318841EF78925

View file

@ -15,6 +15,45 @@ when:
# PLATFORM_ID: suse155
steps:
- name: Build
secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token]
image: docker.io/pats22/arm-binaries-r-ubi9
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
volumes:
- arm-binaries-r-dep-cache-rhel9:/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/arm64-r-binaries.git && cd arm64-r-binaries
- rm -rf /mnt/cache/R-pkgs/00LOCK-arm64-r-binaries
- R -q -e 'install.packages(".", repos = NULL, quiet = FALSE); packageVersion("rBinaries")'
# manually install some packages into the cache so that some builds don't fail
# Hmisc -> ABCanalysis
# - R -q -e 'pak::pak("Hmisc")'
- mkdir -p /mnt/cache/pkgcache /mnt/cache/R-pkgs /mnt/cache/binaries
- R -q -e 'options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = "error"); pkgs = tools::CRAN_package_db()[[1]][7:10]; library(rBinaries); future::plan("multisession", workers = 4, rscript_startup = quote(options(crayon.enabled = TRUE))); foo = lapply(pkgs, function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE))'
backend_options:
kubernetes:
resources:
requests:
memory: 2000Mi
cpu: 2000m
limits:
memory: 6000Mi
cpu: 4050m
nodeSelector:
kubernetes.io/arch: 'arm64'
# - name: Sleep
# image: alpine:3.20
# commands: sleep 10
- name: Upload PACKAGES files
secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token]
image: docker.io/pats22/arm-binaries-r-ubi9
pull: true
@ -30,19 +69,16 @@ steps:
# 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/arm64-r-binaries.git && cd arm64-r-binaries
- R -q -e 'install.packages(".", repos = NULL, quiet = TRUE); packageVersion("rBinaries")'
# manually install some packages into the cache so that some builds don't fail
# Hmisc -> ABCanalysis
# - R -q -e 'pak::pak("Hmisc")'
- mkdir -p /mnt/cache/pkgcache /mnt/cache/R-pkgs
- R -q -e 'options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = "error"); pkgs = tools::CRAN_package_db()[[1]][3:5]; library(rBinaries); future::plan("multisession", workers = 4, rscript_startup = quote(options(crayon.enabled = TRUE))); foo = lapply(pkgs, function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE))'
- R -q -e 'options(crayon.enabled = TRUE); library(rBinaries); upload_package_index()'
- R -q -e 'files = list.files("/mnt/cache/binaries/", include.dirs = FALSE, full.names = TRUE, recursive = TRUE); foo = file.remove(files)'
backend_options:
kubernetes:
resources:
requests:
memory: 2000Mi
cpu: 2000m
memory: 300Mi
cpu: 0m
limits:
memory: 6000Mi
cpu: 4050m
memory: 500Mi
cpu: 1000m
nodeSelector:
kubernetes.io/arch: 'arm64'