only parallelise package builds

This commit is contained in:
Patrick Schratz 2024-09-23 13:25:21 +02:00
commit 6db7443844
Signed by: pat-s
GPG key ID: 3C6318841EF78925
3 changed files with 93 additions and 76 deletions

View file

@ -65,6 +65,10 @@ archive_package <- function(
}
}
cli::cli_alert("{.fun archive_package}: Archiving {.field {basename(old_versions)}}, keeping {.field {basename(all_versions[index])}}.")
# suppress progressr output here
progressr::handlers("void")
# don't parallelise
future::plan("sequential")
s3fs::s3_file_move(old_versions, sprintf("%s/Archive/%s/%s", remote_bin_dir, .x, basename(old_versions)), overwrite = TRUE)
cli::cli_alert_success("{.fun archive_package}: Successfully archived package {.pkg {.x}}.")
if (!is.null(pause)) {

View file

@ -16,7 +16,9 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
deps_verbose = FALSE,
debug = FALSE,
force = FALSE,
archive = TRUE) {
archive = TRUE,
future_strategy = "multisession",
future_workers = 2) {
cli::cli_h2("Preparations ({.pkg {package_name}})")
codename <- set_codename(codename)
@ -81,6 +83,12 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
cli::cli_alert("[{format(Sys.time(), format='%H:%M:%S')}] Building binaries for {.pkg {package_name[[1]]}} with tags {.field {tag}}.")
future::plan(future_strategy,
workers = future_workers,
rscript_startup = quote(options(crayon.enabled = TRUE))
)
progressr::handlers("cli")
p <- progressr::progressor(along = tag)
worker_fun <- function(x, y, p) {

View file

@ -40,6 +40,11 @@ upload_single_binary_to_s3 <- function(
exists <- s3fs::s3_file_exists(sprintf("%s/%s", remote_bin_path, tarball_name))
# suppress progressr output here
progressr::handlers("void")
# don't parallelise
future::plan("sequential")
if ((!exists && !force) || (!exists && force)) {
cli::cli_alert("{.fun upload_single_binary_to_s3}: Uploading {.pkg {package_name}} {.field {tag}} to {.path {sprintf('%s/%s', remote_bin_path, tarball_name)}}.")
s3fs::s3_file_upload(