fix(ci): declare FORCE_REBUILD as a UI variable and make it take effect #12
1 changed files with 33 additions and 57 deletions
fix(ci): declare FORCE_REBUILD as a UI variable and make it take effect
Follow-up to #11, which landed the trigger-form handling but not the rest. Three things still stood between FORCE_REBUILD and an actual republish. Declare FORCE_REBUILD as a top-level variable so the UI offers it as a dropdown on a manual run, rather than requiring a hand-typed key. Test the value rather than emptiness. A declared variable substitutes its default, so the `[ -n ... ]` check from #11 would have seen the literal string "false" and rebuilt every platform on every cron run. Set overwrite: true on the upload. plugin-s3 skips an object that already exists when overwrite is false, logging "File already exists, skipping upload" and still exiting green, so a forced rebuild would have recompiled every package and published none of them. Normal runs are unaffected, since dedup means only not-yet-published versions are ever built. Also drop the Net debug step, the commented-out Pull upstream step and a stray `# docker info`. The MTU workaround the debug step was diagnosing stays, as does the commented-out alpine-320 matrix entry, which records a deliberately disabled platform rather than dead scaffolding.
commit
637a321bcc
|
|
@ -1,6 +1,18 @@
|
||||||
when:
|
when:
|
||||||
event: [cron, manual]
|
event: [cron, manual]
|
||||||
|
|
||||||
|
variables:
|
||||||
|
FORCE_REBUILD:
|
||||||
|
description: >-
|
||||||
|
Rebuild every targeted R version even when the artifact is already in the
|
||||||
|
bucket. Needed after a builder-image change that alters the resulting R
|
||||||
|
binary, because artifact filenames carry only the R version and would
|
||||||
|
otherwise dedup to the stale build forever.
|
||||||
|
options:
|
||||||
|
- "false"
|
||||||
|
- "true"
|
||||||
|
default: "false"
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- PLATFORM: rhel-9
|
- PLATFORM: rhel-9
|
||||||
|
|
@ -82,46 +94,6 @@ matrix:
|
||||||
ARCH_ID: x86_64
|
ARCH_ID: x86_64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Ensures that we're always using the latest available upstream build chain
|
|
||||||
# - name: Pull upstream
|
|
||||||
# image: reg.devxy.io/docker.io/library/alpine:3.20
|
|
||||||
# commands:
|
|
||||||
# - apk add -q --no-cache git
|
|
||||||
# - git remote add upstream https://github.com/cynkra/r-builds.git
|
|
||||||
# - git config --global user.email "you@example.com"
|
|
||||||
# - git config --global user.name "Your Name"
|
|
||||||
# - git config pull.ff only
|
|
||||||
# - git fetch upstream
|
|
||||||
# - git merge upstream/main --allow-unrelated-histories
|
|
||||||
#.
|
|
||||||
|
|
||||||
- name: Net debug
|
|
||||||
image: reg.devxy.io/docker.io/library/alpine:3.23
|
|
||||||
privileged: true
|
|
||||||
commands:
|
|
||||||
- ip link set dev eth0 mtu 1280 2>/dev/null || true
|
|
||||||
- echo "=== pod interface ==="
|
|
||||||
- cat /sys/class/net/eth0/mtu
|
|
||||||
- ip -o link show eth0
|
|
||||||
- echo "=== route ==="
|
|
||||||
- ip route
|
|
||||||
- echo "=== resolv.conf ==="
|
|
||||||
- cat /etc/resolv.conf
|
|
||||||
- for i in 1 2 3; do apk add -q --no-cache iputils && break; sleep 5; done || echo "apk failed; falling back to busybox ping (no -M do)"
|
|
||||||
- |
|
|
||||||
echo "=== PMTUD probes (DF=1) to dl-cdn.alpinelinux.org ==="
|
|
||||||
for sz in 1472 1392 1352 1252 1200; do
|
|
||||||
echo "--- payload=$sz (wire ~$((sz+28))) ---"
|
|
||||||
ping -c 2 -W 3 -M do -s $sz dl-cdn.alpinelinux.org || echo "(size=$sz failed)"
|
|
||||||
done
|
|
||||||
- ping -c 3 -W 5 dl-cdn.alpinelinux.org || true
|
|
||||||
- wget --tries=1 --timeout=10 -O /dev/null -nv https://dl-cdn.alpinelinux.org/ 2>&1 || true
|
|
||||||
backend_options:
|
|
||||||
kubernetes:
|
|
||||||
nodeSelector:
|
|
||||||
kubernetes.io/arch: "${ARCH}"
|
|
||||||
|
|
||||||
|
|
||||||
- name: Get R versions to build
|
- name: Get R versions to build
|
||||||
image: reg.devxy.io/docker.io/library/alpine:3.23
|
image: reg.devxy.io/docker.io/library/alpine:3.23
|
||||||
privileged: true
|
privileged: true
|
||||||
|
|
@ -178,22 +150,23 @@ steps:
|
||||||
esac
|
esac
|
||||||
BASE="https://s3.eu-central-003.backblazeb2.com/devxy-r-builds/${PLATFORM_ID}"
|
BASE="https://s3.eu-central-003.backblazeb2.com/devxy-r-builds/${PLATFORM_ID}"
|
||||||
: > r-versions-existing.txt
|
: > r-versions-existing.txt
|
||||||
# Escape hatch for when the builder image itself changes in a way that
|
# FORCE_REBUILD is declared as a top-level variable, so the UI offers it
|
||||||
# alters the resulting R binary (a newly enabled graphics device, a
|
# as a dropdown on a manual run. The two trigger paths deliver it
|
||||||
# different BLAS). The artifact filename carries only the R version, so
|
# differently, so accept either:
|
||||||
# dedup would otherwise keep the stale binaries forever. Uploads
|
# UI, or crow pipeline create --var FORCE_REBUILD=true
|
||||||
# overwrite in place.
|
# -> a substitution variable, expanded into ${FORCE_REBUILD} below
|
||||||
#
|
# crow pipeline start -p FORCE_REBUILD=true
|
||||||
# The two ways to trigger a manual run pass the flag differently:
|
|
||||||
# crow pipeline create --branch main --var FORCE_REBUILD=1
|
|
||||||
# -> a crow substitution variable, read below as ${FORCE_REBUILD},
|
|
||||||
# which crow blanks out when it was not supplied
|
|
||||||
# crow pipeline start -p FORCE_REBUILD=1
|
|
||||||
# -> injected into the step environment, read as bare $FORCE_REBUILD
|
# -> injected into the step environment, read as bare $FORCE_REBUILD
|
||||||
# Accept either, so the flag cannot be silently ignored.
|
# The declared default is the string "false", so test the value rather
|
||||||
FORCE_REBUILD_VAR="${FORCE_REBUILD}"
|
# than emptiness; an empty value means neither path supplied one.
|
||||||
if [ -n "$FORCE_REBUILD_VAR" ] || [ -n "$FORCE_REBUILD" ]; then
|
FORCE_VALUE="${FORCE_REBUILD}"
|
||||||
echo "FORCE_REBUILD is set, ignoring artifacts already in the bucket"
|
[ -n "$FORCE_VALUE" ] || FORCE_VALUE="$FORCE_REBUILD"
|
||||||
|
case "$FORCE_VALUE" in
|
||||||
|
true|TRUE|True|1|yes|YES) FORCE_ON=1 ;;
|
||||||
|
*) FORCE_ON="" ;;
|
||||||
|
esac
|
||||||
|
if [ -n "$FORCE_ON" ]; then
|
||||||
|
echo "FORCE_REBUILD=$FORCE_VALUE, ignoring artifacts already in the bucket"
|
||||||
else
|
else
|
||||||
for VERSION in $(cat r-versions-to-build.txt); do
|
for VERSION in $(cat r-versions-to-build.txt); do
|
||||||
URL="$BASE/$(printf "$FMT" "$VERSION" "${ARCH_ID}")"
|
URL="$BASE/$(printf "$FMT" "$VERSION" "${ARCH_ID}")"
|
||||||
|
|
@ -217,7 +190,6 @@ steps:
|
||||||
DOCKER_HOST: tcp://docker:2375
|
DOCKER_HOST: tcp://docker:2375
|
||||||
commands: |
|
commands: |
|
||||||
ip link set dev eth0 mtu 1280 2>/dev/null || true
|
ip link set dev eth0 mtu 1280 2>/dev/null || true
|
||||||
# docker info
|
|
||||||
TO_BUILD=""
|
TO_BUILD=""
|
||||||
for VERSION in $(cat r-versions-to-build.txt); do
|
for VERSION in $(cat r-versions-to-build.txt); do
|
||||||
if grep -qxF "$VERSION" r-versions-existing.txt; then
|
if grep -qxF "$VERSION" r-versions-existing.txt; then
|
||||||
|
|
@ -263,7 +235,11 @@ steps:
|
||||||
from_secret: B2_S3_ACCESS_KEY_ID
|
from_secret: B2_S3_ACCESS_KEY_ID
|
||||||
secret_key:
|
secret_key:
|
||||||
from_secret: B2_S3_SECRET_KEY
|
from_secret: B2_S3_SECRET_KEY
|
||||||
overwrite: false
|
# Must stay true for FORCE_REBUILD to mean anything: with overwrite=false
|
||||||
|
# the plugin logs "File already exists, skipping upload" and still exits
|
||||||
|
# green, so a rebuild would be discarded. Normal runs are unaffected,
|
||||||
|
# since dedup means only not-yet-published versions are ever built.
|
||||||
|
overwrite: true
|
||||||
volumes:
|
volumes:
|
||||||
- ci-tmp-rwx:/tmp # agent on k8s
|
- ci-tmp-rwx:/tmp # agent on k8s
|
||||||
# - /tmp:/tmp # agent on VM
|
# - /tmp:/tmp # agent on VM
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue