feat(ci): OS/OS_VERSION manual dropdowns + restore lost crow fix #97
3 changed files with 51 additions and 13 deletions
|
|
@ -10,10 +10,21 @@ variables:
|
||||||
- arm64
|
- arm64
|
||||||
default: amd64
|
default: amd64
|
||||||
OS:
|
OS:
|
||||||
description: "Base OS image name (e.g. alpine, redhat, ubuntu)."
|
description: "Base OS image name."
|
||||||
|
options:
|
||||||
|
- alpine
|
||||||
|
- redhat
|
||||||
|
- ubuntu
|
||||||
default: alpine
|
default: alpine
|
||||||
OS_VERSION:
|
OS_VERSION:
|
||||||
description: "OS version / image tag (e.g. 3.24, 9, jammy, noble)."
|
description: "OS image tag. Must match OS (alpine: 3.24; redhat: 8/9/10; ubuntu: jammy/noble)."
|
||||||
|
options:
|
||||||
|
- "3.24"
|
||||||
|
- "8"
|
||||||
|
- "9"
|
||||||
|
- "10"
|
||||||
|
- "jammy"
|
||||||
|
- "noble"
|
||||||
default: "3.24"
|
default: "3.24"
|
||||||
R_VERSION:
|
R_VERSION:
|
||||||
description: "Primary R version under /opt/R."
|
description: "Primary R version under /opt/R."
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,21 @@ variables:
|
||||||
- arm64
|
- arm64
|
||||||
default: amd64
|
default: amd64
|
||||||
OS:
|
OS:
|
||||||
description: "Base OS image name (e.g. alpine, redhat, ubuntu)."
|
description: "Base OS image name."
|
||||||
|
options:
|
||||||
|
- alpine
|
||||||
|
- redhat
|
||||||
|
- ubuntu
|
||||||
default: alpine
|
default: alpine
|
||||||
OS_VERSION:
|
OS_VERSION:
|
||||||
description: "OS version / image tag (e.g. 3.24, 9, jammy, noble)."
|
description: "OS image tag. Must match OS (alpine: 3.24; redhat: 8/9/10; ubuntu: jammy/noble)."
|
||||||
|
options:
|
||||||
|
- "3.24"
|
||||||
|
- "8"
|
||||||
|
- "9"
|
||||||
|
- "10"
|
||||||
|
- "jammy"
|
||||||
|
- "noble"
|
||||||
default: "3.24"
|
default: "3.24"
|
||||||
R_VERSION:
|
R_VERSION:
|
||||||
description: "Primary R version under /opt/R."
|
description: "Primary R version under /opt/R."
|
||||||
|
|
@ -90,13 +101,6 @@ steps:
|
||||||
from_secret: GITHUB_PAT
|
from_secret: GITHUB_PAT
|
||||||
# normal env vars
|
# normal env vars
|
||||||
GIT_USER: pat-s
|
GIT_USER: pat-s
|
||||||
# Export the platform selectors as runtime env vars. They are otherwise
|
|
||||||
# only available for ${...} interpolation (image/volume), so build-all.R's
|
|
||||||
# `Sys.getenv("OS")/("OS_VERSION")/("ARCH")` would be empty and its
|
|
||||||
# already-built dedup query would match platform "-" and skip nothing.
|
|
||||||
OS: ${OS}
|
|
||||||
OS_VERSION: ${OS_VERSION}
|
|
||||||
ARCH: ${ARCH}
|
|
||||||
# set the location of the 'pkgcache' cache dir which persists the R package dependencies needed to install the packages themselves
|
# set the location of the 'pkgcache' cache dir which persists the R package dependencies needed to install the packages themselves
|
||||||
R_PKG_CACHE_DIR: ${R_PKG_CACHE_DIR}
|
R_PKG_CACHE_DIR: ${R_PKG_CACHE_DIR}
|
||||||
R_LIBS_USER: /mnt/cache/R-pkgs
|
R_LIBS_USER: /mnt/cache/R-pkgs
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,31 @@ chunk <- chunk[!chunk$Package %in% exclude, ]
|
||||||
# pkgs_to_build.rds is a static snapshot from the install-deps step, so on a
|
# pkgs_to_build.rds is a static snapshot from the install-deps step, so on a
|
||||||
# restart it still lists everything an interrupted run already produced. The
|
# restart it still lists everything an interrupted run already produced. The
|
||||||
# metadata DB reflects that progress, so we re-derive the remaining set here.
|
# metadata DB reflects that progress, so we re-derive the remaining set here.
|
||||||
platform <- paste(Sys.getenv("OS"), gsub("[.]", "", Sys.getenv("OS_VERSION")), sep = "-")
|
# Derive platform + arch from the running container, mirroring the codename ->
|
||||||
arch <- Sys.getenv("ARCH")
|
# platform mapping bincraft uses internally. The OS/OS_VERSION selectors are
|
||||||
|
# workflow-level CI variables that are not injected into the container
|
||||||
|
# environment, so Sys.getenv() would return "" and this pre-filter would query
|
||||||
|
# platform "-" and skip nothing.
|
||||||
|
codename <- bincraft::set_codename(NULL)
|
||||||
|
platform <- switch(
|
||||||
|
codename,
|
||||||
|
jammy = "ubuntu-2204",
|
||||||
|
noble = "ubuntu-2404",
|
||||||
|
resolute = "ubuntu-2604",
|
||||||
|
rhel10 = "redhat-10",
|
||||||
|
rhel9 = "redhat-9",
|
||||||
|
rhel8 = "redhat-8",
|
||||||
|
alpine320 = "alpine-320",
|
||||||
|
alpine321 = "alpine-321",
|
||||||
|
alpine322 = "alpine-322",
|
||||||
|
alpine323 = "alpine-323",
|
||||||
|
alpine324 = "alpine-324",
|
||||||
|
alpine325 = "alpine-325",
|
||||||
|
alpine326 = "alpine-326",
|
||||||
|
NA_character_
|
||||||
|
)
|
||||||
|
local_machine <- Sys.info()[["machine"]]
|
||||||
|
arch <- if (grepl("arm64|aarch64", local_machine)) "arm64" else "amd64"
|
||||||
con <- DBI::dbConnect(
|
con <- DBI::dbConnect(
|
||||||
RPostgres::Postgres(),
|
RPostgres::Postgres(),
|
||||||
dbname = "build_metadata",
|
dbname = "build_metadata",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue