Merge "Pass flags to allow domain undefine with NVRAM"
[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 cat > ${BUILD_DIR}/opendaylight_nitrogen.repo << EOF
31 [opendaylight-7-release]
32 name=CentOS CBS OpenDaylight Nitrogen repository
33 baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-7-testing/\$basearch/os/
34 enabled=1
35 gpgcheck=0
36 EOF
37
38 cat > ${BUILD_DIR}/opendaylight_master.repo << EOF
39 [opendaylight-master]
40 name=OpenDaylight master repository
41 baseurl=https://nexus.opendaylight.org/content/repositories/opendaylight-oxygen-epel-7-x86_64-devel/
42 enabled=1
43 gpgcheck=0
44 EOF
45
46 # OpenDaylight Puppet Module
47 rm -rf puppet-opendaylight
48 git clone -b stable/carbon https://git.opendaylight.org/gerrit/integration/packaging/puppet-opendaylight
49 pushd puppet-opendaylight > /dev/null
50 git archive --format=tar.gz --prefix=opendaylight/ HEAD > ${BUILD_DIR}/puppet-opendaylight-carbon.tar.gz
51 git checkout master
52 git archive --format=tar.gz --prefix=opendaylight/ HEAD > ${BUILD_DIR}/puppet-opendaylight-master.tar.gz
53 git checkout stable/nitrogen
54 git archive --format=tar.gz --prefix=opendaylight/ HEAD > ${BUILD_DIR}/puppet-opendaylight-nitrogen.tar.gz
55 popd > /dev/null
56
57 # cache gluon
58 populate_cache http://artifacts.opnfv.org/netready/$gluon_rpm
59
60 #Gluon puppet module
61 rm -rf netready
62 git clone -b master https://gerrit.opnfv.org/gerrit/netready
63 pushd netready/ > /dev/null
64 git archive --format=tar.gz HEAD:deploy/puppet/ > ${BUILD_DIR}/puppet-gluon.tar.gz
65 popd > /dev/null
66
67 # Download ODL netvirt for VPP
68 populate_cache http://artifacts.opnfv.org/apex/danube/fdio_netvirt/opendaylight-7.0.0-0.1.20170531snap665.el7.noarch.rpm
69
70 # install ODL packages
71 # Patch in OPNFV custom puppet-tripleO
72 # install quagga/zrpc
73 # upload neutron patch for generic NS linux interface driver + OVS for external networks
74 LIBGUESTFS_BACKEND=direct virt-customize \
75     --upload ${BUILD_DIR}/opendaylight_master.repo:/etc/yum.repos.d/opendaylight.repo \
76     --run-command "mkdir -p /root/master" \
77     --run-command "yumdownloader --destdir=/root/master opendaylight" \
78     --upload ${BUILD_DIR}/opendaylight_nitrogen.repo:/etc/yum.repos.d/opendaylight.repo \
79     --run-command "mkdir -p /root/nitrogen" \
80     --run-command "yum install --downloadonly --downloaddir=/root/nitrogen opendaylight" \
81     --upload ${BUILD_DIR}/opendaylight.repo:/etc/yum.repos.d/opendaylight.repo \
82     --install opendaylight,python-networking-odl \
83     --upload ${BUILD_DIR}/puppet-opendaylight-carbon.tar.gz:/etc/puppet/modules/ \
84     --run-command "cd /etc/puppet/modules/ && tar xzf puppet-opendaylight-carbon.tar.gz" \
85     --upload ${BUILD_DIR}/puppet-opendaylight-master.tar.gz:/root/ \
86     --upload ${BUILD_DIR}/puppet-opendaylight-nitrogen.tar.gz:/root/ \
87     --upload ${BUILD_DIR}/puppet-gluon.tar.gz:/etc/puppet/modules/ \
88     --run-command "cd /etc/puppet/modules/ && tar xzf puppet-gluon.tar.gz" \
89     --install python-click \
90     --upload ${CACHE_DIR}/$gluon_rpm:/root/\
91     --install /root/$gluon_rpm \
92     --run-command "yum downgrade -y python-zmq-14.3.1" \
93     --install capnproto-libs,capnproto \
94     --upload ${BUILD_ROOT}/patches/neutron-patch-NSDriver.patch:/usr/lib/python2.7/site-packages/ \
95     --upload ${CACHE_DIR}/opendaylight-7.0.0-0.1.20170531snap665.el7.noarch.rpm:/root/ \
96     -a overcloud-full-opendaylight_build.qcow2
97
98 # Arch dependent on x86
99 if [ "$(uname -i)" == 'x86_64' ]; then
100
101 # Download quagga/zrpc rpms
102 populate_cache http://artifacts.opnfv.org/apex/danube/quagga/quagga-3.tar.gz
103
104 LIBGUESTFS_BACKEND=direct virt-customize \
105     --install zeromq-4.1.4 \
106     --upload ${CACHE_DIR}/quagga-3.tar.gz:/root/ \
107     --run-command "cd /root/ && tar xzf quagga-3.tar.gz" \
108     --run-command "cd /root/quagga; packages=\$(ls |grep -vE 'debuginfo|devel|contrib'); yum -y install \$packages" \
109     --run-command "sudo usermod -a -G quaggavt quagga" \
110     -a overcloud-full-opendaylight_build.qcow2
111 fi
112
113 LIBGUESTFS_BACKEND=direct virt-sparsify --compress overcloud-full-opendaylight_build.qcow2 overcloud-full-opendaylight.qcow2
114 rm -f overcloud-full-opendaylight_build.qcow2
115 popd > /dev/null