From: Sam Hague Date: Mon, 17 Sep 2018 14:21:04 +0000 (+0000) Subject: Merge "Pull in common-variables.sh PATH fix" X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=fe8117260e971a7bf67542cab38b78e351db6d59;hp=d357398c6dcdbb3621fdd49a1af26ec6323ded17;p=releng%2Fbuilder.git Merge "Pull in common-variables.sh PATH fix" --- diff --git a/jjb/integration/common-functions.sh b/jjb/integration/common-functions.sh index 48280d1cd..e3499828b 100644 --- a/jjb/integration/common-functions.sh +++ b/jjb/integration/common-functions.sh @@ -419,6 +419,7 @@ EOF mv /tmp/changes.txt ${WORKSPACE}/archives mv ${WORKSPACE}/rabbit.txt ${WORKSPACE}/archives + mv ${WORKSPACE}/haproxy.cfg ${WORKSPACE}/archives sleep 5 # FIXME: Do not create .tar and gzip before copying. diff --git a/jjb/integration/integration-deploy-openstack-run-test.sh b/jjb/integration/integration-deploy-openstack-run-test.sh index 7b7c12360..1eef8c16e 100644 --- a/jjb/integration/integration-deploy-openstack-run-test.sh +++ b/jjb/integration/integration-deploy-openstack-run-test.sh @@ -450,16 +450,16 @@ EOF } # create_compute_node_local_conf() function configure_haproxy_for_neutron_requests() { - MGRIP=$1 + local -r haproxy_ip=$1 # shellcheck disable=SC2206 - ODL_IPS=(${2//,/ }) + local -r odl_ips=(${2//,/ }) cat > ${WORKSPACE}/install_ha_proxy.sh<< EOF sudo systemctl stop firewalld sudo yum -y install policycoreutils-python haproxy EOF -cat > ${WORKSPACE}/haproxy.cfg << EOF + cat > ${WORKSPACE}/haproxy.cfg << EOF global daemon group haproxy @@ -481,28 +481,39 @@ defaults timeout check 10s listen opendaylight - bind ${MGRIP}:8080 + bind ${haproxy_ip}:8181 transparent + mode http + http-request set-header X-Forwarded-Proto https if { ssl_fc } + http-request set-header X-Forwarded-Proto http if !{ ssl_fc } + option httpchk GET /diagstatus + option httplog balance source +EOF -listen opendaylight_rest - bind ${MGRIP}:8181 - balance source + odlindex=1 + for odlip in ${odl_ips[*]}; do + echo " server opendaylight-rest-${odlindex} ${odlip}:8181 check fall 5 inter 2000 rise 2" >> ${WORKSPACE}/haproxy.cfg + odlindex=$((odlindex+1)) + done -listen opendaylight_websocket - bind ${MGRIP}:8185 - balance source + cat >> ${WORKSPACE}/haproxy.cfg << EOF +listen opendaylight_ws + bind ${haproxy_ip}:8185 transparent + mode http + timeout connect 5s + timeout client 25s + timeout server 25s + timeout tunnel 3600s + balance source EOF odlindex=1 - for odlip in ${ODL_IPS[*]}; do - sed -i "/listen opendaylight$/a server controller-${odlindex} ${odlip}:8080 check fall 5 inter 2000 rise 2" ${WORKSPACE}/haproxy.cfg - sed -i "/listen opendaylight_rest$/a server controller-rest-${odlindex} ${odlip}:8181 check fall 5 inter 2000 rise 2" ${WORKSPACE}/haproxy.cfg - sed -i "/listen opendaylight_websocket$/a server controller-websocket-${odlindex} ${odlip}:8185 check fall 5 inter 2000 rise 2" ${WORKSPACE}/haproxy.cfg + for odlip in ${odl_ips[*]}; do + echo " server opendaylight-ws-${odlindex} ${odlip}:8185 check fall 5 inter 2000 rise 2" >> ${WORKSPACE}/haproxy.cfg odlindex=$((odlindex+1)) done - echo "Dump haproxy.cfg" cat ${WORKSPACE}/haproxy.cfg @@ -517,11 +528,11 @@ sudo systemctl status haproxy true EOF - scp ${WORKSPACE}/install_ha_proxy.sh ${MGRIP}:/tmp - ${SSH} ${MGRIP} "sudo bash /tmp/install_ha_proxy.sh" - scp ${WORKSPACE}/haproxy.cfg ${MGRIP}:/tmp - scp ${WORKSPACE}/deploy_ha_proxy.sh ${MGRIP}:/tmp - ${SSH} ${MGRIP} "sudo bash /tmp/deploy_ha_proxy.sh" + scp ${WORKSPACE}/install_ha_proxy.sh ${haproxy_ip}:/tmp + ${SSH} ${haproxy_ip} "sudo bash /tmp/install_ha_proxy.sh" + scp ${WORKSPACE}/haproxy.cfg ${haproxy_ip}:/tmp + scp ${WORKSPACE}/deploy_ha_proxy.sh ${haproxy_ip}:/tmp + ${SSH} ${haproxy_ip} "sudo bash /tmp/deploy_ha_proxy.sh" } # configure_haproxy_for_neutron_requests() # Following three functions are debugging helpers when debugging devstack changes. @@ -719,6 +730,8 @@ if [ -n "${DEVSTACK_HASH}" ]; then echo "git checkout ${DEVSTACK_HASH}" git checkout ${DEVSTACK_HASH} fi +wget https://raw.githubusercontent.com/shague/odl_tools/master/fix-logging.patch.txt -O /tmp/fix-logging.patch.txt +patch --verbose -p1 -i /tmp/fix-logging.patch.txt git --no-pager log --pretty=format:'%h %<(13)%ar%<(13)%cr %<(20,trunc)%an%d %s%b' -n20 echo diff --git a/jjb/odl-openstack-check-image-protection.sh b/jjb/odl-openstack-check-image-protection.sh index 77a669e0b..76a68e5bc 100644 --- a/jjb/odl-openstack-check-image-protection.sh +++ b/jjb/odl-openstack-check-image-protection.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -17,9 +17,6 @@ # by the cleanup old images job. echo "---> Check image protection" -# shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091 -source "/tmp/v/openstack/bin/activate" - declare -a yaml_images readarray -t yaml_images <<< "$(grep -r _system_image: --include \*.yaml \ | awk -F": " -e '{print $3}' | sed "s:'::;s:'$::;/^$/d" | sort -u)" diff --git a/jjb/odl-openstack-cleanup-old-images.sh b/jjb/odl-openstack-cleanup-old-images.sh index 01e420dde..9cc82cd82 100644 --- a/jjb/odl-openstack-cleanup-old-images.sh +++ b/jjb/odl-openstack-cleanup-old-images.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 - 2018 The Linux Foundation and others. @@ -11,6 +11,4 @@ # Removes openstack images older than 30 days in the cloud echo "---> Cleanup old images" -# shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091 -source "/tmp/v/openstack/bin/activate" lftools openstack --os-cloud vex image cleanup --days=30 diff --git a/jjb/odl-openstack-cleanup-orphaned-nodes.sh b/jjb/odl-openstack-cleanup-orphaned-nodes.sh index c3c6b35a2..df598b473 100644 --- a/jjb/odl-openstack-cleanup-orphaned-nodes.sh +++ b/jjb/odl-openstack-cleanup-orphaned-nodes.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 - 2018 The Linux Foundation and others. @@ -43,9 +43,6 @@ minion_in_jenkins() { # Fetch server list before fetching active minions to minimize race condition # where we might be trying to delete servers while jobs are trying to start -# shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091 -source "/tmp/v/openstack/bin/activate" - # We purposely need word splitting here to create the OS_SERVERS array. # shellcheck disable=SC2207 mapfile -t OS_SERVERS < <(openstack server list -f value -c "Name" | grep -E 'prd|snd') @@ -69,5 +66,3 @@ for server in "${OS_SERVERS[@]}"; do server remove --minutes 15 "$server" fi done - -deactivate diff --git a/jjb/odl-openstack-cleanup-stale-nodes.sh b/jjb/odl-openstack-cleanup-stale-nodes.sh index f9af3c8e1..25cf88c70 100644 --- a/jjb/odl-openstack-cleanup-stale-nodes.sh +++ b/jjb/odl-openstack-cleanup-stale-nodes.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 - 2018 The Linux Foundation and others. @@ -10,9 +10,6 @@ ############################################################################## echo "---> Cleanup stale nodes" -# shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091 -source "/tmp/v/openstack/bin/activate" - # Todo: As a safe check we could obtain the list of active jobs from Jenkins and # compute the checksum from $JOB_NAME to check if any active nodes exist and # skip deleting those nodes. This step may not be required since there is already diff --git a/jjb/odl-openstack-cleanup-stale-stacks.sh b/jjb/odl-openstack-cleanup-stale-stacks.sh index 16559c9fe..6d5e553c1 100644 --- a/jjb/odl-openstack-cleanup-stale-stacks.sh +++ b/jjb/odl-openstack-cleanup-stale-stacks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -13,9 +13,6 @@ # list of Jenkins instances to check for active builds. echo "---> Cleanup stale stacks" -# shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091 -source "/tmp/v/openstack/bin/activate" - stack_in_jenkins() { # Usage: check_stack_in_jenkins STACK_NAME JENKINS_URL [JENKINS_URL...] # Returns: 0 If stack is in Jenkins and 1 if stack is not in Jenkins. diff --git a/jjb/odl-openstack-cleanup-stale-volumes.sh b/jjb/odl-openstack-cleanup-stale-volumes.sh index 433aecf2c..3745eb253 100644 --- a/jjb/odl-openstack-cleanup-stale-volumes.sh +++ b/jjb/odl-openstack-cleanup-stale-volumes.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2018 The Linux Foundation and others. @@ -10,8 +10,6 @@ ############################################################################## # Scans OpenStack for orphaned volumes -# shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091 -source "/tmp/v/openstack/bin/activate" mapfile -t os_volumes < <(openstack volume list -f value -c ID --status Available) echo "---> Orphaned volumes" @@ -23,5 +21,3 @@ else lftools openstack --os-cloud vex volume remove --minutes 15 "$volume" done fi - -deactivate diff --git a/jjb/releng-jobs.yaml b/jjb/releng-jobs.yaml index 7cbd88e5d..0768c5858 100644 --- a/jjb/releng-jobs.yaml +++ b/jjb/releng-jobs.yaml @@ -166,7 +166,7 @@ - timed: '0,30 * * * *' builders: - - odl-openstack-install + - lf-infra-pre-build # Servers - odl-openstack-cleanup-stale-stacks - odl-openstack-cleanup-stale-nodes