added integration with congress charm. 99/15299/12
authorNarinder Gupta <narinder.gupta@canonical.com>
Wed, 8 Jun 2016 14:46:07 +0000 (09:46 -0500)
committerNarinder Gupta <narinder.gupta@canonical.com>
Thu, 9 Jun 2016 13:06:56 +0000 (08:06 -0500)
Change-Id: Iabdc6e2641653103d7e406c1d7488c3f4406084b
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
ci/01-deploybundle.sh
ci/02-maasdeploy.sh
ci/deploy.py
ci/nosdn/fetch-charms.sh
ci/nosdn/juju-deployer/ovs-nosdn-nonha.yaml

index 7addbce..bf9784f 100755 (executable)
@@ -8,8 +8,7 @@ set -ex
     cp $4/fetch-charms.sh ./fetch-charms.sh
     #modify the ubuntu series wants to deploy
     sed -i -- "s|distro=trusty|distro=$6|g" ./fetch-charms.sh
-    sh ./fetch-charms.sh $6
-
+    ./fetch-charms.sh $6
 
 case "$1" in
     'nonha' )
@@ -31,24 +30,17 @@ esac
 
 #read the value from deployment.yaml
 if [ -e ~/.juju/deployment.yaml ]; then
-
    cp ~/.juju/deployment.yaml ./deployment.yaml
-
-   if [ -e ~/.juju/deployment.yaml ]; then
+   if [ -e ~/.juju/deployconfig.yaml ]; then
       cp ~/.juju/deployconfig.yaml ./deployconfig.yaml
-
       extport=`grep "ext-port" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //' | tr ',' ' '`
       sed --i "s@#ext-port: \"eth1\"@ext-port: \"$extport\"@g" ./bundles.yaml
-
       datanet=`grep "dataNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
-
       if [ "$datanet" != "''" ]; then
           sed -i -- "s@#os-data-network: 10.4.8.0/21@os-data-network: $datanet@g" ./bundles.yaml
       fi
-
       admnet=`grep "admNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
       sed --i "s@10.4.1.1@$admnet@g" ./bundles.yaml
