From 53b06ad2cda44589561ed1423961e8e9a0ae5190 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 13 Jun 2024 04:15:11 +0200 Subject: [PATCH] btrfs-progs: ci: add RockyLinux 9 image There's no Centos 9, use one of it's replacemnts for to continue the familiy of LTS distros. No exceptions for feature support (zoned, udev). Signed-off-by: David Sterba --- ci/ci-build-rockylinux9 | 34 +++++++++++++++++ ci/images/ci-rockylinux-9-x86_64/Dockerfile | 37 +++++++++++++++++++ ci/images/ci-rockylinux-9-x86_64/docker-build | 1 + ci/images/ci-rockylinux-9-x86_64/docker-run | 1 + ci/images/ci-rockylinux-9-x86_64/run-tests | 13 +++++++ ci/images/ci-rockylinux-9-x86_64/test-build | 23 ++++++++++++ 6 files changed, 109 insertions(+) create mode 100755 ci/ci-build-rockylinux9 create mode 100644 ci/images/ci-rockylinux-9-x86_64/Dockerfile create mode 120000 ci/images/ci-rockylinux-9-x86_64/docker-build create mode 120000 ci/images/ci-rockylinux-9-x86_64/docker-run create mode 100755 ci/images/ci-rockylinux-9-x86_64/run-tests create mode 100755 ci/images/ci-rockylinux-9-x86_64/test-build diff --git a/ci/ci-build-rockylinux9 b/ci/ci-build-rockylinux9 new file mode 100755 index 00000000..74f242c7 --- /dev/null +++ b/ci/ci-build-rockylinux9 @@ -0,0 +1,34 @@ +#!/bin/sh +# Usage: $0 [branch] [configure options] +# Create source tarball from HEAD or given branch and build it in RockyLinux 9 CI +# environment. Configure options follow branch name that can be empty. + +HERE=`pwd` +if [ -f "configure.ac" ]; then + SOURCEDIR=`pwd` +elif [ -f "../configure.ac" ]; then + cd .. + SOURCEDIR=`pwd` +else + echo "ERROR: cannot determine source directory from `pwd`" + exit 1 +fi + +CIIMAGEDIR=ci/images/ci-rockylinux-9-x86_64 +BRANCH=${1:-HEAD} +if [ "$#" -ge 1 ]; then + shift +fi +HASH=$(git log -1 --format='%h %s' "$BRANCH") + +echo "CI: Generate archive from $BRANCH ($HASH)" +git archive --prefix=btrfs-progs-devel/ -o devel.tar "$BRANCH" +echo "$BRANCH $HASH" > GITCOMMIT +tar uvf devel.tar GITCOMMIT +#rm GITCOMMIT +gzip --force --best devel.tar + +cd "$CIIMAGEDIR" +cp "$SOURCEDIR/devel.tar.gz" . +./docker-build +./docker-run -- ./test-build devel --disable-documentation "$@" diff --git a/ci/images/ci-rockylinux-9-x86_64/Dockerfile b/ci/images/ci-rockylinux-9-x86_64/Dockerfile new file mode 100644 index 00000000..7c1651ca --- /dev/null +++ b/ci/images/ci-rockylinux-9-x86_64/Dockerfile @@ -0,0 +1,37 @@ +FROM rockylinux:9 + +WORKDIR /tmp + +RUN rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org +RUN yum -y install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm +RUN yum -y install epel-release + +RUN yum -y install autoconf automake pkg-config +RUN yum -y install libattr-devel libblkid-devel libuuid-devel +RUN yum -y install e2fsprogs-libs e2fsprogs-devel +RUN yum -y install zlib-devel lzo-devel libzstd-devel zstd +RUN yum -y install make gcc tar gzip clang +RUN yum -y install python3 python3-devel python3-setuptools + +# For downloading fresh sources +RUN yum -y install wget + +# For running tests +RUN yum -y install util-linux e2fsprogs findutils grep +RUN yum -y install udev systemd-devel device-mapper acl attr xz + +RUN yum -y install libsodium-devel + +# For debugging +RUN yum -y install less vim + +COPY ./test-build . +COPY ./run-tests . +COPY ./devel.tar.gz . + +CMD ./test-build devel --disable-documentation + +# Continue with: +# cd /tmp +# (see CMD above) +# ./run-tests /tmp/btrfs-progs-devel diff --git a/ci/images/ci-rockylinux-9-x86_64/docker-build b/ci/images/ci-rockylinux-9-x86_64/docker-build new file mode 120000 index 00000000..622545a7 --- /dev/null +++ b/ci/images/ci-rockylinux-9-x86_64/docker-build @@ -0,0 +1 @@ +../docker-build \ No newline at end of file diff --git a/ci/images/ci-rockylinux-9-x86_64/docker-run b/ci/images/ci-rockylinux-9-x86_64/docker-run new file mode 120000 index 00000000..09033311 --- /dev/null +++ b/ci/images/ci-rockylinux-9-x86_64/docker-run @@ -0,0 +1 @@ +../docker-run \ No newline at end of file diff --git a/ci/images/ci-rockylinux-9-x86_64/run-tests b/ci/images/ci-rockylinux-9-x86_64/run-tests new file mode 100755 index 00000000..f2a15242 --- /dev/null +++ b/ci/images/ci-rockylinux-9-x86_64/run-tests @@ -0,0 +1,13 @@ +#!/bin/sh -x + +where="$1" + +cd "$where" || { echo "ERROR: $1 not found"; exit 1; } + +make TEST_LOG=dump test-cli +make TEST_LOG=dump test-mkfs +make TEST_LOG=dump test-check +make TEST_LOG=dump test-check-lowmem +make TEST_LOG=dump test-misc +make TEST_LOG=dump test-convert +make TEST_LOG=dump test-fuzz diff --git a/ci/images/ci-rockylinux-9-x86_64/test-build b/ci/images/ci-rockylinux-9-x86_64/test-build new file mode 100755 index 00000000..54559461 --- /dev/null +++ b/ci/images/ci-rockylinux-9-x86_64/test-build @@ -0,0 +1,23 @@ +#!/bin/sh +# usage: $0 [branch name] [configure parameters] + +urlbase="https://github.com/kdave/btrfs-progs/archive" +branch=${1:-devel} +fnbase="${branch/\//-}" +fname="${fnbase}.tar.gz" +url="${urlbase}/${branch}.tar.gz" + +shift + +echo "btrfs-progs build test of branch ${branch}" +cd /tmp +if [ -f "$fname" -a -s "$fname" ]; then + echo "Found local file $fname, not downloading" +else + echo "Missing or empty tar, downloading branch $branch from git" + rm -- "$fname" + wget "$url" -O "$fname" +fi +tar xf "$fname" +cd "btrfs-progs-$fnbase" +ci/build-default "$@"