set -ex
+source tools.sh
+
#need to put multiple cases here where decide this bundle to deploy by default use the odl bundle.
# Below parameters are the default and we can according the release
jq -r ".[] | select(.hostname == \"$node\").system_id")
fi
if [[ -z "$node_id" ]]; then
- echo "Error: failed to create node $node ."
+ echo_error "Error: failed to create node $node ."
exit 1
fi
maas $PROFILE tag update-nodes control add=$node_id || true
python genDeploymentConfig.py -l labconfig.yaml > deployconfig.yaml
fi
else
- echo " MAAS not deployed please deploy MAAS first."
+ echo_error "MAAS not deployed please deploy MAAS first."
fi
fi
cp ~/joid_config/environments.yaml ./environments.yaml
fi
#copy the script which needs to get deployed as part of ofnfv release
- echo "...... deploying now ......"
+ echo_info "Deploying now..."
echo " " >> environments.yaml
echo " enable-os-refresh-update: false" >> environments.yaml
echo " enable-os-upgrade: false" >> environments.yaml
retval=0
timeoutiter=0
- echo -n "executing the relationship within charms ."
+ echo_info "Executing the relationships within charms..."
while [ $retval -eq 0 ]; do
if juju status | grep -q $waitstatus; then
- echo -n '.'
+ echo_info "Still waiting for $waitstatus units"
if [ $timeoutiter -ge 180 ]; then
- echo 'timed out'
+ echo_error 'Timed out'
retval=1
else
sleep 30
fi
timeoutiter=$((timeoutiter+1))
else
- echo 'done'
+ echo_info 'Done executing the relationships'
retval=1
fi
done
#juju ssh ceph/0 \ 'sudo radosgw-admin user create --uid="ubuntu" --display-name="Ubuntu Ceph"'
fi
- echo "...... deployment finishing ......."
+ echo_info "Deployment finishing..."
}
# In the case of a virtual deployment
./clean.sh || true
fi
-echo "...... deployment started ......"
+echo_info "Deployment started"
deploy
check_status executing
-echo "...... deployment finished ......."
+echo_info "Deployment finished"
-echo "...... configuring public access ......."
+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
if ([ $admin_gw ] && [ $admin_gw != "null" ]); then
# set default gateway to public api gateway
for cnt in $cnt_list; do
- echo "changing default gw on $cnt"
+ 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) &&\
done
fi
-echo "...... configure ......."
-
+// Configuring deployment
if ([ $opnfvmodel == "openstack" ]); then
+ echo_info "Configuring OpenStack deployment"
+
./openstack.sh "$opnfvsdn" "$opnfvlab" "$opnfvdistro" "$openstack" || true
# creating heat domain after pushing the public API into /etc/hosts
fi
elif ([ $opnfvmodel == "kubernetes" ]); then
+ echo_info "Configuring Kubernetes deployment"
+
./k8.sh
fi
# expose the juju gui-url to login into juju gui
-echo " ...... JUJU GUI can be access using the below URL ...... "
+echo_info "Juju GUI can be accessed using the following URL and credentials:"
juju gui --show-credentials --no-browser
-echo "...... finished ......."
+echo "Finished deployment and configuration"
#!/bin/bash -ex
-
##############################################################################
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+set -ex
+
+source tools.sh
+
#./openstack.sh "$opnfvsdn" "$opnfvlab" "$opnfvdistro" "$openstack" || true
opnfvsdn=$1
# create external network and subnet in openstack
create_openrc() {
+ echo_info "Creating the openrc (OpenStack client environment scripts)"
+
mkdir -m 0700 -p cloud
keystoneIp=$(keystoneIp)
if [[ "$jujuver" < "2" ]]; then
EOF
}
-if ([ $API_FQDN ] && [ $API_FQDN != "null" ] && [ $API_FQDN != "None"]); then
+if ([ $API_FQDN ] && [ $API_FQDN != "null" ] && [ $API_FQDN != "None" ]); then
+ echo_info "OS domain name was specified - injecting API FQDN to nodes"
+
# Push api fqdn local ip to all /etc/hosts
if [[ "$jujuver" < "2" ]]; then
API_FQDN=$(juju get keystone | python -c "import yaml; import sys;\
. ~/joid_config/admin-openrc
-echo "...... deploy public api proxy ......"
-
if ([ "$opnfvlab" == "orangepod1" ] \
|| [ "$opnfvlab" == "intelpod6" ]) \
&& [ "$opnfvsdn" == "nosdn" ] \
&& [ "$API_FQDN" != "None" ]; then # only for first test phase
if [ -e ./labconfig.yaml ]; then
+ echo_info "Deploying public API proxy"
+
PUB_API_MASK=$(grep floating-ip-range ./labconfig.yaml |cut -d/ -f2)
PUB_API_NET=$(grep floating-ip-range ./labconfig.yaml |cut -d, -f4)
PUB_API_IP=$(grep public-api-ip ./labconfig.yaml |cut -d: -f2)
juju run --unit nodes/0 "sudo ip l set dev br-ex up" || true
python genPublicAPIProxyBundle.py -l labconfig.yaml >> bundles.yaml
juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $opnfvdistro-"$opnfvos" || true
+
+ echo_info "Public API proxy deployed!"
fi
fi
-echo "...... deploy end public api proxy ......"
##
## removing the swift API endpoint which is created by radosgw.
## Create external subnet Network
##
+echo_info "Creating external network with neutron"
+
if [ "onos" == "$opnfvsdn" ]; then
launch_eth
neutron net-show ext-net > /dev/null 2>&1 || neutron net-create ext-net \
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+# include only once
+[ ! -z "$_tools_included" ] && return || readonly _tools_included=true
#######################################
# Echo printing in yellow bold color
echo "${@:1:($#-1)}" -e "$yellow_bold${@: -1}$color_off";
)
}
+
+#######################################
+# Echo error
+# Arguments:
+# Same as for echo
+# Returns:
+# None
+#######################################
+function echo_error { (
+ # don't clutter the script output with the xtrace of the echo command
+ { set +x; } 2> /dev/null
+
+ red_bold='\033[1;31m'
+ color_off='\033[0m'
+ >&2 echo "${@:1:($#-1)}" -e "$red_bold${@: -1}$color_off";
+ )
+}