Merge "Update global haproxy to match OOO"
[releng/builder.git] / jjb / integration / integration-deploy-openstack-run-test.sh
index 7b7c12360c9e1e15c036ce824d650b6df42a02bb..4f211e022e43cd04836cd2933dcfdb289e9c7e88 100644 (file)
@@ -110,10 +110,6 @@ function install_openstack_clients_in_robot_vm() {
 function install_rdo_release() {
     local ip=$1
     case ${OPENSTACK_BRANCH} in
-       *pike*)
-          ${SSH} ${ip} "sudo yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-pike/rdo-release-pike-1.noarch.rpm"
-          ;;
-
        *queens*)
           ${SSH} ${ip} "sudo yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-queens/rdo-release-queens-1.noarch.rpm"
           ;;
@@ -450,22 +446,26 @@ 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
   log  /dev/log local0
   maxconn  20480
   pidfile  /tmp/haproxy.pid
+  ssl-default-bind-ciphers  !SSLv2:kEECDH:kRSA:kEDH:kPSK:+3DES:!aNULL:!eNULL:!MD5:!EXP:!RC4:!SEED:!IDEA:!DES
+  ssl-default-bind-options  no-sslv3 no-tlsv10
+  stats  socket /var/lib/haproxy/stats mode 600 level user
+  stats  timeout 2m
   user  haproxy
 
 defaults
@@ -474,35 +474,44 @@ defaults
   mode  tcp
   retries  3
   timeout  http-request 10s
-  timeout  queue 1m
+  timeout  queue 2m
   timeout  connect 10s
-  timeout  client 1m
-  timeout  server 1m
+  timeout  client 2m
+  timeout  server 2m
   timeout  check 10s
 
 listen opendaylight
-  bind ${MGRIP}:8080
-  balance source
+  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
+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
 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 +526,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,16 +728,14 @@ 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
 
 echo "workaround: do not upgrade openvswitch"
 sudo yum install -y yum-plugin-versionlock
 sudo yum versionlock add openvswitch
-
-#Install qemu-img command in Control Node for Pike
-echo "Install qemu-img application"
-sudo yum install -y qemu-img
 EOF
 
 cat > "${WORKSPACE}/setup_host_cell_mapping.sh" << EOF
@@ -821,6 +828,11 @@ for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do
         setup_live_migration_compute ${!CONTROLIP} ${!CONTROLIP}
     fi
     [ -n "${OVS_INSTALL}" ] && install_ovs ${!CONTROLIP} /tmp/ovs_rpms
+    if [[ "${ENABLE_OS_PLUGINS}" =~ networking-sfc ]]; then
+        # This should be really done by networking-odl devstack plugin,
+        # but in the meantime do it ourselves
+        ssh ${!CONTROLIP} "sudo ovs-vsctl set Open_vSwitch . external_ids:of-tunnel=true"
+    fi
     echo "Stack the control node ${i} of ${NUM_OPENSTACK_CONTROL_NODES}: ${CONTROLIP}"
     ssh ${!CONTROLIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
     ssh ${!CONTROLIP} "ps -ef | grep stack.sh"
@@ -871,6 +883,11 @@ for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do
     install_rdo_release ${!COMPUTEIP}
     setup_live_migration_compute ${!COMPUTEIP} ${!CONTROLIP}
     [ -n "${OVS_INSTALL}" ] && install_ovs ${!COMPUTEIP} /tmp/ovs_rpms
+    if [[ "${ENABLE_OS_PLUGINS}" =~ networking-sfc ]]; then
+        # This should be really done by networking-odl devstack plugin,
+        # but in the meantime do it ourselves
+        ssh ${!COMPUTEIP} "sudo ovs-vsctl set Open_vSwitch . external_ids:of-tunnel=true"
+    fi
     echo "Stack the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${!COMPUTEIP}"
     ssh ${!COMPUTEIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &"
     ssh ${!COMPUTEIP} "ps -ef | grep stack.sh"