Compare commits
4 changed files with 80 additions and 59 deletions
|
|
@ -53,11 +53,11 @@ matrix:
|
||||||
ARCH: amd64
|
ARCH: amd64
|
||||||
ARCH_ID: amd64
|
ARCH_ID: amd64
|
||||||
INSTANCE_TYPE: AX42
|
INSTANCE_TYPE: AX42
|
||||||
# - PLATFORM: alpine-320
|
- PLATFORM: alpine-320
|
||||||
# PLATFORM_ID: alpine320
|
PLATFORM_ID: alpine320
|
||||||
# ARCH: arm64
|
ARCH: arm64
|
||||||
# ARCH_ID: aarch64
|
ARCH_ID: aarch64
|
||||||
# INSTANCE_TYPE: cax31
|
INSTANCE_TYPE: cax31
|
||||||
- PLATFORM: alpine-321
|
- PLATFORM: alpine-321
|
||||||
PLATFORM_ID: alpine321
|
PLATFORM_ID: alpine321
|
||||||
ARCH: arm64
|
ARCH: arm64
|
||||||
|
|
@ -97,9 +97,9 @@ steps:
|
||||||
image: alpine:3.22
|
image: alpine:3.22
|
||||||
commands:
|
commands:
|
||||||
- apk add -q --no-cache curl
|
- 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-version-to-build.txt
|
- 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.1.3" > r-version-to-build.txt
|
- echo "4.3.3" > r-release-version.txt
|
||||||
- cat r-version-to-build.txt
|
- cat r-release-version.txt
|
||||||
backend_options:
|
backend_options:
|
||||||
kubernetes:
|
kubernetes:
|
||||||
resources:
|
resources:
|
||||||
|
|
@ -128,12 +128,8 @@ steps:
|
||||||
image: alpine:3.22
|
image: alpine:3.22
|
||||||
commands:
|
commands:
|
||||||
- apk add -q --no-cache aws-cli
|
- 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
|
||||||
VERSION=$(cat r-version-to-build.txt)
|
- cat r_build_latest.txt
|
||||||
aws s3 ls s3://devxy-r-builds/${PLATFORM_ID}/ | \
|
|
||||||
awk -v arch="${ARCH_ID}" -v ver="${VERSION}" \
|
|
||||||
'$0 ~ arch && $0 ~ ver {print substr($NF, 3, 5)}' > r-version-s3.txt
|
|
||||||
- cat r-version-s3.txt
|
|
||||||
backend_options:
|
backend_options:
|
||||||
kubernetes:
|
kubernetes:
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
|
|
@ -153,10 +149,10 @@ steps:
|
||||||
DOCKER_HOST: tcp://docker:2375
|
DOCKER_HOST: tcp://docker:2375
|
||||||
commands: |
|
commands: |
|
||||||
# docker info
|
# docker info
|
||||||
if ! grep -qF "$(cat r-version-to-build.txt)" r-version-s3.txt; then
|
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
|
apk add -q --no-cache py3-pip make just aws-cli docker-compose
|
||||||
pip3 install -q b2 --break-system-packages
|
pip3 install -q b2 --break-system-packages
|
||||||
just build-r-${PLATFORM} $(cat r-version-to-build.txt)
|
just build-r-${PLATFORM} $(cat r-release-version.txt)
|
||||||
fi
|
fi
|
||||||
backend_options:
|
backend_options:
|
||||||
kubernetes:
|
kubernetes:
|
||||||
|
|
@ -177,7 +173,7 @@ steps:
|
||||||
effect: "NoSchedule"
|
effect: "NoSchedule"
|
||||||
|
|
||||||
- name: Upload to Hetzner S3
|
- name: Upload to Hetzner S3
|
||||||
image: woodpeckerci/plugin-s3:1.5.0
|
image: woodpeckerci/plugin-s3:1.3.0
|
||||||
pull: true
|
pull: true
|
||||||
settings:
|
settings:
|
||||||
bucket: devxy-r-builds
|
bucket: devxy-r-builds
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM rockylinux/rockylinux:10
|
FROM almalinux:10
|
||||||
|
|
||||||
ENV OS_IDENTIFIER rhel-10
|
ENV OS_IDENTIFIER rhel-10
|
||||||
|
|
||||||
|
|
@ -59,9 +59,7 @@ RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_
|
||||||
|
|
||||||
RUN chmod 0777 /opt
|
RUN chmod 0777 /opt
|
||||||
|
|
||||||
# Configure flags for RHEL 10 that don't use the defaults in build.sh
|
# Configure flags for RHEL 9 that don't use the defaults in build.sh
|
||||||
# Since RHEL 9 with the R 4.3.0 release, RHEL/Fedora now uses FlexiBLAS as the
|
|
||||||
# default BLAS/LAPACK, which provides a native BLAS switching mechanism and matches EPEL.
|
|
||||||
ENV CONFIGURE_OPTIONS="\
|
ENV CONFIGURE_OPTIONS="\
|
||||||
--enable-R-shlib \
|
--enable-R-shlib \
|
||||||
--with-tcltk \
|
--with-tcltk \
|
||||||
|
|
@ -70,25 +68,26 @@ ENV CONFIGURE_OPTIONS="\
|
||||||
--with-system-valgrind-headers \
|
--with-system-valgrind-headers \
|
||||||
--with-tcl-config=/usr/lib64/tclConfig.sh \
|
--with-tcl-config=/usr/lib64/tclConfig.sh \
|
||||||
--with-tk-config=/usr/lib64/tkConfig.sh \
|
--with-tk-config=/usr/lib64/tkConfig.sh \
|
||||||
--enable-prebuilt-html \
|
--enable-prebuilt-html"
|
||||||
--with-blas=flexiblas \
|
|
||||||
--with-lapack=flexiblas"
|
|
||||||
|
|
||||||
# RHEL 10 doesn't have the inconsolata font, so override the defaults.
|
# RHEL 9 doesn't have the inconsolata font, so override the defaults.
|
||||||
# This may be removed if RHEL ever adds the texlive-inconsolata package from Fedora.
|
# This may be removed if RHEL ever adds the texlive-inconsolata package from Fedora.
|
||||||
# Or check `dnf provides '*/inconsolata.sty'` for a package that provides it.
|
# Or check `dnf provides '*/inconsolata.sty'` for a package that provides it.
|
||||||
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Making-the-manuals
|
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Making-the-manuals
|
||||||
ENV R_RD4PDF="times,hyper"
|
ENV R_RD4PDF="times,hyper"
|
||||||
|
|
||||||
# Make sure that patching Java does not break R.
|
# Make sure that patching Java does not break R.
|
||||||
# R's default JAVA_HOME path includes the exact Java version on RHEL, which
|
# R's default JAVA_HOME path includes the exact Java version on CentOS/RHEL, which
|
||||||
# requires users to run `R CMD javareconf` even on minor/patch upgrades. Use the
|
# requires users to run `R CMD javareconf` even on minor/patch upgrades. Use the
|
||||||
# major version symlink to avoid this.
|
# major version symlink to avoid this.
|
||||||
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Java-support
|
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Java-support
|
||||||
# https://solutions.posit.co/envs-pkgs/using-rjava/
|
# https://solutions.posit.co/envs-pkgs/using-rjava/
|
||||||
ENV JAVA_HOME=/usr/lib/jvm/jre-21-openjdk
|
ENV JAVA_HOME=/usr/lib/jvm/jre-11-openjdk
|
||||||
|
|
||||||
COPY package.rhel-10 /package.sh
|
# R 3.x requires PCRE2 for Pango support on RHEL 9
|
||||||
|
ENV INCLUDE_PCRE2_IN_R_3 yes
|
||||||
|
|
||||||
|
COPY package.rhel-9 /package.sh
|
||||||
COPY build.sh .
|
COPY build.sh .
|
||||||
COPY patches /patches
|
COPY patches /patches
|
||||||
ENTRYPOINT ./build.sh
|
ENTRYPOINT ./build.sh
|
||||||
|
|
|
||||||
|
|
@ -4,22 +4,67 @@ if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
|
||||||
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
|
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# R 4.5.0 and later require libzstd (with headers to link against libR)
|
# R 3.x requires PCRE1. On RHEL 9, R 3.x also requires PCRE2 for Pango support.
|
||||||
zstd_libs='# - libzstd-devel'
|
pcre_libs='- pcre2-devel'
|
||||||
if grep -q '^LIBS *=.*[-]lzstd' ${R_INSTALL_PATH}/lib/R/etc/Makeconf; then
|
if [[ "${R_VERSION}" =~ ^3 ]]; then
|
||||||
zstd_libs='- libzstd-devel'
|
pcre_libs='- pcre2-devel
|
||||||
|
- pcre-devel'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create postremove script to remove empty directories, as nFPM doesn't include them in the RPM files.
|
# On RHEL and SUSE, we link R against the internal shared BLAS to make the
|
||||||
cat <<EOF >> /after-remove.sh
|
# R binaries more portable and allow users to switch BLAS implementations without
|
||||||
if [ -d ${R_INSTALL_PATH} ]; then
|
# having to recompile R. We default to OpenBLAS, but users may prefer other implementations.
|
||||||
rm -r ${R_INSTALL_PATH}
|
#
|
||||||
fi
|
# Binary packages built against the shared BLAS are also more portable and may be used
|
||||||
|
# with the default R distributed by RHEL/SUSE, or other R installations using
|
||||||
|
# shared BLAS and configured with a different BLAS (such as Microsoft R Open with MKL).
|
||||||
|
# This is especially important for Posit Package Manager's binary packages.
|
||||||
|
#
|
||||||
|
# However, EPEL 9's R now links externally against FlexiBLAS, which provides a
|
||||||
|
# native BLAS switching mechanism for Fedora/RHEL. Starting with R 4.3.0, we also
|
||||||
|
# link to external FlexiBLAS for compatibility.
|
||||||
|
# https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager
|
||||||
|
#
|
||||||
|
# On Ubuntu/Debian, we link R against the external BLAS instead (--with-blas/--with-lapack),
|
||||||
|
# as those distributions use the alternatives system to swap BLAS libraries at runtime.
|
||||||
|
# The default R distributions on Ubuntu/Debian use the external BLAS, so we do as well
|
||||||
|
# for portability.
|
||||||
|
#
|
||||||
|
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Shared-BLAS
|
||||||
|
if [[ "$("${R_INSTALL_PATH}/bin/R" CMD config BLAS_LIBS)" == "-lflexiblas" ]]; then
|
||||||
|
blas_lib='flexiblas-devel'
|
||||||
|
|
||||||
|
# Create postremove script to remove empty directories, as nFPM doesn't include them in the RPM files.
|
||||||
|
cat <<EOF >> /after-remove.sh
|
||||||
|
if [ -d ${R_INSTALL_PATH} ]; then
|
||||||
|
rm -r ${R_INSTALL_PATH}
|
||||||
|
fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
scripts="scripts:
|
scripts="scripts:
|
||||||
postremove: /after-remove.sh
|
postremove: /after-remove.sh
|
||||||
"
|
"
|
||||||
|
else
|
||||||
|
blas_lib='openblas-devel'
|
||||||
|
|
||||||
|
# Create post-install script required for OpenBLAS.
|
||||||
|
cat <<EOF >> /post-install.sh
|
||||||
|
mv ${R_INSTALL_PATH}/lib/R/lib/libRblas.so ${R_INSTALL_PATH}/lib/R/lib/libRblas.so.keep
|
||||||
|
ln -s /usr/lib64/libopenblasp.so ${R_INSTALL_PATH}/lib/R/lib/libRblas.so
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Create after-remove script to remove internal BLAS, which won't be cleaned up automatically.
|
||||||
|
cat <<EOF >> /after-remove.sh
|
||||||
|
if [ -d ${R_INSTALL_PATH} ]; then
|
||||||
|
rm -r ${R_INSTALL_PATH}
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
|
||||||
|
scripts="scripts:
|
||||||
|
postinstall: /post-install.sh
|
||||||
|
postremove: /after-remove.sh
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch
|
if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch
|
||||||
|
|
||||||
|
|
@ -46,11 +91,10 @@ depends:
|
||||||
- libtiff
|
- libtiff
|
||||||
- libXmu
|
- libXmu
|
||||||
- libXt
|
- libXt
|
||||||
${zstd_libs}
|
|
||||||
- make
|
- make
|
||||||
- flexiblas-devel
|
- ${blas_lib}
|
||||||
- pango
|
- pango
|
||||||
- pcre2-devel
|
${pcre_libs}
|
||||||
- tcl
|
- tcl
|
||||||
- tk
|
- tk
|
||||||
- unzip
|
- unzip
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
{
|
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
||||||
"extends": ["local>devxy/renovate-config"],
|
|
||||||
"automergeType": "branch",
|
|
||||||
"enabledManagers": ["woodpecker", "custom.regex"],
|
|
||||||
"customManagers": [
|
|
||||||
{
|
|
||||||
"customType": "regex",
|
|
||||||
"managerFilePatterns": ["/^\\.crow(?:/[^/]+)?\\.ya?ml$/"],
|
|
||||||
"matchStrings": [
|
|
||||||
"(?<depName>\\w+):\\s*(?<currentValue>\\S+)\\s*#\\s*renovate:\\s*datasource=(?<datasource>\\S+)\\s*depName=(?<depName2>\\S+)"
|
|
||||||
],
|
|
||||||
"datasourceTemplate": "{{{datasource}}}",
|
|
||||||
"depNameTemplate": "{{{depName2}}}",
|
|
||||||
"versioningTemplate": "semver"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue