chore: build alpine 3.22
All checks were successful
ci/crow/manual/build/6 Pipeline was successful
ci/crow/manual/build/5 Pipeline was successful
ci/crow/manual/build/7 Pipeline was successful
ci/crow/manual/build/8 Pipeline was successful
ci/crow/manual/build/3 Pipeline was successful
ci/crow/manual/build/4 Pipeline was successful
ci/crow/manual/build/13 Pipeline was successful
ci/crow/manual/build/1 Pipeline was successful
ci/crow/manual/build/11 Pipeline was successful
ci/crow/manual/build/2 Pipeline was successful
ci/crow/manual/build/9 Pipeline was successful
ci/crow/manual/build/10 Pipeline was successful
ci/crow/manual/build/12 Pipeline was successful
ci/crow/cron/build/5 Pipeline was successful
ci/crow/cron/build/9 Pipeline was successful
ci/crow/cron/build/1 Pipeline was successful
ci/crow/cron/build/8 Pipeline was successful
ci/crow/cron/build/2 Pipeline was successful
ci/crow/cron/build/4 Pipeline was successful
ci/crow/cron/build/7 Pipeline was successful
ci/crow/cron/build/10 Pipeline was successful
ci/crow/cron/build/13 Pipeline was successful
ci/crow/cron/build/12 Pipeline was successful
ci/crow/cron/build/3 Pipeline was successful
ci/crow/cron/build/6 Pipeline was successful
ci/crow/cron/build/11 Pipeline was successful

This commit is contained in:
Patrick Schratz 2025-06-01 11:54:41 +02:00
commit 94184582c9
Signed by: pat-s
GPG key ID: 3C6318841EF78925
6 changed files with 130 additions and 11 deletions

224
.crow/build.yaml Normal file
View file

