make alpine dockerfile arch-agnostic

This commit is contained in:
Patrick Schratz 2024-09-04 22:38:55 +02:00
commit 125caa8a3e
Signed by: pat-s
GPG key ID: 3C6318841EF78925

View file

@ -7,18 +7,26 @@ matrix:
include:
# - PLATFORM: redhat-9
# BLOCK: 20099:21169
# ARCH: arm64
# - PLATFORM: redhat-8
# BLOCK: 20099:21169
# ARCH: arm64
# - PLATFORM: ubuntu-2404
# BLOCK: 20099:21169
# ARCH: arm64
# - PLATFORM: ubuntu-2204
# BLOCK: 20099:21169
# ARCH: arm64
- PLATFORM: alpine-320
BLOCK: 5881:length(pkgs)
ARCH: arm64
- PLATFORM: alpine-320
BLOCK: 4680:length(pkgs)
ARCH: amd64
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/arm-binaries-r-${PLATFORM}
image: docker.io/devxygmbh/${ARCH}-binaries-r-${PLATFORM}
pull: true
# to ensure the PACKAGES upload step is being executed
failure: ignore
@ -29,7 +37,7 @@ steps:
R_LIBS_USER: /mnt/cache/R-pkgs
CCACHE_DIR: /mnt/cache/ccache
volumes:
- arm-binaries-r-dep-cache-${PLATFORM}:/mnt/cache
- ${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
@ -65,38 +73,9 @@ steps:
# memory: 4Gi
# cpu: 2000m
nodeSelector:
kubernetes.io/arch: 'arm64'
kubernetes.io/arch: "${ARCH}"
tolerations:
- key: "CI"
operator: "Equal"
value: "true"
effect: "NoSchedule"
# - 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
# 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
# - R -q -e 'pak::local_install(); packageVersion("bincraftR")'
# - R -q -e 'pak::pak(c("dyfanjones/s3fs", "pat-s/desc@description-from-remote", "pat-s/cranlike@s3"))'
# - cd /mnt/cache/packages
# - R -q -e 'options(crayon.enabled = TRUE); library(bincraftR); upload_package_index()'
# backend_options:
# kubernetes:
# resources:
# requests:
# memory: 1000Mi
# cpu: 0m
# limits:
# memory: 1300Mi
# cpu: 1000m
# nodeSelector:
# kubernetes.io/arch: 'arm64'