From a19cf619b0ca81db662b1167a94350f6c72c8220 Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Wed, 21 Dec 2016 09:53:06 -0500 Subject: Updating ENV var names to better reflect what they point to - Also removing a stale file Change-Id: Ice2f9b4f9961bcd7f05278f11995aa0af237ac8e Signed-off-by: Dan Radez --- build/build_ovs_nsh.sh | 22 ---------------------- ci/clean.sh | 19 ++++++++++++++++--- ci/deploy.sh | 19 ++++++++++++++++--- ci/util.sh | 19 ++++++++++++++++--- lib/overcloud-deploy-functions.sh | 6 +++--- lib/parse-functions.sh | 2 +- lib/undercloud-functions.sh | 10 +++++----- 7 files changed, 57 insertions(+), 40 deletions(-) delete mode 100755 build/build_ovs_nsh.sh diff --git a/build/build_ovs_nsh.sh b/build/build_ovs_nsh.sh deleted file mode 100755 index 834df5bb..00000000 --- a/build/build_ovs_nsh.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -############################################################################## -# Copyright (c) 2016 Tim Rozet (Red Hat) and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -set -e - -yum -y install rpm-build autoconf automake libtool systemd-units openssl openssl-devel python python-twisted-core python-zope-interface python-six desktop-file-utils groff graphviz procps-ng libcap-ng libcap-ng-devel PyQt4 selinux-policy-devel kernel-devel kernel-headers kernel-tools -./boot.sh -libtoolize --force -aclocal -autoheader -automake --force-missing --add-missing -autoconf -./configure -yum -y install rpmdevtools -make rpm-fedora RPMBUILD_OPT="\"-D kversion `rpm -q kernel | rpmdev-sort | tail -n -1 | sed 's/^kernel-//'`\" --without check" -make rpm-fedora-kmod RPMBUILD_OPT="\"-D kversion `rpm -q kernel | rpmdev-sort | tail -n -1 | sed 's/^kernel-//'`\"" diff --git a/ci/clean.sh b/ci/clean.sh index 1e5e320e..262e74bf 100755 --- a/ci/clean.sh +++ b/ci/clean.sh @@ -12,10 +12,23 @@ #author: Dan Radez (dradez@redhat.com) #author: Tim Rozet (trozet@redhat.com) +# Backwards compat for old ENV Vars +# Remove in E Release +if [ -n "$CONFIG" ]; then + echo -e "${red}WARNING: ENV var CONFIG is Deprecated, please unset CONFIG and export BASE in its place${reset}" + echo -e "${red}WARNING: CONFIG will be removed in E${reset}" + BASE=$CONFIG +fi +if [ -n "$RESOURCES" ]; then + echo -e "${red}WARNING: ENV var RESOURCES is Deprecated, please unset RESOURCES and export IMAGES in its place${reset}" + echo -e "${red}WARNING: RESOURCES will be removed in E${reset}" + IMAGES=$RESOURCES +fi + # Use default if no param passed -CONFIG=${CONFIG:-'/var/opt/opnfv'} -RESOURCES=${RESOURCES:-"$CONFIG/images"} -LIB=${LIB:-"$CONFIG/lib"} +BASE=${BASE:-'/var/opt/opnfv'} +IMAGES=${IMAGES:-"$BASE/images"} +LIB=${LIB:-"$BASE/lib"} reset=$(tput sgr0 || echo "") blue=$(tput setaf 4 || echo "") red=$(tput setaf 1 || echo "") diff --git a/ci/deploy.sh b/ci/deploy.sh index fde62907..b55f47ee 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -37,12 +37,25 @@ declare -A deploy_options_array declare -a performance_options declare -A NET_MAP +# Backwards compat for old ENV Vars +# Remove in E Release +if [ -n "$CONFIG" ]; then + echo -e "${red}WARNING: ENV var CONFIG is Deprecated, please unset CONFIG and export BASE in its place${reset}" + echo -e "${red}WARNING: CONFIG will be removed in E${reset}" + BASE=$CONFIG +fi +if [ -n "$RESOURCES" ]; then + echo -e "${red}WARNING: ENV var RESOURCES is Deprecated, please unset RESOURCES and export IMAGES in its place${reset}" + echo -e "${red}WARNING: RESOURCES will be removed in E${reset}" + IMAGES=$RESOURCES +fi + APEX_TMP_DIR=$(python3 -c "import tempfile; print(tempfile.mkdtemp())") SSH_OPTIONS=(-o StrictHostKeyChecking=no -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -o LogLevel=error) DEPLOY_OPTIONS="" -CONFIG=${CONFIG:-'/var/opt/opnfv'} -RESOURCES=${RESOURCES:-"$CONFIG/images"} -LIB=${LIB:-"$CONFIG/lib"} +BASE=${BASE:-'/var/opt/opnfv'} +IMAGES=${IMAGES:-"$BASE/images"} +LIB=${LIB:-"$BASE/lib"} OPNFV_NETWORK_TYPES="admin tenant external storage api" ENV_FILE="opnfv-environment.yaml" diff --git a/ci/util.sh b/ci/util.sh index 480858d0..34821a7b 100755 --- a/ci/util.sh +++ b/ci/util.sh @@ -2,9 +2,22 @@ # Utility script used to interact with a deployment # @author Tim Rozet (trozet@redhat.com) -CONFIG=${CONFIG:-'/var/opt/opnfv'} -RESOURCES=${RESOURCES:-"$CONFIG/images"} -LIB=${LIB:-"$CONFIG/lib"} +# Backwards compat for old ENV Vars +# Remove in E Release +if [ -n "$CONFIG" ]; then + echo -e "${red}WARNING: ENV var CONFIG is Deprecated, please unset CONFIG and export BASE in its place${reset}" + echo -e "${red}WARNING: CONFIG will be removed in E${reset}" + BASE=$CONFIG +fi +if [ -n "$RESOURCES" ]; then + echo -e "${red}WARNING: ENV var RESOURCES is Deprecated, please unset RESOURCES and export IMAGES in its place${reset}" + echo -e "${red}WARNING: RESOURCES will be removed in E${reset}" + IMAGES=$RESOURCES +fi + +BASE=${BASE:-'/var/opt/opnfv'} +IMAGES=${IMAGES:-"$BASE/images"} +LIB=${LIB:-"$BASE/lib"} VALID_CMDS="undercloud overcloud opendaylight debug-stack mock-detached -h --help" source $LIB/utility-functions.sh diff --git a/lib/overcloud-deploy-functions.sh b/lib/overcloud-deploy-functions.sh index 216fa6c6..cf9abcfb 100755 --- a/lib/overcloud-deploy-functions.sh +++ b/lib/overcloud-deploy-functions.sh @@ -55,15 +55,15 @@ function overcloud_deploy { # Make sure the correct overcloud image is available - if [ ! -f $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 ]; then - echo "${red} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 is required to execute your deployment." + if [ ! -f $IMAGES/overcloud-full-${SDN_IMAGE}.qcow2 ]; then + echo "${red} $IMAGES/overcloud-full-${SDN_IMAGE}.qcow2 is required to execute your deployment." echo "Please install the opnfv-apex package to provide this overcloud image for deployment.${reset}" exit 1 fi echo "Copying overcloud image to Undercloud" ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "rm -f overcloud-full.qcow2" - scp ${SSH_OPTIONS[@]} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 "stack@$UNDERCLOUD":overcloud-full.qcow2 + scp ${SSH_OPTIONS[@]} $IMAGES/overcloud-full-${SDN_IMAGE}.qcow2 "stack@$UNDERCLOUD":overcloud-full.qcow2 # Install ovs-dpdk inside the overcloud image if it is enabled. if [[ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' || "${deploy_options_array['dataplane']}" == 'fdio' ]]; then diff --git a/lib/parse-functions.sh b/lib/parse-functions.sh index 84da75c5..9d95bbc4 100755 --- a/lib/parse-functions.sh +++ b/lib/parse-functions.sh @@ -25,7 +25,7 @@ parse_network_settings() { done fi - if output=$(python3 -B $LIB/python/apex_python_utils.py parse-net-settings -s $NETSETS -td $APEX_TMP_DIR -e $CONFIG/network-environment.yaml $parse_ext); then + if output=$(python3 -B $LIB/python/apex_python_utils.py parse-net-settings -s $NETSETS -td $APEX_TMP_DIR -e $BASE/network-environment.yaml $parse_ext); then echo -e "${blue}${output}${reset}" eval "$output" else diff --git a/lib/undercloud-functions.sh b/lib/undercloud-functions.sh index 6f7addbd..080fcbbd 100755 --- a/lib/undercloud-functions.sh +++ b/lib/undercloud-functions.sh @@ -19,7 +19,7 @@ function setup_undercloud_vm { define_vm undercloud hd 30 "$undercloud_nets" 4 12288 ### this doesn't work for some reason I was getting hangup events so using cp instead - #virsh vol-upload --pool default --vol undercloud.qcow2 --file $CONFIG/stack/undercloud.qcow2 + #virsh vol-upload --pool default --vol undercloud.qcow2 --file $BASE/stack/undercloud.qcow2 #2015-12-05 12:57:20.569+0000: 8755: info : libvirt version: 1.2.8, package: 16.el7_1.5 (CentOS BuildSystem , 2015-11-03-13:56:46, worker1.bsys.centos.org) #2015-12-05 12:57:20.569+0000: 8755: warning : virKeepAliveTimerInternal:143 : No response from client 0x7ff1e231e630 after 6 keepalive messages in 35 seconds #2015-12-05 12:57:20.569+0000: 8756: warning : virKeepAliveTimerInternal:143 : No response from client 0x7ff1e231e630 after 6 keepalive messages in 35 seconds @@ -28,14 +28,14 @@ function setup_undercloud_vm { #error: Reconnected to the hypervisor local undercloud_dst=/var/lib/libvirt/images/undercloud.qcow2 - cp -f $RESOURCES/undercloud.qcow2 $undercloud_dst + cp -f $IMAGES/undercloud.qcow2 $undercloud_dst # resize Undercloud machine echo "Checking if Undercloud needs to be resized..." undercloud_size=$(LIBGUESTFS_BACKEND=direct virt-filesystems --long -h --all -a $undercloud_dst |grep device | grep -Eo "[0-9\.]+G" | sed -n 's/\([0-9][0-9]*\).*/\1/p') if [ "$undercloud_size" -lt 30 ]; then qemu-img resize /var/lib/libvirt/images/undercloud.qcow2 +25G - LIBGUESTFS_BACKEND=direct virt-resize --expand /dev/sda1 $RESOURCES/undercloud.qcow2 $undercloud_dst + LIBGUESTFS_BACKEND=direct virt-resize --expand /dev/sda1 $IMAGES/undercloud.qcow2 $undercloud_dst LIBGUESTFS_BACKEND=direct virt-customize -a $undercloud_dst --run-command 'xfs_growfs -d /dev/sda1 || true' new_size=$(LIBGUESTFS_BACKEND=direct virt-filesystems --long -h --all -a $undercloud_dst |grep filesystem | grep -Eo "[0-9\.]+G" | sed -n 's/\([0-9][0-9]*\).*/\1/p') if [ "$new_size" -lt 30 ]; then @@ -136,12 +136,12 @@ function configure_undercloud { ovs_dpdk_bridge='' fi - if ! controller_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r controller -s $NETSETS -t $CONFIG/nics-template.yaml.jinja2 -e "br-ex"); then + if ! controller_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r controller -s $NETSETS -t $BASE/nics-template.yaml.jinja2 -e "br-ex"); then echo -e "${red}ERROR: Failed to generate controller NIC heat template ${reset}" exit 1 fi - if ! compute_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r compute -s $NETSETS -t $CONFIG/nics-template.yaml.jinja2 -e $ext_net_type -d "$ovs_dpdk_bridge"); then + if ! compute_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r compute -s $NETSETS -t $BASE/nics-template.yaml.jinja2 -e $ext_net_type -d "$ovs_dpdk_bridge"); then echo -e "${red}ERROR: Failed to generate compute NIC heat template ${reset}" exit 1 fi -- cgit 1.2.3-korg