fix: fix tag parsing for 'latest'

This commit is contained in:
Patrick Schratz 2024-11-05 17:20:44 +01:00
commit 7797efc8c5
Signed by: pat-s
GPG key ID: 3C6318841EF78925
6 changed files with 134 additions and 133 deletions

View file

@ -9,29 +9,29 @@ when:
skip_clone: true skip_clone: true
steps: steps:
# - name: 'Warming up' - name: 'Warming up'
# image: busybox:latest image: busybox:latest
# failure: ignore failure: ignore
# commands: commands:
# - sleep 300 - sleep 300
# - echo "Warmed Up" - echo "Warmed Up"
# backend_options: backend_options:
# kubernetes: kubernetes:
# resources: resources:
# requests: requests:
# memory: 14Gi memory: 14Gi
# cpu: 2000m cpu: 2000m
# limits: limits:
# memory: 14Gi memory: 14Gi
# cpu: 2000m cpu: 2000m
# nodeSelector: nodeSelector:
# kubernetes.io/arch: amd64 kubernetes.io/arch: amd64
# node.kubernetes.io/instance-type: ccx23 node.kubernetes.io/instance-type: ccx23
# tolerations: tolerations:
# - key: 'CI' - key: 'CI'
# operator: 'Equal' operator: 'Equal'
# value: 'true' value: 'true'
# effect: 'NoSchedule' effect: 'NoSchedule'
- name: 'Build binaries' - name: 'Build binaries'
secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token, GITHUB_PAT] secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token, GITHUB_PAT]

View file

@ -9,29 +9,29 @@ when:
skip_clone: true skip_clone: true
steps: steps:
# - name: 'Warming up' - name: 'Warming up'
# image: busybox:latest image: busybox:latest
# failure: ignore failure: ignore
# commands: commands:
# - sleep 300 - sleep 300
# - echo "Warmed Up" - echo "Warmed Up"
# backend_options: backend_options:
# kubernetes: kubernetes:
# resources: resources:
# requests: requests:
# memory: 14Gi memory: 14Gi
# cpu: 2000m cpu: 2000m
# limits: limits:
# memory: 14Gi memory: 14Gi
# cpu: 2000m cpu: 2000m
# nodeSelector: nodeSelector:
# kubernetes.io/arch: amd64 kubernetes.io/arch: amd64
# node.kubernetes.io/instance-type: ccx23 node.kubernetes.io/instance-type: ccx23
# tolerations: tolerations:
# - key: 'CI' - key: 'CI'
# operator: 'Equal' operator: 'Equal'
# value: 'true' value: 'true'
# effect: 'NoSchedule' effect: 'NoSchedule'
- name: 'Build binaries' - name: 'Build binaries'
secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token, GITHUB_PAT] secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token, GITHUB_PAT]

View file

