Updates FD.IO ODL scenarios to use Carbon ODL version
[apex.git] / build / overcloud-full.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 source ./functions.sh
14
15 populate_cache "$rdo_images_uri/overcloud-full.tar"
16
17 if [ ! -d images/ ]; then mkdir images; fi
18 tar -xf cache/overcloud-full.tar -C images/
19 mv -f images/overcloud-full.qcow2 images/overcloud-full_build.qcow2
20
21 ##########################################################
22 #####  Prep initial overcloud image with common deps #####
23 ##########################################################
24
25 # prep opnfv-puppet-tripleo for undercloud
26 clone_fork opnfv-puppet-tripleo
27 pushd opnfv-puppet-tripleo > /dev/null
28 git archive --format=tar.gz --prefix=tripleo/ HEAD > ../opnfv-puppet-tripleo.tar.gz
29 popd > /dev/null
30
31 # download customized os-net-config
32 rm -fr os-net-config
33 git clone https://github.com/trozet/os-net-config.git -b stable/colorado
34 pushd os-net-config > /dev/null
35 pushd os_net_config > /dev/null
36 git archive --format=tar.gz --prefix=os_net_config/ HEAD > ../../os-net-config.tar.gz
37 popd > /dev/null
38 popd > /dev/null
39
40 pushd images > /dev/null
41
42 dpdk_pkg_str=''
43 for package in ${dpdk_rpms[@]}; do
44   wget "$dpdk_uri_base/$package"
45   dpdk_pkg_str+=" --upload $package:/root/dpdk_rpms"
46 done
47
48 # tar up the congress puppet module
49 rm -rf puppet-congress
50 git clone -b stable/mitaka https://github.com/radez/puppet-congress
51 pushd puppet-congress > /dev/null
52 git archive --format=tar.gz --prefix=congress/ origin/stable/mitaka > ../puppet-congress.tar.gz
53 popd > /dev/null
54
55 # create fd.io yum repo file
56 #cat > /tmp/fdio-master.repo << EOF
57 #[fdio-master]
58 #name=fd.io master branch latest merge
59 #baseurl=https://nexus.fd.io/content/repositories/fd.io.master.centos7/
60 #enabled=1
61 #gpgcheck=0
62 #EOF
63
64 # tar up the fd.io module
65 rm -rf puppet-fdio
66 git clone https://github.com/radez/puppet-fdio
67 pushd puppet-fdio > /dev/null
68 git archive --format=tar.gz --prefix=fdio/ HEAD > ../puppet-fdio.tar.gz
69 popd > /dev/null
70
71 # tar up vsperf
72 rm -rf vsperf vsperf.tar.gz
73 git clone https://gerrit.opnfv.org/gerrit/vswitchperf vsperf
74 tar czf vsperf.tar.gz vsperf
75
76 # tar up the tacker puppet module
77 rm -rf puppet-tacker
78 # TODO move this back to radez puppet-tacker after PR is accepted
79 git clone -b fix_db_sync https://github.com/trozet/puppet-tacker
80 pushd puppet-tacker > /dev/null
81 git archive --format=tar.gz --prefix=tacker/ HEAD > ../puppet-tacker.tar.gz
82 popd > /dev/null
83
84 # Master FD.IO Repo
85 cat > /tmp/fdio.repo << EOF
86 [fdio-master]
87 name=fd.io master branch latest merge
88 baseurl=https://nexus.fd.io/content/repositories/fd.io.master.centos7/
89 enabled=1
90 gpgcheck=0
91 EOF
92
93 # Increase disk size by 500MB to accommodate more packages
94 qemu-img resize overcloud-full_build.qcow2 +500MB
95
96 # expand file system to max disk size
97 # installing forked opnfv-puppet-tripleo
98 # enable connection tracking for protocal sctp
99 # upload dpdk rpms but do not install
100 # enable connection tracking for protocal sctp
101 # install the congress rpms
102 # upload and explode the congress puppet module
103 # install doctor driver ## Can be removed in Newton
104 # install fd.io yum repo and packages
105 # upload puppet fdio
106 # git clone vsperf into the overcloud image
107 # upload the tacker puppet module and untar it
108 LIBGUESTFS_BACKEND=direct virt-customize \
109     --run-command "xfs_growfs /dev/sda" \
110     --upload ../opnfv-puppet-tripleo.tar.gz:/etc/puppet/modules \
111     --run-command "yum update -y python-ipaddress rabbitmq-server erlang*" \
112     --run-command "if ! rpm -qa | grep python-redis; then yum install -y python-redis; fi" \
113     --run-command "sed -i 's/^#UseDNS.*$/UseDNS no/' /etc/ssh/sshd_config" \
114     --run-command "sed -i 's/^GSSAPIAuthentication.*$/GSSAPIAuthentication no/' /etc/ssh/sshd_config" \
115     --run-command "cd /etc/puppet/modules && rm -rf tripleo && tar xzf opnfv-puppet-tripleo.tar.gz" \
116     --run-command "echo 'nf_conntrack_proto_sctp' > /etc/modules-load.d/nf_conntrack_proto_sctp.conf" \
117     --run-command "mkdir /root/dpdk_rpms" \
118     --upload /tmp/fdio.repo:/etc/yum.repos.d/fdio.repo \
119     $dpdk_pkg_str \
120     --run-command "yum install --downloadonly --downloaddir=/root/fdio vpp vpp-devel vpp-lib vpp-python-api vpp-plugins" \
121     --upload ../networking-vpp.noarch.rpm:/root/fdio \
122     --run-command "pip install distro flask_restful" \
123     --run-command "yum install -y etcd" \
124     --run-command "pip install python-etcd" \
125     --run-command "puppet module install cristifalcas/etcd" \
126     --run-command "yum update -y puppet" \
127     --install "centos-release-qemu-ev" \
128     --run-command "yum install -y qemu-kvm-ev-2.3.0-31.el7_2.21.1.x86_64" \
129     --run-command "yum remove -y qemu-system-x86" \
130     --upload ../os-net-config.tar.gz:/usr/lib/python2.7/site-packages \
131     --run-command "cd /usr/lib/python2.7/site-packages/ && rm -rf os_net_config && tar xzf os-net-config.tar.gz" \
132     --upload ../noarch/$openstack_congress_pkg:/root/ \
133     --install /root/$openstack_congress_pkg \
134     --install "python2-congressclient" \
135     --upload puppet-congress.tar.gz:/etc/puppet/modules/ \
136     --run-command "cd /etc/puppet/modules/ && tar xzf puppet-congress.tar.gz" \
137     --run-command "cd /usr/lib/python2.7/site-packages/congress/datasources && curl -O $doctor_driver" \
138     --run-command "yum install -y /root/fdio/*.rpm" \
139     --run-command "rm -f /etc/sysctl.d/80-vpp.conf" \
140     --install unzip \
141     --upload puppet-fdio.tar.gz:/etc/puppet/modules \
142     --run-command "cd /etc/puppet/modules && tar xzf puppet-fdio.tar.gz" \
143     --upload vsperf.tar.gz:/var/opt \
144     --run-command "cd /var/opt && tar xzf vsperf.tar.gz" \
145     --upload puppet-tacker.tar.gz:/etc/puppet/modules/ \
146     --run-command "cd /etc/puppet/modules/ && tar xzf puppet-tacker.tar.gz" \
147     --run-command "pip install python-senlinclient" \
148     --upload ../neutron/agent/interface/interface.py:/usr/lib/python2.7/site-packages/neutron/agent/linux/ \
149     --run-command "mkdir /root/fdio_neutron_l3" \
150     --upload ../neutron/agent/l3/namespaces.py:/root/fdio_neutron_l3/ \
151     --upload ../neutron/agent/l3/router_info.py:/root/fdio_neutron_l3/ \
152     --upload ../puppet-neutron/manifests/agents/ml2/networking-vpp.pp:/etc/puppet/modules/neutron/manifests/agents/ml2/ \
153     --upload ../puppet-neutron/manifests/plugins/ml2/networking-vpp.pp:/etc/puppet/modules/neutron/manifests/plugins/ml2/ \
154     --upload ../puppet-neutron/lib/puppet/type/neutron_agent_vpp.rb:/etc/puppet/modules/neutron/lib/puppet/type/ \
155     --mkdir /etc/puppet/modules/neutron/lib/puppet/provider/neutron_agent_vpp \
156     --upload ../puppet-neutron/lib/puppet/provider/neutron_agent_vpp/ini_setting.rb:/etc/puppet/modules/neutron/lib/puppet/provider/neutron_agent_vpp/ \
157     -a overcloud-full_build.qcow2
158
159 rm -rf ovs_nsh_patches
160 rm -rf ovs
161 git clone https://github.com/yyang13/ovs_nsh_patches.git
162 git clone https://github.com/openvswitch/ovs.git
163 pushd ovs > /dev/null
164 git reset --hard 7d433ae57ebb90cd68e8fa948a096f619ac4e2d8
165 cp ../ovs_nsh_patches/*.patch ./
166 # Hack for build servers that have no git config
167 git config user.email "apex@opnfv.com"
168 git config user.name "apex"
169 git am *.patch
170 popd > /dev/null
171 tar czf ovs.tar.gz ovs
172
173 # BUILD NSH OVS
174 LIBGUESTFS_BACKEND=direct virt-customize \
175     --upload ../build_ovs_nsh.sh:/root/ \
176     --upload ovs.tar.gz:/root/ \
177     --run-command "cd /root/ && tar xzf ovs.tar.gz" \
178     --run-command "cd /root/ovs && /root/build_ovs_nsh.sh" \
179     -a overcloud-full_build.qcow2
180
181 mv -f overcloud-full_build.qcow2 overcloud-full.qcow2
182 popd > /dev/null