Skip to content

Commit e291d95

Browse files
authored
Merge pull request #132 from bedroge/riscv
Build containers for riscv64
2 parents f01acd1 + 8da6758 commit e291d95

File tree

5 files changed

+103
-20
lines changed

5 files changed

+103
-20
lines changed

.github/workflows/build-publish-containers.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- main
1313
paths:
1414
- containers/Dockerfile.EESSI-*
15-
- containers/build-or-download-cvmfs-rpm.sh
15+
- containers/build-or-download-cvmfs-*.sh
1616

1717
# also rebuild the containers for new releases of filesystem-layer:
1818
# this often means that we have a new CVMFS configuration package
@@ -32,8 +32,14 @@ jobs:
3232
contents: read
3333
strategy:
3434
matrix:
35-
tag: ['client:centos7', 'build-node:debian11']
36-
platform: [amd64, arm64, ppc64le]
35+
tag: ['client:centos7', 'build-node:debian11', 'build-node:debian-sid']
36+
platform: [amd64, arm64, riscv64]
37+
exclude:
38+
# exclude images that don't support RISC-V
39+
- tag: client:centos7
40+
platform: riscv64
41+
- tag: build-node:debian11
42+
platform: riscv64
3743

3844
steps:
3945
- name: Check out the repo
@@ -91,7 +97,7 @@ jobs:
9197
contents: read
9298
strategy:
9399
matrix:
94-
tag: ['client:centos7', 'build-node:debian11']
100+
tag: ['client:centos7', 'build-node:debian11', 'build-node:debian-sid']
95101
steps:
96102
- name: Login to GitHub Container Registry
97103
if: github.event_name != 'pull_request'
@@ -106,12 +112,19 @@ jobs:
106112
echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
107113
108114
- name: Create the final image using "docker buildx imagetools create"
109-
if: github.event_name != 'pull_request'
115+
if: github.event_name != 'pull_request' && matrix.tag == 'build-node:debian-sid'
110116
run: |
111117
docker buildx imagetools create -t ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }} \
112118
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-amd64 \
113119
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-arm64 \
114-
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-ppc64le
120+
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-riscv64
121+
122+
- name: Create the final image using "docker buildx imagetools create"
123+
if: github.event_name != 'pull_request' && matrix.tag != 'build-node:debian-sid'
124+
run: |
125+
docker buildx imagetools create -t ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }} \
126+
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-amd64 \
127+
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-arm64
115128
116129
- name: Inspect the final image
117130
if: github.event_name != 'pull_request'
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
ARG cvmfsversion=2.11.2
2+
ARG archspecversion=0.2.2
3+
ARG awscliversion=1.32.22
4+
ARG fuseoverlayfsversion=1.10
5+
6+
FROM debian:sid-20240330-slim AS prepare-deb
7+
ARG cvmfsversion
8+
COPY ./containers/build-or-download-cvmfs-debs.sh /build-or-download-cvmfs-debs.sh
9+
RUN sh /build-or-download-cvmfs-debs.sh ${cvmfsversion}
10+
11+
12+
FROM debian:sid-20240330-slim
13+
ARG cvmfsversion
14+
ARG archspecversion
15+
ARG awscliversion
16+
ARG fuseoverlayfsversion
17+
18+
COPY --from=prepare-deb /root/deb /root/deb
19+
20+
RUN apt-get update
21+
RUN apt-get install -y sudo vim openssh-client gawk autofs curl attr uuid fuse3 libfuse2 psmisc gdb uuid-dev lsof strace
22+
# python3 and jq are required for eessi-upload-to-staging script (next to awscli)
23+
RUN apt-get install -y python3-pip python3-venv jq
24+
RUN dpkg -i /root/deb/cvmfs_${cvmfsversion}~1+debian13_$(dpkg --print-architecture).deb \
25+
/root/deb/cvmfs-fuse3_${cvmfsversion}~1+debian13_$(dpkg --print-architecture).deb \
26+
/root/deb/cvmfs-libs_${cvmfsversion}~1+debian13_$(dpkg --print-architecture).deb \
27+
/root/deb/cvmfs-config-default_latest_all.deb \
28+
/root/deb/cvmfs-config-eessi_latest_all.deb
29+
30+
# download binary for specific version of fuse-overlayfs
31+
RUN curl -L -o /usr/local/bin/fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/v${fuseoverlayfsversion}/fuse-overlayfs-$(uname -m) \
32+
&& chmod +x /usr/local/bin/fuse-overlayfs
33+
34+
RUN echo 'CVMFS_QUOTA_LIMIT=10000' > /etc/cvmfs/default.local \
35+
&& echo 'CVMFS_CLIENT_PROFILE="single"' >> /etc/cvmfs/default.local \
36+
&& echo 'CVMFS_HIDE_MAGIC_XATTRS=yes' >> /etc/cvmfs/default.local
37+
38+
RUN mkdir -p /cvmfs/software.eessi.io
39+
40+
RUN useradd -ms /bin/bash eessi
41+
42+
RUN python3 -m venv /opt/archspec && . /opt/archspec/bin/activate && pip3 install archspec==${archspecversion} && deactivate && ln -s /opt/archspec/bin/archspec /usr/local/bin/archspec
43+
# stick to awscli v1.x, 2.x is not available through PyPI (see https://github.com/aws/aws-cli/issues/4947)
44+
RUN python3 -m venv /opt/awscli && . /opt/awscli/bin/activate && pip3 install awscli==${awscliversion} && deactivate && ln -s /opt/awscli/bin/aws /usr/local/bin/aws

