This commit is contained in:
Patrick Schratz 2024-09-20 16:24:55 +02:00
commit 5e43c25acf
Signed by: pat-s
GPG key ID: 3C6318841EF78925
4 changed files with 24 additions and 24 deletions

View file

@ -9,62 +9,62 @@ depends_on:
matrix: matrix:
include: include:
- PLATFORM: redhat-9 - PLATFORM: redhat-9
BLOCK: 1:length(pkgs) BLOCK: 72:length(pkgs)
ARCH: arm64 ARCH: arm64
NCPUS: 2 NCPUS: 2
MEMORY: 29Gi MEMORY: 29Gi
STRATEGY: multisession STRATEGY: multisession
- PLATFORM: redhat-8 - PLATFORM: redhat-8
BLOCK: 1:length(pkgs) BLOCK: 105:length(pkgs)
ARCH: arm64 ARCH: arm64
NCPUS: 2 NCPUS: 2
MEMORY: 29Gi MEMORY: 29Gi
STRATEGY: multisession STRATEGY: multisession
- PLATFORM: ubuntu-2404 - PLATFORM: ubuntu-2404
BLOCK: 1:length(pkgs) BLOCK: 17:length(pkgs)
ARCH: arm64 ARCH: arm64
NCPUS: 2 NCPUS: 2
MEMORY: 29Gi MEMORY: 29Gi
STRATEGY: multisession STRATEGY: multisession
- PLATFORM: ubuntu-2204 - PLATFORM: ubuntu-2204
BLOCK: 1:length(pkgs) BLOCK: 87:length(pkgs)
ARCH: arm64 ARCH: arm64
NCPUS: 2 NCPUS: 2
MEMORY: 29Gi MEMORY: 29Gi
STRATEGY: multisession STRATEGY: multisession
- PLATFORM: alpine-320 - PLATFORM: alpine-320
BLOCK: 1:length(pkgs) BLOCK: 139:length(pkgs)
ARCH: arm64 ARCH: arm64
NCPUS: 2 NCPUS: 2
MEMORY: 29Gi MEMORY: 29Gi
STRATEGY: multisession STRATEGY: multisession
### AMD # ### AMD
- PLATFORM: redhat-9 - PLATFORM: redhat-9
BLOCK: 1:length(pkgs) BLOCK: 157:length(pkgs)
ARCH: amd64 ARCH: amd64
NCPUS: 2 NCPUS: 2
MEMORY: 29Gi MEMORY: 29Gi
STRATEGY: multisession STRATEGY: multisession
- PLATFORM: redhat-8 - PLATFORM: redhat-8
BLOCK: 1:length(pkgs) BLOCK: 156:length(pkgs)
ARCH: amd64 ARCH: amd64
NCPUS: 2 NCPUS: 2
MEMORY: 29Gi MEMORY: 29Gi
STRATEGY: multisession STRATEGY: multisession
- PLATFORM: ubuntu-2404 - PLATFORM: ubuntu-2404
BLOCK: 1:length(pkgs) BLOCK: 77:length(pkgs)
ARCH: amd64 ARCH: amd64
NCPUS: 2 NCPUS: 2
MEMORY: 29Gi MEMORY: 29Gi
STRATEGY: multisession STRATEGY: multisession
- PLATFORM: ubuntu-2204 - PLATFORM: ubuntu-2204
BLOCK: 1:length(pkgs) BLOCK: 174:length(pkgs)
ARCH: amd64 ARCH: amd64
NCPUS: 2 NCPUS: 2
MEMORY: 29Gi MEMORY: 29Gi
STRATEGY: multisession STRATEGY: multisession
- PLATFORM: alpine-320 - PLATFORM: alpine-320
BLOCK: 1:length(pkgs) BLOCK: 138:length(pkgs)
ARCH: amd64 ARCH: amd64
NCPUS: 2 NCPUS: 2
MEMORY: 29Gi MEMORY: 29Gi

2
R/db.R
View file

@ -4,7 +4,7 @@
dbcon <- function() { dbcon <- function() {
DBI::dbConnect(RPostgres::Postgres(), DBI::dbConnect(RPostgres::Postgres(),
dbname = "build_metadata", host = "r-binaries.devxy.io", dbname = "build_metadata", host = "r-binaries.devxy.io",
port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS") port = 15432, user = "r_binaries", password = Sys.getenv("PGPASS")
) )
} }

View file

@ -5,12 +5,12 @@ store_build_metadata <- function(
force = FALSE, error = NA, build_duration = NA, size = NA) { force = FALSE, error = NA, build_duration = NA, size = NA) {
con <- DBI::dbConnect(RPostgres::Postgres(), con <- DBI::dbConnect(RPostgres::Postgres(),
dbname = "build_metadata", host = "r-binaries.devxy.io", dbname = "build_metadata", host = "r-binaries.devxy.io",
port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS") port = 15432, user = "r_binaries", password = Sys.getenv("PGPASS")
) )
# Check if an entry with the same package_name and tag already exists # Check if an entry with the same package_name and tag already exists
existing_entries <- dbGetQuery(con, paste0( existing_entries <- dbGetQuery(con, paste0(
"SELECT * FROM single_builds WHERE package_name = '", "SELECT * FROM single_builds WHERE name = '",
package_name, "' AND tag = '", tag, "' AND platform = '", platform, "'" package_name, "' AND tag = '", tag, "' AND platform = '", platform, "'"
)) ))
@ -19,21 +19,21 @@ store_build_metadata <- function(
} else if (nrow(existing_entries) >= 1 && force) { } else if (nrow(existing_entries) >= 1 && force) {
cli::cli_alert_info("{.fun store_build_metadata}: Force overwriting build metadata for {.pkg {package_name}} {.field {tag}} ({platform}) because {.code force = TRUE} was set.") cli::cli_alert_info("{.fun store_build_metadata}: Force overwriting build metadata for {.pkg {package_name}} {.field {tag}} ({platform}) because {.code force = TRUE} was set.")
DBI::dbExecute(con, "UPDATE single_builds SET build_timestamp = $1, error_occurred = $2, error = $3, build_duration = $4, size = $5 WHERE package_name = $6 and tag = $7 and platform = $8", DBI::dbExecute(con, "UPDATE single_builds SET timestamp = $1, error_occurred = $2, error_text = $3, duration = $4, size = $5 WHERE name = $6 and tag = $7 and platform = $8",
params = list(format(Sys.time(), "%Y-%m-%d %H:%M:%S"), error_occurred, error, build_duration, size, package_name, tag, platform) params = list(format(Sys.time(), "%Y-%m-%d %H:%M:%S"), error_occurred, error, build_duration, size, package_name, tag, platform)
) )
} else if (nrow(existing_entries) == 0) { } else if (nrow(existing_entries) == 0) {
cli::cli_alert("{.fun store_build_metadata}: Storing build metadata for {.pkg {package_name}} {.field {tag}}.") cli::cli_alert("{.fun store_build_metadata}: Storing build metadata for {.pkg {package_name}} {.field {tag}}.")
# if no entry exists already, we can insert the info via dbWriteTable by passing a DF # if no entry exists already, we can insert the info via dbWriteTable by passing a DF
metadata <- data.frame( metadata <- data.frame(
package_name = package_name, name = package_name,
tag = tag, tag = tag,
platform = platform, platform = platform,
error_occurred = error_occurred, error_occurred = error_occurred,
error = error, error_text = error,
build_timestamp = format(Sys.time(), "%Y-%m-%d %H:%M:%S"), size = size,
build_duration = build_duration, timestamp = format(Sys.time(), "%Y-%m-%d %H:%M:%S"),
size = size duration = build_duration
) )
# Write the data frame to the SQLite database # Write the data frame to the SQLite database
dbWriteTable(con, "single_builds", metadata, append = TRUE) dbWriteTable(con, "single_builds", metadata, append = TRUE)
@ -48,11 +48,11 @@ store_build_metadata <- function(
build_metadata_summary <- function(package_name, platform) { build_metadata_summary <- function(package_name, platform) {
con <- DBI::dbConnect(RPostgres::Postgres(), con <- DBI::dbConnect(RPostgres::Postgres(),
dbname = "build_metadata", host = "r-binaries.devxy.io", dbname = "build_metadata", host = "r-binaries.devxy.io",
port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS") port = 15432, user = "r_binaries", password = Sys.getenv("PGPASS")
) )
metadata <- dbGetQuery(con, sprintf( metadata <- dbGetQuery(con, sprintf(
"SELECT * FROM single_builds WHERE package_name = '%s' AND platform = '%s'", package_name, platform "SELECT * FROM single_builds WHERE name = '%s' AND platform = '%s'", package_name, platform
)) ))
cli::cli_alert("{.fun build_binary_package}: Building/updating metadata summary for {.pkg {package_name[[1]]}}.") cli::cli_alert("{.fun build_binary_package}: Building/updating metadata summary for {.pkg {package_name[[1]]}}.")

View file

@ -7,7 +7,7 @@
query_metadata_table <- function(table = "single_builds") { query_metadata_table <- function(table = "single_builds") {
con <- DBI::dbConnect(RPostgres::Postgres(), con <- DBI::dbConnect(RPostgres::Postgres(),
dbname = "build_metadata", host = "r-binaries.devxy.io", dbname = "build_metadata", host = "r-binaries.devxy.io",
port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS") port = 15432, user = "r_binaries", password = Sys.getenv("PGPASS")
) )
metadata <- tbl(con, table) metadata <- tbl(con, table)
return(metadata) return(metadata)
@ -18,7 +18,7 @@ query_metadata_table <- function(table = "single_builds") {
list_metadata_tables <- function() { list_metadata_tables <- function() {
con <- DBI::dbConnect(RPostgres::Postgres(), con <- DBI::dbConnect(RPostgres::Postgres(),
dbname = "build_metadata", host = "r-binaries.devxy.io", dbname = "build_metadata", host = "r-binaries.devxy.io",
port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS") port = 15432, user = "r_binaries", password = Sys.getenv("PGPASS")
) )
dbListTables(con) dbListTables(con)
} }