diff options
author | Narinder Gupta <narinder.gupta@canonical.com> | 2017-08-17 07:28:10 -0500 |
---|---|---|
committer | Narinder Gupta <narinder.gupta@canonical.com> | 2017-08-17 07:28:10 -0500 |
commit | 3c848787b3c8f2bdbf7723a5178b688e018f1e95 (patch) | |
tree | e446dd2efca34a94dbb469ab602db3ba059eacb9 | |
parent | f1a9e826b04c39e192c5dc86bda54e77e734ecce (diff) |
cleanup and remove unnecessary code.
Change-Id: Idace8f5b31479dbcd8040fc41ee20e3a70b0cc8a
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
-rwxr-xr-x | ci/02-deploybundle.sh | 26 | ||||
-rwxr-xr-x | ci/deploy.sh | 39 |
2 files changed, 28 insertions, 37 deletions
diff --git a/ci/02-deploybundle.sh b/ci/02-deploybundle.sh index 1bb0084c..0d4166e5 100755 --- a/ci/02-deploybundle.sh +++ b/ci/02-deploybundle.sh @@ -151,25 +151,13 @@ fi #keep the back in cloud for later debugging. pastebinit bundles.yaml || true -if [[ "$jujuver" < "2" ]]; then - echo "... Deployment Started ...." - juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $opnfvdistro-"$openstack"-nodes - count=`juju status nodes --format=short | grep nodes | wc -l` - c=0 - while [ $c -lt $count ]; do - juju ssh nodes/$c 'echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p' || true - juju ssh nodes-compute/$c 'echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p' || true - juju ssh nodes/$c 'echo 2048 | sudo tee /proc/sys/fs/inotify/max_user_instances' || true - juju ssh nodes-compute/$c 'echo 2048 | sudo tee /proc/sys/fs/inotify/max_user_instances' || true - let c+=1 - done +# with JUJU 2.0 bundles has to be deployed only once. +juju deploy bundles.yaml --debug +sleep 120 +check_status allocating - juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $opnfvdistro-"$openstack" || true -else - # with JUJU 2.0 bundles has to be deployed only once. - juju deploy bundles.yaml --debug - sleep 120 - check_status allocating +# need to revisit later if not needed we will remove the below. +openfile_fix() { # seeing issue related to number of open files. count=`juju status nodes --format=short | grep nodes | wc -l` c=0 @@ -180,7 +168,7 @@ else juju ssh nodes-compute/$c 'echo 2048 | sudo tee /proc/sys/fs/inotify/max_user_instances' || true let c+=1 done -fi +} if [ "$opnfvsdn" = "ocl" ] then diff --git a/ci/deploy.sh b/ci/deploy.sh index f9c1b2d0..b013b33c 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -228,29 +228,32 @@ echo_info "Configuring public access" # translate bundle.yaml to json python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < bundles.yaml > bundles.json -# get services list having a public interface -srv_list=$(cat bundles.json | jq -r ".services | to_entries[] | {\"key\": .key, \"value\": .value[\"bindings\"]} | select (.value!=null) | select(.value[] | contains(\"public-api\"))".key) -# get cnt list from service list -cnt_list=$(for cnt in $srv_list; do juju status $cnt --format=json | jq -r ".machines[].containers | to_entries[]".key; done) -# get public network gateway (supposing it is the first ip of the network) -public_api_gw=$(cat labconfig.json | jq --raw-output ".opnfv.spaces[] | select(.type==\"public\")".gateway) -admin_gw=$(cat labconfig.json | jq --raw-output ".opnfv.spaces[] | select(.type==\"admin\")".gateway) - -if ([ $admin_gw ] && [ $admin_gw != "null" ]); then - # set default gateway to public api gateway - for cnt in $cnt_list; do - echo_info "Changing default gateway on $cnt" - if ([ $public_api_gw ] && [ $public_api_gw != "null" ]); then - juju ssh $cnt "sudo ip r d default && sudo ip r a default via $public_api_gw"; - juju ssh $cnt "gw_dev=\$(ip r l | grep 'via $public_api_gw' | cut -d \ -f5) &&\ + +public_service() { + # get services list having a public interface + srv_list=$(cat bundles.json | jq -r ".services | to_entries[] | {\"key\": .key, \"value\": .value[\"bindings\"]} | select (.value!=null) | select(.value[] | contains(\"public-api\"))".key) + # get cnt list from service list + cnt_list=$(for cnt in $srv_list; do juju status $cnt --format=json | jq -r ".machines[].containers | to_entries[]".key; done) + # get public network gateway (supposing it is the first ip of the network) + public_api_gw=$(cat labconfig.json | jq --raw-output ".opnfv.spaces[] | select(.type==\"public\")".gateway) + admin_gw=$(cat labconfig.json | jq --raw-output ".opnfv.spaces[] | select(.type==\"admin\")".gateway) + + if ([ $admin_gw ] && [ $admin_gw != "null" ]); then + # set default gateway to public api gateway + for cnt in $cnt_list; do + echo_info "Changing default gateway on $cnt" + if ([ $public_api_gw ] && [ $public_api_gw != "null" ]); then + juju ssh $cnt "sudo ip r d default && sudo ip r a default via $public_api_gw"; + juju ssh $cnt "gw_dev=\$(ip r l | grep 'via $public_api_gw' | cut -d \ -f5) &&\ sudo cp /etc/network/interfaces /etc/network/interfaces.bak &&\ echo 'removing old default gateway' &&\ sudo perl -i -pe 's/^\ *gateway $admin_gw\n$//' /etc/network/interfaces &&\ sudo perl -i -pe \"s/iface \$gw_dev inet static/iface \$gw_dev inet static\\n gateway $public_api_gw/\" /etc/network/interfaces \ "; - fi - done -fi + fi + done + fi +} # Configuring deployment if ([ $opnfvmodel == "openstack" ]); then |