containers/Dockerfile.EESSI-build-node-debian11

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,3 @@ RUN useradd -ms /bin/bash eessi
3939

4040
# stick to awscli v1.x, 2.x is not available through PyPI (see https://github.com/aws/aws-cli/issues/4947)
4141
RUN pip3 install archspec awscli==${awscliversion}
42-
43-
RUN curl -OL https://raw.githubusercontent.com/EESSI/eessi-bot-software-layer/develop/scripts/eessi-upload-to-staging \
44-
&& mv eessi-upload-to-staging /usr/bin \
45-
&& chmod a+x /usr/bin/eessi-upload-to-staging

containers/build-or-download-cvmfs-debs.sh

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,52 @@
11
#/bin/bash
22
cvmfsversion=$1
33
arch=$(dpkg --print-architecture)
4-
os=debian11
54

65
apt-get update
7-
apt-get install -y wget
8-
if [ "$arch" = "ppc64el" ] || [ "$arch" = "arm64" ]
6+
apt-get install -y wget lsb-release
7+
8+
distro=$(lsb_release -si | tr [:upper:] [:lower:])
9+
release=$(lsb_release -sr)
10+
11+
# lsb_release -sr prints n/a for debian sid, replace it by 13
12+
if [ "${distro}" = "debian" ] && [ "${release}" = "n/a" ]
13+
then
14+
release=13
15+
fi
16+
17+
os="${distro}${release}"
18+
19+
if [ "$arch" = "arm64" ] || [ "$arch" = "riscv64" ] || [ "${os}" = "debian13" ]
920
then
10-
apt-get install -y devscripts libfuse3-dev cmake cpio libcap-dev libssl-dev libfuse-dev pkg-config libattr1-dev python-dev python-setuptools python3-dev python3-setuptools uuid-dev valgrind libz-dev lsb-release
11-
# Set Python 2 as default Python
12-
update-alternatives --install /usr/bin/python python /usr/bin/python2 1
13-
update-alternatives --install /usr/bin/python python /usr/bin/python3 2
21+
apt-get install -y devscripts libfuse3-dev cmake cpio libcap-dev libssl-dev libfuse-dev pkg-config libattr1-dev python3-dev python3-setuptools python3-dev python3-setuptools uuid-dev libz-dev lsb-release
1422
cd /tmp
1523
wget https://github.com/cvmfs/cvmfs/archive/refs/tags/cvmfs-${cvmfsversion}.tar.gz
1624
tar xzf cvmfs-${cvmfsversion}.tar.gz
17-
cd cvmfs-cvmfs-${cvmfsversion}/ci/cvmfs
25+
cd cvmfs-cvmfs-${cvmfsversion}
1826
mkdir /root/deb
19-
sed -i 's/Architecture: i386 amd64 armhf arm64/Architecture: i386 amd64 armhf arm64 ppc64el/' ../../packaging/debian/cvmfs/control.in
27+
sed -i 's/Architecture: i386 amd64 armhf arm64/Architecture: i386 amd64 armhf arm64 riscv64/' packaging/debian/cvmfs/control.in
28+
sed -i 's/python-dev/python3-dev/' packaging/debian/cvmfs/control.in
29+
sed -i 's/python-setuptools/python3-setuptools/' packaging/debian/cvmfs/control.in
30+
if [ "$arch" = "riscv64" ]
31+
then
32+
# valgrind is not available (yet) for RISC-V
33+
sed -i 's/, valgrind//' packaging/debian/cvmfs/control.in
34+
# for RISC-V we need to run autoreconf, see:
35+
# https://github.com/cvmfs/cvmfs/pull/3446
36+
wget https://github.com/cvmfs/cvmfs/pull/3446.patch
37+
patch -p 1 -i ./3446.patch
38+
rm 3446.patch
39+
# QEMU shows the host CPU in /proc/cpuinfo, so we need to tweak the CPU detection for some packages and use uname -m instead
40+
sed -i "s/^ISA=.*/ISA=\$(uname -m)/" externals/libcrypto/src/configureHook.sh
41+
sed -i "s/rv64/riscv64/" externals/libcrypto/src/configureHook.sh
42+
sed -i "s/^ISA=.*/ISA=\$(uname -m)/" externals/protobuf/src/configureHook.sh
43+
sed -i "s/rv64/riscv64/" externals/protobuf/src/configureHook.sh
44+
else
45+
apt-get install -y valgrind
46+
fi
47+
cd ci/cvmfs
48+
# make sure the cvmfs package also uses debian 13 for debian sid
49+
[ $release = "13" ] && sed -i "s@\$(lsb_release -sr)@13@" ./deb.sh && sed -i "s/focal/trixie/" ./deb.sh
2050
./deb.sh /tmp/cvmfs-cvmfs-${cvmfsversion} /root/deb
2151
else
2252
mkdir -p /root/deb

containers/build-or-download-cvmfs-rpms.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cvmfsversion=$1
22
arch=$(uname -m)
33

44
yum install -y wget
5-
if [ "$arch" = "ppc64le" ]
5+
if [ "$arch" = "riscv64" ]
66
then
77
yum install -y epel-release
88
yum install -y rpm-build checkpolicy cmake fuse-devel fuse3-devel gcc gcc-c++ golang libattr-devel libcap-devel libuuid-devel openssl-devel python-devel python-setuptools python3-devel python3-setuptools selinux-policy-devel valgrind-devel hardlink selinux-policy-targeted

0 commit comments

Comments
 (0)