diff options
author | Narinder Gupta <narinder.gupta@canonical.com> | 2017-01-19 16:34:18 -0600 |
---|---|---|
committer | Narinder Gupta <narinder.gupta@canonical.com> | 2017-01-19 16:47:02 -0600 |
commit | 3de608422cffacc90d80e479538b91e90874e242 (patch) | |
tree | e0c9a0690ab51aa12f8a81b56b4fabe2d1e48cc7 /jjb/joid/joid-deploy.sh | |
parent | 88812b12f218b23561f915168619e66b2b68df82 (diff) |
added support for kubernetes job.
This patch is to add support for Kubernetes jobs in JOID. We have
added os (openstack) or k8 (kubernetes) during deployment.
Change-Id: Ide33cb3c1d1d0e8c4b99af2acd721c0a41073dd6
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'jjb/joid/joid-deploy.sh')
-rw-r--r-- | jjb/joid/joid-deploy.sh | 89 |
1 files changed, 51 insertions, 38 deletions
diff --git a/jjb/joid/joid-deploy.sh b/jjb/joid/joid-deploy.sh index 05c2de1fc..88dbe2214 100644 --- a/jjb/joid/joid-deploy.sh +++ b/jjb/joid/joid-deploy.sh @@ -64,8 +64,9 @@ fi # Based on scenario naming we can get joid options # naming convention: -# os-<controller>-<nfvfeature>-<mode>[-<extrastuff>] +# <model>-<controller>-<nfvfeature>-<mode>[-<extrastuff>] # With parameters: +# model=(os|k8) # controller=(nosdn|odl_l3|odl_l2|onos|ocl) # No odl_l3 today # nfvfeature=(kvm|ovs|dpdk|nofeature) @@ -77,6 +78,7 @@ fi IFS='-' read -r -a DEPLOY_OPTIONS <<< "${DEPLOY_SCENARIO}--" #last -- need to avoid nounset error +JOID_MODEL=${DEPLOY_OPTIONS[0]} SDN_CONTROLLER=${DEPLOY_OPTIONS[1]} NFV_FEATURES=${DEPLOY_OPTIONS[2]} HA_MODE=${DEPLOY_OPTIONS[3]} @@ -103,49 +105,60 @@ fi ## Configure Joid deployment ## -echo "------ Deploy with juju ------" -echo "Execute: ./deploy.sh -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES" +if [ "$JOID_MODEL" == 'k8' ]; then + echo "------ Deploy with juju ------" + echo "Execute: ./deploy.sh -m $JOID_MODEL -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES" -./deploy.sh -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES -exit_on_error $? "Main deploy FAILED" + ./deploy.sh -m kubernetes -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES + exit_on_error $? "Main deploy FAILED" +fi ## ## Set Admin RC ## -JOID_ADMIN_OPENRC=$LAB_CONFIG/admin-openrc -echo "------ Create OpenRC file [$JOID_ADMIN_OPENRC] ------" - -# get controller IP -case "$SDN_CONTROLLER" in - "odl") - SDN_CONTROLLER_IP=$(juju status odl-controller/0 |grep public-address|sed -- 's/.*\: //') - ;; - "onos") - SDN_CONTROLLER_IP=$(juju status onos-controller/0 |grep public-address|sed -- 's/.*\: //') - ;; - *) - SDN_CONTROLLER_IP='none' - ;; -esac -SDN_PASSWORD='admin' - -# export the openrc file by getting the one generated by joid and add SDN -# controller for Functest -cp ./cloud/admin-openrc $JOID_ADMIN_OPENRC -cat << EOF >> $JOID_ADMIN_OPENRC -export SDN_CONTROLLER=$SDN_CONTROLLER_IP -export SDN_PASSWORD=$SDN_PASSWORD -EOF - -## -## Backup local juju env -## +if [ "$JOID_MODEL" == 'os' ]; then + echo "------ Deploy with juju ------" + echo "Execute: ./deploy.sh -m $JOID_MODEL -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES" + + ./deploy.sh -m openstack -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES + exit_on_error $? "Main deploy FAILED" + + JOID_ADMIN_OPENRC=$LAB_CONFIG/admin-openrc + echo "------ Create OpenRC file [$JOID_ADMIN_OPENRC] ------" + + # get controller IP + case "$SDN_CONTROLLER" in + "odl") + SDN_CONTROLLER_IP=$(juju status odl-controller/0 |grep public-address|sed -- 's/.*\: //') + ;; + "onos") + SDN_CONTROLLER_IP=$(juju status onos-controller/0 |grep public-address|sed -- 's/.*\: //') + ;; + *) + SDN_CONTROLLER_IP='none' + ;; + esac + SDN_PASSWORD='admin' + + # export the openrc file by getting the one generated by joid and add SDN + # controller for Functest + cp ./cloud/admin-openrc $JOID_ADMIN_OPENRC + cat << EOF >> $JOID_ADMIN_OPENRC + export SDN_CONTROLLER=$SDN_CONTROLLER_IP + export SDN_PASSWORD=$SDN_PASSWORD + EOF + + ## + ## Backup local juju env + ## + + echo "------ Backup Juju environment ------" + cp environments.yaml $LAB_CONFIG/ + cp deployment.yaml $LAB_CONFIG/ + if [ -e deployconfig.yaml ]; then + cp deployconfig.yaml $LAB_CONFIG + fi -echo "------ Backup Juju environment ------" -cp environments.yaml $LAB_CONFIG/ -cp deployment.yaml $LAB_CONFIG/ -if [ -e deployconfig.yaml ]; then - cp deployconfig.yaml $LAB_CONFIG fi ## |