]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
buildpackages: pkgrepo host also needs user-data setup.
authorRobin H. Johnson <robin.johnson@dreamhost.com>
Thu, 10 Dec 2015 19:56:05 +0000 (11:56 -0800)
committerLoic Dachary <ldachary@redhat.com>
Sat, 12 Dec 2015 13:53:21 +0000 (14:53 +0100)
The packages repo host fails in environments where networking setup is
needed in VMs. Use the same user-data as the buildhosts to ensure this
is the case.

Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
(cherry picked from commit ebf8508c083b4a1bf39354597a6472034081962c)

tasks/buildpackages/Makefile

index 054558938473a770726787558d043746c91675b8..94389906d8549f8e48e971a1703ecb75eb0ccb26 100644 (file)
@@ -1,6 +1,10 @@
 SHELL=/bin/bash
 D=/tmp/stampsdir
 VPATH=${D}
+PKG_REPO=packages-repository
+PKG_REPO_OS_TYPE=ubuntu
+PKG_REPO_OS_VERSION=14.04
+PKG_REPO_USER_DATA=${PKG_REPO_OS_TYPE}-${PKG_REPO_OS_VERSION}-user-data.txt
 
 # We want to extract the first listed IPv4 address!
 # Openstack will provide the addresses field in this format:
@@ -25,22 +29,24 @@ ${HOME}/.ssh_agent:
        source ${HOME}/.ssh_agent ; ssh-add ; ssh-add -l
        grep -q ssh_agent ~/.bashrc_teuthology || echo 'source ${HOME}/.ssh_agent' >> ~/.bashrc_teuthology
 
-flock-packages-repository:
-       openstack server create --image 'teuthology-ubuntu-14.04' --flavor ${HTTP_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --wait packages-repository
+flock-${PKG_REPO}:
+       openstack server create --image 'teuthology-ubuntu-14.04' --flavor ${HTTP_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --user-data ${PKG_REPO_USER_DATA} --wait ${PKG_REPO}
        sleep 30
-       ip=$(call get_ip,packages-repository) ; \
+       set -ex ; \
+       ip=$(call get_ip,${PKG_REPO}) ; \
+       for delay in 1 2 4 8 8 8 8 8 8 8 8 8 16 16 16 16 16 32 32 32 64 128 256 512 ; do if ssh -o 'ConnectTimeout=3' $$ip bash -c '"grep -q READYTORUN /var/log/cloud-init*.log"' ; then break ; else sleep $$delay ; fi ; done ; \
        ssh $$ip sudo apt-get update ; \
-       ssh $$ip sudo apt-get install -y nginx ; \
-       ssh $$ip sudo chown -R ubuntu /usr/share/nginx/html ; \
+       ssh $$ip sudo apt-get install -y nginx && \
+       ssh $$ip sudo chown -R ubuntu /usr/share/nginx/html && \
        perl -pi -e "s/^gitbuilder_host:.*/gitbuilder_host: $$ip/" ~/.teuthology.yaml
        touch ${D}/$@
 
-packages-repository:
+${PKG_REPO}:
        mkdir -p ${D}
        flock --close ${D}/flock-$@.lock ${MAKE} flock-$@
        touch ${D}/$@
 
-ceph-${CEPH_PKG_TYPE}-${CEPH_DIST}-${CEPH_ARCH}-${CEPH_FLAVOR}-${CEPH_SHA1}: packages-repository
+ceph-${CEPH_PKG_TYPE}-${CEPH_DIST}-${CEPH_ARCH}-${CEPH_FLAVOR}-${CEPH_SHA1}: ${PKG_REPO}
        openstack server create --image 'teuthology-${CEPH_OS_TYPE}-${CEPH_OS_VERSION}' --flavor ${BUILD_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --user-data ${CEPH_OS_TYPE}-${CEPH_OS_VERSION}-user-data.txt --wait $@
        sleep 30
        set -ex ; \