Use delorean-current for puppet modules

Currently we always build from source, but the latest master is now
available via delorean-current since o-p-m was broken into per-module
packages.

This should reduce the time taken to install everything from source,
and also provide a better path wnen upgrading as a simple
openstack undercloud install or yum update will update to the latest
puppet modules (currently failures happen if you forget to run via
tripleo.sh because the puppet modules aren't upgraded but things
that depend on the puppet modules are).

Also disable usage of the overcloud image cache as I have no idea what
will happen if we mix an image with puppet modules deployed from source
with ci scripts trying to install packaged modules.

Change-Id: Ie4cae6b884b2e539545371b9f716903b8fe5cf1f
Closes-Bug: #1597438
This commit is contained in:
Steven Hardy 2016-07-13 10:51:41 +00:00 committed by Juan Antonio Osorio Robles
parent c2b7dcdace
commit 242cfb9d97
6 changed files with 8 additions and 78 deletions

View File

@ -31,8 +31,6 @@ sudo yum -y install instack-undercloud git openstack-tripleo-common
export ELEMENTS_PATH="/usr/share/diskimage-builder/elements:/usr/share/instack-undercloud:/usr/share/tripleo-image-elements:/usr/share/tripleo-puppet-elements:/usr/share/openstack-heat-templates/software-config/elements"
export DIB_INSTALLTYPE_puppet_modules=source
sudo yum -y install openstack-tripleo-common
ELEMENTS=$(\

View File

@ -104,31 +104,6 @@ function update_image(){
sudo rm -f $MOUNTDIR/etc/yum.repos.d/delorean*
sudo mv -f $MOUNTDIR/etc/resolv.conf{_,}
# If the image has contains puppet modules (i.e. overcloud-full image)
# the puppet modules that were baked into the image may be out of date
# go through them all and make sure they match the various DIB_REPO*
# variables.
# FIXME: There is a bug here that means any new puppet modules needed on
# the overcloud image need to be added and the image cached before they can
# be used.
if [ -d $MOUNTDIR/opt/stack/puppet-modules ] ; then
for MODULE in $MOUNTDIR/opt/stack/puppet-modules/* ; do
pushd $MODULE
REPONAME=$(git remote -v | grep fetch | sed -e 's/.*\/\(.*\)_.*/\1/')
REPOLOC=DIB_REPOLOCATION_$REPONAME
REPOREF=DIB_REPOREF_$REPONAME
if [ -n "${!REPOLOC:-}" ] ; then
sudo git fetch ${!REPOLOC}
if [ -n "${!REPOREF:-}" ] ; then
sudo git reset --hard ${!REPOREF:-}
else
sudo git reset --hard FETCH_HEAD
fi
fi
popd
done
fi
case ${IMAGE##*.} in
qcow2)
# The yum update inside a chroot breaks selinux file contexts, fix them
@ -149,6 +124,11 @@ function update_image(){
# Decide if a particular cached artifact can be used in this CI test
# Takes a single argument representing the name of the artifact being checked.
function canusecache(){
# Disable image caching until after we have overcloud images available containing
# packaged puppet modules (as opposed to source)
return 1
# If we are uploading to the cache then we shouldn't use it
[ "$CACHEUPLOAD" == 1 ] && return 1
@ -267,8 +247,7 @@ function delorean_build_and_serve {
for PROJFULLREF in $ZUUL_CHANGES ; do
PROJ=$(filterref $PROJFULLREF)
# If ci is being run for a change to ci its ok not to have a ci produced repository
# We also don't build packages for puppet repositories, we use them from source
if [ "$PROJ" == "tripleo-ci" ] || [[ "$PROJ" =~ ^puppet-* ]] ; then
if [ "$PROJ" == "tripleo-ci" ] ; then
mkdir -p $TRIPLEO_ROOT/delorean/data/repos/current
touch $TRIPLEO_ROOT/delorean/data/repos/current/delorean-ci.repo
else
@ -292,20 +271,6 @@ function delorean_build_and_serve {
popd
}
function create_dib_vars_for_puppet {
# create DIB environment variables for all the puppet modules, $TRIPLEO_ROOT
# has all of the openstack modules with the correct HEAD. Set the DIB_REPO*
# variables so they are used (and not cloned from github)
# Note DIB_INSTALLTYPE_puppet_modules is set in tripleo.sh
for PROJDIR in $(ls -d $TRIPLEO_ROOT/puppet-*); do
REV=$(git --git-dir=$PROJDIR/.git rev-parse HEAD)
X=${PROJDIR//-/_}
PROJ=${X##*/}
echo "export DIB_REPOREF_$PROJ=$REV" >> $TRIPLEO_ROOT/tripleo-ci/deploy.env
echo "export DIB_REPOLOCATION_$PROJ=$PROJDIR" >> $TRIPLEO_ROOT/tripleo-ci/deploy.env
done
}
function dummy_ci_repo {
# If we have no ZUUL_CHANGES then this is a periodic job, we wont be
# building a ci repo, create a dummy one.

View File

@ -233,7 +233,7 @@ function repo_setup {
sudo sed -i 's/\[delorean\]/\[delorean-current\]/' $REPO_PREFIX/delorean-current.repo
sudo /bin/bash -c "cat <<-EOF>>$REPO_PREFIX/delorean-current.repo
includepkgs=diskimage-builder,instack,instack-undercloud,os-apply-config,os-cloud-config,os-collect-config,os-net-config,os-refresh-config,python-tripleoclient,openstack-tripleo-common,openstack-tripleo-heat-templates,openstack-tripleo-image-elements,openstack-tripleo,openstack-tripleo-puppet-elements
includepkgs=diskimage-builder,instack,instack-undercloud,os-apply-config,os-cloud-config,os-collect-config,os-net-config,os-refresh-config,python-tripleoclient,openstack-tripleo-common,openstack-tripleo-heat-templates,openstack-tripleo-image-elements,openstack-tripleo,openstack-tripleo-puppet-elements,openstack-puppet-modules,puppet-*
EOF"
else
# Enable the Delorean Deps repository
@ -389,14 +389,6 @@ function delorean_build {
function undercloud {
log "Undercloud install"
# We use puppet modules from source by default for master, for stable we
# currently use a stable package (we may eventually want to use a
# stable-puppet-modules element instead so we can set DIB_REPOREF.., etc)
if [ -z "$STABLE_RELEASE" ]; then
export DIB_INSTALLTYPE_puppet_modules=${DIB_INSTALLTYPE_puppet_modules:-source}
else
export DIB_INSTALLTYPE_puppet_modules=${DIB_INSTALLTYPE_puppet_modules:-}
fi
sudo yum install -y python-tripleoclient
@ -422,15 +414,6 @@ function overcloud_images {
log "Overcloud images"
log "Overcloud images saved in $OVERCLOUD_IMAGES_PATH"
# We use puppet modules from source by default for master, for stable we
# currently use a stable package (we may eventually want to use a
# stable-puppet-modules element instead so we can set DIB_REPOREF.., etc)
if [ -z "$STABLE_RELEASE" ]; then
export DIB_INSTALLTYPE_puppet_modules=${DIB_INSTALLTYPE_puppet_modules:-source}
else
export DIB_INSTALLTYPE_puppet_modules=${DIB_INSTALLTYPE_puppet_modules:-}
fi
if [[ "${STABLE_RELEASE}" =~ ^(liberty)$ ]] ; then
export FS_TYPE=ext4
fi

View File

@ -85,18 +85,6 @@ export DIB_DISTRIBUTION_MIRROR=$CENTOS_MIRROR
export DIB_EPEL_MIRROR=$EPEL_MIRROR
export DIB_CLOUD_IMAGES=http://$MIRRORSERVER/cloud.centos.org/centos/7/images
create_dib_vars_for_puppet
IFS=$'\n'
# For the others we use local mirror server
for REPO in $(cat $TRIPLEO_ROOT/tripleo-ci/scripts/mirror-server/mirrored.list | grep -v "^#"); do
RDIR=${REPO%% *}
REPOLOCATION=http://$MIRRORSERVER/repos/$RDIR
if curl -sf ${REPOLOCATION}/HEAD ; then
echo "export DIB_REPOLOCATION_$RDIR=$REPOLOCATION" >> $TRIPLEO_ROOT/tripleo-ci/deploy.env
fi
done
IFS=$' \t\n'
source $TRIPLEO_ROOT/tripleo-ci/deploy.env
# Build and deploy our undercloud instance
@ -138,7 +126,7 @@ echo_vars_to_deploy_env
cp $TRIPLEO_ROOT/tripleo-ci/deploy.env $WORKSPACE/logs/deploy.env.log
# Copy the required CI resources to the undercloud were we use them
tar -czf - $TRIPLEO_ROOT/tripleo-ci $TRIPLEO_ROOT/puppet-*/.git /etc/yum.repos.d/delorean* | ssh $SSH_OPTIONS root@$SEED_IP tar -C / -xzf -
tar -czf - $TRIPLEO_ROOT/tripleo-ci /etc/yum.repos.d/delorean* | ssh $SSH_OPTIONS root@$SEED_IP tar -C / -xzf -
# Don't get a file from cache if CACHEUPLOAD=1 (periodic job)
# If this 404's it wont error just continue without a file created

View File

@ -54,8 +54,6 @@ sleep 3
layer_ci_repo
create_dib_vars_for_puppet
echo_vars_to_deploy_env
# We need to override $OVERCLOUD_VALIDATE_ARGS to be empty so that the
# validations that check for the correct number of ironic nodes does not fail

View File

@ -64,8 +64,6 @@ sleep 3
layer_ci_repo
create_dib_vars_for_puppet
export http_proxy=""
echo_vars_to_deploy_env