]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-dev*build: Wait for the appropriate arch's repo to be ready 1918/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 1 Oct 2021 15:07:40 +0000 (11:07 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 6 Oct 2021 13:21:58 +0000 (09:21 -0400)
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 <dgallowa@redhat.com>
ceph-dev-build/build/build_rpm
ceph-dev-new-build/build/build_rpm

index 4851f8c3dfe82bec7d5ad377349072ace4d4d29a..9082fb1af3eb8f2ece2e8c7e545e6d4e7e239793 100644 (file)
@@ -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
index 3b37fdbea99deed1b7750251fe87e791c70a992f..8510b3769fea1ed7e60a31a0d5ff4da27c0ec1da 100644 (file)
@@ -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