Adapting BGPVPN scenario to new composable service
[apex.git] / build / overcloud-opendaylight.sh
1 #!/bin/sh
2 ##############################################################################
3 # Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 set -e
11 source ./cache.sh
12 source ./variables.sh
13
14 pushd ${BUILD_DIR} > /dev/null
15
16 cp -f overcloud-full.qcow2 overcloud-full-opendaylight_build.qcow2
17
18 ###############################################
19 #####    Adding OpenDaylight to overcloud #####
20 ###############################################
21
22 cat > ${BUILD_DIR}/opendaylight.repo << EOF
23 [opendaylight-6-release]
24 name=CentOS CBS OpenDaylight Carbon repository
25 baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-6-testing/\$basearch/os/
26 enabled=1
27 gpgcheck=0
28 EOF
29
30 # OpenDaylight Puppet Module
31 rm -rf puppet-opendaylight
32 git clone -b stable/carbon https://git.opendaylight.org/gerrit/integration/packaging/puppet-opendaylight
33 pushd puppet-opendaylight > /dev/null
34 git archive --format=tar.gz --prefix=opendaylight/ HEAD > ${BUILD_DIR}/puppet-opendaylight-carbon.tar.gz
35 git checkout stable/boron
36 git archive --format=tar.gz --prefix=opendaylight/ HEAD > ${BUILD_DIR}/puppet-opendaylight-boron.tar.gz
37 popd > /dev/null
38
39 # cache gluon
40 populate_cache http://artifacts.opnfv.org/netready/$gluon_rpm
41
42 #Gluon puppet module
43 rm -rf netready
44 git clone -b master https://gerrit.opnfv.org/gerrit/netready
45 pushd netready/ > /dev/null
46 git archive --format=tar.gz HEAD:deploy/puppet/ > ${BUILD_DIR}/puppet-gluon.tar.gz
47 popd > /dev/null
48
49 # Download quagga/zrpc rpms
50 populate_cache http://artifacts.opnfv.org/apex/danube/quagga/quagga-3.tar.gz
51
52 # Download ODL netvirt for VPP
53 populate_cache http://artifacts.opnfv.org/apex/danube/fdio_netvirt/opendaylight-7.0.0-0.1.20170531snap665.el7.noarch.rpm
54
55 # install ODL packages
56 # Patch in OPNFV custom puppet-tripleO
57 # install Honeycomb
58 # install quagga/zrpc
59 # upload neutron patch for generic NS linux interface driver + OVS for external networks
60 LIBGUESTFS_BACKEND=direct virt-customize \
61     --upload ${BUILD_DIR}/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \
62     --run-command "curl -L https://nexus.fd.io/content/repositories/fd.io.stable.1704.centos7/io/fd/hc2vpp/honeycomb/1.17.04-2048.noarch/honeycomb-1.17.04-2048.noarch.rpm > /root/fdio/honeycomb-1.17.04-2048.noarch.rpm" \
63     --install opendaylight,python-networking-odl \
64     --run-command "yum install -y /root/fdio/honeycomb-1.17.04-2048.noarch.rpm" \
65     --upload ${BUILD_DIR}/puppet-opendaylight-boron.tar.gz:/etc/puppet/modules/ \
66     --run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight-boron.tar.gz" \
67     --upload ${BUILD_DIR}/puppet-opendaylight-carbon.tar.gz:/root/ \
68     --upload ${BUILD_DIR}/puppet-gluon.tar.gz:/etc/puppet/modules/ \
69     --run-command "cd /etc/puppet/modules/ && tar xzf puppet-gluon.tar.gz" \
70     --install epel-release \
71     --install python-click \
72     --upload ${CACHE_DIR}/$gluon_rpm:/root/\
73     --install /root/$gluon_rpm \
74     --upload ${CACHE_DIR}/quagga-3.tar.gz:/root/ \
75     --run-command "cd /root/ && tar xzf quagga-3.tar.gz" \
76     --run-command "yum downgrade -y python-zmq-14.3.1" \
77     --install zeromq-4.1.4 \
78     --install capnproto-libs,capnproto \
79     --run-command "cd /root/quagga; packages=\$(ls |grep -vE 'debuginfo|devel|contrib'); yum -y install \$packages" \
80     --run-command "sudo usermod -a -G quaggavt quagga" \
81     --upload ${BUILD_ROOT}/patches/neutron-patch-NSDriver.patch:/usr/lib/python2.7/site-packages/ \
82     --upload ${CACHE_DIR}/opendaylight-7.0.0-0.1.20170531snap665.el7.noarch.rpm:/root/ \
83     -a overcloud-full-opendaylight_build.qcow2
84
85 LIBGUESTFS_BACKEND=direct virt-sparsify --compress overcloud-full-opendaylight_build.qcow2 overcloud-full-opendaylight.qcow2
86 popd > /dev/null