diff --git a/Dockerfile.mockbuild b/Dockerfile.mockbuild index d8d86ac..b6cc465 100644 --- a/Dockerfile.mockbuild +++ b/Dockerfile.mockbuild @@ -16,6 +16,7 @@ LABEL maintainer="daos@daos.groups.io" ARG REPO_FILE_URL ARG DAOS_LAB_CA_FILE_URL ARG REPOSITORY_NAME + # script to install OS updates basic tools and daos dependencies # COPY ./utils/scripts/install-fedora.sh /tmp/install.sh # script to setup local repo if available @@ -26,9 +27,9 @@ RUN chmod +x /tmp/repo-helper.sh && \ rm -f /tmp/repo-helper.sh # Install basic tools -RUN dnf -y install mock make \ - rpm-build createrepo rpmlint redhat-lsb-core git \ - python-srpm-macros rpmdevtools && \ +RUN dnf -y install mock make \ + rpm-build createrepo rpmlint git \ + python-srpm-macros rpmdevtools && \ dnf -y clean all # use same UID as host and default value of 1000 if not specified diff --git a/Jenkinsfile b/Jenkinsfile index 34371ba..2f35cd1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -71,7 +71,7 @@ pipeline { ' --cap-add=SYS_ADMIN' + ' --privileged=true' + ' -v /scratch:/scratch' - additionalBuildArgs dockerBuildArgs() + '--build-arg PACKAGINGDIR=. ' + additionalBuildArgs dockerBuildArgs() + '--build-arg FVERSION=latest --build-arg PACKAGINGDIR=. ' } } steps { @@ -110,6 +110,55 @@ pipeline { } } } //stage('Build libfabric on EL 8') + stage('Build libfabric on EL 8 (Fedora 41)') { + agent { + dockerfile { + filename 'Dockerfile.mockbuild' + label 'docker_runner' + args '--group-add mock' + + ' --cap-add=SYS_ADMIN' + + ' --privileged=true' + + ' -v /scratch:/scratch' + additionalBuildArgs dockerBuildArgs() + + '--build-arg FVERSION=41 --build-arg PACKAGINGDIR=. ' + } + } + steps { + checkoutScm url: 'https://github.com/daos-stack/libfabric.git', + checkoutDir: "libfabric", + branch: commitPragma(pragma: 'libfabric-branch', def_val: 'master') + sh label: env.STAGE_NAME, + script: updatePackaging('libfabric') + ''' + rm -rf artifacts/el8/ + mkdir -p artifacts/el8/ + make CHROOT_NAME="rocky+epel-8-x86_64" DISTRO_VERSION=8 chrootbuild''' + } + post { + success { + sh 'ls -l /var/lib/mock/rocky+epel-8-x86_64/result/' + } + unsuccessful { + sh label: "Collect artifacts", + script: '''mockroot=/var/lib/mock/rocky+epel-8-x86_64 + artdir=$PWD/libfabric/artifacts/el8 + cp -af _topdir/SRPMS $artdir + (cd $mockroot/result/ && + cp -r . $artdir) + (if cd $mockroot/root/builddir/build/BUILD/*/; then + find . -name configure -printf %h\\\\n | \ + while read dir; do + if [ ! -f $dir/config.log ]; then + continue + fi + tdir="$artdir/autoconf-logs/$dir" + mkdir -p $tdir + cp -a $dir/config.log $tdir/ + done + fi)''' + archiveArtifacts artifacts: 'libfabric/artifacts/el8/**' + } + } + } //stage('Build libfabric on EL 8 (Fedora 41)') stage('Build libfabric on EL 9') { agent { dockerfile { @@ -158,6 +207,55 @@ pipeline { } } } //stage('Build libfabric on EL 9') + stage('Build libfabric on EL 9 (Fedora 42)') { + agent { + dockerfile { + filename 'Dockerfile.mockbuild' + label 'docker_runner' + args '--group-add mock' + + ' --cap-add=SYS_ADMIN' + + ' --privileged=true' + + ' -v /scratch:/scratch' + additionalBuildArgs dockerBuildArgs() + + '--build-arg FVERSION=42 --build-arg PACKAGINGDIR=. ' + } + } + steps { + checkoutScm url: 'https://github.com/daos-stack/libfabric.git', + checkoutDir: "libfabric", + branch: commitPragma(pragma: 'libfabric-branch', def_val: 'master') + sh label: env.STAGE_NAME, + script: updatePackaging('libfabric') + ''' + rm -rf artifacts/el9/ + mkdir -p artifacts/el9/ + make CHROOT_NAME="rocky+epel-9-x86_64" DISTRO_VERSION=9 chrootbuild''' + } + post { + success { + sh 'ls -l /var/lib/mock/rocky+epel-9-x86_64/result/' + } + unsuccessful { + sh label: "Collect artifacts", + script: '''mockroot=/var/lib/mock/rocky+epel-9-x86_64 + artdir=$PWD/libfabric/artifacts/el9 + cp -af _topdir/SRPMS $artdir + (cd $mockroot/result/ && + cp -r . $artdir) + (if cd $mockroot/root/builddir/build/BUILD/*/; then + find . -name configure -printf %h\\\\n | \ + while read dir; do + if [ ! -f $dir/config.log ]; then + continue + fi + tdir="$artdir/autoconf-logs/$dir" + mkdir -p $tdir + cp -a $dir/config.log $tdir/ + done + fi)''' + archiveArtifacts artifacts: 'libfabric/artifacts/el9/**' + } + } + } //stage('Build libfabric on EL 9 (Fedora 42)') stage('Build mercury on EL 8') { agent { dockerfile { @@ -216,7 +314,106 @@ pipeline { ' --privileged=true' + ' -v /scratch:/scratch' additionalBuildArgs dockerBuildArgs() + - '--build-arg FVERSION=37 --build-arg PACKAGINGDIR=. ' + '--build-arg PACKAGINGDIR=. ' + } + } + steps { + checkoutScm url: 'https://github.com/daos-stack/libfabric.git', + checkoutDir: "libfabric", + branch: commitPragma(pragma: 'libfabric-branch', def_val: 'master') + sh label: env.STAGE_NAME, + script: updatePackaging('libfabric') + ''' + rm -rf artifacts/leap15/ + mkdir -p artifacts/leap15/ + make CHROOT_NAME="opensuse-leap-15.6-x86_64" chrootbuild''' + } + post { + success { + sh 'ls -l /var/lib/mock/opensuse-leap-15.6-x86_64/result/' + } + unsuccessful { + sh label: "Collect artifacts", + script: '''mockroot=/var/lib/mock/opensuse-leap-15.6-x86_64 + artdir=$PWD/libfabric/artifacts/leap15 + cp -af _topdir/SRPMS $artdir + (cd $mockroot/result/ && + cp -r . $artdir) + (if cd $mockroot/root/builddir/build/BUILD/*/; then + find . -name configure -printf %h\\\\n | \ + while read dir; do + if [ ! -f $dir/config.log ]; then + continue + fi + tdir="$artdir/autoconf-logs/$dir" + mkdir -p $tdir + cp -a $dir/config.log $tdir/ + done + fi)''' + archiveArtifacts artifacts: 'libfabric/artifacts/leap15/**' + } + } + } //stage('Build libfabric on Leap 15') + stage('Build libfabric on Leap 15 (Fedora 41)') { + agent { + dockerfile { + filename 'Dockerfile.mockbuild' + label 'docker_runner' + args '--group-add mock' + + ' --cap-add=SYS_ADMIN' + + ' --privileged=true' + + ' -v /scratch:/scratch' + additionalBuildArgs dockerBuildArgs() + + '--build-arg FVERSION=41 --build-arg PACKAGINGDIR=. ' + } + } + steps { + checkoutScm url: 'https://github.com/daos-stack/libfabric.git', + checkoutDir: "libfabric", + branch: commitPragma(pragma: 'libfabric-branch', def_val: 'master') + sh label: env.STAGE_NAME, + script: updatePackaging('libfabric') + ''' + rm -rf artifacts/leap15/ + mkdir -p artifacts/leap15/ + make CHROOT_NAME="opensuse-leap-15.6-x86_64" chrootbuild''' + } + post { + success { + sh 'ls -l /var/lib/mock/opensuse-leap-15.6-x86_64/result/' + } + unsuccessful { + sh label: "Collect artifacts", + script: '''mockroot=/var/lib/mock/opensuse-leap-15.6-x86_64 + artdir=$PWD/libfabric/artifacts/leap15 + cp -af _topdir/SRPMS $artdir + (cd $mockroot/result/ && + cp -r . $artdir) + (if cd $mockroot/root/builddir/build/BUILD/*/; then + find . -name configure -printf %h\\\\n | \ + while read dir; do + if [ ! -f $dir/config.log ]; then + continue + fi + tdir="$artdir/autoconf-logs/$dir" + mkdir -p $tdir + cp -a $dir/config.log $tdir/ + done + fi)''' + archiveArtifacts artifacts: 'libfabric/artifacts/leap15/**' + } + } + } //stage('Build libfabric on Leap 15 (Fedora 41)') + // Leap 15.5 requires Fedora 38 or older + stage('Build libfabric on Leap 15.5 (Fedora 38)') { + agent { + dockerfile { + filename 'Dockerfile.mockbuild' + label 'docker_runner' + args '--group-add mock' + + ' --cap-add=SYS_ADMIN' + + ' --privileged=true' + + ' -v /scratch:/scratch' + additionalBuildArgs dockerBuildArgs() + + '--build-arg FVERSION=38 --build-arg PACKAGINGDIR=. ' } } steps { @@ -254,7 +451,7 @@ pipeline { archiveArtifacts artifacts: 'libfabric/artifacts/leap15/**' } } - } //stage('Build libfabric on Leap 15') + } //stage('Build libfabric on Leap 15.5') stage('Build libfabric on Ubuntu 20.04') { agent { dockerfile { diff --git a/scripts/repo-helper-fedora.sh b/scripts/repo-helper-fedora.sh index baa7026..b567e00 100644 --- a/scripts/repo-helper-fedora.sh +++ b/scripts/repo-helper-fedora.sh @@ -9,9 +9,26 @@ set -uex : "${FVERSION:=latest}" : "${REPOSITORY_NAME:=artifactory}" : "${archive:=}" -if [ "$FVERSION" != "latest" ]; then - archive="-archive" -fi + +is_fedora_eol() { + local eol_url fedora_version eol_date today + if [ -n "$REPO_FILE_URL" ]; then + eol_url="${REPO_FILE_URL%repo-files/}eol-proxy/fedora.json" + fedora_version=$(grep VERSION_ID /etc/os-release | cut -d= -f2 | \ + tr -d '"') + eol_date=$(curl -s "$eol_url" | sed 's/},{/}\n{/g' | \ + grep "cycle\":\"$fedora_version\"" | \ + sed -n 's/.*"eol":"\([^"]*\)".*/\1/p') + if [[ -z "$eol_date" ]]; then + return 1 # Assume NOT EOL if data missing + fi + today=$(date +%Y-%m-%d) + [[ "$today" > "$eol_date" ]] + return $? # Return 0 if EOL, 1 if not + else + return 1 # Assume NOT EOL if url is missing + fi +} # shellcheck disable=SC2120 disable_repos () { @@ -58,11 +75,14 @@ install_optional_ca() { if [ -n "$REPO_FILE_URL" ]; then install_curl install_optional_ca + if is_fedora_eol; then + archive="-archive" + fi mkdir -p /etc/yum.repos.d pushd /etc/yum.repos.d/ curl -k --noproxy '*' -sSf \ -o "daos_ci-fedora${archive}-${REPOSITORY_NAME}.repo" \ - "{$REPO_FILE_URL}daos_ci-fedora${archive}-${REPOSITORY_NAME}.repo" + "${REPO_FILE_URL}daos_ci-fedora${archive}-${REPOSITORY_NAME}.repo" disable_repos /etc/yum.repos.d/ popd fi