2 ##############################################################################
3 # Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others.
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 ##############################################################################
15 populate_cache "$rdo_images_uri/overcloud-full.tar"
17 if [ ! -d ${BUILD_DIR} ]; then mkdir ${BUILD_DIR}; fi
18 tar -xf ${CACHE_DIR}/overcloud-full.tar -C ${BUILD_DIR}/
19 mv -f ${BUILD_DIR}/overcloud-full.qcow2 ${BUILD_DIR}/overcloud-full_build.qcow2
21 ##########################################################
22 ##### Prep initial overcloud image with common deps #####
23 ##########################################################
25 pushd ${BUILD_DIR} > /dev/null
27 # prep opnfv-puppet-tripleo for undercloud
28 clone_fork opnfv-puppet-tripleo
29 pushd opnfv-puppet-tripleo > /dev/null
30 git archive --format=tar.gz --prefix=tripleo/ HEAD > ${BUILD_DIR}/opnfv-puppet-tripleo.tar.gz
33 # download customized os-net-config
34 clone_fork os-net-config
35 pushd os-net-config/os_net_config > /dev/null
36 git archive --format=tar.gz --prefix=os_net_config/ HEAD > ${BUILD_DIR}/os-net-config.tar.gz
40 for package in ${dpdk_rpms[@]}; do
41 wget "$dpdk_uri_base/$package"
42 dpdk_pkg_str+=" --upload ${BUILD_DIR}/${package}:/root/dpdk_rpms"
45 # tar up the congress puppet module
46 rm -rf puppet-congress
47 git clone https://github.com/openstack/puppet-congress
48 pushd puppet-congress > /dev/null
49 git archive --format=tar.gz --prefix=congress/ HEAD > ${BUILD_DIR}/puppet-congress.tar.gz
52 # tar up the fd.io module
54 git clone https://git.fd.io/puppet-fdio
55 pushd puppet-fdio > /dev/null
56 git checkout 4a9d6b863d1c77af21a1c5ea278c8cba3386a45f
57 git archive --format=tar.gz --prefix=fdio/ HEAD > ${BUILD_DIR}/puppet-fdio.tar.gz
61 rm -rf vsperf vsperf.tar.gz
62 git clone https://gerrit.opnfv.org/gerrit/vswitchperf vsperf
63 tar czf vsperf.tar.gz vsperf
65 # tar up the tacker puppet module
67 git clone https://github.com/openstack/puppet-tacker
68 pushd puppet-tacker > /dev/null
69 git archive --format=tar.gz --prefix=tacker/ origin/stable/ocata > ${BUILD_DIR}/puppet-tacker.tar.gz
72 # tar up the ovn puppet module
74 git clone https://github.com/openstack/puppet-ovn
75 pushd puppet-ovn > /dev/null
76 git archive --format=tar.gz --prefix=ovn/ origin/stable/ocata > ${BUILD_DIR}/puppet-ovn.tar.gz
79 # Get Real Time Kernel from kvm4nfv
80 populate_cache $kvmfornfv_uri_base/$kvmfornfv_kernel_rpm
82 # packages frozen for fdio scenarios
84 for package in ${fdio_pkgs[@]}; do
86 fdio_pkg_str+=" --upload ${BUILD_DIR}/${package##*/}:/root/fdio/"
91 git clone https://github.com/openstack/tosca-parser
92 tar czf tosca-parser.tar.gz tosca-parser
95 rm -rf heat-translator
96 git clone https://github.com/openstack/heat-translator
97 tar czf heat-translator.tar.gz heat-translator
99 # Increase disk size by 900MB to accommodate more packages
100 qemu-img resize overcloud-full_build.qcow2 +900MB
102 # expand file system to max disk size
103 # installing forked opnfv-puppet-tripleo
104 # upload dpdk rpms but do not install
105 # install the congress rpms
106 # upload and explode the congress puppet module
107 # install fd.io yum repo and packages
109 # git clone vsperf into the overcloud image
110 # upload the tacker puppet module and untar it
112 # upload the rt_kvm kernel
113 LIBGUESTFS_BACKEND=direct virt-customize \
114 --run-command "xfs_growfs /dev/sda" \
115 --upload ${BUILD_DIR}/opnfv-puppet-tripleo.tar.gz:/etc/puppet/modules \
116 --run-command "cd /etc/puppet/modules && rm -rf tripleo && tar xzf opnfv-puppet-tripleo.tar.gz" \
117 --run-command "yum update -y python-ipaddress rabbitmq-server erlang*" \
118 --run-command "if ! rpm -qa | grep python-redis; then yum install -y python-redis; fi" \
119 --run-command "sed -i 's/^#UseDNS.*$/UseDNS no/' /etc/ssh/sshd_config" \
120 --run-command "sed -i 's/^GSSAPIAuthentication.*$/GSSAPIAuthentication no/' /etc/ssh/sshd_config" \
121 --run-command "mkdir /root/dpdk_rpms" \
123 --run-command "mkdir /root/fdio" \
124 --upload ${BUILD_DIR}/noarch/$netvpp_pkg:/root/fdio \
126 --run-command "yum install -y /root/fdio/*.rpm" \
127 --run-command "yum install -y etcd" \
128 --install python-etcd \
129 --run-command "puppet module install cristifalcas/etcd" \
130 --run-command "yum update -y puppet" \
131 --install "centos-release-qemu-ev" \
132 --run-command "yum install -y qemu-kvm-ev-2.3.0-31.el7_2.21.1.x86_64" \
133 --run-command "yum remove -y qemu-system-x86" \
134 --upload ${BUILD_DIR}/os-net-config.tar.gz:/usr/lib/python2.7/site-packages \
135 --run-command "cd /usr/lib/python2.7/site-packages/ && rm -rf os_net_config && tar xzf os-net-config.tar.gz" \
136 --upload ${BUILD_DIR}/noarch/$congress_pkg:/root/ \
137 --install /root/$congress_pkg \
138 --install "python2-congressclient" \
139 --upload ${BUILD_DIR}/puppet-congress.tar.gz:/etc/puppet/modules/ \
140 --run-command "cd /etc/puppet/modules/ && tar xzf puppet-congress.tar.gz" \
141 --run-command "rm -f /etc/sysctl.d/80-vpp.conf" \
143 --upload ${BUILD_DIR}/puppet-fdio.tar.gz:/etc/puppet/modules \
144 --run-command "cd /etc/puppet/modules && tar xzf puppet-fdio.tar.gz" \
145 --upload ${BUILD_DIR}/vsperf.tar.gz:/var/opt \
146 --run-command "cd /var/opt && tar xzf vsperf.tar.gz" \
147 --upload ${BUILD_DIR}/puppet-tacker.tar.gz:/etc/puppet/modules/ \
148 --run-command "cd /etc/puppet/modules/ && tar xzf puppet-tacker.tar.gz" \
149 --upload ${BUILD_DIR}/noarch/$tacker_pkg:/root/ \
150 --install /root/$tacker_pkg \
151 --upload ${BUILD_DIR}/noarch/$tackerclient_pkg:/root/ \
152 --install /root/$tackerclient_pkg \
153 --upload ${BUILD_DIR}/tosca-parser.tar.gz:/root/ \
154 --run-command "cd /root/ && tar xzf tosca-parser.tar.gz" \
155 --run-command "cd /root/tosca-parser && python setup.py build && python setup.py install" \
156 --upload ${BUILD_DIR}/heat-translator.tar.gz:/root/ \
157 --run-command "cd /root/ && tar xzf heat-translator.tar.gz" \
158 --run-command "cd /root/heat-translator && python setup.py build && python setup.py install" \
159 --upload ${BUILD_DIR}/puppet-ovn.tar.gz:/etc/puppet/modules/ \
160 --run-command "cd /etc/puppet/modules/ && rm -fr ovn && tar xzf puppet-ovn.tar.gz" \
161 --run-command "curl -f https://copr.fedorainfracloud.org/coprs/leifmadsen/ovs-master/repo/epel-7/leifmadsen-ovs-master-epel-7.repo > /etc/yum.repos.d/leifmadsen-ovs-master-epel-7.repo" \
162 --run-command "mkdir /root/ovs27" \
163 --run-command "yumdownloader --destdir=/root/ovs27 openvswitch*2.7* python-openvswitch-2.7*" \
164 --run-command "pip install python-senlinclient" \
165 --run-command "sed -i -E 's/timeout=[0-9]+/timeout=60/g' /usr/share/openstack-puppet/modules/rabbitmq/lib/puppet/provider/rabbitmqctl.rb" \
166 --upload ${CACHE_DIR}/$kvmfornfv_kernel_rpm:/root/ \
167 --upload ${BUILD_ROOT}/patches/puppet-neutron-vpp-ml2.patch:/usr/share/openstack-puppet/modules/neutron/ \
168 --run-command "cd /usr/share/openstack-puppet/modules/neutron && patch -p1 < puppet-neutron-vpp-ml2.patch" \
169 --upload ${BUILD_ROOT}/patches/puppet-neutron-vpp-ml2-type_drivers-setting.patch:/usr/share/openstack-puppet/modules/neutron/ \
170 --run-command "cd /usr/share/openstack-puppet/modules/neutron && patch -p1 < puppet-neutron-vpp-ml2-type_drivers-setting.patch" \
171 --install python2-networking-sfc \
172 -a overcloud-full_build.qcow2
174 mv -f overcloud-full_build.qcow2 overcloud-full.qcow2