@ -9,29 +9,29 @@ when:
skip_clone: true skip_clone: true
steps: steps:
- name: 'Warming up' # - name: 'Warming up'
image: busybox:latest # image: busybox:latest
failure: ignore # failure: ignore
commands: # commands:
- sleep 300 # - sleep 300
- echo "Warmed Up" # - echo "Warmed Up"
backend_options: # backend_options:
kubernetes: # kubernetes:
resources: # resources:
requests: # requests:
memory: 14Gi # memory: 14Gi
cpu: 2000m # cpu: 2000m
limits: # limits:
memory: 14Gi # memory: 14Gi
cpu: 2000m # cpu: 2000m
nodeSelector: # nodeSelector:
kubernetes.io/arch: amd64 # kubernetes.io/arch: amd64
node.kubernetes.io/instance-type: ccx23 # node.kubernetes.io/instance-type: ccx23
tolerations: # tolerations:
- key: 'CI' # - key: 'CI'
operator: 'Equal' # operator: 'Equal'
value: 'true' # value: 'true'
effect: 'NoSchedule' # effect: 'NoSchedule'
- name: 'Build binaries' - name: 'Build binaries'
secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token, GITHUB_PAT] secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token, GITHUB_PAT]
@ -50,10 +50,10 @@ steps:
ARCH: amd64 ARCH: amd64
NCPUS: 2 NCPUS: 2
MEMORY: 14Gi MEMORY: 14Gi
INSTANCE_TYPE: ccx23 INSTANCE_TYPE: AX42
STRATEGY: sequential STRATEGY: sequential
volumes: # volumes:
- amd64-binaries-r-dep-cache-redhat-9:/mnt/cache # - amd64-binaries-r-dep-cache-redhat-9:/mnt/cache
commands: commands:
# download latest package version (avoid having to rebuild image every time) # 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 # rscript_startup arg: required to pass down global option to future workers https://github.com/HenrikBengtsson/future/issues/134#issuecomment-2245666169
@ -107,7 +107,7 @@ steps:
### PROD-parallel ### PROD-parallel
resources: resources:
requests: requests:
memory: 14Gi memory: 5Gi
cpu: 2000m cpu: 2000m
limits: limits:
memory: 14Gi memory: 14Gi
@ -130,7 +130,7 @@ steps:
# cpu: 2000m # cpu: 2000m
nodeSelector: nodeSelector:
kubernetes.io/arch: amd64 kubernetes.io/arch: amd64
node.kubernetes.io/instance-type: ccx23 node.kubernetes.io/instance-type: AX42
tolerations: tolerations:
- key: 'CI' - key: 'CI'
operator: 'Equal' operator: 'Equal'

View file

@ -9,33 +9,33 @@ when:
skip_clone: true skip_clone: true
steps: steps:
# - name: 'Warming up' - name: 'Warming up'
# image: busybox:latest image: busybox:latest
# failure: ignore failure: ignore
# commands: commands:
# - sleep 300 - sleep 300
# - echo "Warmed Up" - echo "Warmed Up"
# backend_options: backend_options:
# kubernetes: kubernetes:
# resources: resources:
# requests: requests:
# memory: 14Gi memory: 14Gi
# cpu: 2000m cpu: 2000m
# limits: limits:
# memory: 14Gi memory: 14Gi
# cpu: 2000m cpu: 2000m
# nodeSelector: nodeSelector:
# kubernetes.io/arch: amd64 kubernetes.io/arch: amd64
# node.kubernetes.io/instance-type: ccx23 node.kubernetes.io/instance-type: ccx23
# tolerations: tolerations:
# - key: 'CI' - key: 'CI'
# operator: 'Equal' operator: 'Equal'
# value: 'true' value: 'true'
# effect: 'NoSchedule' effect: 'NoSchedule'
- name: 'Build binaries' - name: 'Build binaries'
secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token, GITHUB_PAT] secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token, GITHUB_PAT]
image: docker.io/devxygmbh/amd64-binaries-r-amd64 image: docker.io/devxygmbh/amd64-binaries-r-ubuntu-2204
pull: true pull: true
# to ensure the PACKAGES upload step is being executed # to ensure the PACKAGES upload step is being executed
failure: ignore failure: ignore

View file

