ca5ee068af7e6e562f3fca906504c2cf7c7986f4
[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 # Beryllium Repo
23 cat > ${BUILD_DIR}/opendaylight.repo << EOF
24 [opendaylight-4-release]
25 name=CentOS CBS OpenDaylight Beryllium repository
26 baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-4-release/\$basearch/os/
27 enabled=1
28 gpgcheck=0
29 EOF
30
31 # Boron Repo
32 cat > ${BUILD_DIR}/opendaylight_boron.repo << EOF
33 [opendaylight-5-release]
34 name=CentOS CBS OpenDaylight Boron repository
35 baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-5-testing/\$basearch/os/
36 enabled=1
37 gpgcheck=0
38 EOF
39
40 # Master Repo
41 cat > ${BUILD_DIR}/opendaylight_master.repo << EOF
42 [opendaylight-6-release]
43 name=CentOS CBS OpenDaylight Carbon repository
44 baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-6-testing/\$basearch/os/
45 enabled=1
46 gpgcheck=0
47 EOF
48
49 # OpenDaylight Puppet Module
50 rm -rf puppet-opendaylight
51 git clone -b master https://github.com/dfarrell07/puppet-opendaylight
52 pushd puppet-opendaylight > /dev/null
53 git archive --format=tar.gz --prefix=opendaylight/ HEAD > ${BUILD_DIR}/puppet-opendaylight.tar.gz
54 popd > /dev/null
55
56 # cache networking-BGPVPN
57 populate_cache https://github.com/oglok/networking-bgpvpn-rpm/raw/stable/newton/python2-networking-bgpvpn-5.0.1-dev6.noarch.rpm
58 populate_cache https://github.com/oglok/networking-bgpvpn-rpm/raw/stable/newton/python-networking-bgpvpn-heat-5.0.1-dev6.noarch.rpm
59 populate_cache https://github.com/oglok/networking-bgpvpn-rpm/raw/stable/newton/python-networking-bgpvpn-dashboard-5.0.1-dev6.noarch.rpm
60 populate_cache https://github.com/oglok/networking-bgpvpn-rpm/raw/stable/newton/python-networking-bgpvpn-doc-5.0.1-dev6.noarch.rpm
61 populate_cache https://github.com/oglok/networking-bgpvpn-rpm/raw/stable/newton/python-networking-bgpvpn-tests-5.0.1-dev6.noarch.rpm
62 pushd ${CACHE_DIR}/ > /dev/null
63 tar czf ${BUILD_DIR}/networking-bgpvpn.tar.gz *networking-bgpvpn*
64 popd > /dev/null
65
66 # cache gluon
67 populate_cache http://artifacts.opnfv.org/netready/$gluon_rpm
68
69 #Gluon puppet module
70 rm -rf netready
71 git clone -b master https://gerrit.opnfv.org/gerrit/netready
72 pushd netready/ > /dev/null
73 git archive --format=tar.gz HEAD:deploy/puppet/ > ${BUILD_DIR}/puppet-gluon.tar.gz
74 popd > /dev/null
75
76 # Download quagga/zrpc rpms
77 populate_cache http://artifacts.opnfv.org/apex/danube/quagga/quagga-3.tar.gz
78
79 # Download ODL netvirt for VPP
80 populate_cache http://artifacts.opnfv.org/apex/danube/fdio_netvirt/odl-netvirt-vpp-distribution.tar.gz
81
82 # install ODL packages
83 # Patch in OPNFV custom puppet-tripleO
84 # install Honeycomb
85 # install quagga/zrpc
86 # upload neutron patch for generic NS linux interface driver + OVS for external networks
87 LIBGUESTFS_BACKEND=direct virt-customize \
88     --upload ${BUILD_DIR}/opendaylight_boron.repo:/etc/yum.repos.d/opendaylight.repo \
89     --run-command "yum install --downloadonly --downloaddir=/root/boron/ opendaylight" \
90     --upload ${BUILD_DIR}/opendaylight_master.repo:/etc/yum.repos.d/opendaylight.repo \
91     --run-command "yum install --downloadonly --downloaddir=/root/master/ opendaylight" \
92     --upload ${BUILD_DIR}/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \
93     --run-command "wget 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 -O /root/fdio/honeycomb-1.17.04-2048.noarch.rpm" \
94     --install opendaylight,python-networking-odl \
95     --run-command "yum install -y /root/fdio/honeycomb-1.17.04-2048.noarch.rpm" \
96     --upload ${BUILD_DIR}/puppet-opendaylight.tar.gz:/etc/puppet/modules/ \
97     --run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight.tar.gz" \
98     --upload ${BUILD_DIR}/networking-bgpvpn.tar.gz:/root/ \
99     --run-command "cd /root/ && tar xzf networking-bgpvpn.tar.gz && yum localinstall -y *networking-bgpvpn*.rpm" \
100     --run-command "rm -f /etc/neutron/networking_bgpvpn.conf" \
101     --run-command "touch /etc/neutron/networking_bgpvpn.conf" \
102     --upload ${BUILD_DIR}/puppet-gluon.tar.gz:/etc/puppet/modules/ \
103     --run-command "cd /etc/puppet/modules/ && tar xzf puppet-gluon.tar.gz" \
104     --install epel-release \
105     --install python-click \
106     --upload ${CACHE_DIR}/$gluon_rpm:/root/\
107     --install /root/$gluon_rpm \
108     --upload ${CACHE_DIR}/quagga-3.tar.gz:/root/ \
109     --run-command "cd /root/ && tar xzf quagga-3.tar.gz" \
110     --run-command "yum downgrade -y python-zmq-14.3.1" \
111     --install zeromq-4.1.4 \
112     --install capnproto-libs,capnproto \
113     --upload ${BUILD_ROOT}/patches/neutron-patch-NSDriver.patch:/usr/lib/python2.7/site-packages/ \
114     --upload ${BUILD_ROOT}/patches/disable_odl_clustering.patch:/etc/puppet/modules/tripleo/ \
115     --upload ${CACHE_DIR}/odl-netvirt-vpp-distribution.tar.gz:/root/ \
116     -a overcloud-full-opendaylight_build.qcow2
117
118 LIBGUESTFS_BACKEND=direct virt-sparsify --compress overcloud-full-opendaylight_build.qcow2 overcloud-full-opendaylight.qcow2
119 popd > /dev/null