-
       cephdisk=`grep "disk" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
       sed --i "s@osd-devices: /srv@osd-devices: $cephdisk@g" ./bundles.yaml
    fi
index 839d29f..b1b7e21 100755 (executable)
@@ -9,7 +9,7 @@ labname=$1
 sudo apt-add-repository ppa:maas-deployers/stable -y
 sudo apt-add-repository ppa:juju/stable -y
 sudo apt-add-repository ppa:maas/stable -y
-sudo apt-add-repository cloud-archive:liberty -y
+sudo apt-add-repository cloud-archive:mitaka -y
 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
@@ -237,16 +237,40 @@ if [ "$virtinstall" -eq 1 ]; then
     maas maas tag update-nodes compute add=$computenodeid
 fi
 
+#read interface needed in Auto mode and enable it. Will be rmeoved once auto enablement will be implemented in the maas-deployer.
+enable_if(){
+   if [ -e ~/.juju/deployconfig.yaml ]; then
+      cp ~/.juju/deployconfig.yaml ./deployconfig.yaml
+
+      enableiflist=`grep "interface-enable" deployconfig.yaml | cut -d ' ' -f 4 `
+      datanet=`grep "dataNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
+      stornet=`grep "storageNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
+
+      # split EXTERNAL_NETWORK=first ip;last ip; gateway;network
+
+      if [ "$datanet" != "''" ]; then
+          EXTNET=(${enableiflist//,/ })
+          i="0"
+          while [ ! -z "${EXTNET[i]}" ];
+          do
+              enableautomode ${EXTNET[i]} AUTO $datanet || true
+              i=$[$i+1]
+          done
+      fi
+      if [ "$stornet" != "''" ]; then
+          EXTNET=(${enableiflist//,/ })
+          i="0"
+          while [ ! -z "${EXTNET[i]}" ];
+          do
+              echo enableautomode ${EXTNET[i]} AUTO $stornet || true
+              i=$[$i+1]
+          done
+      fi
+   fi
+}
+
 # Enable vlan interfaces with maas
 case "$labname" in
-    'intelpod5' )
-        maas refresh
-        enableautomode eth4 AUTO "10.5.12.0/24" || true
-        ;;
-    'intelpod6' )
-        maas refresh
-        enableautomode eth4 AUTO "10.6.12.0/24" || true
-        ;;
     'intelpod9' )
         maas refresh
         crvlanupdsubnet vlan902 1 "DataNetwork" 902 2 || true
@@ -258,21 +282,6 @@ case "$labname" in
         enableautomodebyname eth0.902 AUTO "10.9.12.0/24" control || true
         enableautomodebyname eth1.905 AUTO "10.9.15.0/24" control || true
         ;;
-    'orangepod1' )
-        maas refresh
-        enableautomode eth2 DHCP "192.168.21.0/24" || true
-        enableautomode eth3 AUTO "192.168.11.0/24" || true
-        ;;
-    'orangepod2' )
-        maas refresh
-        enableautomode eth4 DHCP "192.168.22.0/24" || true
-        enableautomode eth2 DHCP "192.168.22.0/24" || true
-        enableautomode eth5 AUTO "192.168.12.0/24" || true
-        enableautomode eth3 AUTO "192.168.12.0/24" || true
-        ;;
-    'attvirpod1' )
-        enableautomode eth1 AUTO "192.168.10.0/24" || true
-        ;;
     'juniperpod1' )
         ;;
     'cengnlynxpod1' )
@@ -286,7 +295,6 @@ case "$labname" in
         ;;
 esac
 
-echo " .... MAAS deployment finished successfully ...."
+enable_if
 
-#echo "... Deployment of opnfv release Started ...."
-#python deploy.py $maas_ip
+echo " .... MAAS deployment finished successfully ...."
index fffe1bd..65e1924 100644 (file)
@@ -53,7 +53,8 @@ opnfvcfg['demo-maas']={'juju-bootstrap':{'memory': 4096,'name': "bootstrap",\
                               }\
                       }
 
-opnfvlabcfg['opnfv']={'ext-port':'','floating-ip-range':'','dataNetwork':'','ceph-disk':'/srv/'}
+opnfvlabcfg['opnfv']={'ext-port':'','floating-ip-range':'','dataNetwork':'','ceph-disk':'/srv/',\
+                      'storageNetwork':'','interface-enable':""}
 
 opnfvcfg['demo-maas']['maas']['apt_sources'].append("ppa:maas/stable")
 opnfvcfg['demo-maas']['maas']['apt_sources'].append("ppa:juju/stable")
@@ -141,6 +142,8 @@ while c < len(labcfg["opnfv"]["spaces"]):
             opnfvcfg["demo-maas"]["juju-bootstrap"]["interfaces"].append("bridge="+brname+",model=virtio")
         if brtype == "data":
             opnfvlabcfg["opnfv"]["dataNetwork"]=brcidr
+        if brtype == "storage":
+            opnfvlabcfg["opnfv"]["storageNetwork"]=brcidr
 
     c=c+1
 
@@ -157,6 +160,7 @@ if len(labcfg["lab"]["racks"][0]["nodes"]) < 1:
 
 #lets insert the node details here:
 c=0
+ifnamelist=[]
 #
 while c < len(labcfg["lab"]["racks"][0]["nodes"]):
     valuemac=[]
@@ -188,7 +192,10 @@ while c < len(labcfg["lab"]["racks"][0]["nodes"]):
              "power":power,'tags':noderoles})
     y = 0
     while y < len(labcfg["lab"]["racks"][0]["nodes"][c]["nics"]):
+        valuespaces = labcfg["lab"]["racks"][0]["nodes"][c]["nics"][y]["spaces"]
         valueifname = labcfg["lab"]["racks"][0]["nodes"][c]["nics"][y]["ifname"]
+        if "admin" not in valuespaces:
+            ifnamelist += [valueifname]
         valueifmac = labcfg["lab"]["racks"][0]["nodes"][c]["nics"][y]["mac"][0]
         valuemac += labcfg["lab"]["racks"][0]["nodes"][c]["nics"][y]["mac"]
         opnfvcfg["demo-maas"]["maas"]["nodes"][c]["interfaces"]\
@@ -204,6 +211,7 @@ while c < len(labcfg["lab"]["racks"][0]["nodes"]):
 opnfvlabcfg["opnfv"]["floating-ip-range"]=labcfg["lab"]["racks"][0]["floating-ip-range"]
 opnfvlabcfg["opnfv"]["ext-port"]=labcfg["lab"]["racks"][0]["ext-port"]
 opnfvlabcfg["opnfv"]["ceph-disk"]=labcfg["opnfv"]["storage"][0]["disk"]
+opnfvlabcfg["opnfv"]["interface-enable"]=",".join(list(set(ifnamelist)))
 
 with open('deployment.yaml', 'wa') as opnfvf:
    yaml.dump(opnfvcfg, opnfvf, default_flow_style=False)
index d715bd8..0a659af 100755 (executable)
@@ -1,8 +1,14 @@
-#!/bin/sh -ex
+#!/bin/bash -ex
 
 distro=$1
 mkdir -p $distro
 
+function build {
+    sudo apt-get install charm-tools
+    (cd $distro/charm-congress; charm build -s $distro  -obuild src)
+    mv $distro/charm-congress/build/$distro/congress $distro
+}
+
 # openstack
 bzr branch lp:~narindergupta/charms/trusty/promise/trunk $distro/promise
 bzr branch lp:~billy-olsen/charms/xenial/mongodb/trunk $distro/mongodb
@@ -16,7 +22,8 @@ git clone https://github.com/openstack/charm-ceph-radosgw.git $distro/ceph-rados
 git clone https://github.com/openstack/charm-cinder.git $distro/cinder
 git clone https://github.com/openstack/charm-cinder-ceph.git $distro/cinder-ceph
 git clone https://github.com/openstack/charm-glance.git $distro/glance
-git clone https://github.com/openstack/charm-keystone.git $distro/keystone
+#git clone https://github.com/openstack/charm-keystone.git $distro/keystone
+git clone -b bug/congress-fix https://github.com/gnuoy/charm-keystone.git $distro/keystone
 git clone https://github.com/openstack/charm-percona-cluster.git $distro/percona-cluster
 git clone https://github.com/openstack/charm-neutron-api.git $distro/neutron-api
 git clone https://github.com/openstack/charm-neutron-gateway.git $distro/neutron-gateway
@@ -27,3 +34,5 @@ git clone https://github.com/openstack/charm-openstack-dashboard.git $distro/ope
 git clone https://github.com/openstack/charm-rabbitmq-server.git $distro/rabbitmq-server
 git clone https://github.com/openstack/charm-heat.git $distro/heat
 git clone https://github.com/openstack/charm-lxd.git xenial/lxd
+git clone https://github.com/gnuoy/charm-congress.git $distro/charm-congress
+build
index 3601d2c..db7474e 100644 (file)
@@ -127,6 +127,12 @@ openstack-phase2:
       - rabbitmq-server:amqp
     #- - nova-compute:lxd
       #- lxd:lxd
+    - - congress:shared-db
+      - mysql:shared-db
+    - - congress:identity-service
+      - keystone:identity-service
+    - - congress:amqp
+      - rabbitmq-server:amqp
   services:
     ceilometer:
       charm: "local:trusty/ceilometer"
@@ -257,3 +263,9 @@ openstack-phase2:
       charm: "local:trusty/heat"
       to:
         - "lxc:nodes=0"
+    congress:
+      charm: local:trusty/congress
+      options:
+        source-branch: stable/liberty
+      to:
+        - "lxc:nodes=1"