@ -9,29 +9,29 @@ when:
skip_clone: true skip_clone: true
steps: steps:
# - name: 'Warming up' - name: 'Warming up'
# image: busybox:latest image: busybox:latest
# failure: ignore failure: ignore
# commands: commands:
# - sleep 300 - sleep 300
# - echo "Warmed Up" - echo "Warmed Up"
# backend_options: backend_options:
# kubernetes: kubernetes:
# resources: resources:
# requests: requests:
# memory: 14Gi memory: 14Gi
# cpu: 2000m cpu: 2000m
# limits: limits:
# memory: 14Gi memory: 14Gi
# cpu: 2000m cpu: 2000m
# nodeSelector: nodeSelector:
# kubernetes.io/arch: amd64 kubernetes.io/arch: amd64
# node.kubernetes.io/instance-type: ccx23 node.kubernetes.io/instance-type: ccx23
# tolerations: tolerations:
# - key: 'CI' - key: 'CI'
# operator: 'Equal' operator: 'Equal'
# value: 'true' value: 'true'
# effect: 'NoSchedule' effect: 'NoSchedule'
- name: 'Build binaries' - name: 'Build binaries'
secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token, GITHUB_PAT] secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass, git_ro_token, GITHUB_PAT]
@ -70,7 +70,7 @@ steps:
# - Rsymphony/ROI.plugin.symphony/adea/PortfolioAnalytics -> can't install/link external SYMPHONY lib (only on RHEL, as for others syslib exists) # - Rsymphony/ROI.plugin.symphony/adea/PortfolioAnalytics -> can't install/link external SYMPHONY lib (only on RHEL, as for others syslib exists)
# - Rglpk # - Rglpk
# biplotbootGUI: somehow ubuntu still hangs even when using xvfb-run # biplotbootGUI: somehow ubuntu still hangs even when using xvfb-run
- xvfb-run R -q -e 'options(crayon.enabled = TRUE, Ncpus = $NCPUS, future.globals.onReference = NULL); pkgs = tools::CRAN_package_db()[[1]]; pkgs = setdiff(pkgs, c("biplotbootGUI", "Rsymphony", "PortfolioAnalytics", "ROI.plugin.symphony", "adea", "RInno", "skedastic", "RPushbullet", "SimNPH", "SimDesign","simCAT", "SIAmodules", "shinytest2", "shinyIRT", "ShinyItemAnalysis", "shiny.benchmark", "scDIFtest", "RSP", "ROracle", "ROI.plugin.qpoases", "ROI.plugin.cplex", "RmecabKo", "rmarchingcubes", "RcppMeCab", "Rcplex", "ravetools", "Rbeast", "Rblpapi", "RcppEnsmallen", "qtkit", "priorCON", "prior3D", "PerFit", "outlierensembles", "nomnoml", "mxfda", "MultBiplotR", "mstDIF", "mdsr", "makepipe", "lordif", "KSgeneral", "kequate", "jstager", "jrt", "irtreliability", "irtQ", "irtpwr", "irtawsi", "GRShiny", "gpuR", "googletraffic", "giacR", "gamstransfer", "aflps", "flow", "filters", "faoutlier", "equateIRT", "EnrichIntersect", "EFA.dimensions", "DFIT", "D3mirt", "ctgdist", "CoTiMA", "ConvertPar", "clrng", "bscui", "BifactorIndicesCalculator", "autoFC", "airt")); 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); foo = lapply(pkgs[$BLOCK], function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE, platform = "amd64"))' - xvfb-run R -q -e "options(crayon.enabled = TRUE, Ncpus = $NCPUS, future.globals.onReference = NULL); pkgs = tools::CRAN_package_db()[[1]]; pkgs = setdiff(pkgs, c('biplotbootGUI', 'Rsymphony', 'PortfolioAnalytics', 'ROI.plugin.symphony', 'adea', 'RInno', 'skedastic', 'RPushbullet', 'SimNPH', 'SimDesign','simCAT', 'SIAmodules', 'shinytest2', 'shinyIRT', 'ShinyItemAnalysis', 'shiny.benchmark', 'scDIFtest', 'RSP', 'ROracle', 'ROI.plugin.qpoases', 'ROI.plugin.cplex', 'RmecabKo', 'rmarchingcubes', 'RcppMeCab', 'Rcplex', 'ravetools', 'Rbeast', 'Rblpapi', 'RcppEnsmallen', 'qtkit', 'priorCON', 'prior3D', 'PerFit', 'outlierensembles', 'nomnoml', 'mxfda', 'MultBiplotR', 'mstDIF', 'mdsr', 'makepipe', 'lordif', 'KSgeneral', 'kequate', 'jstager', 'jrt', 'irtreliability', 'irtQ', 'irtpwr', 'irtawsi', 'GRShiny', 'gpuR', 'googletraffic', 'giacR', 'gamstransfer', 'aflps', 'flow', 'filters', 'faoutlier', 'equateIRT', 'EnrichIntersect', 'EFA.dimensions', 'DFIT', 'D3mirt', 'ctgdist', 'CoTiMA', 'ConvertPar', 'clrng', 'bscui', 'BifactorIndicesCalculator', 'autoFC', 'airt')); 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); foo = lapply(pkgs[$BLOCK], function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE, platform = 'ubuntu-2404'))"
### Manual pkg builds ### Manual pkg builds
# webshot2, tabledown, TestAnaAPP, trekcolors, Spectran, SimNPH, RPushbullet, SimDesign, simCAT, SIAmodules, shinytest2, ShinyItemAnalysis, shinyIRT, shiny.benchmark, scDIFtest, RSP, qtkit, PROsetta, prettifyAddins, PerFit, outlierensembles, nomnoml, mxfda, MultBiplotR, mstDIF, mdsr, makepipe, lordif, kequate, jstager, jrt, irtreliability, irtQ, irtpwr, irtGUI, irtawsi, GRShiny, GPCMlasso, googletraffic, giacR, flps, flow, faoutlier, equateIRT, EnrichIntersect, EFA.dimensions, DFIT, D3mirt, ctgdist, CoTiMA, ConvertPar, bscui, BifactorIndicesCalculator, autoFC, airt: wait for https://github.com/rstudio/r-system-requirements/pull/178 # webshot2, tabledown, TestAnaAPP, trekcolors, Spectran, SimNPH, RPushbullet, SimDesign, simCAT, SIAmodules, shinytest2, ShinyItemAnalysis, shinyIRT, shiny.benchmark, scDIFtest, RSP, qtkit, PROsetta, prettifyAddins, PerFit, outlierensembles, nomnoml, mxfda, MultBiplotR, mstDIF, mdsr, makepipe, lordif, kequate, jstager, jrt, irtreliability, irtQ, irtpwr, irtGUI, irtawsi, GRShiny, GPCMlasso, googletraffic, giacR, flps, flow, faoutlier, equateIRT, EnrichIntersect, EFA.dimensions, DFIT, D3mirt, ctgdist, CoTiMA, ConvertPar, bscui, BifactorIndicesCalculator, autoFC, airt: wait for https://github.com/rstudio/r-system-requirements/pull/178
# RInno: Windows-only # RInno: Windows-only

