Merge pull request #945 from dachary/wip-pr-763

buildpackages: openstack image names not unique.

Reviewed-by: Loic Dachary <ldachary@redhat.com>
This commit is contained in:
Loic Dachary 2016-04-09 01:43:54 +02:00
commit edb2c617dc
3 changed files with 27 additions and 5 deletions

View File

@ -1,6 +1,8 @@
SHELL=/bin/bash
D=/tmp/stampsdir
VPATH=${D}
TIMEOUT_SERVER_CREATE = 30m
TIMEOUT_BUILD = 220m # 20 minutes short of 4 hours
PKG_REPO=packages-repository
PKG_REPO_OS_TYPE=ubuntu
PKG_REPO_OS_VERSION=14.04
@ -30,7 +32,7 @@ ${HOME}/.ssh_agent:
grep -q ssh_agent ~/.bashrc_teuthology || echo 'source ${HOME}/.ssh_agent' >> ~/.bashrc_teuthology
flock-${PKG_REPO}:
openstack server create --image 'teuthology-ubuntu-14.04-${HTTP_ARCH}' ${OPENSTACK_NETWORK} --flavor ${HTTP_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --user-data ${PKG_REPO_USER_DATA} --wait ${PKG_REPO}
timeout $(TIMEOUT_SERVER_CREATE) openstack server create --image 'teuthology-ubuntu-14.04-${HTTP_ARCH}' ${OPENSTACK_NETWORK} --flavor ${HTTP_FLAVOR} --key-name teuthology --security-group teuthology --property ownedby=${MY_IP} --user-data ${PKG_REPO_USER_DATA} --wait ${PKG_REPO}
sleep 30
set -ex ; \
ip=$(call get_ip,${PKG_REPO}) ; \
@ -49,16 +51,28 @@ ${PKG_REPO}:
flock --close ${D}/flock-$@.lock ${MAKE} flock-$@
touch ${D}/$@
# Just because 'server create' return success does not mean it actually succeeded!
# Check the server status before we proceed.
# If it's a weird status, bail out and let the delete fire
# eg: ERROR status can happen if there is no VM host without enough capacity for the request.
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}-${CEPH_ARCH}' ${OPENSTACK_NETWORK} --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
timeout $(TIMEOUT_SERVER_CREATE) openstack server create --image 'teuthology-${CEPH_OS_TYPE}-${CEPH_OS_VERSION}-${CEPH_ARCH}' ${OPENSTACK_NETWORK} --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 $@
set -ex ; \
trap "openstack server delete --wait $@" EXIT ; \
for delay in 30 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ; do \
status=$$(openstack server show -c status -f value $@) ; \
case $$status in \
ACTIVE) break ;; \
NOSTATE|*BUILD|*BOOT|*RESIZE) sleep $$delay ;; \
*) exit 1 ;; \
esac ; \
done ; \
ip=$(call get_ip,$@) ; \
test -n "$$ip" || exit ; \
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 ; \
scp make-${CEPH_PKG_TYPE}.sh common.sh ubuntu@$$ip: ; \
packages_repository=$(call get_ip,${<F}) ; \
ssh -tt -A ubuntu@$$ip bash ./make-${CEPH_PKG_TYPE}.sh $$packages_repository ${CEPH_DIST} ${CEPH_GIT_URL} ${CEPH_SHA1} ${CEPH_FLAVOR} ${CEPH_ARCH}
timeout $(TIMEOUT_BUILD) ssh -tt -A ubuntu@$$ip bash ./make-${CEPH_PKG_TYPE}.sh $$packages_repository ${CEPH_DIST} ${CEPH_GIT_URL} ${CEPH_SHA1} ${CEPH_FLAVOR} ${CEPH_ARCH}
mkdir -p ${D}/${@D} ; touch ${D}/$@
clobber:

View File

@ -69,10 +69,17 @@ function build_package() {
# options (otherwise parts of the source tree will be left out).
#
./autogen.sh
# Building with LTTNG on Ubuntu Precise is not possible.
# It fails the LTTNG-is-sane check (it misses headers)
# And the Debian rules files leave it out anyway
case $codename in
precise) lttng_opt="--without-lttng" ;;
*) lttng_opt="--with-lttng" ;;
esac
./configure $(flavor2configure $flavor) \
--with-rocksdb --with-ocf \
--with-nss --with-debug --enable-cephfs-java \
--with-lttng --with-babeltrace
$lttng_opt --with-babeltrace
#
# use distdir= to set the name of the top level directory of the
# tarbal to match the desired version

View File

@ -0,0 +1 @@
user-data.txt