From 53447be957517322501caf7c2d441693c350d73f Mon Sep 17 00:00:00 2001 From: Narinder Gupta Date: Thu, 2 Jun 2016 01:59:09 -0500 Subject: [PATCH] remove the ext-port and data network dependency on the labs. All data will be captured from labconfig.yaml Change-Id: I11a2431b3896a65dc74cc0423a1b03050ef16146 Signed-off-by: Narinder Gupta --- ci/01-deploybundle.sh | 54 ++++++++++++--------------------------------------- ci/02-maasdeploy.sh | 9 +++------ ci/deploy.py | 11 +++++++++-- ci/fetch-charms.sh | 39 ------------------------------------- 4 files changed, 24 insertions(+), 89 deletions(-) delete mode 100755 ci/fetch-charms.sh diff --git a/ci/01-deploybundle.sh b/ci/01-deploybundle.sh index 90724096..22eea3f8 100755 --- a/ci/01-deploybundle.sh +++ b/ci/01-deploybundle.sh @@ -29,27 +29,17 @@ case "$1" in esac +#read the value from deployment.yaml +if [ -e ~/.juju/deployment.yaml ]; then + extport=`grep "ext-port" deployment.yaml | cut -d ' ' -f 4 | sed -e 's/ //'` + sed --i "s@#ext-port: \"eth1\"@ext-port: \"$extport\"@g" ./bundles.yaml + datanet=`grep "dataNetwork" deployment.yaml | cut -d ' ' -f 4 | sed -e 's/ //'` + sed --i "s@#os-data-network: 10.4.8.0/21@os-data-network: $datanet@g" ./bundles.yaml + admnet=`grep "admNetwork" deployment.yaml | cut -d ' ' -f 4 | sed -e 's/ //'` + sed --i "s@10.4.1.1@$admnet@g" ./bundles.yaml +fi + case "$3" in - 'orangepod1' ) - # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20 - sed -i -- 's/10.4.1.1/192.168.1.2/g' ./bundles.yaml - # choose the correct interface to use for data network - sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 192.168.11.0\/24/g' ./bundles.yaml - # Choose the external port to go out from gateway to use. - sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml - # Use host for public API for Orange pod2 - # sed -i -- 's/#os-public-hostname: api.public-fqdn/os-public-hostname: api.pod2.opnfv.fr/g' ./bundles.yaml - ;; - 'orangepod2' ) - # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20 - sed -i -- 's/10.4.1.1/192.168.2.2/g' ./bundles.yaml - # choose the correct interface to use for data network - sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 192.168.12.0\/24/g' ./bundles.yaml - # Choose the external port to go out from gateway to use. - sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml - # Use host for public API for Orange pod2 - # sed -i -- 's/#os-public-hostname: api.public-fqdn/os-public-hostname: api.pod2.opnfv.fr/g' ./bundles.yaml - ;; 'intelpod9' ) # As per your lab vip address list be deafult uses 10.9.1.11 - 10.9.1.20 sed -i -- 's/10.4.1.1/10.9.1.2/g' ./bundles.yaml @@ -60,26 +50,6 @@ case "$3" in # Provide the gateway MAC to route the traffic externally. sed -i -- 's/#gateway-mac: "default"/gateway-mac: "default"/g' ./bundles.yaml ;; - 'intelpod6' ) - # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20 - sed -i -- 's/10.4.1.1/10.6.1.2/g' ./bundles.yaml - # choose the correct interface to use for data network - sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 10.6.12.0\/24/g' ./bundles.yaml - # Choose the external port to go out from gateway to use. - sed -i -- 's/#ext-port: "eth1"/ext-port: "eth5"/g' ./bundles.yaml - # Provide the gateway MAC to route the traffic externally. - sed -i -- 's/#gateway-mac: "default"/gateway-mac: "default"/g' ./bundles.yaml - ;; - 'intelpod5' ) - # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20 - sed -i -- 's/10.4.1.1/10.5.1.2/g' ./bundles.yaml - # choose the correct interface to use for data network - sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 10.5.12.0\/24/g' ./bundles.yaml - # Choose the external port to go out from gateway to use. - sed -i -- 's/#ext-port: "eth1"/ext-port: "eth5"/g' ./bundles.yaml - # Provide the gateway MAC to route the traffic externally. - sed -i -- 's/#gateway-mac: "default"/gateway-mac: "default"/g' ./bundles.yaml - ;; 'attvirpod1' ) # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20 sed -i -- 's/10.4.1.1/192.168.10.1/g' ./bundles.yaml @@ -164,6 +134,6 @@ case "$6" in esac echo "... Deployment Started ...." - juju-deployer -vW -d -t 3600 -c bundles.yaml $6-"$2"-nodes - juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $6-"$2" + juju-deployer -vW -d -t 3600 -c bundles.yaml $6-"$2"-nodes + juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $6-"$2" diff --git a/ci/02-maasdeploy.sh b/ci/02-maasdeploy.sh index 741773d1..4aa9199b 100755 --- a/ci/02-maasdeploy.sh +++ b/ci/02-maasdeploy.sh @@ -14,8 +14,6 @@ sudo apt-get update -y sudo apt-get dist-upgrade -y sudo apt-get install openssh-server git maas-deployer juju juju-deployer maas-cli python-pip python-openstackclient gsutil -y -cp maas/deployment.yaml ./deployment.yaml - #first parameter should be custom and second should be either # absolute location of file (including file name) or url of the # file to download. @@ -40,7 +38,7 @@ if [ "$1" == "custom" ]; then cp ../labconfig/default/deployment.yaml ./ cp ../labconfig/default/labconfig.yaml ./ fi - labname=`grep "lab_location" labconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //'` + labname=`grep "maas_name" deployment.yaml | cut -d ':' -f 2 | sed -e 's/ //'` else case "$1" in 'intelpod5' ) @@ -180,13 +178,12 @@ crnodevlanint() { done } -#convert labconfig file to deployment.yaml to consume by MAAS. -#python deploy.py - #just make sure the ssh keys added into maas for the current user sed --i "s@/home/ubuntu@$HOME@g" ./deployment.yaml sed --i "s@qemu+ssh://ubuntu@qemu+ssh://$USER@g" ./deployment.yaml +cp ./deployment.yaml ~/.juju/ + sudo maas-deployer -c deployment.yaml -d --force sudo chown $USER:$USER environments.yaml diff --git a/ci/deploy.py b/ci/deploy.py index cfd744d7..dadc964a 100644 --- a/ci/deploy.py +++ b/ci/deploy.py @@ -52,9 +52,10 @@ opnfvcfg['demo-maas']={'juju-bootstrap':{'memory': 4096,'name': "bootstrap",\ }\ } +opnfvcfg['opnfv']={'ext-port':'','floating-ip-range':'','dataNetwork':''} -opnfvcfg['demo-maas']['maas']['apt_sources'].append("ppa:maas/stable") -opnfvcfg['demo-maas']['maas']['apt_sources'].append("ppa:juju/stable") +opnfvcfg['demo-maas']['maas']['apt_sources'].append("ppa:maas/stable") +opnfvcfg['demo-maas']['maas']['apt_sources'].append("ppa:juju/stable") # lets modify the maas general settings: @@ -84,6 +85,7 @@ while c < len(labcfg["opnfv"]["spaces"]): ethbrAdmin = getFromDict(labcfg, ["opnfv","spaces",c,"bridge"]) brgway = getFromDict(labcfg, ["opnfv","spaces",c,"gateway"]) tmpcidr = brcidr[:-4] + opnfvcfg["opnfv"]["admNetwork"]=tmpcidr+"2" nodegroup={"device": "eth"+str(y), "ip": tmpcidr+"5","subnet_mask": "255.255.255.0", \ "broadcast_ip": tmpcidr+"255", "router_ip": brgway,\ @@ -136,6 +138,8 @@ while c < len(labcfg["opnfv"]["spaces"]): ' address '+ipaddress+'\n' ' netmask 255.255.255.0\n') opnfvcfg["demo-maas"]["juju-bootstrap"]["interfaces"].append("bridge="+brname+",model=virtio") + if brtype == "data": + opnfvcfg["opnfv"]["dataNetwork"]=brcidr c=c+1 @@ -196,6 +200,9 @@ while c < len(labcfg["lab"]["racks"][0]["nodes"]): c=c+1 +opnfvcfg["opnfv"]["floating-ip-range"]=labcfg["lab"]["racks"][0]["floating-ip-range"] +opnfvcfg["opnfv"]["ext-port"]=labcfg["lab"]["racks"][0]["ext-port"] + with open('deployment.yaml', 'wa') as opnfvf: yaml.dump(opnfvcfg, opnfvf, default_flow_style=False) diff --git a/ci/fetch-charms.sh b/ci/fetch-charms.sh deleted file mode 100755 index 2912e5c9..00000000 --- a/ci/fetch-charms.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -ex - -distro=$distro -mkdir -p $distro - -# openstack -bzr branch lp:~openstack-charmers/charms/$distro/ceilometer/next $distro/ceilometer -bzr branch lp:~openstack-charmers/charms/$distro/ceilometer-agent/next $distro/ceilometer-agent -bzr branch lp:~openstack-charmers/charms/$distro/ceph/next $distro/ceph -bzr branch lp:~openstack-charmers/charms/$distro/ceph-osd/next $distro/ceph-osd -bzr branch lp:~openstack-charmers/charms/$distro/ceph-radosgw/next $distro/ceph-radosgw -bzr branch lp:~openstack-charmers/charms/$distro/cinder/next $distro/cinder -bzr branch lp:~openstack-charmers/charms/$distro/cinder-ceph/next $distro/cinder-ceph -bzr branch lp:~openstack-charmers/charms/$distro/glance/next $distro/glance -bzr branch lp:~narindergupta/charms/$distro/promise/trunk $distro/promise -bzr branch lp:~openstack-charmers/charms/$distro/keystone/next $distro/keystone -bzr branch lp:~openstack-charmers/charms/$distro/percona-cluster/next $distro/percona-cluster -bzr branch lp:~openstack-charmers/charms/$distro/neutron-api/next $distro/neutron-api -bzr branch lp:~openstack-charmers/charms/$distro/neutron-gateway/next $distro/neutron-gateway -bzr branch lp:~openstack-charmers/charms/$distro/neutron-openvswitch/next $distro/neutron-openvswitch -bzr branch lp:~openstack-charmers/charms/$distro/nova-cloud-controller/next $distro/nova-cloud-controller -bzr branch lp:~openstack-charmers/charms/$distro/nova-compute/next $distro/nova-compute -bzr branch lp:~openstack-charmers/charms/$distro/openstack-dashboard/next $distro/openstack-dashboard -bzr branch lp:~openstack-charmers/charms/$distro/rabbitmq-server/next $distro/rabbitmq-server -bzr branch lp:~openstack-charmers/charms/$distro/hacluster/next $distro/hacluster -bzr branch lp:~openstack-charmers/charms/$distro/heat/next $distro/heat -bzr branch lp:~opnfv-team/charms/$distro/haproxy/trunk $distro/haproxy - -# Controller specific charm -bzr branch lp:~sdn-charmers/charms/$distro/keepalived/trunk $distro/keepalived -bzr branch lp:~stub/charms/$distro/cassandra/noauthentication $distro/cassandra-noauthentication -bzr branch lp:~sdn-charmers/charms/$distro/contrail-analytics/trunk $distro/contrail-analytics -bzr branch lp:~sdn-charmers/charms/$distro/contrail-configuration/trunk $distro/contrail-configuration -bzr branch lp:~sdn-charmers/charms/$distro/contrail-control/trunk $distro/contrail-control -bzr branch lp:~sdn-charmers/charms/$distro/contrail-webui/trunk $distro/contrail-webui -bzr branch lp:~charmers/charms/precise/zookeeper/trunk src/charms/precise/zookeeper -bzr branch lp:~opnfv-team/charms/$distro/neutron-api-contrail/trunk $distro/neutron-api-contrail -bzr branch lp:~opnfv-team/charms/$distro/neutron-contrail/trunk $distro/neutron-contrail - -- 2.16.6