View file

@ -72,22 +72,23 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
gert::git_config_global_set("advice.detachedHead", "false") gert::git_config_global_set("advice.detachedHead", "false")
if (tag == "latest" || is.null(tag)) { if (is.null(tag) || tag == "latest") {
gert::git_clone(sprintf("https://github.com/cran/%s", package_name), gert::git_clone(sprintf("https://github.com/cran/%s", package_name),
path = sprintf("%s/%s", tempdir(), "tmp1"), path = sprintf("%s/%s", tempdir(), "tmp1"),
verbose = FALSE verbose = FALSE
) )
# Retrieve all tags
all_tags <- gert::git_tag_list(repo = sprintf("%s/%s", tempdir(), "tmp1"))
# filter out tags that start with R- (= non-valid ones)
all_tags <- all_tags[!grepl("R-", all_tags$name), ]
unlink(sprintf("%s/%s", tempdir(), "tmp1"), force = TRUE, recursive = TRUE)
tag <- all_tags$name
# gert cannot sort by date (which is a problem for properly sorting tags like 1.0-10 and others) # gert cannot sort by date (which is a problem for properly sorting tags like 1.0-10 and others)
if (tag == "latest") { if (!is.null(tag) && tag == "latest") {
system("git tag --sort=-creatordate | head -1") tag = system("git tag --sort=-creatordate | head -1", intern = TRUE)
} } else {
# Retrieve all tags
all_tags <- gert::git_tag_list(repo = sprintf("%s/%s", tempdir(), "tmp1"))
# filter out tags that start with R- (= non-valid ones)
all_tags <- all_tags[!grepl("R-", all_tags$name), ]
unlink(sprintf("%s/%s", tempdir(), "tmp1"), force = TRUE, recursive = TRUE)
tag <- all_tags$name
}
package_name <- rep(package_name, length(tag)) package_name <- rep(package_name, length(tag))
} }