Redirect disk-image-builder logs, make verbose

Update the diskimage-create.sh to have a "-l" option to pass into
dib's "--logfile" option.  In the devstack job, use this to redirect
the dib output to a separate logfile.  Turn on verbose logging by
default for this log.

Copy this in the v1 jobs.  v2 jobs are covered by a similar change in
octavia-tempest-plugin: I5bc0d9a3b071733cbe31d618f7236a3c2285b3e5

Depends-On: https://review.openstack.org/612865
Change-Id: Ie639af4266152d4626f8312b1849deeba5048348
This commit is contained in:
Ian Wienand 2018-10-23 18:50:08 +11:00 committed by Carlos Goncalves
parent 2c790796f5
commit 5bec6f70c2
11 changed files with 46 additions and 4 deletions

View File

@ -80,7 +80,10 @@ function build_octavia_worker_image {
export PARAM_OCTAVIA_AMP_IMAGE_SIZE='-s '$OCTAVIA_AMP_IMAGE_SIZE
fi
if ! [ -f $OCTAVIA_AMP_IMAGE_FILE ]; then
$OCTAVIA_DIR/diskimage-create/diskimage-create.sh $octavia_dib_tracing_arg -o $OCTAVIA_AMP_IMAGE_FILE ${PARAM_OCTAVIA_AMP_BASE_OS:-} ${PARAM_OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID:-} ${PARAM_OCTAVIA_AMP_IMAGE_SIZE:-}
local dib_logs=/var/log/dib-build
sudo mkdir ${dib_logs}
sudo chown $STACK_USER ${dib_logs}
$OCTAVIA_DIR/diskimage-create/diskimage-create.sh -l ${dib_logs}/$(basename $OCTAVIA_AMP_IMAGE_FILE).log $octavia_dib_tracing_arg -o $OCTAVIA_AMP_IMAGE_FILE ${PARAM_OCTAVIA_AMP_BASE_OS:-} ${PARAM_OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID:-} ${PARAM_OCTAVIA_AMP_IMAGE_SIZE:-}
fi
upload_image file://${OCTAVIA_AMP_IMAGE_FILE} $TOKEN

View File

@ -96,7 +96,7 @@ 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"}
OCTAVIA_DIB_TRACING=${OCTAVIA_DIB_TRACING:-"1"}
OCTAVIA_SERVICE_TYPE="load-balancer"
OCTAVIA_UWSGI_APP=${OCTAVIA_UWSGI_APP:-${OCTAVIA_BIN_DIR}/octavia-wsgi}

View File

@ -70,6 +70,7 @@ Command syntax:
[-c **~/.cache/image-create** | <cache directory> ]
[-h]
[-i **ubuntu** | fedora | centos | rhel ]
[-l <log file> ]
[-n]
[-o **amphora-x64-haproxy** | <filename> ]
[-r <root password> ]
@ -83,6 +84,7 @@ Command syntax:
'-c' is the path to the cache directory (default: ~/.cache/image-create)
'-h' display help message
'-i' is the base OS (default: ubuntu)
'-l' is output logfile (default: none)
'-n' disable sshd (default: enabled)
'-o' is the output image file name
'-p' install amphora-agent from distribution packages (default: disabled)"

View File

@ -27,6 +27,7 @@ usage() {
echo " [-e]"
echo " [-h]"
echo " [-i **ubuntu-minimal** | fedora | centos | rhel ]"
echo " [-l <log file> ]"
echo " [-n]"
echo " [-o **amphora-x64-haproxy** | <filename> ]"
echo " [-p]"
@ -43,6 +44,7 @@ usage() {
echo " '-e' enable complete mandatory access control systems when available (default: permissive)"
echo " '-h' display this help message"
echo " '-i' is the base OS (default: ubuntu)"
echo " '-l' is output logfile (default: none)"
echo " '-n' disable sshd (default: enabled)"
echo " '-o' is the output image file name"
echo " '-p' install amphora-agent from distribution packages (default: disabled)"
@ -80,7 +82,9 @@ if [ -z $OCTAVIA_REPO_PATH ]; then
fi
dib_enable_tracing=
while getopts "a:b:c:d:ehi:no:pt:r:s:vw:x" opt; do
AMP_LOGFILE=""
while getopts "a:b:c:d:ehi:l:no:pt:r:s:vw:x" opt; do
case $opt in
a)
AMP_ARCH=$OPTARG
@ -125,6 +129,9 @@ while getopts "a:b:c:d:ehi:no:pt:r:s:vw:x" opt; do
AMP_BASEOS="ubuntu-minimal"
fi
;;
l)
AMP_LOGFILE="--logfile=$OPTARG"
;;
n)
AMP_DISABLE_SSHD=1
;;
@ -388,7 +395,7 @@ 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
disk-image-create $AMP_LOGFILE $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

View File

@ -1,4 +1,8 @@
- hosts: primary
roles:
- role: stage-output
stage_dir: "{{ ansible_user_dir }}/workspace"
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node

View File

@ -1,4 +1,8 @@
- hosts: primary
roles:
- role: stage-output
stage_dir: "{{ ansible_user_dir }}/workspace"
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node

View File

@ -1,4 +1,8 @@
- hosts: primary
roles:
- role: stage-output
stage_dir: "{{ ansible_user_dir }}/workspace"
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node

View File

@ -1,4 +1,8 @@
- hosts: primary
roles:
- role: stage-output
stage_dir: "{{ ansible_user_dir }}/workspace"
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node

View File

@ -1,4 +1,8 @@
- hosts: primary
roles:
- role: stage-output
stage_dir: "{{ ansible_user_dir }}/workspace"
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node

View File

@ -1,4 +1,8 @@
- hosts: primary
roles:
- role: stage-output
stage_dir: "{{ ansible_user_dir }}/workspace"
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node

View File

@ -17,6 +17,9 @@
- ^doc/.*$
- ^etc/.*$
- ^releasenotes/.*$
vars:
zuul_copy_output:
'/var/log/dib-build': 'logs'
- job:
name: octavia-legacy-dsvm-base-multinode
@ -38,6 +41,9 @@
- ^etc/.*$
- ^releasenotes/.*$
nodeset: legacy-ubuntu-xenial-2-node
vars:
zuul_copy_output:
'/var/log/dib-build/': 'logs'
- job:
name: octavia-v1-dsvm-scenario