From 3ed34b94b3b84bea97532366393a916d1a34760c Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 7 May 2025 12:02:41 -0600 Subject: [PATCH] ceph-dev-pipeline: Fix extract/upload of cephadm Signed-off-by: Zack Cerza --- ceph-dev-pipeline/build/Jenkinsfile | 29 +++++++++++++++++++++-------- scripts/chacra_upload.sh | 8 +++----- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/ceph-dev-pipeline/build/Jenkinsfile b/ceph-dev-pipeline/build/Jenkinsfile index ea8917e7..af053e0a 100644 --- a/ceph-dev-pipeline/build/Jenkinsfile +++ b/ceph-dev-pipeline/build/Jenkinsfile @@ -351,6 +351,9 @@ pipeline { env.AWS_ACCESS_KEY_ID = env.SCCACHE_BUCKET_CREDS_USR env.AWS_SECRET_ACCESS_KEY = env.SCCACHE_BUCKET_CREDS_PSW sh 'echo > .env' + def ceph_builder_tag = "${env.SHA1[0..6]}.${env.BRANCH}.${env.DIST}.${ARCH}" + def bwc_command_base = "python3 src/script/build-with-container.py --image-repo=${env.CEPH_BUILDER_IMAGE} --tag=${ceph_builder_tag} -d ${DIST} --ceph-version ${env.VERSION}" + def bwc_command = bwc_command_base def bwc_cmd_sccache_flags = "" if ( env.DWZ == "false" ) { sh '''#!/bin/bash @@ -383,9 +386,7 @@ pipeline { ) bwc_cmd_sccache_flags = "--env-file=${env.WORKSPACE}/.env"; } - def ceph_builder_tag = "${env.SHA1[0..6]}.${env.BRANCH}.${env.DIST}.${ARCH}" - def bwc_command_base = "python3 src/script/build-with-container.py ${bwc_cmd_sccache_flags} --image-repo=${env.CEPH_BUILDER_IMAGE} --tag=${ceph_builder_tag} -d ${DIST} --ceph-version ${env.VERSION}" - def bwc_command = bwc_command_base + bwc_command = "${bwc_command} ${bwc_cmd_sccache_flags}" if ( os.pkg_type == "deb" ) { def sccache_flag = "-DWITH_SCCACHE=ON" if ( env.SCCACHE == "true" && ! env.CEPH_EXTRA_CMAKE_ARGS.contains(sccache_flag) ) { @@ -404,12 +405,24 @@ pipeline { } else { throw new Exception("DIST '${env.DIST}' is invalid!") } - sh """#!/bin/bash - set -ex - cd dist/ceph - ln ../ceph-${env.VERSION}.tar.bz2 . - ${bwc_command} + sh """#!/bin/bash -ex + cd dist/ceph + ln ../ceph-${env.VERSION}.tar.bz2 . + ${bwc_command} """ + if ( os.pkg_type == "deb" ) { + sh """#!/bin/bash -ex + cd dist/ceph + ${bwc_command_base} -e custom -- "dpkg-deb --fsys-tarfile /ceph/debs/*/pool/main/c/ceph/cephadm_${VERSION}*.deb | tar -x -f - --strip-components=3 ./usr/sbin/cephadm" + ln ./cephadm ../../ + """ + } else if ( env.DIST =~ /^(centos|rhel|fedora).*/ ) { + sh """#!/bin/bash -ex + cd dist/ceph + ${bwc_command_base} -e custom -- "rpm2cpio /ceph/rpmbuild/RPMS/noarch/cephadm-*.rpm | cpio -i --to-stdout *sbin/cephadm > cephadm" + ln ./cephadm ../../ + """ + } } } post { diff --git a/scripts/chacra_upload.sh b/scripts/chacra_upload.sh index e68b1ad5..2ea7621b 100755 --- a/scripts/chacra_upload.sh +++ b/scripts/chacra_upload.sh @@ -14,8 +14,7 @@ if [ "$OS_PKG_TYPE" = "rpm" ]; then BUILDAREA="${WORKSPACE}/dist/ceph/rpmbuild" find dist/ceph/rpmbuild/SRPMS | grep rpm | chacractl binary ${chacra_flags} create ${chacra_endpoint}/source/flavors/${FLAVOR} find dist/ceph/rpmbuild/RPMS/* | grep rpm | chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR} - if [ -f ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm ] ; then - rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm | cpio -i --to-stdout *sbin/cephadm > cephadm + if [ -f ./cephadm ] ; then echo cephadm | chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR} fi elif [ "$OS_PKG_TYPE" = "deb" ]; then @@ -24,9 +23,8 @@ elif [ "$OS_PKG_TYPE" = "deb" ]; then egrep "*(\.changes|\.deb|\.ddeb|\.dsc|ceph[^/]*\.gz)$" | \ egrep -v "(Packages|Sources|Contents)" | \ chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR} - # FIXME need the real path here - if [ -f release/${VERSION}/cephadm_${VERSION}*.deb ] ; then - dpkg-deb --fsys-tarfile release/${VERSION}/cephadm_${VERSION}*.deb | tar -x -f - --strip-components=3 ./usr/sbin/cephadm + BUILDAREA="${WORKSPACE}/dist/ceph/debs" + if [ -f ./cephadm ] ; then echo cephadm | chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR} fi fi -- 2.39.5