DPDK package fixes
[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 # Add extra space to the overcloud image
22 qemu-img resize images/overcloud-full_build.qcow2 +1G
23 LIBGUESTFS_BACKEND=direct virt-customize -a images/overcloud-full_build.qcow2 \
24                                          --run-command 'resize2fs /dev/sda'
25
26 ##########################################################
27 #####  Prep initial overcloud image with common deps #####
28 ##########################################################
29
30 # prep opnfv-puppet-tripleo for undercloud
31 clone_fork opnfv-puppet-tripleo
32 pushd opnfv-puppet-tripleo > /dev/null
33 git archive --format=tar.gz --prefix=tripleo/ HEAD > ../opnfv-puppet-tripleo.tar.gz
34 popd > /dev/null
35
36 # download customized os-net-config
37 rm -fr os-net-config
38 git clone https://github.com/trozet/os-net-config.git -b stable/colorado
39 pushd os-net-config > /dev/null
40 pushd os_net_config > /dev/null
41 git archive --format=tar.gz --prefix=os_net_config/ HEAD > ../../os-net-config.tar.gz
42 popd > /dev/null
43 popd > /dev/null
44
45 pushd images > /dev/null
46
47 dpdk_pkg_str=''
48 for package in ${dpdk_rpms[@]}; do
49   wget "$dpdk_uri_base/$package"
50   dpdk_pkg_str+=" --upload $package:/root/dpdk_rpms"
51 done
52
53 # tar up the congress puppet module
54 rm -rf puppet-congress
55 git clone -b stable/mitaka https://github.com/radez/puppet-congress
56 pushd puppet-congress > /dev/null
57 git archive --format=tar.gz --prefix=congress/ origin/stable/mitaka > ../puppet-congress.tar.gz
58 popd > /dev/null
59
60 # create fd.io yum repo file
61 #cat > /tmp/fdio-master.repo << EOF
62 #[fdio-master]
63 #name=fd.io master branch latest merge
64 #baseurl=https://nexus.fd.io/content/repositories/fd.io.master.centos7/
65 #enabled=1
66 #gpgcheck=0
67 #EOF
68
69 # tar up the fd.io module
70 rm -rf puppet-fdio
71 git clone https://github.com/radez/puppet-fdio
72 pushd puppet-fdio > /dev/null
73 git archive --format=tar.gz --prefix=fdio/ HEAD > ../puppet-fdio.tar.gz
74 popd > /dev/null
75
76 # tar up vsperf
77 rm -rf vsperf vsperf.tar.gz
78 git clone https://gerrit.opnfv.org/gerrit/vswitchperf vsperf
79 tar czf vsperf.tar.gz vsperf
80
81 # tar up the tacker puppet module
82 rm -rf puppet-tacker
83 # TODO move this back to radez puppet-tacker after PR is accepted
84 git clone -b fix_db_sync https://github.com/trozet/puppet-tacker
85 pushd puppet-tacker > /dev/null
86 git archive --format=tar.gz --prefix=tacker/ HEAD > ../puppet-tacker.tar.gz
87 popd > /dev/null
88
89 # installing forked opnfv-puppet-tripleo
90 # enable connection tracking for protocal sctp
91 # upload dpdk rpms but do not install
92 # enable connection tracking for protocal sctp
93 # install the congress rpms
94 # upload and explode the congress puppet module
95 # install doctor driver ## Can be removed in Newton
96 # install fd.io yum repo and packages
97 # upload puppet fdio
98 # git clone vsperf into the overcloud image
99 # upload the tacker puppet module and untar it
100 LIBGUESTFS_BACKEND=direct virt-customize \
101     --upload ../opnfv-puppet-tripleo.tar.gz:/etc/puppet/modules \
102     --run-command "if ! rpm -qa | grep python-redis; then yum install -y python-redis; fi" \
103     --run-command "sed -i 's/^#UseDNS.*$/UseDNS no/' /etc/ssh/sshd_config" \
104     --run-command "sed -i 's/^GSSAPIAuthentication.*$/GSSAPIAuthentication no/' /etc/ssh/sshd_config" \
105     --run-command "cd /etc/puppet/modules && rm -rf tripleo && tar xzf opnfv-puppet-tripleo.tar.gz" \
106     --run-command "echo 'nf_conntrack_proto_sctp' > /etc/modules-load.d/nf_conntrack_proto_sctp.conf" \
107     --run-command "mkdir /root/dpdk_rpms" \
108     $dpdk_pkg_str \
109     --install "centos-release-qemu-ev" \
110     --run-command "yum update -y" \
111     --run-command "yum remove -y qemu-system-x86" \
112     --upload ../os-net-config.tar.gz:/usr/lib/python2.7/site-packages \
113     --run-command "cd /usr/lib/python2.7/site-packages/ && rm -rf os_net_config && tar xzf os-net-config.tar.gz" \
114     --upload ../noarch/openstack-congress-2016.1-1.el7.centos.noarch.rpm:/root/ \
115     --install /root/openstack-congress-2016.1-1.el7.centos.noarch.rpm \
116     --install "python2-congressclient" \
117     --upload puppet-congress.tar.gz:/etc/puppet/modules/ \
118     --run-command "cd /etc/puppet/modules/ && tar xzf puppet-congress.tar.gz" \
119     --run-command "cd /usr/lib/python2.7/site-packages/congress/datasources && curl -O $doctor_driver" \
120     --run-command "sed -i \"s/'--detailed-exitcodes',/'--detailed-exitcodes','-l','syslog','-l','console',/g\" /var/lib/heat-config/hooks/puppet" \
121     --upload ../vpp-bin.tar.gz:/root \
122     --run-command "cd /root && tar zxvf vpp-bin.tar.gz" \
123     --run-command "yum install -y /root/vpp-bin/*.rpm" \
124     --run-command "tar zxvf /root/vpp-bin/vpp_papi*.tar.gz -C /" \
125     --install unzip \
126     --upload puppet-fdio.tar.gz:/etc/puppet/modules \
127     --run-command "cd /etc/puppet/modules && tar xzf puppet-fdio.tar.gz" \
128     --upload vsperf.tar.gz:/var/opt \
129     --run-command "cd /var/opt && tar xzf vsperf.tar.gz" \
130     --upload ../noarch/python-tackerclient-2015.2-1.trozet.noarch.rpm:/root/ \
131     --install /root/python-tackerclient-2015.2-1.trozet.noarch.rpm \
132     --upload ../noarch/openstack-tacker-2015.2-1.trozet.noarch.rpm:/root/ \
133     --install /root/openstack-tacker-2015.2-1.trozet.noarch.rpm \
134     --upload puppet-tacker.tar.gz:/etc/puppet/modules/ \
135     --run-command "cd /etc/puppet/modules/ && tar xzf puppet-tacker.tar.gz" \
136     --run-command "yum install -y https://dl.dropboxusercontent.com/u/7079970/rabbitmq-server-3.6.3-5.el7ost.noarch.rpm" \
137     --run-command "pip install python-senlinclient" \
138     -a overcloud-full_build.qcow2
139
140 mv -f overcloud-full_build.qcow2 overcloud-full.qcow2
141 popd > /dev/null