Merge "Pull in common-variables.sh PATH fix"
authorSam Hague <shague@redhat.com>
Mon, 17 Sep 2018 14:21:04 +0000 (14:21 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 17 Sep 2018 14:21:04 +0000 (14:21 +0000)
jjb/integration/common-functions.sh
jjb/integration/integration-deploy-openstack-run-test.sh
jjb/odl-openstack-check-image-protection.sh
jjb/odl-openstack-cleanup-old-images.sh
jjb/odl-openstack-cleanup-orphaned-nodes.sh
jjb/odl-openstack-cleanup-stale-nodes.sh
jjb/odl-openstack-cleanup-stale-stacks.sh
jjb/odl-openstack-cleanup-stale-volumes.sh
jjb/releng-jobs.yaml

index 48280d1cd994eadf9bc5ec47882d36e4c676cc70..e3499828b727d2529474efdb9f8cb55fa7c74627 100644 (file)
@@ -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.
index 7b7c12360c9e1e15c036ce824d650b6df42a02bb..1eef8c16efd216f39b011506e09812fe7ed86d9c 100644 (file)
@@ -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
 
index 77a669e0bbbe6a59628228f4c87284677ce35f8e..76a68e5bc040f3acf7f17a0c469ab6d98d669499 100644 (file)
@@ -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)"
index 01e420dde66d9d30d6a91fa87ed01ffa8fc4891a..9cc82cd823d518d47e9702d620eda20018f33c9d 100644 (file)
@@ -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
index c3c6b35a24e23c25b85e77ff60dd2851ee8d2dc1..df598b473d83eba76ae30b3803f28df1afadfe3d 100644 (file)
@@ -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
index f9af3c8e168918ceec06153f9bc65551ec6ca2a4..25cf88c70f2c33b5b63404719e81d898b60344c6 100644 (file)
@@ -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
index 16559c9feb8c5a3079a0415a579808b071899f1a..6d5e553c1a0fb6baa3a325607110dd1d145d71da 100644 (file)
@@ -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.
index 433aecf2cc45aeb33d47e2005160d2f1544b1f83..3745eb25349b2974d1f0f65e05d044da6a46d19d 100644 (file)
@@ -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
index 7cbd88e5d30e16825f8c547324b3641518d08ef4..0768c5858fc41194dbf2a508bc62189484a336da 100644 (file)
       - timed: '0,30 * * * *'
 
     builders:
-      - odl-openstack-install
+      - lf-infra-pre-build
       # Servers
       - odl-openstack-cleanup-stale-stacks
       - odl-openstack-cleanup-stale-nodes