From: prithiv Date: Tue, 5 Dec 2017 23:19:39 +0000 (+0000) Subject: MON Installation Changes Updated. X-Git-Tag: v3.1.0~30 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F31%2F5931%2F2;p=osm%2Fdevops.git MON Installation Changes Updated. Signed-off-by: prithiv --- diff --git a/installers/export_ips b/installers/export_ips index a41e1efc..a345a4b9 100644 --- a/installers/export_ips +++ b/installers/export_ips @@ -22,4 +22,4 @@ export DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a export VCA_CONTAINER_IP=`lxc list VCA -c 4|grep eth0 |awk '{print $2}'` export SO_CONTAINER_IP=`lxc list SO-ub -c 4|grep eth0 |awk '{print $2}'` export RO_CONTAINER_IP=`lxc list RO -c 4|grep eth0 |awk '{print $2}'` -#export MON_CONTAINER_IP=`lxc list MON -c 4|grep eth0|awk '{print $2}'` +export MON_CONTAINER_IP=`lxc list MON -c 4|grep eth0|awk '{print $2}'` diff --git a/installers/install_osm.sh b/installers/install_osm.sh index 054b2c26..7416dabf 100755 --- a/installers/install_osm.sh +++ b/installers/install_osm.sh @@ -48,11 +48,13 @@ function uninstall(){ if [ $RC_CLONE ] || [ -n "$TEST_INSTALLER" ]; then $OSM_DEVOPS/jenkins/host/clean_container RO $OSM_DEVOPS/jenkins/host/clean_container VCA + $OSM_DEVOPS/jenkins/host/clean_container MON $OSM_DEVOPS/jenkins/host/clean_container SO #$OSM_DEVOPS/jenkins/host/clean_container UI else lxc stop RO && lxc delete RO lxc stop VCA && lxc delete VCA + lxc stop MON && lxc delete MON lxc stop SO-ub && lxc delete SO-ub fi echo -e "\nDeleting imported lxd images if they exist" @@ -147,6 +149,34 @@ function update(){ # lxc exec SO-ub -- ... fi echo + echo -e "Updating MON Container" + CONTAINER="MON" + MDG="MON" + INSTALL_FOLDER="/root/MON" + echo -e " Fetching the repo" + lxc exec $CONTAINER -- git -C $INSTALL_FOLDER fetch --all + BRANCH="" + BRANCH=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER status -sb | head -n1 | sed -n 's/^## \(.*\).*/\1/p'|awk '{print $1}' |sed 's/\(.*\)\.\.\..*/\1/'` + [ -z "$BRANCH" ] && FATAL "Could not find the current branch in use in the '$MDG'" + CURRENT=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER status |head -n1` + CURRENT_COMMIT_ID=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER rev-parse HEAD` + echo " FROM: $CURRENT ($CURRENT_COMMIT_ID)" + # COMMIT_ID either was previously set with -b option, or is an empty string + CHECKOUT_ID=$COMMIT_ID + [ -z "$CHECKOUT_ID" ] && [ "$BRANCH" == "HEAD" ] && CHECKOUT_ID="tags/$LATEST_STABLE_DEVOPS" + [ -z "$CHECKOUT_ID" ] && [ "$BRANCH" != "HEAD" ] && CHECKOUT_ID="$BRANCH" + if [[ $CHECKOUT_ID == "tags/"* ]]; then + REMOTE_COMMIT_ID=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER rev-list -n 1 $CHECKOUT_ID` + else + REMOTE_COMMIT_ID=`lxc exec $CONTAINER -- git -C $INSTALL_FOLDER rev-parse origin/$CHECKOUT_ID` + fi + echo " TO: $CHECKOUT_ID ($REMOTE_COMMIT_ID)" + if [ "$CURRENT_COMMIT_ID" == "$REMOTE_COMMIT_ID" ]; then + echo " Nothing to be done." + else + echo " Update required." + fi + echo } function so_is_up() { @@ -186,6 +216,15 @@ function vca_is_up() { FATAL "OSM Failed to startup. VCA failed to startup" } +function mon_is_up() { + if [[ `curl http://$RO_IP:9090/openmano/ | grep "works" | wc -l` -eq 1 ]]; then + echo "MON is up and running" + return 0 + fi + + FATAL "OSM Failed to startup. MON failed to startup" +} + function ro_is_up() { if [ -n "$1" ]; then RO_IP=$1 @@ -218,8 +257,12 @@ function configure_RO(){ ro_is_up lxc exec RO -- openmano tenant-delete -f osm >/dev/null +<<<<<<< HEAD lxc exec RO -- openmano tenant-create osm > /dev/null lxc exec RO -- sed -i '/export OPENMANO_TENANT=osm/d' .bashrc +======= + lxc exec RO -- sed -i '/export OPENMANO_TENANT=osm/d' .bashrc +>>>>>>> MON Installation Changes Updated. lxc exec RO -- sed -i '$ i export OPENMANO_TENANT=osm' .bashrc lxc exec RO -- sh -c 'echo "export OPENMANO_TENANT=osm" >> .bashrc' } @@ -235,6 +278,9 @@ function configure_SOUI(){ JUJU_CONTROLLER_IP=`lxc exec VCA -- lxc list -c 4 |grep eth0 |awk '{print $2}'` RO_TENANT_ID=`lxc exec RO -- openmano tenant-list osm |awk '{print $1}'` + echo -e " Configuring MON" + #Information to be added about SO socket for logging + echo -e " Configuring SO" sudo route add -host $JUJU_CONTROLLER_IP gw $VCA_CONTAINER_IP sudo sed -i "$ i route add -host $JUJU_CONTROLLER_IP gw $VCA_CONTAINER_IP" /etc/rc.local @@ -304,7 +350,7 @@ function configure_SOUI(){ lxc exec SO-ub -- tee /etc/network/interfaces.d/60-rift.cfg <>>>>>> MON Installation Changes Updated. /^\*nat/ { innat=1; print; diff --git a/jenkins/MON/install b/jenkins/MON/install index 40fae53f..41ee4a1a 100755 --- a/jenkins/MON/install +++ b/jenkins/MON/install @@ -1,3 +1,5 @@ +#!/bin/bash + # Copyright 2017 Intel Research and Development Ireland Limited # ************************************************************* @@ -39,7 +41,7 @@ OSM_load_config apt-get update DEBIAN_FRONTEND=noninteractive apt-get install --yes python-all python-pip && pip install --upgrade pip -DEBIAN_FRONTEND=noninteractive apt-get --yes install default-jre +DEBIAN_FRONTEND=noninteractive apt-get --yes install default-jre python-stdeb DEBIAN_FRONTEND=noninteractive python kafkad RC=$? INFO "done, RC=$RC" diff --git a/jenkins/MON/start_build b/jenkins/MON/start_build index c73a40ce..ffbcfa03 100755 --- a/jenkins/MON/start_build +++ b/jenkins/MON/start_build @@ -1,3 +1,5 @@ +#!/bin/bash + # Copyright 2017 Intel Research and Development Ireland Limited # ************************************************************* @@ -27,7 +29,7 @@ OSM_JENKINS=$(dirname $HERE) . $OSM_JENKINS/common/all_funcs # SET YOU MDG repository name here -export OSM_MDG=RO +export OSM_MDG=MON OSM_load_config OSM_git_checkout "$@" python -m py_compile kafkad @@ -37,9 +39,9 @@ service kafka start #Start VMWare install script INFO "Installing vROPs Web Service" -. plugins/vRealiseOps/vROPs_Webservice/install.sh -INFO "Startinv vrops Web Service" -python plugins/vRealiseOps/vROPs_Webservice/vrops_webservice +. osm_mon/plugins/vRealiseOps/vROPs_Webservice/install.sh +INFO "Starting vrops Web Service" +python osm_mon/plugins/vRealiseOps/vROPs_Webservice/vrops_webservice RC=$? INFO "done, RC=$RC" diff --git a/jenkins/common/install_common b/jenkins/common/install_common index bae5b9a7..901d287b 100755 --- a/jenkins/common/install_common +++ b/jenkins/common/install_common @@ -49,4 +49,4 @@ echo $key_location curl $key_location | apt-key add - REPOSITORY_BASE=${REPOSITORY_BASE%/} -apt-get update && add-apt-repository -y "deb $REPOSITORY_BASE/$RELEASE $REPOSITORY SO UI RO IM osmclient openvim" +apt-get update && add-apt-repository -y "deb $REPOSITORY_BASE/$RELEASE $REPOSITORY SO UI RO MON IM osmclient openvim" diff --git a/jenkins/release/delete-tag.sh b/jenkins/release/delete-tag.sh index 358d6806..2c7690ef 100755 --- a/jenkins/release/delete-tag.sh +++ b/jenkins/release/delete-tag.sh @@ -11,7 +11,7 @@ TAG="$1" TEMPDIR="$(mktemp -q -d --tmpdir "tagosm.XXXXXX")" trap 'rm -rf "$TEMPDIR"' EXIT -list="juju-charms devops descriptor-packages openvim RO SO UI" +list="juju-charms devops descriptor-packages openvim RO MON SO UI" for i in $list; do REPO_FOLDER="$TEMPDIR/$i" echo diff --git a/jenkins/release/new-tag.sh b/jenkins/release/new-tag.sh index 37c5193b..7bba5d83 100755 --- a/jenkins/release/new-tag.sh +++ b/jenkins/release/new-tag.sh @@ -33,7 +33,7 @@ for i in $list; do rm -rf $REPO_FOLDER done -list="descriptor-packages openvim RO SO UI" +list="descriptor-packages openvim RO MON SO UI" for i in $list; do REPO_FOLDER="$TEMPDIR/$i" echo