Skip to content

Use Debian Trixie (instead of Sid) for build containers, and only build CVMFS from source for RISC-V #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 3, 2025
Merged
11 changes: 6 additions & 5 deletions .github/workflows/build-publish-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ permissions: read-all
jobs:
build_and_publish:
name: Build and publish image
runs-on: self-hosted
#runs-on: self-hosted
runs-on: ubuntu-24.04-arm
timeout-minutes: 720
permissions:
packages: write
contents: read
strategy:
matrix:
tag: ['client:rocky8', 'build-node:debian11', 'build-node:debian-sid']
tag: ['client:rocky8', 'build-node:debian11', 'build-node:debian13']
platform: [amd64, arm64, riscv64]
exclude:
# exclude images that don't support RISC-V
Expand Down Expand Up @@ -97,7 +98,7 @@ jobs:
contents: read
strategy:
matrix:
tag: ['client:rocky8', 'build-node:debian11', 'build-node:debian-sid']
tag: ['client:rocky8', 'build-node:debian11', 'build-node:debian13']
steps:
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
Expand All @@ -112,15 +113,15 @@ jobs:
echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV

- name: Create the final image using "docker buildx imagetools create"
if: github.event_name != 'pull_request' && matrix.tag == 'build-node:debian-sid'
if: github.event_name != 'pull_request' && matrix.tag == 'build-node:debian13'
run: |
docker buildx imagetools create -t ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }} \
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-amd64 \
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-arm64 \
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-riscv64

- name: Create the final image using "docker buildx imagetools create"
if: github.event_name != 'pull_request' && matrix.tag != 'build-node:debian-sid'
if: github.event_name != 'pull_request' && matrix.tag != 'build-node:debian13'
run: |
docker buildx imagetools create -t ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }} \
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-amd64 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ ARG archspecversion=0.2.2
ARG awscliversion=1.32.22
ARG fuseoverlayfsversion=1.10

FROM debian:sid-20240330-slim AS prepare-deb
FROM debian:trixie-20250520-slim AS prepare-deb
ARG cvmfsversion
COPY ./containers/build-or-download-cvmfs-debs.sh /build-or-download-cvmfs-debs.sh
RUN sh /build-or-download-cvmfs-debs.sh ${cvmfsversion}


FROM debian:sid-20240330-slim
FROM debian:trixie-20250520-slim
ARG cvmfsversion
ARG archspecversion
ARG awscliversion
Expand Down
58 changes: 10 additions & 48 deletions containers/build-or-download-cvmfs-debs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ apt-get install -y wget lsb-release
distro=$(lsb_release -si | tr [:upper:] [:lower:])
release=$(lsb_release -sr)

# lsb_release -sr prints n/a for debian sid, replace it by 13
if [ "${distro}" = "debian" ] && [ "${release}" = "n/a" ]
then
release=13
fi

os="${distro}${release}"

if [ "$arch" = "riscv64" ] || [ "${os}" = "debian13" ]
if [ "$arch" = "riscv64" ]
then
apt-get install -y devscripts libfuse3-dev cmake cpio golang libcap-dev libssl-dev libfuse-dev pkg-config libattr1-dev python3-dev python3-setuptools python3-dev python3-setuptools uuid-dev libz-dev lsb-release
cd /tmp
Expand All @@ -25,49 +19,17 @@ then
cd cvmfs-cvmfs-${cvmfsversion}
mkdir /root/deb
sed -i 's/amd64 armhf arm64/amd64 armhf arm64 riscv64/' packaging/debian/cvmfs/control*
sed -i 's/python-dev/python3-dev/' packaging/debian/cvmfs/control*
sed -i 's/python-setuptools/python3-setuptools/' packaging/debian/cvmfs/control*
# debian13 has libfuse3-4
[ $os = "debian13" ] && sed -i 's/libfuse3-3/libfuse3-4/' packaging/debian/cvmfs/control*
if [ "$arch" = "riscv64" ]
then
# valgrind is not available (yet) for RISC-V
sed -i 's/, valgrind//' packaging/debian/cvmfs/control*
# for RISC-V we need to run autoreconf, see:
# https://github.com/cvmfs/cvmfs/pull/3446
wget https://github.com/cvmfs/cvmfs/pull/3446.patch
patch -p 1 -i ./3446.patch
rm 3446.patch
# QEMU shows the host CPU in /proc/cpuinfo, so we need to tweak the CPU detection for some packages and use uname -m instead
sed -i "s/^ISA=.*/ISA=\$(uname -m)/" externals/libcrypto/src/configureHook.sh
sed -i "s/rv64/riscv64/" externals/libcrypto/src/configureHook.sh
sed -i "s/^ISA=.*/ISA=\$(uname -m)/" externals/protobuf/src/configureHook.sh
sed -i "s/rv64/riscv64/" externals/protobuf/src/configureHook.sh
else
apt-get install -y valgrind
fi

# gcc 14 fix for CVMFS's dependency pacparser, see
# https://github.com/manugarg/pacparser/issues/194
if gcc --version | grep -q "^gcc.*14"; then
cat << EOF > externals/pacparser/src/fix_gcc14.patch
--- src/spidermonkey/js/src/jsapi.c
+++ src/spidermonkey/js/src/jsapi.c
@@ -93,7 +93,7 @@
#ifdef HAVE_VA_LIST_AS_ARRAY
#define JS_ADDRESSOF_VA_LIST(ap) ((va_list *)(ap))
#else
-#define JS_ADDRESSOF_VA_LIST(ap) (&(ap))
+#define JS_ADDRESSOF_VA_LIST(ap) ((va_list *)(&(ap)))
#endif

#if defined(JS_PARANOID_REQUEST) && defined(JS_THREADSAFE)
EOF
fi
# debian13 provides libfuse3-4, see https://github.com/cvmfs/cvmfs/pull/3847
[ $os = "debian13" ] && sed -i 's/libfuse3-3 (>= 3.3.0)/libfuse3-3 (>= 3.3.0) | libfuse3-4/g' packaging/debian/cvmfs/control*
# valgrind is not available (yet) for RISC-V
sed -i 's/, valgrind//' packaging/debian/cvmfs/control*
# QEMU shows the host CPU in /proc/cpuinfo, so we need to tweak the CPU detection for some packages and use uname -m instead
sed -i "s/^ISA=.*/ISA=\$(uname -m)/" externals/libcrypto/src/configureHook.sh
sed -i "s/rv64/riscv64/" externals/libcrypto/src/configureHook.sh
sed -i "s/^ISA=.*/ISA=\$(uname -m)/" externals/protobuf/src/configureHook.sh
sed -i "s/rv64/riscv64/" externals/protobuf/src/configureHook.sh

cd ci/cvmfs
# make sure the cvmfs package also uses debian 13 for debian sid
[ $release = "13" ] && sed -i "s@\$(lsb_release -sr)@13@" ./deb.sh && sed -i "s/focal/trixie/" ./deb.sh
./deb.sh /tmp/cvmfs-cvmfs-${cvmfsversion} /root/deb
else
mkdir -p /root/deb
Expand Down
Loading