devxy/build-cran-binaries
Watch
1
0
Fork
You've already forked build-cran-binaries
0

Compare commits

..
64 changed files with 2407 additions and 3160 deletions

View file

@ -74,7 +74,6 @@ steps:
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git . - git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
- mkdir -p /tmp/R-pkgs - mkdir -p /tmp/R-pkgs
- /opt/R/4.5.3/bin/Rscript local/install-bincraft.R - /opt/R/4.5.3/bin/Rscript local/install-bincraft.R
- UVR_R_BIN=/opt/R/4.5.3/bin/R local/uvr-install.sh RPostgres
- | - |
set -eu set -eu
LIMIT="" LIMIT=""

View file

@ -140,11 +140,12 @@ steps:
from_secret: PGPASS from_secret: PGPASS
REPO_RO_TOKEN: REPO_RO_TOKEN:
from_secret: REPO_RO_TOKEN from_secret: REPO_RO_TOKEN
# bincraft reads the DESCRIPTION of every new or replaced tarball from # uvr resolves bincraft's dependencies through the GitHub API, including
# the CRAN mirror on raw.githubusercontent.com, and authenticates with # the pat-s/cranlike@s3 fork. Unauthenticated it is rate limited, and the
# this token when it is set. A slot whose published index cannot be read # failure is not loud: uvr warns, falls back to the registry copy of
# is re-read in full, ~25k requests, which the anonymous rate limit would # cranlike, and the index write then dies on `unused argument (built =
# cut short. # built)` because upstream has no such parameter. Intermittent by nature,
# since it depends on the rate-limit window.
GITHUB_PAT: GITHUB_PAT:
from_secret: GITHUB_PAT from_secret: GITHUB_PAT
GIT_USER: pat-s GIT_USER: pat-s
@ -155,7 +156,6 @@ steps:
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git . - git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
- mkdir -p /tmp/R-pkgs - mkdir -p /tmp/R-pkgs
- /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R - /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R
- UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres
- | - |
set -eu set -eu
LIMIT="" LIMIT=""

View file

@ -36,13 +36,6 @@ variables:
- 4.5.3 - 4.5.3
- 4.4.3 - 4.4.3
default: 4.5.3 default: 4.5.3
SEED_FROM:
# Only for bootstrapping a new slot. Copies the pure-R binaries of these
# slots (same OS family and arch, same primary R minor; see
# local/seed-pure-r.R) before the build list is computed, so build-all only
# compiles what actually needs compiling. Space-separated, first wins.
description: 'Existing slots to copy pure-R binaries from, e.g. "alpine324 alpine323". Empty: no seeding.'
default: ''
when: when:
- event: manual - event: manual
@ -93,9 +86,8 @@ steps:
# Pin the same bincraft version the build steps use, so the precomputed # Pin the same bincraft version the build steps use, so the precomputed
# snapshot and the per-agent library stay consistent across the pipeline. # snapshot and the per-agent library stay consistent across the pipeline.
- /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R - /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R
- UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres s3fs data.table future jsonlite purrr - UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres s3fs data.table future jsonlite
- /opt/R/$R_VERSION/bin/R -q -e 'packageVersion("bincraft")' - /opt/R/$R_VERSION/bin/R -q -e 'packageVersion("bincraft")'
- if [ -n "${SEED_FROM}" ]; then /opt/R/$R_VERSION/bin/Rscript local/seed-pure-r.R ${SEED_FROM}; fi
- /opt/R/$R_VERSION/bin/R -q -e "source('local/packages-to-build.R'); saveRDS(pkgs, '/mnt/cache/packages/pkgs_to_build.rds'); saveRDS(pkgs[r_minor_sensitive == TRUE], '/mnt/cache/packages/r_minor_sensitive_pkgs.rds'); sprintf('Precomputed %s package versions (%s r-minor-sensitive)', nrow(pkgs), nrow(pkgs[r_minor_sensitive == TRUE]))" - /opt/R/$R_VERSION/bin/R -q -e "source('local/packages-to-build.R'); saveRDS(pkgs, '/mnt/cache/packages/pkgs_to_build.rds'); saveRDS(pkgs[r_minor_sensitive == TRUE], '/mnt/cache/packages/r_minor_sensitive_pkgs.rds'); sprintf('Precomputed %s package versions (%s r-minor-sensitive)', nrow(pkgs), nrow(pkgs[r_minor_sensitive == TRUE]))"
backend_options: backend_options:
docker: docker:

View file

