Skip to content

Commit 122ab70

Browse files
committed
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
1 parent 315971d commit 122ab70

File tree

3 files changed

+97
-4
lines changed

3 files changed

+97
-4
lines changed

extras.d/40-dib.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# dib.sh - Devstack extras script to install diskimage-builder
2+
3+
if is_service_enabled dib; then
4+
if [[ "$1" == "source" ]]; then
5+
# Initial source
6+
source $TOP_DIR/lib/dib
7+
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
8+
echo_summary "Installing diskimage-builder"
9+
install_dib
10+
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
11+
# no-op
12+
:
13+
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
14+
# no-op
15+
:
16+
fi
17+
18+
if [[ "$1" == "unstack" ]]; then
19+
# no-op
20+
:
21+
fi
22+
23+
if [[ "$1" == "clean" ]]; then
24+
# no-op
25+
:
26+
fi
27+
fi

lib/dib

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# lib/dib
2+
# Install and build images with **diskimage-builder**
3+
4+
# Dependencies:
5+
#
6+
# - functions
7+
# - DEST, DATA_DIR must be defined
8+
9+
# stack.sh
10+
# ---------
11+
# - install_dib
12+
13+
# Save trace setting
14+
XTRACE=$(set +o | grep xtrace)
15+
set +o xtrace
16+
17+
# Defaults
18+
# --------
19+
20+
# set up default directories
21+
DIB_DIR=$DEST/diskimage-builder
22+
TIE_DIR=$DEST/tripleo-image-elements
23+
DIB_IMAGE_CACHE=$DATA_DIR/diskimage-builder/image-create
24+
OCC_DIR=$DEST/os-collect-config
25+
ORC_DIR=$DEST/os-refresh-config
26+
OAC_DIR=$DEST/os-apply-config
27+
28+
# Functions
29+
# ---------
30+
31+
# install_dib() - Collect source and prepare
32+
function install_dib {
33+
git_clone $DIB_REPO $DIB_DIR $DIB_BRANCH
34+
pushd $DIB_DIR
35+
pip_install ./
36+
popd
37+
38+
git_clone $TIE_REPO $TIE_DIR $TIE_BRANCH
39+
git_clone $OCC_REPO $OCC_DIR $OCC_BRANCH
40+
git_clone $ORC_REPO $ORC_DIR $ORC_BRANCH
41+
git_clone $OAC_REPO $OAC_DIR $OAC_BRANCH
42+
mkdir -p $DIB_IMAGE_CACHE
43+
}
44+
45+
# Restore xtrace
46+
$XTRACE
47+
48+
# Tell emacs to use shell-script-mode
49+
## Local variables:
50+
## mode: shell-script
51+
## End:

stackrc

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ CINDER_BRANCH=${CINDER_BRANCH:-master}
124124
CINDERCLIENT_REPO=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git}
125125
CINDERCLIENT_BRANCH=${CINDERCLIENT_BRANCH:-master}
126126

127+
# diskimage-builder
128+
DIB_REPO=${DIB_REPO:-${GIT_BASE}/openstack/diskimage-builder.git}
129+
DIB_BRANCH=${DIB_BRANCH:-master}
130+
127131
# image catalog service
128132
GLANCE_REPO=${GLANCE_REPO:-${GIT_BASE}/openstack/glance.git}
129133
GLANCE_BRANCH=${GLANCE_BRANCH:-master}
@@ -184,10 +188,22 @@ NOVA_BRANCH=${NOVA_BRANCH:-master}
184188
NOVACLIENT_REPO=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git}
185189
NOVACLIENT_BRANCH=${NOVACLIENT_BRANCH:-master}
186190

191+
# os-apply-config configuration template tool
192+
OAC_REPO=${OAC_REPO:-${GIT_BASE}/openstack/os-apply-config.git}
193+
OAC_BRANCH=${OAC_BRANCH:-master}
194+
195+
# os-collect-config configuration agent
196+
OCC_REPO=${OCC_REPO:-${GIT_BASE}/openstack/os-collect-config.git}
197+
OCC_BRANCH=${OCC_BRANCH:-master}
198+
187199
# consolidated openstack python client
188200
OPENSTACKCLIENT_REPO=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git}
189201
OPENSTACKCLIENT_BRANCH=${OPENSTACKCLIENT_BRANCH:-master}
190202

203+
# os-refresh-config configuration run-parts tool
204+
ORC_REPO=${ORC_REPO:-${GIT_BASE}/openstack/os-refresh-config.git}
205+
ORC_BRANCH=${ORC_BRANCH:-master}
206+
191207
# cliff command line framework
192208
CLIFF_REPO=${CLIFF_REPO:-${GIT_BASE}/openstack/cliff.git}
193209
CLIFF_BRANCH=${CLIFF_BRANCH:-master}
@@ -258,10 +274,9 @@ SWIFTCLIENT_BRANCH=${SWIFTCLIENT_BRANCH:-master}
258274
TEMPEST_REPO=${TEMPEST_REPO:-${GIT_BASE}/openstack/tempest.git}
259275
TEMPEST_BRANCH=${TEMPEST_BRANCH:-master}
260276

261-
262-
# diskimage-builder
263-
DIB_REPO=${DIB_REPO:-${GIT_BASE}/openstack/diskimage-builder.git}
264-
DIB_BRANCH=${DIB_BRANCH:-master}
277+
# Tripleo elements for diskimage-builder images
278+
TIE_REPO=${TIE_REPO:-${GIT_BASE}/openstack/tripleo-image-elements.git}
279+
TIE_BRANCH=${TIE_BRANCH:-master}
265280

266281
# a websockets/html5 or flash powered VNC console for vm instances
267282
NOVNC_REPO=${NOVNC_REPO:-https://github.com/kanaka/noVNC.git}

0 commit comments

Comments
 (0)