Browse Source

Merge "Add support for diskimage-builder tracing"

changes/13/411013/1
Jenkins 6 years ago committed by Gerrit Code Review
parent
commit
547d03ae25
  1. 6
      devstack/plugin.sh
  2. 2
      devstack/settings
  3. 13
      diskimage-create/diskimage-create.sh

6
devstack/plugin.sh

@ -34,8 +34,12 @@ function build_octavia_worker_image {
TOKEN=$(openstack token issue | grep ' id ' | get_field 2)
die_if_not_set $LINENO TOKEN "Keystone failed to get token."
octavia_dib_tracing_arg=
if [ "$OCTAVIA_DIB_TRACING" != "0" ]; then
octavia_dib_tracing_arg="-x"
fi
if ! [ -f $OCTAVIA_AMP_IMAGE_FILE ]; then
$OCTAVIA_DIR/diskimage-create/diskimage-create.sh -s 2 -o $OCTAVIA_AMP_IMAGE_FILE
$OCTAVIA_DIR/diskimage-create/diskimage-create.sh $octavia_dib_tracing_arg -s 2 -o $OCTAVIA_AMP_IMAGE_FILE
fi
upload_image file://${OCTAVIA_AMP_IMAGE_FILE} $TOKEN

2
devstack/settings

@ -89,3 +89,5 @@ OCTAVIA_PREGENERATED_CERTS_DIR=${OCTAVIA_PREGENERATED_CERTS_DIR:-"${OCTAVIA_DIR}
OCTAVIA_NODE=${OCTAVIA_NODE:-"standalone"}
OCTAVIA_CONTROLLER_IP_PORT_LIST=${OCTAVIA_CONTROLLER_IP_PORT_LIST:-"auto"}
OCTAVIA_MGMT_PORT_IP=${OCTAVIA_MGMT_PORT_IP:-"auto"}
OCTAVIA_DIB_TRACING=${OCTAVIA_DIB_TRACING:-"0"}

13
diskimage-create/diskimage-create.sh

@ -45,6 +45,7 @@ usage() {
echo " '-t' is the image type (default: qcow2)"
echo " '-v' display the script version"
echo " '-w' working directory for image building (default: .)"
echo " '-x' enable tracing for diskimage-builder"
echo
exit 1
}
@ -71,8 +72,9 @@ if [ -z $OCTAVIA_REPO_PATH ]; then
AMP_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
OCTAVIA_REPO_PATH=${OCTAVIA_REPO_PATH:-${AMP_DIR%/*}}
fi
dib_enable_tracing=
while getopts "a:b:c:d:hi:o:t:r:s:vw:" opt; do
while getopts "a:b:c:d:hi:o:t:r:s:vw:x" opt; do
case $opt in
a)
AMP_ARCH=$OPTARG
@ -138,6 +140,8 @@ while getopts "a:b:c:d:hi:o:t:r:s:vw:" opt; do
w)
AMP_WORKING_DIR=$OPTARG
;;
x) dib_enable_tracing=1
;;
*)
usage
;;
@ -396,7 +400,12 @@ if [ "$AMP_BASEOS" = "ubuntu" ]; then
export DIB_CLOUD_INIT_DATASOURCES=$CLOUD_INIT_DATASOURCES
fi
disk-image-create -a $AMP_ARCH -o $AMP_OUTPUTFILENAME -t $AMP_IMAGETYPE --image-size $AMP_IMAGESIZE --image-cache $AMP_CACHEDIR $AMP_element_sequence
dib_trace_arg=
if [ -n "$dib_enable_tracing" ]; then
dib_trace_arg="-x"
fi
disk-image-create $dib_trace_arg -a $AMP_ARCH -o $AMP_OUTPUTFILENAME -t $AMP_IMAGETYPE --image-size $AMP_IMAGESIZE --image-cache $AMP_CACHEDIR $AMP_element_sequence
popd > /dev/null # out of $TEMP
rm -rf $TEMP

Loading…
Cancel
Save