Ensures v4/v6 iptables filters are loaded
[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 -xe
11 source ./cache.sh
12 source ./variables.sh
13 source ./barometer-install.sh
14
15 populate_cache "$rdo_images_uri/overcloud-full.tar"
16
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
20
21 ##########################################################
22 #####  Prep initial overcloud image with common deps #####
23 ##########################################################
24
25 pushd ${BUILD_DIR} > /dev/null
26
27 # prep opnfv-puppet-tripleo for undercloud
28 python3 -B $BUILD_UTILS clone-fork -r apex-puppet-tripleo
29 pushd apex-puppet-tripleo > /dev/null
30 git archive --format=tar.gz --prefix=tripleo/ HEAD > ${BUILD_DIR}/apex-puppet-tripleo.tar.gz
31 popd > /dev/null
32
33 # download customized os-net-config
34 python3 -B $BUILD_UTILS clone-fork -r apex-os-net-config
35 pushd apex-os-net-config/os_net_config > /dev/null
36 git archive --format=tar.gz --prefix=os_net_config/ HEAD > ${BUILD_DIR}/apex-os-net-config.tar.gz
37 popd > /dev/null
38
39 # tar up vsperf
40 rm -rf vsperf vsperf.tar.gz
41 git clone https://gerrit.opnfv.org/gerrit/vswitchperf vsperf
42 tar czf vsperf.tar.gz vsperf
43
44 # Increase disk size by 1500MB to accommodate more packages
45 qemu-img resize overcloud-full_build.qcow2 +1500M
46
47 # expand file system to max disk size
48 # installing forked apex-puppet-tripleo
49 # upload neutron port data plane status
50 LIBGUESTFS_BACKEND=direct $VIRT_CUSTOMIZE \
51     --run-command "curl -f https://trunk.rdoproject.org/centos7-pike/delorean-deps.repo > /etc/yum.repos.d/delorean-deps.repo" \
52     --run-command "xfs_growfs /dev/sda" \
53     --upload ${BUILD_DIR}/apex-puppet-tripleo.tar.gz:/etc/puppet/modules \
54     --run-command "cd /etc/puppet/modules && rm -rf tripleo && tar xzf apex-puppet-tripleo.tar.gz" \
55     --upload ${BUILD_DIR}/apex-os-net-config.tar.gz:/usr/lib/python2.7/site-packages \
56     --run-command "cd /usr/lib/python2.7/site-packages/ && rm -rf os_net_config && tar xzf apex-os-net-config.tar.gz" \
57     --run-command "if ! rpm -qa | grep python-redis; then yum install -y python-redis; fi" \
58     --install epel-release \
59     --install unzip \
60     --upload ${BUILD_DIR}/vsperf.tar.gz:/var/opt \
61     --run-command "cd /var/opt && tar xzf vsperf.tar.gz" \
62     --run-command "sed -i -E 's/timeout=[0-9]+/timeout=60/g' /usr/share/openstack-puppet/modules/rabbitmq/lib/puppet/provider/rabbitmqctl.rb" \
63     --install patch \
64     --upload ${BUILD_ROOT}/patches/neutron_lib_dps.patch:/usr/lib/python2.7/site-packages/ \
65     --upload ${BUILD_ROOT}/patches/neutron_server_dps.patch:/usr/lib/python2.7/site-packages/ \
66     --upload ${BUILD_ROOT}/patches/neutron_openstacksdk_dps.patch:/usr/lib/python2.7/site-packages/ \
67     --upload ${BUILD_ROOT}/patches/neutron_openstackclient_dps.patch:/usr/lib/python2.7/site-packages/ \
68     --upload ${BUILD_ROOT}/patches/puppet-neutron-add-sfc.patch:/usr/share/openstack-puppet/modules/neutron/ \
69     --upload ${BUILD_ROOT}/patches/congress-parallel-execution.patch:/usr/lib/python2.7/site-packages/ \
70     --install openstack-utils \
71     -a overcloud-full_build.qcow2
72 #    --upload ${BUILD_ROOT}/patches/puppet-neutron-vpp-ml2-type_drivers-setting.patch:/usr/share/openstack-puppet/modules/neutron/ \
73 #    --run-command "cd /usr/share/openstack-puppet/modules/neutron && patch -p1 < puppet-neutron-vpp-ml2-type_drivers-setting.patch" \
74 #    --upload ${BUILD_ROOT}/patches/puppet-neutron-add-external_network_bridge-option.patch:/usr/share/openstack-puppet/modules/neutron/ \
75 #    --run-command "cd /usr/share/openstack-puppet/modules/neutron && patch -p1 < puppet-neutron-add-external_network_bridge-option.patch" \
76
77
78 # Arch dependent on x86
79 if [ "$(uname -i)" == 'x86_64' ]; then
80 dpdk_pkg_str=''
81 for package in ${dpdk_rpms[@]}; do
82   wget "$dpdk_uri_base/$package"
83   dpdk_pkg_str+=" --upload ${BUILD_DIR}/${package}:/root/dpdk_rpms"
84 done
85
86 # tar up the fd.io module
87 rm -rf puppet-fdio
88 git clone https://git.fd.io/puppet-fdio
89 pushd puppet-fdio > /dev/null
90 git archive --format=tar.gz --prefix=fdio/ HEAD > ${BUILD_DIR}/puppet-fdio.tar.gz
91 popd > /dev/null
92
93 # FD.IO Repo
94 cat > ${BUILD_DIR}/fdio.repo << EOF
95 [fdio-1710]
96 name=fd.io packages
97 baseurl=https://nexus.fd.io/content/repositories/fd.io.stable.1710.centos7/
98 enabled=1
99 gpgcheck=0
100 EOF
101
102 vpp_nosdn_pkg_str=''
103 for package in ${nosdn_vpp_rpms[@]}; do
104   wget $package
105   vpp_nosdn_pkg_str+=" --upload ${BUILD_DIR}/${package##*/}:/root/nosdn_vpp_rpms"
106 done
107
108 # Kubernetes Repo
109 cat > ${BUILD_DIR}/kubernetes.repo << EOF
110 [kubernetes]
111 name=Kubernetes
112 baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
113 enabled=1
114 gpgcheck=0
115 repo_gpgcheck=0
116 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
117         https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
118 EOF
119
120 # Get Real Time Kernel from kvm4nfv
121 populate_cache $kvmfornfv_uri_base/$kvmfornfv_kernel_rpm
122
123 # upload dpdk rpms but do not install
124 # install fd.io yum repo and packages
125 # upload puppet fdio
126 # git clone vsperf into the overcloud image
127 # upload the rt_kvm kernel
128 LIBGUESTFS_BACKEND=direct $VIRT_CUSTOMIZE \
129     --run-command "mkdir /root/dpdk_rpms" \
130     $dpdk_pkg_str \
131     --upload ${BUILD_DIR}/puppet-fdio.tar.gz:/etc/puppet/modules \
132     --run-command "cd /etc/puppet/modules && tar xzf puppet-fdio.tar.gz" \
133     --upload ${BUILD_DIR}/fdio.repo:/etc/yum.repos.d/ \
134     --run-command "mkdir /root/nosdn_vpp_rpms" \
135     $vpp_nosdn_pkg_str \
136     --upload ${BUILD_DIR}/kubernetes.repo:/etc/yum.repos.d/ \
137     --run-command "mkdir /root/fdio" \
138     --upload ${BUILD_DIR}/noarch/$netvpp_pkg:/root/nosdn_vpp_rpms \
139     --install honeycomb,vpp-plugins,vpp,vpp-lib,vpp-api-python \
140     --run-command "rm -f /etc/sysctl.d/80-vpp.conf" \
141     --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" \
142     --run-command "mkdir /root/ovs28" \
143     --run-command "yumdownloader --destdir=/root/ovs28 openvswitch*2.8* python-openvswitch-2.8*" \
144     --upload ${CACHE_DIR}/$kvmfornfv_kernel_rpm:/root/ \
145     --install python-etcd,puppet-etcd \
146     --install patch \
147     --install docker,kubelet,kubeadm,kubectl,kubernetes-cni \
148     -a overcloud-full_build.qcow2
149
150     # upload and install barometer packages
151     # FIXME collectd pkgs conflict during upgrade to Pike
152     # barometer_pkgs overcloud-full_build.qcow2
153
154 fi # end x86_64 specific items
155
156 mv -f overcloud-full_build.qcow2 overcloud-full.qcow2
157 popd > /dev/null