minor
This commit is contained in:
parent
cb0cbbca7b
commit
7610e0507b
5 changed files with 38 additions and 18 deletions
|
|
@ -15,20 +15,20 @@ when:
|
|||
# PLATFORM_ID: suse155
|
||||
steps:
|
||||
- name: Build
|
||||
secrets: [red_hat_dev_pw, aws_access_key_id, aws_secret_access_key, pgpass]
|
||||
image: registry.access.redhat.com/ubi9
|
||||
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
|
||||
# PY_COLORS: 1
|
||||
commands:
|
||||
- subscription-manager register --username mail@devxy.io --password $RED_HAT_DEV_PW
|
||||
- subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
|
||||
- curl -s -O https://devxy-r-builds.s3.eu-central-003.backblazeb2.com/el9/R-4.0.5-1-1.aarch64.rpm
|
||||
- dnf install \
|
||||
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
|
||||
- dnf install -y R-4.0.5-1-1.aarch64.rpm
|
||||
- export PATH=/opt/R/4.0.5/bin:$PATH
|
||||
- R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
|
||||
- R -q -e 'Sys.setenv(PKG_SYSREQS = TRUE, PKG_SYSREQS_VERBOSE = TRUE, PKG_SYSREQS_PLATFORM = "redhat-9"); pak::pak()'
|
||||
# - echo $TERM
|
||||
# download latest package version (avoid having to rebuild image every time)
|
||||
- git config credential.helper '!f() { sleep 1; echo "username=${GIT_USER}"; echo "password=${GIT_RO_TOKEN}"; }; f'
|
||||
- git clone https://git.devxy.io/devxy/arm64-r-binaries.git && cd arm64-r-binaries
|
||||
- R CMD INSTALL .
|
||||
- R -q -e 'pkgs = tools::CRAN_package_db()[[1]][1:4]; library(rBinaries); devtools::load_all(); future::plan("sequential", workers = 4); lapply(pkgs, function(x) build_binary_package(x, build_for_minor=FALSE))'
|
||||
- R -q -e 'cli::cli_sitrep()'
|
||||
- R -q -e 'options(crayon.enabled = TRUE); pkgs = tools::CRAN_package_db()[[1]][1:2]; library(rBinaries); future::plan("multicore", workers = 2); lapply(pkgs, function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE))'
|
||||
backend_options:
|
||||
kubernetes:
|
||||
resources:
|
||||
|
|
@ -36,7 +36,7 @@ https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
|
|||
memory: 1500Mi
|
||||
cpu: 1000m
|
||||
limits:
|
||||
memory: 2000Mi
|
||||
memory: 4000Mi
|
||||
cpu: 2000m
|
||||
nodeSelector:
|
||||
kubernetes.io/arch: "arm64"
|
||||
kubernetes.io/arch: 'arm64'
|
||||
|
|
|
|||
|
|
@ -31,10 +31,12 @@ importFrom(lubridate,as_date)
|
|||
importFrom(lubridate,dmy_hms)
|
||||
importFrom(magrittr,"%>%")
|
||||
importFrom(pak,local_install_dev_deps)
|
||||
importFrom(paws.storage,s3)
|
||||
importFrom(pkgbuild,build)
|
||||
importFrom(purrr,list_rbind)
|
||||
importFrom(purrr,map)
|
||||
importFrom(s3fs,s3_file_exists)
|
||||
importFrom(s3fs,s3_file_system)
|
||||
importFrom(s3fs,s3_file_upload)
|
||||
importFrom(xml2,read_xml)
|
||||
importFrom(xml2,xml_find_all)
|
||||
importFrom(xml2,xml_find_first)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
|
|||
install_system_dependencies = TRUE) {
|
||||
cli::cli_h2("Preparations")
|
||||
codename <- set_codename(codename)
|
||||
cli::cli_alert_warning("DEBUG: codename {codename}.")
|
||||
|
||||
if (is.null(r_version_minor)) {
|
||||
r_version_minor <- sub("R version (\\d+\\.\\d+).*", "\\1", R.Version()$version.string)
|
||||
|
|
@ -20,9 +21,11 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
|
|||
|
||||
# create directory structure
|
||||
dir_out_bin <- set_bin_path(r_version_minor, build_for_minor, local_build_root, codename)
|
||||
cli::cli_alert_warning("DEBUG: dir_out_bin {dir_out_bin}.")
|
||||
|
||||
dir_out_src <- sprintf("%s/src/contrib/Archive", local_build_root)
|
||||
cli::cli_alert_info("{.fun build_binary_package}: Creating dir {.path {dir_out_bin}}.")
|
||||
cli::cli_alert_info("{.fun build_binary_package}: Creating dir {.path {dir_out_src}}.")
|
||||
cli::cli_alert_info("{.fun build_binary_package}: Creating bin dir {.path {dir_out_bin}}.")
|
||||
cli::cli_alert_info("{.fun build_binary_package}: Creating src dir {.path {dir_out_src}}.")
|
||||
dir.create(sprintf("%s/Archive", dir_out_bin), sprintf("%s/Archive", dir_out_src),
|
||||
recursive = TRUE
|
||||
)
|
||||
|
|
|
|||
|
|
@ -26,8 +26,11 @@ set_codename <- function(codename) {
|
|||
return(codename)
|
||||
}
|
||||
|
||||
#' Helper function to set the path for binary package outputs
|
||||
#' @export
|
||||
set_bin_path <- function(r_version_minor, build_for_minor, local_build_root, codename) {
|
||||
set_bin_path <- function(
|
||||
r_version_minor, build_for_minor,
|
||||
local_build_root, codename) {
|
||||
if (!build_for_minor) {
|
||||
path <- sprintf(
|
||||
"%s/__linux__/%s/latest/src/contrib",
|
||||
|
|
@ -39,6 +42,7 @@ set_bin_path <- function(r_version_minor, build_for_minor, local_build_root, cod
|
|||
local_build_root, codename, r_version_minor
|
||||
)
|
||||
}
|
||||
cli::cli_alert_warning("DEBUG: path {path}.")
|
||||
|
||||
return(path)
|
||||
}
|
||||
|
|
|
|||
11
man/set_bin_path.Rd
Normal file
11
man/set_bin_path.Rd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/helpers.R
|
||||
\name{set_bin_path}
|
||||
\alias{set_bin_path}
|
||||
\title{Helper function to set the path for binary package outputs}
|
||||
\usage{
|
||||
set_bin_path(r_version_minor, build_for_minor, local_build_root, codename)
|
||||
}
|
||||
\description{
|
||||
Helper function to set the path for binary package outputs
|
||||
}
|
||||
Loading…
Reference in a new issue