From: David Galloway Date: Fri, 1 Oct 2021 15:07:40 +0000 (-0400) Subject: ceph-dev*build: Wait for the appropriate arch's repo to be ready X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1918%2Fhead;p=ceph-build.git ceph-dev*build: Wait for the appropriate arch's repo to be ready Also use shaman's search API. What was happening before this was, for example: - master branch gets built - x86_64 job, build, and repo are done way before arm64 - arm64 job finally gets to the point where it's ready to build its container - arm64 job checks with shaman to ask if the branch's repo is ready - shaman answers with the x86_64 repo status and says it is ready - arm64 job proceeds but fails because the arm64 repo is not ready ``` $ echo $RELEASE 8 $ echo $SHA1 d5759e030bea9732b905c51d041fe16c934790ce $ echo $BRANCH master $ echo $FLAVOR default $ for ARCH in x86_64 arm64; do echo "============== $ARCH =============="; curl -s "https://shaman.ceph.com/api/search/?project=ceph&distros=centos/${RELEASE}/${ARCH}&sha1=${SHA1}&ref=${BRANCH}&flavor=${FLAVOR}" | jq -r '.[0].status'; done ============== x86_64 ============== ready ============== arm64 ============== ready ``` Signed-off-by: David Galloway --- diff --git a/ceph-dev-build/build/build_rpm b/ceph-dev-build/build/build_rpm index 4851f8c3d..9082fb1af 100644 --- a/ceph-dev-build/build/build_rpm +++ b/ceph-dev-build/build/build_rpm @@ -83,7 +83,7 @@ if [[ "$CI_CONTAINER" == true && $DISTRO == "centos" ]] ; then loop=0 ready=false while ((loop < 15)); do - if [[ $(curl -s https://shaman.ceph.com/api/repos/${chacra_endpoint}/flavors/${FLAVOR}/ | jq '.[0].status') == '"ready"' ]] ; then ready=true; break; fi + if [[ $(curl -s "https://shaman.ceph.com/api/search/?project=ceph&distros=centos/${RELEASE}/${ARCH}&sha1=${SHA1}&ref=${BRANCH}&flavor=${FLAVOR}" | jq -r '.[0].status') == 'ready' ]] ; then ready=true; break; fi ((loop = loop + 1)) sleep 60 done diff --git a/ceph-dev-new-build/build/build_rpm b/ceph-dev-new-build/build/build_rpm index 3b37fdbea..8510b3769 100644 --- a/ceph-dev-new-build/build/build_rpm +++ b/ceph-dev-new-build/build/build_rpm @@ -85,7 +85,7 @@ if [[ $CI_CONTAINER == "true" && $DISTRO == "centos" ]] ; then loop=0 ready=false while ((loop < 15)); do - if [[ $(curl -s https://shaman.ceph.com/api/repos/${chacra_endpoint}/flavors/${FLAVOR}/ | jq '.[0].status') == '"ready"' ]] ; then ready=true; break; fi + if [[ $(curl -s "https://shaman.ceph.com/api/search/?project=ceph&distros=centos/${RELEASE}/${ARCH}&sha1=${SHA1}&ref=${BRANCH}&flavor=${FLAVOR}" | jq -r '.[0].status') == 'ready' ]] ; then ready=true; break; fi ((loop = loop + 1)) sleep 60 done