A service to install diskimage-builder

Enabling service 'dib' will install the following repos:
* diskimage-builder
* tripleo-image-elements
* os-collect-config
* os-refresh-config
* os-apply-config

These repos are already pre-fetched in devstack-gate.

This will facilitate gating on changes in these projects by building
a custom image then running the heat-slow job against that image.

diskimage_builder is pip installed from the current git checkout
if the dib service is enabled. This allows devstack gating on
diskimage-builder changes while also allowing diskimage-builder to
be installed from releases for other scenarios (for example, ironic).

Change-Id: Ia911cdee86f5b2e2ba1557e5aa8bf392b92ef555
This commit is contained in:
Steve Baker 2014-05-05 16:06:17 +12:00
parent 315971d972
commit 122ab70330
3 changed files with 97 additions and 4 deletions

27
extras.d/40-dib.sh Normal file
View File

@ -0,0 +1,27 @@
# dib.sh - Devstack extras script to install diskimage-builder
if is_service_enabled dib; then
if [[ "$1" == "source" ]]; then
# Initial source
source $TOP_DIR/lib/dib
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing diskimage-builder"
install_dib
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
# no-op
:
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
# no-op
:
fi
if [[ "$1" == "unstack" ]]; then
# no-op
:
fi
if [[ "$1" == "clean" ]]; then
# no-op
:
fi
fi

51
lib/dib Normal file
View File

@ -0,0 +1,51 @@
# lib/dib
# Install and build images with **diskimage-builder**
# Dependencies:
#
# - functions
# - DEST, DATA_DIR must be defined
# stack.sh
# ---------
# - install_dib
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace
# Defaults
# --------
# set up default directories
DIB_DIR=$DEST/diskimage-builder
TIE_DIR=$DEST/tripleo-image-elements
DIB_IMAGE_CACHE=$DATA_DIR/diskimage-builder/image-create
OCC_DIR=$DEST/os-collect-config
ORC_DIR=$DEST/os-refresh-config
OAC_DIR=$DEST/os-apply-config
# Functions
# ---------
# install_dib() - Collect source and prepare
function install_dib {
git_clone $DIB_REPO $DIB_DIR $DIB_BRANCH
pushd $DIB_DIR
pip_install ./
popd
git_clone $TIE_REPO $TIE_DIR $TIE_BRANCH
git_clone $OCC_REPO $OCC_DIR $OCC_BRANCH
git_clone $ORC_REPO $ORC_DIR $ORC_BRANCH
git_clone $OAC_REPO $OAC_DIR $OAC_BRANCH
mkdir -p $DIB_IMAGE_CACHE
}
# Restore xtrace
$XTRACE
# Tell emacs to use shell-script-mode
## Local variables:
## mode: shell-script
## End:

23
stackrc
View File

@ -124,6 +124,10 @@ CINDER_BRANCH=${CINDER_BRANCH:-master}
CINDERCLIENT_REPO=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git}
CINDERCLIENT_BRANCH=${CINDERCLIENT_BRANCH:-master}
# diskimage-builder
DIB_REPO=${DIB_REPO:-${GIT_BASE}/openstack/diskimage-builder.git}
DIB_BRANCH=${DIB_BRANCH:-master}
# image catalog service
GLANCE_REPO=${GLANCE_REPO:-${GIT_BASE}/openstack/glance.git}
GLANCE_BRANCH=${GLANCE_BRANCH:-master}
@ -184,10 +188,22 @@ NOVA_BRANCH=${NOVA_BRANCH:-master}
NOVACLIENT_REPO=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git}
NOVACLIENT_BRANCH=${NOVACLIENT_BRANCH:-master}
# os-apply-config configuration template tool
OAC_REPO=${OAC_REPO:-${GIT_BASE}/openstack/os-apply-config.git}
OAC_BRANCH=${OAC_BRANCH:-master}
# os-collect-config configuration agent
OCC_REPO=${OCC_REPO:-${GIT_BASE}/openstack/os-collect-config.git}
OCC_BRANCH=${OCC_BRANCH:-master}
# consolidated openstack python client
OPENSTACKCLIENT_REPO=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git}
OPENSTACKCLIENT_BRANCH=${OPENSTACKCLIENT_BRANCH:-master}
# os-refresh-config configuration run-parts tool
ORC_REPO=${ORC_REPO:-${GIT_BASE}/openstack/os-refresh-config.git}
ORC_BRANCH=${ORC_BRANCH:-master}
# cliff command line framework
CLIFF_REPO=${CLIFF_REPO:-${GIT_BASE}/openstack/cliff.git}
CLIFF_BRANCH=${CLIFF_BRANCH:-master}
@ -258,10 +274,9 @@ SWIFTCLIENT_BRANCH=${SWIFTCLIENT_BRANCH:-master}
TEMPEST_REPO=${TEMPEST_REPO:-${GIT_BASE}/openstack/tempest.git}
TEMPEST_BRANCH=${TEMPEST_BRANCH:-master}
# diskimage-builder
DIB_REPO=${DIB_REPO:-${GIT_BASE}/openstack/diskimage-builder.git}
DIB_BRANCH=${DIB_BRANCH:-master}
# Tripleo elements for diskimage-builder images
TIE_REPO=${TIE_REPO:-${GIT_BASE}/openstack/tripleo-image-elements.git}
TIE_BRANCH=${TIE_BRANCH:-master}
# a websockets/html5 or flash powered VNC console for vm instances
NOVNC_REPO=${NOVNC_REPO:-https://github.com/kanaka/noVNC.git}