@ -136,18 +136,10 @@ steps:
R_LIBS_USER: /mnt/cache/R-pkgs R_LIBS_USER: /mnt/cache/R-pkgs
CCACHE_DIR: /mnt/cache/ccache CCACHE_DIR: /mnt/cache/ccache
NCPUS: 2 NCPUS: 2
# Whole hours the build passes below may use, measured from the step's
# start. The repo timeout is 50h; the remainder is left for archiving the
# missed packages, so a long run ends cleanly instead of being killed.
BUILD_BUDGET_HOURS: 44
volumes: volumes:
- ${ARCH}-binaries-r-dep-cache-${OS}-${OS_VERSION//./}:/mnt/cache - ${ARCH}-binaries-r-dep-cache-${OS}-${OS_VERSION//./}:/mnt/cache
commands: commands:
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git . - git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
- . local/compiler-cache.sh
# One deadline shared by every build pass in this step, read by
# local/build-all.R and local/build-newer-r.R before each package.
- export BUILD_DEADLINE=$(( $(date +%s) + BUILD_BUDGET_HOURS * 3600 ))
- mkdir -p /mnt/cache/uvr/cache /mnt/cache/uvr/packages /mnt/cache/R-pkgs /mnt/cache/ccache /mnt/cache/packages - mkdir -p /mnt/cache/uvr/cache /mnt/cache/uvr/packages /mnt/cache/R-pkgs /mnt/cache/ccache /mnt/cache/packages
# The primary pass must not rely on build-all-versions-install-deps having # The primary pass must not rely on build-all-versions-install-deps having
# run on *this* agent: depends_on only orders the steps, but the cache # run on *this* agent: depends_on only orders the steps, but the cache
@ -160,8 +152,8 @@ steps:
# The dependency-prep job may run on another agent whose cache volume is # The dependency-prep job may run on another agent whose cache volume is
# not visible here. Install the packages needed to recompute the snapshot # not visible here. Install the packages needed to recompute the snapshot
# and query build metadata in every build job. # and query build metadata in every build job.
- UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres s3fs data.table future jsonlite purrr - UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres s3fs data.table future jsonlite
- XVFB=$(command -v xwfb-run 2>/dev/null || command -v xvfb-run); XVFB_ARGS="-a"; if command -v xwfb-run >/dev/null 2>&1; then dnf install -y -q weston 2>/dev/null; XVFB_ARGS="-c weston"; fi - XVFB=$(command -v xwfb-run 2>/dev/null || command -v xvfb-run); XVFB_ARGS=""; if command -v xwfb-run >/dev/null 2>&1; then dnf install -y -q weston 2>/dev/null; XVFB_ARGS="-c weston"; fi
- $XVFB $XVFB_ARGS -n $SPLIT_INDEX -- /opt/R/$R_VERSION/bin/Rscript local/build-all.R $SPLIT_INTO $SPLIT_INDEX $NCPUS 2>&1 - $XVFB $XVFB_ARGS -n $SPLIT_INDEX -- /opt/R/$R_VERSION/bin/Rscript local/build-all.R $SPLIT_INTO $SPLIT_INDEX $NCPUS 2>&1
- | - |
PRIMARY_MINOR=$(echo "$R_VERSION" | cut -d. -f1-2) PRIMARY_MINOR=$(echo "$R_VERSION" | cut -d. -f1-2)
@ -201,10 +193,6 @@ steps:
from_secret: B2_S3_ACCESS_KEY from_secret: B2_S3_ACCESS_KEY
B2_S3_SECRET_KEY: B2_S3_SECRET_KEY:
from_secret: B2_S3_SECRET_KEY from_secret: B2_S3_SECRET_KEY
# A per-minor index reads the ABI classifier cache and the flat-object
# safety table from the build database, and is not republished without it.
PGPASS:
from_secret: PGPASS
R_LIBS_USER: /mnt/cache/R-pkgs R_LIBS_USER: /mnt/cache/R-pkgs
volumes: volumes:
- ${ARCH}-binaries-r-dep-cache-${OS}-${OS_VERSION//./}:/mnt/cache - ${ARCH}-binaries-r-dep-cache-${OS}-${OS_VERSION//./}:/mnt/cache
@ -212,15 +200,10 @@ steps:
- | - |
CODENAME=$(/opt/R/$R_VERSION/bin/Rscript -e "cat(bincraft::set_codename(NULL))") CODENAME=$(/opt/R/$R_VERSION/bin/Rscript -e "cat(bincraft::set_codename(NULL))")
/opt/R/$R_VERSION/bin/R -q -e "bincraft::upload_package_index(codename = '$CODENAME', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'))" /opt/R/$R_VERSION/bin/R -q -e "bincraft::upload_package_index(codename = '$CODENAME', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'))"
FAILED_MINORS=""
for RBIN in /opt/R/[0-9]*/bin/R; do for RBIN in /opt/R/[0-9]*/bin/R; do
RMINOR=$(basename "$(dirname "$(dirname "$RBIN")")" | cut -d. -f1-2) RMINOR=$(basename "$(dirname "$(dirname "$RBIN")")" | cut -d. -f1-2)
/opt/R/$R_VERSION/bin/R -q -e "bincraft::upload_package_index(codename = '$CODENAME', r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'), metadata_db_host = 'r-binaries.devxy.io', metadata_db_name = 'build_metadata', metadata_db_port = 15432L, metadata_db_user = 'rpkgs', metadata_db_password = Sys.getenv('PGPASS'), metadata_db_sslmode = 'verify-full')" || FAILED_MINORS="$FAILED_MINORS $RMINOR" /opt/R/$R_VERSION/bin/R -q -e "bincraft::upload_package_index(codename = '$CODENAME', r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'))" || true
done done
if [ -n "$FAILED_MINORS" ]; then
echo "Could not republish the per-minor index for:$FAILED_MINORS" >&2
exit 1
fi
backend_options: backend_options:
docker: docker:
resources: resources:

View file

@ -1,79 +0,0 @@
# Collect CDN access logs and publish the public download statistics.
#
# Each run reads the last 70 hours of cran-rpkgs access logs from Bunny into
# `download_stats.events` (build metadata Postgres), then rewrites
# https://cran.rpkgs.com/stats/downloads.json, which the rpkgs.com /stats page
# reads. Bunny keeps logs for only three days, so a run every hour leaves room
# for two days of failed runs before anything is lost. Re-reading the window is
# safe: events are keyed by Bunny's request id.
#
# The classification rules and what is excluded are documented in
# `stats/README.md`.
#
# Register the `download-stats` cron (hourly, `0 * * * *`) in the crow UI, or
# run manually:
# crow pipeline create --branch main --var download_stats=true devxy/build-cran-binaries
#
# Secrets:
# STATS_CLIENT_SALT HMAC key for the client hash. Rotating it resets
# distinct-client counts, so keep it stable.
# STATS_OWN_NETWORKS Comma-separated CIDRs of our own CI runners.
# Both live in OpenBao at development/agent-dev/rpkgs-download-stats.
variables:
download_stats:
description: 'Collect and publish download statistics. Also gates this pipeline.'
options:
- 'true'
- 'false'
default: 'false'
when:
- event: manual
evaluate: 'download_stats == "true"'
- event: cron
cron: download-stats
skip_clone: true
labels:
group: rpkgs-amd64
steps:
- name: 'Collect and publish download stats'
image: oven/bun:1.4.5-alpine
pull: true
environment:
BUNNYNET_API_KEY:
from_secret: BUNNYNET_API_KEY
PGPASS:
from_secret: PGPASS
B2_S3_ACCESS_KEY:
from_secret: B2_S3_ACCESS_KEY
B2_S3_SECRET_KEY:
from_secret: B2_S3_SECRET_KEY
STATS_CLIENT_SALT:
from_secret: STATS_CLIENT_SALT
STATS_OWN_NETWORKS:
from_secret: STATS_OWN_NETWORKS
REPO_RO_TOKEN:
from_secret: REPO_RO_TOKEN
commands:
- apk add --no-cache -q git
- git clone -q --depth 1 --branch "$CI_COMMIT_BRANCH" https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
- bun test stats
- bun stats/collect.ts
- bun stats/publish.ts
backend_options:
kubernetes:
resources:
requests:
memory: 256Mi
cpu: 250m
limits:
memory: 1Gi
cpu: 1000m
tolerations:
- key: 'CI'
operator: 'Equal'
value: 'true'
effect: 'NoSchedule'

View file

@ -179,8 +179,6 @@ steps:
R_LIBS_USER: /mnt/cache/R-pkgs R_LIBS_USER: /mnt/cache/R-pkgs
R_VERSION: ${R_VERSION} R_VERSION: ${R_VERSION}
CCACHE_DIR: /mnt/cache/ccache CCACHE_DIR: /mnt/cache/ccache
# parallel make within one package build, matched to the step's CPU limit
MAKE_JOBS: 3
PLATFORM: ${OS} PLATFORM: ${OS}
OS_ID: ${OS_ID} OS_ID: ${OS_ID}
ARCH: ${ARCH} ARCH: ${ARCH}
@ -188,16 +186,15 @@ steps:
INTERVAL: lubridate::interval(lubridate::today() - 6, lubridate::today() - 3) INTERVAL: lubridate::interval(lubridate::today() - 6, lubridate::today() - 3)
commands: commands:
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git . - git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
- . local/compiler-cache.sh
- rm -rf /mnt/cache/R-pkgs/00LOCK-* /mnt/cache/R-pkgs/bincraft - rm -rf /mnt/cache/R-pkgs/00LOCK-* /mnt/cache/R-pkgs/bincraft
- mkdir -p /mnt/cache/uvr/cache /mnt/cache/uvr/packages /mnt/cache/R-pkgs /mnt/cache/ccache /mnt/cache/packages - mkdir -p /mnt/cache/uvr/cache /mnt/cache/uvr/packages /mnt/cache/R-pkgs /mnt/cache/ccache /mnt/cache/packages
- /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R - /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R
- UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres progressr lubridate - UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres
- /opt/R/$R_VERSION/bin/R -q -e 'packageVersion("bincraft")' - /opt/R/$R_VERSION/bin/R -q -e 'packageVersion("bincraft")'
# rhel-10 ships xwfb-run (Xwayland) instead of xvfb-run; prefer it and start weston, else fall back to xvfb-run # rhel-10 ships xwfb-run (Xwayland) instead of xvfb-run; prefer it and start weston, else fall back to xvfb-run
- XVFB=$(command -v xwfb-run 2>/dev/null || command -v xvfb-run); XVFB_ARGS="-a"; if command -v xwfb-run >/dev/null 2>&1; then dnf install -y -q weston 2>/dev/null; XVFB_ARGS="-c weston"; fi - XVFB=$(command -v xwfb-run 2>/dev/null || command -v xvfb-run); XVFB_ARGS=""; if command -v xwfb-run >/dev/null 2>&1; then dnf install -y -q weston 2>/dev/null; XVFB_ARGS="-c weston"; fi
# options(future.globals.onReference = NULL): for some reason s3fs::file_delete() throws 'Error: Detected a non-exportable reference ('externalptr') in one of the globals ('FUN' of class 'function') used in the future expression' otherwise # options(future.globals.onReference = NULL): for some reason s3fs::file_delete() throws 'Error: Detected a non-exportable reference ('externalptr') in one of the globals ('FUN' of class 'function') used in the future expression' otherwise
- $XVFB $XVFB_ARGS -- /opt/R/$R_VERSION/bin/R -q -e "options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = 'error', repos = structure(c(getOption('repos'),INLA='https://inla.r-inla-download.org/R/stable'))); progressr::handlers('cli'); progressr::handlers(global = TRUE); options(future.globals.onReference = NULL); bincraft::process_cran_updates(interval = $INTERVAL, platform = '${OS}', process_updated = TRUE, process_new = ${PROCESS_NEW}, process_removed = TRUE, patches = 'local/patches', r_minor_detection = 'classifier',s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'), metadata_db_host = 'r-binaries.devxy.io', metadata_db_name = 'build_metadata', metadata_db_table = 'single_builds', metadata_db_user = 'rpkgs', metadata_db_password = Sys.getenv('PGPASS'), metadata_db_sslmode = 'verify-full', metadata_db_port = 15432, archive = TRUE, upload = TRUE, store_build_metadata = TRUE)" - $XVFB $XVFB_ARGS -- /opt/R/$R_VERSION/bin/R -q -e "options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = 'error', repos = structure(c(getOption('repos'),INLA='https://inla.r-inla-download.org/R/stable'))); progressr::handlers('cli'); progressr::handlers(global = TRUE); options(future.globals.onReference = NULL); bincraft::process_cran_updates(interval = $INTERVAL, platform = '${OS}', process_updated = TRUE, process_new = ${PROCESS_NEW}, process_removed = TRUE, patches = 'local/patches', r_minor_detection = 'classifier',s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'), metadata_db_host = 'r-binaries.devxy.io', metadata_db_name = 'build_metadata', metadata_db_table = 'single_builds', metadata_db_user = 'rpkgs', metadata_db_password = Sys.getenv('PGPASS'), metadata_db_sslmode = 'require', metadata_db_port = 15432, archive = TRUE, upload = TRUE, store_build_metadata = TRUE)"
- | - |
PRIMARY_MINOR=$(echo "$R_VERSION" | cut -d. -f1-2) PRIMARY_MINOR=$(echo "$R_VERSION" | cut -d. -f1-2)
for RBIN in /opt/R/[0-9]*/bin/R; do for RBIN in /opt/R/[0-9]*/bin/R; do
@ -208,22 +205,17 @@ steps:
LIB="/mnt/cache/R-pkgs-$RMINOR" LIB="/mnt/cache/R-pkgs-$RMINOR"
mkdir -p "$LIB" mkdir -p "$LIB"
R_LIBS_USER="$LIB" "$(dirname "$RBIN")/Rscript" local/install-bincraft.R || true R_LIBS_USER="$LIB" "$(dirname "$RBIN")/Rscript" local/install-bincraft.R || true
R_LIBS_USER="$LIB" UVR_R_BIN="$RBIN" local/uvr-install.sh RPostgres lubridate || true R_LIBS_USER="$LIB" UVR_R_BIN="$RBIN" local/uvr-install.sh RPostgres || true
R_LIBS_USER="$LIB" $XVFB $XVFB_ARGS -- "$(dirname "$RBIN")/R" -q -e "options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = NULL); bincraft::process_cran_updates(interval = $INTERVAL, platform = '${OS}', process_updated = TRUE, process_new = FALSE, process_removed = FALSE, patches = 'local/patches', r_minor_detection = 'classifier',r_minor_sensitive_only = TRUE, s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'), metadata_db_host = 'r-binaries.devxy.io', metadata_db_name = 'build_metadata', metadata_db_table = 'single_builds', metadata_db_user = 'rpkgs', metadata_db_password = Sys.getenv('PGPASS'), metadata_db_sslmode = 'verify-full', metadata_db_port = 15432, archive = TRUE, upload = TRUE, store_build_metadata = TRUE)" || true R_LIBS_USER="$LIB" $XVFB $XVFB_ARGS -- "$(dirname "$RBIN")/R" -q -e "options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = NULL); bincraft::process_cran_updates(interval = $INTERVAL, platform = '${OS}', process_updated = TRUE, process_new = FALSE, process_removed = FALSE, patches = 'local/patches', r_minor_detection = 'classifier',r_minor_sensitive_only = TRUE, s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'), metadata_db_host = 'r-binaries.devxy.io', metadata_db_name = 'build_metadata', metadata_db_table = 'single_builds', metadata_db_user = 'rpkgs', metadata_db_password = Sys.getenv('PGPASS'), metadata_db_sslmode = 'require', metadata_db_port = 15432, archive = TRUE, upload = TRUE, store_build_metadata = TRUE)" || true
# Also build current packages whose required dependency tree needs a newer R. # Also build current packages whose required dependency tree needs a newer R.
R_LIBS_USER="$LIB" $XVFB $XVFB_ARGS -- "$(dirname "$RBIN")/Rscript" local/build-newer-r.R "$R_VERSION" R_LIBS_USER="$LIB" $XVFB $XVFB_ARGS -- "$(dirname "$RBIN")/Rscript" local/build-newer-r.R "$R_VERSION"
done done
- /opt/R/$R_VERSION/bin/R -q -e 'library(bincraft); upload_package_index(codename = "${OS_ID}", s3_endpoint = "https://s3.eu-central-003.backblazeb2.com", s3_region = "eu-central-003", s3_bucket = "devxy-rpkgs-binaries", s3_access_key_id = Sys.getenv("B2_S3_ACCESS_KEY"), s3_secret_access_key = Sys.getenv("B2_S3_SECRET_KEY"))' - /opt/R/$R_VERSION/bin/R -q -e 'library(bincraft); upload_package_index(codename = "${OS_ID}", s3_endpoint = "https://s3.eu-central-003.backblazeb2.com", s3_region = "eu-central-003", s3_bucket = "devxy-rpkgs-binaries", s3_access_key_id = Sys.getenv("B2_S3_ACCESS_KEY"), s3_secret_access_key = Sys.getenv("B2_S3_SECRET_KEY"))'
- | - |
FAILED_MINORS=""
for RBIN in /opt/R/[0-9]*/bin/R; do for RBIN in /opt/R/[0-9]*/bin/R; do
RMINOR=$(basename "$(dirname "$(dirname "$RBIN")")" | cut -d. -f1-2) RMINOR=$(basename "$(dirname "$(dirname "$RBIN")")" | cut -d. -f1-2)
/opt/R/$R_VERSION/bin/R -q -e "library(bincraft); upload_package_index(codename = '${OS_ID}', r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'), metadata_db_host = 'r-binaries.devxy.io', metadata_db_name = 'build_metadata', metadata_db_port = 15432L, metadata_db_user = 'rpkgs', metadata_db_password = Sys.getenv('PGPASS'), metadata_db_sslmode = 'verify-full')" || FAILED_MINORS="$FAILED_MINORS $RMINOR" /opt/R/$R_VERSION/bin/R -q -e "library(bincraft); upload_package_index(codename = '${OS_ID}', r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'))" || true
done done
if [ -n "$FAILED_MINORS" ]; then
echo "Could not republish the per-minor index for:$FAILED_MINORS" >&2
exit 1
fi
backend_options: backend_options:
docker: docker:
resources: resources:
@ -250,7 +242,3 @@ steps:
commands: commands:
- apk add --no-cache -q bash curl - apk add --no-cache -q bash curl
- bash scripts/purge_cdn_cache.sh "$BUNNYNET_API_KEY" "$ARCH" "$OS_ID" "$SUBDOMAIN1" "$SUBDOMAIN2" "$SUBDOMAIN3" - bash scripts/purge_cdn_cache.sh "$BUNNYNET_API_KEY" "$ARCH" "$OS_ID" "$SUBDOMAIN1" "$SUBDOMAIN2" "$SUBDOMAIN3"
# Run it even when a per-minor re-index above failed: the generic index
# and the objects were still replaced, and a stale edge keeps them hidden.
when:
- status: [success, failure]

View file

@ -167,7 +167,6 @@ steps:
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git . - git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
- mkdir -p /tmp/R-pkgs - mkdir -p /tmp/R-pkgs
- /opt/R/4.5.3/bin/Rscript local/install-bincraft.R - /opt/R/4.5.3/bin/Rscript local/install-bincraft.R
- UVR_R_BIN=/opt/R/4.5.3/bin/R local/uvr-install.sh RPostgres
- | - |
set -eu set -eu
APPLY="" APPLY=""
@ -209,20 +208,11 @@ steps:
echo "Dry run: nothing was deleted, so there is nothing to re-index." echo "Dry run: nothing was deleted, so there is nothing to re-index."
exit 0 exit 0
fi fi
# /tmp is container-local, so the library installed by the prune step is gone here.
mkdir -p /tmp/R-pkgs
/opt/R/4.5.3/bin/Rscript local/install-bincraft.R
UVR_R_BIN=/opt/R/4.5.3/bin/R local/uvr-install.sh RPostgres
/opt/R/4.5.3/bin/R -q -e 'library(bincraft); upload_package_index(s3_endpoint = "https://s3.eu-central-003.backblazeb2.com", s3_region = "eu-central-003", s3_bucket = "devxy-rpkgs-binaries", s3_access_key_id = Sys.getenv("B2_S3_ACCESS_KEY"), s3_secret_access_key = Sys.getenv("B2_S3_SECRET_KEY"))' /opt/R/4.5.3/bin/R -q -e 'library(bincraft); upload_package_index(s3_endpoint = "https://s3.eu-central-003.backblazeb2.com", s3_region = "eu-central-003", s3_bucket = "devxy-rpkgs-binaries", s3_access_key_id = Sys.getenv("B2_S3_ACCESS_KEY"), s3_secret_access_key = Sys.getenv("B2_S3_SECRET_KEY"))'
FAILED_MINORS=""
for RBIN in /opt/R/[0-9]*/bin/R; do for RBIN in /opt/R/[0-9]*/bin/R; do
RMINOR=$(basename "$(dirname "$(dirname "$RBIN")")" | cut -d. -f1-2) RMINOR=$(basename "$(dirname "$(dirname "$RBIN")")" | cut -d. -f1-2)
/opt/R/4.5.3/bin/R -q -e "library(bincraft); upload_package_index(r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'), metadata_db_host = 'r-binaries.devxy.io', metadata_db_name = 'build_metadata', metadata_db_port = 15432L, metadata_db_user = 'rpkgs', metadata_db_password = Sys.getenv('PGPASS'), metadata_db_sslmode = 'verify-full')" || FAILED_MINORS="$FAILED_MINORS $RMINOR" /opt/R/4.5.3/bin/R -q -e "library(bincraft); upload_package_index(r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'))" || true
done done
if [ -n "$FAILED_MINORS" ]; then
echo "Could not republish the per-minor index for:$FAILED_MINORS" >&2
exit 1
fi
backend_options: backend_options:
docker: docker:
resources: resources:
@ -250,7 +240,3 @@ steps:
fi fi
apk add --no-cache -q bash curl jq apk add --no-cache -q bash curl jq
bash scripts/purge_cdn_zone.sh "$BUNNYNET_API_KEY" $BUNNY_PULLZONES bash scripts/purge_cdn_zone.sh "$BUNNYNET_API_KEY" $BUNNY_PULLZONES
# Run it even when a per-minor re-index above failed: the generic index
# and the objects were still replaced, and a stale edge keeps them hidden.
when:
- status: [success, failure]

View file

@ -193,7 +193,6 @@ steps:
export R_LIBS_USER="$$LIB" export R_LIBS_USER="$$LIB"
rm -rf "$$LIB"/00LOCK-* rm -rf "$$LIB"/00LOCK-*
"$$RBIN/Rscript" local/install-bincraft.R "$$RBIN/Rscript" local/install-bincraft.R
UVR_R_BIN="$$RBIN/R" local/uvr-install.sh RPostgres
rc=0 rc=0
for spec in $$ABI_PACKAGES; do for spec in $$ABI_PACKAGES; do
pkg=$${spec%@*} pkg=$${spec%@*}

View file

@ -141,11 +141,12 @@ steps:
from_secret: PGPASS from_secret: PGPASS
REPO_RO_TOKEN: REPO_RO_TOKEN:
from_secret: REPO_RO_TOKEN from_secret: REPO_RO_TOKEN
# bincraft reads the DESCRIPTION of every new or replaced tarball from # uvr resolves bincraft's dependencies through the GitHub API, including
# the CRAN mirror on raw.githubusercontent.com, and authenticates with # the pat-s/cranlike@s3 fork. Unauthenticated it is rate limited, and the
# this token when it is set. A slot whose published index cannot be read # failure is not loud: uvr warns, falls back to the registry copy of
# is re-read in full, ~25k requests, which the anonymous rate limit would # cranlike, and the index write then dies on `unused argument (built =
# cut short. # built)` because upstream has no such parameter. Intermittent by nature,
# since it depends on the rate-limit window.
GITHUB_PAT: GITHUB_PAT:
from_secret: GITHUB_PAT from_secret: GITHUB_PAT
GIT_USER: pat-s GIT_USER: pat-s
@ -158,19 +159,13 @@ steps:
- mkdir -p /mnt/cache/R-pkgs - mkdir -p /mnt/cache/R-pkgs
- rm -rf /mnt/cache/R-pkgs/00LOCK-* - rm -rf /mnt/cache/R-pkgs/00LOCK-*
- /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R - /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R
- UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres
# The codename is detected from the image's /etc/os-release. # The codename is detected from the image's /etc/os-release.
- /opt/R/$R_VERSION/bin/R -q -e 'library(bincraft); upload_package_index(s3_endpoint = "https://s3.eu-central-003.backblazeb2.com", s3_region = "eu-central-003", s3_bucket = "devxy-rpkgs-binaries", s3_access_key_id = Sys.getenv("B2_S3_ACCESS_KEY"), s3_secret_access_key = Sys.getenv("B2_S3_SECRET_KEY"))' - /opt/R/$R_VERSION/bin/R -q -e 'library(bincraft); upload_package_index(s3_endpoint = "https://s3.eu-central-003.backblazeb2.com", s3_region = "eu-central-003", s3_bucket = "devxy-rpkgs-binaries", s3_access_key_id = Sys.getenv("B2_S3_ACCESS_KEY"), s3_secret_access_key = Sys.getenv("B2_S3_SECRET_KEY"))'
- | - |
FAILED_MINORS=""
for RBIN in /opt/R/[0-9]*/bin/R; do for RBIN in /opt/R/[0-9]*/bin/R; do
RMINOR=$(basename "$(dirname "$(dirname "$RBIN")")" | cut -d. -f1-2) RMINOR=$(basename "$(dirname "$(dirname "$RBIN")")" | cut -d. -f1-2)
/opt/R/$R_VERSION/bin/R -q -e "library(bincraft); upload_package_index(r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'), metadata_db_host = 'r-binaries.devxy.io', metadata_db_name = 'build_metadata', metadata_db_port = 15432L, metadata_db_user = 'rpkgs', metadata_db_password = Sys.getenv('PGPASS'), metadata_db_sslmode = 'verify-full')" || FAILED_MINORS="$FAILED_MINORS $RMINOR" /opt/R/$R_VERSION/bin/R -q -e "library(bincraft); upload_package_index(r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'))" || true
done done
if [ -n "$FAILED_MINORS" ]; then
echo "Could not republish the per-minor index for:$FAILED_MINORS" >&2
exit 1
fi
- name: Purge CDN cache - name: Purge CDN cache
image: reg.devxy.io/docker.io/library/alpine:3.24 image: reg.devxy.io/docker.io/library/alpine:3.24

View file

@ -3,8 +3,8 @@
# #
# uvr matches the stamp's platform triple plus R minor to decide binary vs # uvr matches the stamp's platform triple plus R minor to decide binary vs
# source, so an unusable triple turns a whole slot source-only. See # source, so an unusable triple turns a whole slot source-only. See
# local/repair-built-stamp.R for why this patches the published PACKAGES.rds in # local/repair-built-stamp.R for why this patches PACKAGES.db in place instead
# place instead of forcing a full reparse. # of forcing a full reparse.
# #
# Run with `dry_run: true` first: it reports how many entries are broken per # Run with `dry_run: true` first: it reports how many entries are broken per
# slot and changes nothing. Pick the R version the slot should advertise, which # slot and changes nothing. Pick the R version the slot should advertise, which

View file

@ -144,7 +144,6 @@ steps:
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git . - git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
- mkdir -p /tmp/R-pkgs - mkdir -p /tmp/R-pkgs
- /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R - /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R
- UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres
- | - |
set -eu set -eu
CODENAME=$(/opt/R/$R_VERSION/bin/Rscript -e 'cat(bincraft::set_codename(NULL))') CODENAME=$(/opt/R/$R_VERSION/bin/Rscript -e 'cat(bincraft::set_codename(NULL))')
@ -159,7 +158,6 @@ steps:
LIB="/tmp/R-pkgs-$$RMINOR" LIB="/tmp/R-pkgs-$$RMINOR"
mkdir -p "$$LIB" mkdir -p "$$LIB"
R_LIBS_USER="$$LIB" "$(dirname "$$RBIN")/Rscript" local/install-bincraft.R || true R_LIBS_USER="$$LIB" "$(dirname "$$RBIN")/Rscript" local/install-bincraft.R || true
R_LIBS_USER="$$LIB" UVR_R_BIN="$$RBIN" local/uvr-install.sh RPostgres || true
while read -r pkg ver; do while read -r pkg ver; do
[ -z "$$pkg" ] && continue [ -z "$$pkg" ] && continue
R_LIBS_USER="$$LIB" "$(dirname "$$RBIN")/Rscript" \ R_LIBS_USER="$$LIB" "$(dirname "$$RBIN")/Rscript" \

View file

@ -137,7 +137,7 @@ steps:
- mkdir -p /mnt/cache/packages /mnt/cache/R-pkgs - mkdir -p /mnt/cache/packages /mnt/cache/R-pkgs
- rm -rf /mnt/cache/R-pkgs/00LOCK-* - rm -rf /mnt/cache/R-pkgs/00LOCK-*
- /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R - /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R
- UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres httr2 jsonlite data.table - UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres httr2 jsonlite
- /opt/R/$R_VERSION/bin/R -q -e 'source("local/weekly-missing-binaries-audit.R")' - /opt/R/$R_VERSION/bin/R -q -e 'source("local/weekly-missing-binaries-audit.R")'
backend_options: backend_options:
docker: docker:

View file

@ -373,8 +373,6 @@ steps:
R_LIBS_USER: /mnt/cache/R-pkgs R_LIBS_USER: /mnt/cache/R-pkgs
R_VERSION: ${R_VERSION} R_VERSION: ${R_VERSION}
CCACHE_DIR: /mnt/cache/ccache CCACHE_DIR: /mnt/cache/ccache
# parallel make within one package build, matched to the step's CPU limit
MAKE_JOBS: 3
PLATFORM: ${OS} PLATFORM: ${OS}
ARCH: ${ARCH} ARCH: ${ARCH}
NCPUS: 2 NCPUS: 2
@ -386,13 +384,12 @@ steps:
REBUILD_BUDGET_HOURS: 20 REBUILD_BUDGET_HOURS: 20
commands: commands:
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git . - git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
- . local/compiler-cache.sh
- mkdir -p /mnt/cache/uvr/cache /mnt/cache/uvr/packages /mnt/cache/R-pkgs /mnt/cache/ccache /mnt/cache/packages - mkdir -p /mnt/cache/uvr/cache /mnt/cache/uvr/packages /mnt/cache/R-pkgs /mnt/cache/ccache /mnt/cache/packages
- rm -rf /mnt/cache/R-pkgs/00LOCK-* - rm -rf /mnt/cache/R-pkgs/00LOCK-*
- /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R - /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R
- /opt/R/$R_VERSION/bin/R -q -e 'packageVersion("bincraft")' - /opt/R/$R_VERSION/bin/R -q -e 'packageVersion("bincraft")'
- XVFB=$(command -v xwfb-run 2>/dev/null || command -v xvfb-run); XVFB_ARGS="-a"; if command -v xwfb-run >/dev/null 2>&1; then dnf install -y -q weston 2>/dev/null; XVFB_ARGS="-c weston"; fi - XVFB=$(command -v xwfb-run 2>/dev/null || command -v xvfb-run); XVFB_ARGS=""; if command -v xwfb-run >/dev/null 2>&1; then dnf install -y -q weston 2>/dev/null; XVFB_ARGS="-c weston"; fi
- UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres httr2 - UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh httr2
- /opt/R/$R_VERSION/bin/R -q -e 'source("local/fetch-rebuild-packages-from-issue.R")' - /opt/R/$R_VERSION/bin/R -q -e 'source("local/fetch-rebuild-packages-from-issue.R")'
- $XVFB $XVFB_ARGS -n $SPLIT_INDEX -- /opt/R/$R_VERSION/bin/Rscript local/rebuild-missing.R $SPLIT_INTO $SPLIT_INDEX $REBUILD_BUDGET_HOURS 2>&1 - $XVFB $XVFB_ARGS -n $SPLIT_INDEX -- /opt/R/$R_VERSION/bin/Rscript local/rebuild-missing.R $SPLIT_INTO $SPLIT_INDEX $REBUILD_BUDGET_HOURS 2>&1
backend_options: backend_options:

View file

@ -4,8 +4,8 @@
# objects in place, so the slot's index still advertises the old MD5 and, for # objects in place, so the slot's index still advertises the old MD5 and, for
# anything that had been served from source, no Built stamp. Re-indexing from # anything that had been served from source, no Built stamp. Re-indexing from
# inside a shard would mean three concurrent `upload_package_index()` calls on # inside a shard would mean three concurrent `upload_package_index()` calls on
# one prefix: each lists the live bucket, so an early lister that uploads last # one prefix: `cranlike::update_PACKAGES()` lists the live bucket, so an early
# publishes an index missing its siblings' work. # lister that uploads last publishes an index missing its siblings' work.
# #
# So it happens exactly once per slot, here, after every shard has finished. # So it happens exactly once per slot, here, after every shard has finished.
# `runs_on: [success, failure]` keeps that true when a shard fails; only an # `runs_on: [success, failure]` keeps that true when a shard fails; only an
@ -144,11 +144,12 @@ steps:
from_secret: PGPASS from_secret: PGPASS
REPO_RO_TOKEN: REPO_RO_TOKEN:
from_secret: REPO_RO_TOKEN from_secret: REPO_RO_TOKEN
# bincraft reads the DESCRIPTION of every new or replaced tarball from # uvr resolves bincraft's dependencies through the GitHub API, including
# the CRAN mirror on raw.githubusercontent.com, and authenticates with # the pat-s/cranlike@s3 fork. Unauthenticated it is rate limited, and the
# this token when it is set. A slot whose published index cannot be read # failure is not loud: uvr warns, falls back to the registry copy of
# is re-read in full, ~25k requests, which the anonymous rate limit would # cranlike, and the index write then dies on `unused argument (built =
# cut short. # built)` because upstream has no such parameter. Intermittent by nature,
# since it depends on the rate-limit window.
GITHUB_PAT: GITHUB_PAT:
from_secret: GITHUB_PAT from_secret: GITHUB_PAT
GIT_USER: pat-s GIT_USER: pat-s
@ -161,19 +162,13 @@ steps:
- mkdir -p /mnt/cache/R-pkgs - mkdir -p /mnt/cache/R-pkgs
- rm -rf /mnt/cache/R-pkgs/00LOCK-* - rm -rf /mnt/cache/R-pkgs/00LOCK-*
- /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R - /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R
- UVR_R_BIN=/opt/R/$R_VERSION/bin/R local/uvr-install.sh RPostgres
# The codename is detected from the image's /etc/os-release. # The codename is detected from the image's /etc/os-release.
- /opt/R/$R_VERSION/bin/R -q -e 'library(bincraft); upload_package_index(s3_endpoint = "https://s3.eu-central-003.backblazeb2.com", s3_region = "eu-central-003", s3_bucket = "devxy-rpkgs-binaries", s3_access_key_id = Sys.getenv("B2_S3_ACCESS_KEY"), s3_secret_access_key = Sys.getenv("B2_S3_SECRET_KEY"))' - /opt/R/$R_VERSION/bin/R -q -e 'library(bincraft); upload_package_index(s3_endpoint = "https://s3.eu-central-003.backblazeb2.com", s3_region = "eu-central-003", s3_bucket = "devxy-rpkgs-binaries", s3_access_key_id = Sys.getenv("B2_S3_ACCESS_KEY"), s3_secret_access_key = Sys.getenv("B2_S3_SECRET_KEY"))'
- | - |
FAILED_MINORS=""
for RBIN in /opt/R/[0-9]*/bin/R; do for RBIN in /opt/R/[0-9]*/bin/R; do
RMINOR=$(basename "$(dirname "$(dirname "$RBIN")")" | cut -d. -f1-2) RMINOR=$(basename "$(dirname "$(dirname "$RBIN")")" | cut -d. -f1-2)
/opt/R/$R_VERSION/bin/R -q -e "library(bincraft); upload_package_index(r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'), metadata_db_host = 'r-binaries.devxy.io', metadata_db_name = 'build_metadata', metadata_db_port = 15432L, metadata_db_user = 'rpkgs', metadata_db_password = Sys.getenv('PGPASS'), metadata_db_sslmode = 'verify-full')" || FAILED_MINORS="$FAILED_MINORS $RMINOR" /opt/R/$R_VERSION/bin/R -q -e "library(bincraft); upload_package_index(r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'))" || true
done done
if [ -n "$FAILED_MINORS" ]; then
echo "Could not republish the per-minor index for:$FAILED_MINORS" >&2
exit 1
fi
- name: Purge CDN cache - name: Purge CDN cache
image: reg.devxy.io/docker.io/library/alpine:3.24 image: reg.devxy.io/docker.io/library/alpine:3.24

4
.gitignore vendored
View file

@ -102,7 +102,3 @@ docs/
# Superpowers SDD scratch (briefs, reports, ledger) # Superpowers SDD scratch (briefs, reports, ledger)
.superpowers/ .superpowers/
# Internal design docs (plans and specs) are kept out of the repo.
plans/
specs/

View file

@ -2,3 +2,6 @@
ignores: ignores:
- LICENSE.md - LICENSE.md
- docs/superpowers/** - docs/superpowers/**
# Internal design docs (specs/plans) are not user-facing reference material.
- specs/**
- plans/**

View file

@ -14,7 +14,8 @@ exclude: |
# here. The exclusions are per-hook, not global, so `validate patch registry` # here. The exclusions are per-hook, not global, so `validate patch registry`
# still runs when a patch changes. # still runs when a patch changes.
repos: repos:
- repo: builtin - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks: hooks:
- id: end-of-file-fixer - id: end-of-file-fixer
exclude: ^local/patches/.*\.patch$ exclude: ^local/patches/.*\.patch$
@ -23,19 +24,19 @@ repos:
args: args:
- --markdown-linebreak-ext=md - --markdown-linebreak-ext=md
- repo: https://github.com/DavidAnson/markdownlint-cli2 - repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.24.2 rev: v0.23.2
hooks: hooks:
- id: markdownlint-cli2 - id: markdownlint-cli2
- repo: https://github.com/rbubley/mirrors-prettier - repo: https://github.com/rbubley/mirrors-prettier
rev: v3.10.1 rev: v3.9.6
hooks: hooks:
- id: prettier - id: prettier
- repo: https://github.com/posit-dev/air-pre-commit - repo: https://github.com/posit-dev/air-pre-commit
rev: 0.13.0 rev: 0.11.0
hooks: hooks:
- id: air-format - id: air-format
- repo: https://github.com/editorconfig-checker/editorconfig-checker - repo: https://github.com/editorconfig-checker/editorconfig-checker
rev: v4.0.2 rev: v4.0.1
hooks: hooks:
- id: editorconfig-checker - id: editorconfig-checker
exclude: ^local/patches/.*\.patch$ exclude: ^local/patches/.*\.patch$

134
.terraform.lock.hcl generated
View file

@ -2,79 +2,79 @@
# Manual edits may be lost in future updates. # Manual edits may be lost in future updates.
provider "registry.opentofu.org/hashicorp/http" { provider "registry.opentofu.org/hashicorp/http" {
version = "3.6.3" version = "3.6.1"
hashes = [ hashes = [
"h1:4Qcn3THnwpzEH7EJvhnDYw82YM/+Fs4x5rjtaOdHIGg=", "h1:7fra+jbUXbG5wMaz5L6RKMBv6gIuenJcBiIww87GoXo=",
"h1:DWXJhjYQ66frFZ2edx766sUWDPoPTsWcO8VeL1TQmj0=", "h1:BzSV3Ie9XMXF7sZHKAS54CzV95v5GBZNhQ4nrprUgfQ=",
"h1:ISETodakZAv3gUBLFHm1+JpKB0vUXzOSmJGlyTvap0A=", "h1:CkrbSKS+pNVgvP3bMe2WoYHaFCIWJUkCtlC5vyTAdLI=",
"h1:IWCGxH32+DkaMeH7xd1SCggVeuhKnKOlkKxlRfQnSlc=", "h1:FboJEwgVIRmqUJkjEoSRpfavVCJotUTe1zzT+pBzcV0=",
"h1:JrmuoX6FTlDFJDqveHpyO0xCOyWd40BVTAEFGmwbsPI=", "h1:GlXELDLSZrdV3Svx1jjEBAXiJFkkdF/Hgx1qrmRK5hE=",
"h1:OqnVFnmMgeKLZ0l32P80o6DdAhd2ug0nJmEcngf6u/U=", "h1:VuXFI2IcnZ6t4sDqtvkuIzbPK1CJQa0CkaM0MBuOlSU=",
"h1:Se19S4Etttxlm6u/fT0JbvqfsTJjNusWK5pe2Hb1Aso=", "h1:WmL2nFQbSzRiDsDiwUbZbBp/cxGQrXrZnB7A4LGSvJU=",
"h1:Sj+741LS543TKq6nf2MXCKzhzEygGgE8ptZKZhWh1N0=", "h1:Zdj26awWJ+m8kMoAMhItsIDcDFg81PWgKKJrvNi3WOI=",
"h1:T8pVs0L1oME182/NXYte0G65aOxNod8fhKd6Gi7l+04=", "h1:lHvYYIumeZ+KJgCrmhCLnRGzrvNMjSHBTdV24coyMEc=",
"h1:VYtHHeZQ+jzrqFppK/eAzdj3dMXn4wPYvfWn9STSaKg=", "h1:pAOYMwA6Zki3ujAbG20b49u1IYXdBz56pW1JHqKdX5U=",
"h1:Xkog5MBnip5VSOe8gkMAg/s+fBSpuc2yOPtoMY78mVQ=", "h1:qi9GUp2+g69C8zY6Z68u4fWPwcZlDTa/CtdhvPgWbMA=",
"h1:Xoun8WNhPBF/Acv6vvBJcOtPS30rWL8bDbPBXAZkWXA=", "h1:w5A3xJ2mowj2wgiE3oNfOI0lFJf5X9IgxOJ6SErMczA=",
"h1:b8JSDcp7TH6fQYII+ZZSrMlyAyyP8oSA6FPLs+2Hm3g=", "h1:xAO03iJyuNGSOqolIcXcofH8cocgUb6Cnzq6yivbWcI=",
"h1:bK4m/bKTU8PjLG4G3wEdoRjqmFSB222h1ue0Jxdsp1U=", "h1:xXigGPwW8MlrB6Br2ce+Bf35BbdzdPKa97T/q/xrrcA=",
"h1:sIiP0wiUT/sXTzwxUoAcEnTgxDkWQZUspChLs/SbXI8=", "h1:yDYzQ2ncNE9q1288xAgflIPq98bOOYsAb9tq6vkbFzw=",
"zh:0551a71cf3c063c8c4925fb3bc95e9145da6440887e8513040ea49ea1ecf61ed", "zh:129d7d5944b31f40916b1ca86b31cef65a6b02fd36008809d13c561894bfedb9",
"zh:19f379bb524434d05f5c917371c8d993491058cf577a6c66ebbf1b26a9924003", "zh:24631608288b0bcd35c1fc63dc5839572254d881c0589ebba036be52b2fc04d6",
"zh:2da5794d9f33f5ba8bdc74de7422b3289f1862be7583fcd86328d28a35a533d9", "zh:5a0f100d7eb256463fe5a2aa1a7128391147b2c5fc895ff1b1ef54fc5b8f15ab",
"zh:3e3d463e11d3a0d1eb54d4a4936d5de42395271e00a0aa884b27f00ca98d246d", "zh:6a8a1126ab9ca61be3b62ec184f6b2e7cbf01cde810acc548cee27d71277b09b",
"zh:476a140b360acb9ca589b7de6a5a8a379aabab4e034fd2dbf4be033c21749907", "zh:6fffef54fd3aada85c074e34d41386aa09c79a308a4679132da31c7272733c6c",
"zh:47f46c2a71075a414049f9c3382dad1b6a0fa3b02a67ed8b7db1e7e24dac1960", "zh:899c992d2aa290ebe1304da0289c5104a630bca421cc6a88ce55bf0960aab1b4",
"zh:5845ccfc22524f8b2b76a8b790569183e70962b05f8767738edcd4a1b86c0c23", "zh:960fd6c2847859a843dd9dbfc95a0037a470aa744094d155a38a057175cf1502",
"zh:80b341609f5f962f709bae424860334e69e1fe6d12b9027f9c0355a1da63eb02", "zh:9b032b685a644634158ace5529e260dfc4447a280056f02858d205ea26753f69",
"zh:94cd85fd04a0b36a8e622efc63e08c34a6ba135713dd9c7a60059af55aea6876", "zh:bba5477c97020c28ed12d4f5b36be2c1bf14d946d7e44b3690e5c23cd7ddf5e6",
"zh:abee98f71480a9485f85dee138d9c120d0a0bccb77c700e03fe9585ad0538673", "zh:c2ff6c33efef52441fa3485137972792031626dcabca2b1d8b6527d45f185279",
"zh:ba330dc3fd22cb646d225b0e5e1263a1aa5493c7e880f97b22788e3702a93acd", "zh:cd492b3dfd150de6bef8ad505293d3d53c6c907706f36d0e497b4fc027d8edb6",
"zh:c3534ef0998dba2a3b79d4c993197ed86f1482dd451479ae8244d92cf7b3b3a9", "zh:d1f832bc33c42781454dc020c6937e7d0133155a5a9f64335309d64a34b36bb7",
"zh:d2a2d76caa8256430cae2238f91ca4d5cdb8aa50cccd0c057c97c229ae8508d5", "zh:d42e9cbebc77643556853b1ebbec14cefe70c57ee86cd3b8c71fbe7f523f07df",
"zh:ec3f1132210103816061bcff2043e852d9dc2add1857af4620f49059771e1646", "zh:d4c0466f578d7f990646bb0847e31ba3797f2100b6380ee1ca736887546c7621",
"zh:f3294fc74d18ada739f968b4e0b5ec65c0acb6a821c777909c6c54e3c54cf771", "zh:d9d81ecebfe6edabdd4c527f3f4debde3e052ff87c5ef4c67497ab3d7539e424",
] ]
} }
provider "registry.terraform.io/bunnyway/bunnynet" { provider "registry.terraform.io/bunnyway/bunnynet" {
version = "0.20.3" version = "0.18.2"
constraints = "~> 0.20" constraints = "~> 0.18"
hashes = [ hashes = [
"h1:09RqUsHrSx1IZ7GZsjn5J7vxqG5jv9aTJe9qR7amJJs=", "h1:3rZl+Co3WMpwj8SciPaCNXoGA31aSoqp6iweLarr5m4=",
"h1:0HE3kahGf8gl1wWze3+wA8+oMkRnIQwdVeDmwm6LtZc=", "h1:6d9cKLhz8QOZ4R5yVX1G0TsWL+K1Abtfbm3xngndxto=",
"h1:1QQgmqEu46pDn0KR27VSQ0Bi2E87CjcNseP4JgQn8C8=", "h1:EBjjkfp5Gx7nXP1DVO+tLhsow6fEUvaIjsCEFRT2fY8=",
"h1:3oouE6cghziTZJ+l+udbXi03wNjH/aYKZETkQ3z9+hU=", "h1:Nu2DoHGOv2YN7ag4kFGpfnPeRDh6bzWqY5anW+ETGpM=",
"h1:4ABuqzs2BlJu1bNHkHvd0b4NY1PmWYeqtd+32fR3Wmk=", "h1:OnvZxg28m4/UJeEhHVLU4kM2MZ704sxRzYfLWlLxnhA=",
"h1:5u3+Nk4DpAIuW0mDbItelbiZL5KWKcLLdh/szuXJfEM=", "h1:PiCse2/UcB7nkPxosveHsJN/jKdBC8AH6tKTxcHSYKw=",
"h1:DC9++/g5hv8W9M3YvWn27PC/NBXbfKjtI7XbfNy4Y+Q=", "h1:QAahdtlDBUon7eMwNN0D2V6CxgasOXIi+9/UExik6Sg=",
"h1:DH3JLDv9oGtUxQi3eCLzUm9OILS4oBO+/T2iSu7fFAg=", "h1:Su5z0A7/UaSm/E7FJnFjpDVQaa1Ju5+fZ8Mirf8E+k8=",
"h1:FnFnDiIyzoroOSf6zHyejpN1bvyo9PqwfSfWm0FcThs=", "h1:UA3a78FJAPAGqCCvlIg9ekPltpVsrmEhwFLalWCFnew=",
"h1:Lb95sYGHhBThec7qXeUPFyVdkM1ViDytYkA3vYtUfYo=", "h1:XAlCTNHRtgUkNjdUItkiak6ajjT7wFJzJN8frXKD5Ms=",
"h1:RFA0Pm6G8ZbaIrDnDrSHGXGqcfPIJJCXiWQcO83R5CE=", "h1:ZgLBOPebYxH059z1cGHmjYO8CTf+tbWPb3VbO97S2YM=",
"h1:dqebzlaxgTHfPfotskbJ72Nl6ft/exl04CwR9f8Zqz8=", "h1:anR91C2F6NDJoQQQIy6KHChodnTaSKnApSWSGM4jSX0=",
"h1:iHUmCyzRcantigqlJYtTjFUhjt8udTpShton09isK2c=", "h1:gVmaNmIu4gEiITM+CAb66e+zncAqzNBYkniTZfvxZ5Y=",
"h1:lltTH48SIjhUY1v5TBIxp96xqC8aaiik0HoAJYUHqQM=", "h1:pODlGrkPqHV4yhXiO7LLLu11HtcuxOAB2zUx3B8w1vI=",
"h1:o09J6fw7vV/M7J/DYfVHsNUZnk8c3aYMU3p+nnpMWj8=", "h1:qEYeHEKVRcc78q5xiRGJSY8DGQpLj40KafEXUxFfaQc=",
"h1:ofBGqkMXdAtVMpmGCXoKQj6hlwsYYk1L7mvuESSxLHk=", "h1:qdVz+O0lLHhyf5YX3ujmoVvAGlKqvi+YOPUzVTqpKzY=",
"h1:t/YBNaqpoJuMz7b+TjRdzNuwWbnGZvByAz7wUklX22M=", "h1:yTrPkdc9eQkxfPLBYydFf0fpcjarP5w0sdLPzekD9RQ=",
"zh:256f3fbfbebb6383ce720001d024bf267c299a48c559d96c20f8f95262030267", "zh:0fe3987c927d81196c97504470ce4d26c3ad0014f8ee3d0c1be422d08cfcf49c",
"zh:28dfae8191b836bad53fab92305298d6ce111c825ab6d857794e95c447c09d83", "zh:15c36dc69e058876921ac887213e1716217d159b7ee7f0f233e21fb35be85178",
"zh:315a6a933184bf7aed0e45bec3e820b7196bdc643bed9194a760b74ffb12fd62", "zh:29d58d7b76dcb142a06d4edd15b8500fe6c1afb7f7c056ada17e2d42bb999fbd",
"zh:427c563c207efc9b8805b90fcd79b200510ab8d2e5216a3ece6c44806027dfd5", "zh:33d313836c0e985186b3456c0946e062b27cacfcb08611d0a394f36db9ee1aef",
"zh:4a71a7f161416d4c3270724c62d04f75c24d0c009b06b1d3521a0df755395d60", "zh:47e085e52e9b24ad85fa2988dbb8604256a970a6f53f7fa6aab04d8ae756a738",
"zh:4edb43070df5112a58baa85bac209465f479713bd722800723bdbf7686f518d6", "zh:4ba4f87571ca72fbc6c24ab71f2f7b5a086938262e2d8e5c0b39701ed52f8bbc",
"zh:533cdd87680b68c56025a9c60ca0cfc582c285136292be2dd79046126e76bc0d", "zh:4c6bae97b543c5b328e1ecbcf7c976351b4b381654e9d3e569270dcab3ba816c",
"zh:59c1a09dcd148f053ce26ed34788ca05b7307c2e8e8e1f78e6d621b93533f1bf",
"zh:60e1bbe4f679bf5c7565ebea38c4cbca84b578e1458d3ba92e75b31433647516",
"zh:7621c7380f91d44727d53c238bc78c66a04cd2f8e302ae173e2f48d7558fdec6",
"zh:876a61ff9b46f5092531b6808903002285952683e05625d6180acbc8f5d642b0",
"zh:8840722da44ebbf4286b1f2da6263d1f550cad2f7445d4136c98758f7adcfe79",
"zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f", "zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f",
"zh:b2fd5fb60183750d6403a2411eb7a36f3a9a3fad39e9ad4c65c8536f58d54614", "zh:9ba7ab56537963db2449d217528a751469c9dc4e413dec3e3d63fd7daf3db4ef",
"zh:b69bdd246040e3792a87acbf963d5c3f6bb5b5513dd49b5df3d7ba629450cd79", "zh:a3c48eda7e11b03b831f2a639797524bb335f155f0dff0e999cf3496994da8b3",
"zh:cbbd0b28082eae5585860a4cac1d19b42c9fe692caa167bec4ec0571bcf4634c", "zh:aab8f4814d55ef8c6c285d2496ae412437017d0fd1be70106f7b3a4a6e764feb",
"zh:e08440881ef438969bab652af115e471e5645ed25b4c7e983ec6ba9cf6933505", "zh:b92b9beacf71ae894717c2036ceb68db52c9c43af4a01b8209eceae9f91a2c8e",
"zh:ff7540cebcb08f8a211890dad58777d54a74649a9231b25d10751208371f2826", "zh:da389285938e22e1249e6a00cebf12a9f67334743f0b3f66399e6881028bda11",
"zh:dadcc33d06e6f64a17d1965478af5e8bbdc971e92ec9b14e384c5d43861d63f7",
"zh:e090c916e6da685125194af4f0a1fd772494a0c63f3f16ab3741782e17f4a8f9",
"zh:e5881e00fa970c08e66e8079b47d69b76def6e7ff3bdc35b68d7811e5ece55d1",
"zh:eeebb25a066a6287d545c91c0fc264acee5b28174d0979faeebdac3bd14f0fff",
"zh:f368195116c9ce0181aa7527c51ae5e7ab23d42fb966acf4eddca344621ae339",
] ]
} }

View file

@ -73,6 +73,8 @@ Patching uses a two-tier approach:
The system is implemented in `bincraft`: when a package needs patching, `bincraft` pre-builds it with the patch and serves the patched binary to `pak`, ensuring transitive dependents receive the fixed package. The system is implemented in `bincraft`: when a package needs patching, `bincraft` pre-builds it with the patch and serves the patched binary to `pak`, ensuring transitive dependents receive the fixed package.
This way, the fix cascades to all packages that depend on it. This way, the fix cascades to all packages that depend on it.
For the design rationale and architecture, see `specs/2026-06-30-package-patching-design.md`.
## Build Environment ## Build Environment
Binaries are built on a mixed-architecture Kubernetes cluster using CI. Binaries are built on a mixed-architecture Kubernetes cluster using CI.
@ -101,13 +103,11 @@ Preview the selection without building or accessing storage or build metadata:
### Creating/Updating the PACKAGES Index Files ### Creating/Updating the PACKAGES Index Files
Tools such as `tools::write_PACKAGES()` and {cranlike} only index files on a local file system. Currently, the {cranlike} and {desc} packages only work with files on a local file system.
This is infeasible if the goal is to store binaries in S3. This is infeasible if the goal is to store binaries in S3.
Storing binaries permanently on a disk-based file system would incur significantly higher costs, especially when operating in the cloud. Storing binaries permanently on a disk-based file system would incur significantly higher costs, especially when operating in the cloud.
Hence, `bincraft::upload_package_index()` builds the index from a listing of the slot in S3 (through {s3fs}). Hence, [{cranlike}](https://devxy.gitlab.io/r-package-binaries/bincraft/) and [{desc}](https://github.com/pat-s/desc/tree/description-from-remote) were forked to handle files in S3 (through {s3fs}).
Each record is read from the package's CRAN `DESCRIPTION` on the GitHub mirror of CRAN, falling back to the `DESCRIPTION` inside the tarball for a package the mirror does not have.
The previously published `PACKAGES.rds` serves as a cache, so only new or replaced tarballs are read.
### Resources ### Resources
@ -139,7 +139,6 @@ For Alpine, no rules existed until recently, establishing a foundation for semi-
The build metadata is stored in a PostgreSQL database. The build metadata is stored in a PostgreSQL database.
The database has a public endpoint at `r-binaries.devxy.io` and port `15432`. The database has a public endpoint at `r-binaries.devxy.io` and port `15432`.
It serves a Let's Encrypt certificate for that name, so connect with `sslmode=verify-full`; from R, pass `sslrootcert = bincraft::postgres_sslrootcert("verify-full")` as well, since libpq does not read the system trust store by default.
It contains one table named `single_builds`, which holds the build metadata for each package: It contains one table named `single_builds`, which holds the build metadata for each package:
| package_name | tag | platform | error_occurred | build_timestamp | build_duration | error | size | removed | | package_name | tag | platform | error_occurred | build_timestamp | build_duration | error | size | removed |

17
cdn.tf
View file

@ -164,23 +164,6 @@ resource "bunnynet_pullzone" "cran_rpkgs_com" {
add_canonical_header = true add_canonical_header = true
# Access logs feed the public download statistics (`stats/`, published to
# `/stats/downloads.json`). Both settings were already on; declaring them
# keeps an apply from quietly switching off the only source of that data.
# Bunny keeps the logs for three days, which is why `download-stats` runs on
# a schedule. IPs stay anonymized to /24 (/64 for IPv6) at the edge.
log_enabled = true
log_anonymized = true
log_anonymized_style = "OneDigit"
# The rpkgs.com website reads `/stats/downloads.json` from the browser, so
# JSON needs the CORS header too. The rest is the zone's existing list.
cors_enabled = true
cors_extensions = [
"css", "eot", "gif", "jpeg", "jpg", "js", "json", "mp3", "mp4", "mpeg", "png", "svg", "ttf", "webm", "webp",
"woff", "woff2",
]
cache_stale = ["offline", "updating"] cache_stale = ["offline", "updating"]
block_ips = var.cdn_block_ips block_ips = var.cdn_block_ips

Some files were not shown because too many files have changed in this diff Show more