diff options
author | blsaws <bs3131@att.com> | 2016-05-17 16:26:54 -0700 |
---|---|---|
committer | blsaws <bryan.sullivan@att.com> | 2016-05-17 16:30:18 -0700 |
commit | 345cf9dcc19dc83c1dce55259ccfdde6107309da (patch) | |
tree | dc201154cce206b0e6881ffc8ad1de41aa840e0b /components/congress/install/bash | |
parent | 4c972868690788e9a186bfffd84ff19188ec4dff (diff) |
Fixes for manual install testing phase.
JIRA: COPPER-2
Change-Id: Ia3eb86248c7fa4ad98789615d669c4571366f634
Signed-off-by: blsaws <bryan.sullivan@att.com>
Diffstat (limited to 'components/congress/install/bash')
3 files changed, 64 insertions, 46 deletions
diff --git a/components/congress/install/bash/centos/clean_congress.sh b/components/congress/install/bash/centos/clean_congress.sh index 4ab21a4..4b5105c 100644 --- a/components/congress/install/bash/centos/clean_congress.sh +++ b/components/congress/install/bash/centos/clean_congress.sh @@ -13,23 +13,34 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This is a cleanup script for installation of Congress on an Ubuntu 14.04 -# LXC container in the OPNFV Controller node. +# This is a cleanup script for installation of Congress on the Centos 7 based +# OPNFV Controller node as installed per the OPNFV Apex project. +# Prequisites: # Presumably something has failed, and any record of the Congress feature # in OpenStack needs to be removed, so you can try the install again. # -# Prequisite: OPFNV install per https://wiki.opnfv.org/copper/academy/joid +# Prequisite: +# OPFNV install per https://wiki.opnfv.org/display/copper/Apex # How to use: -# Install OPNFV per https://wiki.opnfv.org/copper/academy/joid -# $ source ~/git/copper/components/congress/joid/clean_congress.sh <controller_hostname> -# <controller_hostname> is the name of the controller node in MAAS. +# cd ~/congress/copper/ (or wherever you cloned the copper repo) +# source /components/congress/install/bash/centos/clean_congress.sh -source ~/admin-openrc.sh <<EOF -openstack -EOF -source ~/env.sh -set -x echo on -juju ssh ubuntu@$1 "sudo lxc-stop --name juju-trusty-congress; sudo lxc-destroy --name juju-trusty-congress; exit" +cd ~ +# Setup undercloud environment so we can get overcloud Controller server address +source ~/stackrc + +# Get addresses of Controller node(s) +export CONTROLLER_HOST1=$(openstack server list | awk "/overcloud-controller-0/ { print \$8 }" | sed 's/ctlplane=//g') +export CONTROLLER_HOST2=$(openstack server list | awk "/overcloud-controller-1/ { print \$8 }" | sed 's/ctlplane=//g') + +echo "Stop the Congress service" +ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no heat-admin@$CONGRESS_HOST "pkill congress-server; exit" + +echo "Remove the Congress virtualenv and code" +ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no heat-admin@$CONGRESS_HOST "rm -rf ~/congress/congress; rm ~/admin-openrc.sh; rm ~/admin-openrc.sh; exit" + +# Setup env for overcloud API access +source ~/overcloudrc # Delete Congress user export CONGRESS_USER=$(openstack user list | awk "/ congress / { print \$2 }") @@ -42,5 +53,7 @@ export CONGRESS_SERVICE=$(openstack service list | awk "/ congress / { print \$2 if [ "$CONGRESS_SERVICE" != "" ]; then openstack service delete $CONGRESS_SERVICE fi -set -x echo off + +# Delete Congress and other installed code in virtualenv +rm -rf ~/congress diff --git a/components/congress/install/bash/centos/install_congress_1.sh b/components/congress/install/bash/centos/install_congress_1.sh index 19f3d29..4d465af 100644 --- a/components/congress/install/bash/centos/install_congress_1.sh +++ b/components/congress/install/bash/centos/install_congress_1.sh @@ -18,11 +18,11 @@ # Prequisites: # OPFNV install per https://wiki.opnfv.org/display/copper/Apex # On the jumphost, logged in as stack on the undercloud VM: -# Download and save admin-openrc.sh from the overcloud Horizon at ~/ # su stack # Clone the Copper repo and run the install script: # git clone https://gerrit.opnfv.org/gerrit/copper -# source copper/components/install/bash/centos/install_congress_1.sh +# cd copper +# source components/congress/install/bash/centos/install_congress_1.sh if [ $# -gt 1 ] && [ $2 == "debug" ]; then set -x #echo on fi @@ -48,16 +48,18 @@ EOF source ~/env.sh scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/env.sh heat-admin@$CONTROLLER_HOST1:/home/heat-admin -# Setup env for overcloud +# Setup env for overcloud API access source ~/overcloudrc -sed -i -- 's/echo "Please/# echo "Please/g' ~/admin-openrc.sh -sed -i -- 's/read -sr OS_PASSWORD_INPUT/# read -sr OS_PASSWORD_INPUT/g' ~/admin-openrc.sh -sed -i -- 's/export OS_PASSWORD=$OS_PASSWORD_INPUT/export OS_PASSWORD='$OS_PASSWORD'/g' ~/admin-openrc.sh -source ~/admin-openrc.sh -scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/admin-openrc.sh heat-admin@$CONTROLLER_HOST1:/home/heat-admin +export OS_REGION_NAME=$(openstack endpoint list | awk "/ nova / { print \$4 }") +cp ~/overcloudrc ~/admin-openrc.sh +# sed command below is a workaound for a bug - region shows up twice for some reason +cat <<EOF | sed '$d' >>~/admin-openrc.sh +export OS_REGION_NAME=$OS_REGION_NAME +EOF +scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/admin-openrc.sh heat-admin@$CONTROLLER_HOST1:/home/heat-admin/ echo "Copy install_congress_2.sh to the congress server and execute" -scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/git/copper/components/congress/joid/install_congress_2.sh heat-admin@$CONTROLLER_HOST1:/home/heat-admin +scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ~/congress/copper/components/congress/install/bash/centos/install_congress_2.sh heat-admin@$CONTROLLER_HOST1:/home/heat-admin ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no heat-admin@$CONTROLLER_HOST1 "source ~/install_congress_2.sh; exit" echo "Install jumphost dependencies" @@ -70,41 +72,43 @@ sudo yum install apg git gcc libxml2 python-devel libzip-devel libxslt-devel -y sudo pip install --upgrade pip virtualenv setuptools pbr tox echo "Clone congress" -mkdir ~/git -cd ~/git +mkdir ~/congress +cd ~/congress git clone https://github.com/openstack/congress.git cd congress git checkout stable/liberty echo "Create virtualenv" -virtualenv ~/git/congress +virtualenv ~/congress/congress source bin/activate -echo "Install and test OpenStack client" -cd ~/git +echo "Setup overcloud OpenStack API" +admin-openrc.sh + +echo "Install OpenStack client" +cd ~/congress git clone https://github.com/openstack/python-openstackclient.git cd python-openstackclient git checkout stable/liberty -~/git/congress/bin/pip install -r requirements.txt -~/git/congress/bin/pip install . +~/congress/congress/bin/pip install -r requirements.txt +~/congress/congress/bin/pip install . openstack service list -echo "Install and test Congress client" -cd ~/git +echo "Install Congress client" +cd ~/congress git clone https://github.com/openstack/python-congressclient.git cd python-congressclient git checkout stable/liberty -~/git/congress/bin/pip install -r requirements.txt -~/git/congress/bin/pip install . -openstack congress driver list +~/congress/congress/bin/pip install -r requirements.txt +~/congress/congress/bin/pip install . -echo "Install and test Keystone client" -cd ~/git +echo "Install Keystone client" +cd ~/congress git clone https://github.com/openstack/python-keystoneclient.git cd python-keystoneclient git checkout stable/liberty -~/git/congress/bin/pip install -r requirements.txt -~/git/congress/bin/pip install . +~/congress/congress/bin/pip install -r requirements.txt +~/congress/congress/bin/pip install . echo "setup Congress user. TODO: needs update in http://congress.readthedocs.org/en/latest/readme.html#installing-congress" pip install cliff --upgrade @@ -126,7 +130,7 @@ openstack endpoint create $CONGRESS_SERVICE \ --internalurl http://$CONGRESS_HOST:1789/ echo "Start the Congress service" -ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no heat-admin@$CONGRESS_HOST "~/git/congress/bin/congress-server &>/dev/null &" +ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no heat-admin@$CONGRESS_HOST "~/congress/congress/bin/congress-server &>/dev/null &" echo "Wait 30 seconds for Congress service to startup" sleep 30 @@ -168,7 +172,7 @@ echo "Install tox test dependencies" sudo yum install -y libffi-devel openssl-devel echo "Run Congress tox Tests" -cd ~/git/congress +cd ~/congress/congress tox -epy27 set +x #echo off diff --git a/components/congress/install/bash/centos/install_congress_2.sh b/components/congress/install/bash/centos/install_congress_2.sh index e98ca9b..19c7556 100644 --- a/components/congress/install/bash/centos/install_congress_2.sh +++ b/components/congress/install/bash/centos/install_congress_2.sh @@ -21,7 +21,8 @@ # su stack # Clone the Copper repo and run the install script: # git clone https://gerrit.opnfv.org/gerrit/copper -# source copper/components/install/bash/centos/install_congress_1.sh +# cd copper +# source components/congress/install/bash/centos/install_congress_1.sh set -x source ~/admin-openrc.sh @@ -39,14 +40,14 @@ sudo yum install apg git gcc libxml2 python-devel libzip-devel libxslt-devel -y sudo pip install --upgrade pip virtualenv setuptools pbr tox echo "Clone congress" -mkdir ~/git -cd ~/git +mkdir ~/congress +cd ~/congress git clone https://github.com/openstack/congress.git cd congress git checkout stable/liberty echo "Create virtualenv" -virtualenv ~/git/congress +virtualenv ~/congress/congress source bin/activate echo "Setup Congress" @@ -62,7 +63,7 @@ echo "install requirements.txt and tox dependencies (detected by errors during ' sudo yum install libffi-devel openssl openssl-devel -y echo "install dependencies of Congress" -cd ~/git/congress +cd ~/congress/congress bin/pip install -r requirements.txt bin/pip install . @@ -101,7 +102,7 @@ echo "create database schema" congress-db-manage --config-file /etc/congress/congress.conf upgrade head echo "Install Congress client" -cd ~/git +cd ~/congress git clone https://github.com/openstack/python-congressclient.git cd python-congressclient git checkout stable/liberty |