@ -0,0 +1,224 @@
when:
event: [cron, manual]
matrix:
include:
- PLATFORM: rhel-9
PLATFORM_ID: el9
ARCH: arm64
ARCH_ID: aarch64
INSTANCE_TYPE: cax31
- PLATFORM: rhel-9
PLATFORM_ID: el9
ARCH: amd64
ARCH_ID: x86_64
INSTANCE_TYPE: AX42
- PLATFORM: centos-8
PLATFORM_ID: el8
ARCH: arm64
ARCH_ID: aarch64
INSTANCE_TYPE: cax31
- PLATFORM: centos-8
PLATFORM_ID: el8
ARCH: amd64
ARCH_ID: x86_64
INSTANCE_TYPE: AX42
- PLATFORM: ubuntu-2204
PLATFORM_ID: 2204
ARCH: arm64
ARCH_ID: arm64
INSTANCE_TYPE: cax31
- PLATFORM: ubuntu-2204
PLATFORM_ID: 2204
ARCH: amd64
ARCH_ID: amd64
INSTANCE_TYPE: AX42
- PLATFORM: ubuntu-2404
PLATFORM_ID: 2404
ARCH: arm64
ARCH_ID: arm64
INSTANCE_TYPE: cax31
- PLATFORM: ubuntu-2404
PLATFORM_ID: 2404
ARCH: amd64
ARCH_ID: amd64
INSTANCE_TYPE: AX42
- PLATFORM: alpine-320
PLATFORM_ID: alpine320
ARCH: arm64
ARCH_ID: aarch64
INSTANCE_TYPE: cax31
- PLATFORM: alpine-321
PLATFORM_ID: alpine321
ARCH: arm64
ARCH_ID: aarch64
INSTANCE_TYPE: cax31
- PLATFORM: alpine-321
PLATFORM_ID: alpine321
ARCH: amd64
ARCH_ID: x86_64
INSTANCE_TYPE: AX42
- PLATFORM: alpine-322
PLATFORM_ID: alpine322
ARCH: arm64
ARCH_ID: aarch64
INSTANCE_TYPE: cax31
- PLATFORM: alpine-322
PLATFORM_ID: alpine322
ARCH: amd64
ARCH_ID: x86_64
INSTANCE_TYPE: AX42
steps:
# Ensures that we're always using the latest available upstream build chain
# - name: Pull upstream
# image: 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: Get latest R version
image: alpine:3.21
commands:
- apk add -q --no-cache curl
- curl -s https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/r/r.rb | grep -o 'R-[0-9]*\.[0-9]*\.[0-9]*' | tr -d 'R-' | tr -d '"' | head -n 1 > r-release-version.txt
# - echo "4.2.2" > r-release-version.txt
- cat r-release-version.txt
backend_options:
kubernetes:
resources:
requests:
memory: 50Mi
cpu: 200m
limits:
memory: 200Mi
cpu: 500m
nodeSelector:
kubernetes.io/arch: "${ARCH}"
node.kubernetes.io/instance-type: "${INSTANCE_TYPE}"
tolerations:
- key: "CI"
operator: "Equal"
value: "true"
effect: "NoSchedule"
- name: Check if files for R version already exist in s3
environment:
AWS_ACCESS_KEY_ID:
from_secret: HETZNER_S3_ACCESS_KEY_K3S
AWS_SECRET_ACCESS_KEY:
from_secret: HETZNER_S3_SECRET_KEY_K3S
AWS_ENDPOINT_URL: https://fsn1.your-objectstorage.com
image: alpine:3.21
commands:
- apk add -q --no-cache aws-cli
- aws s3 ls s3://devxy-r-builds/${PLATFORM_ID}/ | grep ${ARCH_ID} | tail -1 | awk '{print $NF}' | cut -c 3-7 > r_build_latest.txt
- cat r_build_latest.txt
backend_options:
kubernetes:
nodeSelector:
kubernetes.io/arch: "${ARCH}"
node.kubernetes.io/instance-type: "${INSTANCE_TYPE}"
tolerations:
- key: "CI"
operator: "Equal"
value: "true"
effect: "NoSchedule"
# ref: https://github.com/woodpecker-ci/woodpecker/discussions/2721
- name: Build
image: alpine:3.21
privileged: true
environment:
DOCKER_HOST: tcp://docker:2375
commands: |
# docker info
if [ ! -s r_build_latest.txt ] || [ ! "$(cat r-release-version.txt)" = "$(cat r_build_latest.txt)" ]; then
apk add -q --no-cache py3-pip make just aws-cli docker-compose
pip3 install -q b2 --break-system-packages
just build-r-${PLATFORM} $(cat r-release-version.txt)
fi
backend_options:
kubernetes:
resources:
requests:
memory: 200Mi
cpu: 500m
limits:
memory: 1000Mi
cpu: 4000m
nodeSelector:
kubernetes.io/arch: "${ARCH}"
node.kubernetes.io/instance-type: "${INSTANCE_TYPE}"
tolerations:
- key: "CI"
operator: "Equal"
value: "true"
effect: "NoSchedule"
- name: Upload to Hetzner S3
image: woodpeckerci/plugin-s3:1.3.0
pull: true
settings:
bucket: devxy-r-builds
strip_prefix: /tmp/${PLATFORM}/
source: /tmp/${PLATFORM}/*
target: ${PLATFORM_ID}/
region: fsn1
acl: public-read
endpoint: fsn1.your-objectstorage.com
access_key:
from_secret: HETZNER_S3_ACCESS_KEY_K3S
secret_key:
from_secret: HETZNER_S3_SECRET_KEY_K3S
overwrite: false
volumes:
- ci-tmp-rwx:/tmp # agent on k8s
# - /tmp:/tmp # agent on VM
backend_options:
kubernetes:
resources:
requests:
memory: 100Mi
cpu: 200m
limits:
memory: 1000Mi
cpu: 1000m
nodeSelector:
kubernetes.io/arch: "${ARCH}"
node.kubernetes.io/instance-type: "${INSTANCE_TYPE}"
tolerations:
- key: "CI"
operator: "Equal"
value: "true"
effect: "NoSchedule"
services:
docker:
environment:
DOCKER_TLS_CERTDIR: ""
image: docker:27-dind
commands:
- mkdir -p /tmp/${PLATFORM}/${ARCH}
- dockerd --tls=false --mtu 1420 --host=tcp://0.0.0.0:2375
privileged: true
ports:
- 2375
volumes:
- ci-tmp-rwx:/tmp # agent on k8s
backend_options:
kubernetes:
nodeSelector:
kubernetes.io/arch: "${ARCH}"
node.kubernetes.io/instance-type: "${INSTANCE_TYPE}"
tolerations:
- key: "CI"
operator: "Equal"
value: "true"
effect: "NoSchedule"

View file

@ -23,12 +23,12 @@ build-r-opensuse-155 R_VERSION:
export R_VERSION={{R_VERSION}}; \
make build-r-$PLATFORM
build-r-alpine-320 R_VERSION:
export PLATFORM=alpine-320; \
export R_VERSION={{R_VERSION}}; \
make build-r-$PLATFORM
build-r-alpine-321 R_VERSION:
export PLATFORM=alpine-321; \
export R_VERSION={{R_VERSION}}; \
make build-r-$PLATFORM
build-r-alpine-322 R_VERSION:
export PLATFORM=alpine-322; \
export R_VERSION={{R_VERSION}}; \
make build-r-$PLATFORM

View file

@ -1,4 +1,4 @@
PLATFORMS := ubuntu-2004 ubuntu-2204 ubuntu-2404 debian-10 debian-11 debian-12 centos-7 centos-8 rhel-9 opensuse-155 fedora-38 fedora-39 fedora-40 alpine-320 alpine-321
PLATFORMS := ubuntu-2004 ubuntu-2204 ubuntu-2404 debian-10 debian-11 debian-12 centos-7 centos-8 rhel-9 opensuse-155 fedora-38 fedora-39 fedora-40 alpine-321 alpine-322
SLS_BINARY ?= ./node_modules/serverless/bin/serverless.js
deps:

View file

@ -0,0 +1,28 @@
FROM alpine:3.22
ENV OS_IDENTIFIER alpine-322
RUN set -x \
&& apk add -q R-dev curl ca-certificates bash g++ tzdata openjdk17 texmf-dist texlive-full tar sed patch tcl tk tk-dev xvfb libdeflate libdeflate-dev
# Install AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf aws awscliv2.zip
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.39.0/nfpm_2.39.0_$(arch).apk" && \
apk add --allow-untrusted "./nfpm_2.39.0_$(arch).apk" && \
rm "nfpm_2.39.0_$(arch).apk"
RUN chmod 0777 /opt
# Override the default pager used by R
ENV PAGER /usr/bin/pager
ENV CONFIGURE_OPTIONS "--enable-R-shlib --with-tcltk --enable-memory-profiling --with-x=no --with-blas --with-lapack"
COPY package.alpine-322 /package.sh
COPY build.sh .
COPY patches /patches
ENTRYPOINT ./build.sh

View file

@ -59,6 +59,18 @@ services:
image: r-builds:alpine-321
volumes:
- /tmp/alpine-321:/tmp/output/alpine-321
alpine-322:
command: ./build.sh
environment:
- R_VERSION=${R_VERSION}
- R_INSTALL_PATH=${R_INSTALL_PATH}
- LOCAL_STORE=/tmp/output
build:
context: .
dockerfile: Dockerfile.alpine-322
image: r-builds:alpine-322
volumes:
- /tmp/alpine-322:/tmp/output/alpine-322
debian-10:
command: ./build.sh
environment:

View file

@ -0,0 +1,74 @@
#!/bin/bash
if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi
# R 3.x requires PCRE1. On Ubuntu 24, R 3.x also requires PCRE2 for Pango support.
pcre_libs='- pcre2-dev'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_libs='- pcre2-dev
- libpcre3-dev'
fi
deflate_libs='# - libdeflate-dev'
if grep -q '^LIBS *=.*[-]ldeflate' ${R_INSTALL_PATH}/lib/R/etc/Makeconf; then
deflate_libs='- libdeflate-dev'
fi
cat <<EOF > /tmp/nfpm.yml
name: r-${R_VERSION}
version: 1
version_schema: none
section: universe/math
priority: optional
arch: $(arch)
maintainer: Posit Software, PBC <https://github.com/rstudio/r-builds>
description: |
GNU R statistical computation and graphics system
vendor: Posit Software, PBC
homepage: https://www.r-project.org
license: GPL-2
depends:
- g++
- gcc
- gfortran
- libbz2
# - libc6
- cairo
- libcurl
${deflate_libs}
# - libglib2.0-0t64
# - libgomp1
- icu-dev
- jpeg-dev
# - liblzma-dev
- openblas-dev
- pango
# - libpangocairo-1.0-0
- libpaper
${pcre_libs}
- libpng-dev
- readline-dev
- tcl
- tiff-dev
- libtirpc-dev
- tk
# - libx11-6
# - libxt6t64
- make
# - ucf
- unzip
- zip
- zlib-ng-dev
contents:
- src: ${R_INSTALL_PATH}
dst: ${R_INSTALL_PATH}
EOF
nfpm package \
-f /tmp/nfpm.yml \
-p apk \
-t "/tmp/output/${OS_IDENTIFIER}"
export PKG_FILE=$(ls /tmp/output/${OS_IDENTIFIER}/r-${R_VERSION}*.apk | head -1)