Merge "Fixes inserting ceph OSD into compute role"
[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 "xfs_growfs /dev/sda" \
52     --upload ${BUILD_DIR}/apex-puppet-tripleo.tar.gz:/etc/puppet/modules \
53     --run-command "cd /etc/puppet/modules && rm -rf tripleo && tar xzf apex-puppet-tripleo.tar.gz" \
54     --upload ${BUILD_DIR}/apex-os-net-config.tar.gz:/usr/lib/python2.7/site-packages \
55     --run-command "cd /usr/lib/python2.7/site-packages/ && rm -rf os_net_config && tar xzf apex-os-net-config.tar.gz" \
56     --run-command "if ! rpm -qa | grep python-redis; then yum install -y python-redis; fi" \
57     --install epel-release \
58     --install unzip \
59     --upload ${BUILD_DIR}/vsperf.tar.gz:/var/opt \
60     --run-command "cd /var/opt && tar xzf vsperf.tar.gz" \
61     --run-command "sed -i -E 's/timeout=[0-9]+/timeout=60/g' /usr/share/openstack-puppet/modules/rabbitmq/lib/puppet/provider/rabbitmqctl.rb" \
62     --install patch \
63     --upload ${BUILD_ROOT}/patches/neutron_lib_dps.patch:/usr/lib/python2.7/site-packages/ \
64     --upload ${BUILD_ROOT}/patches/neutron_server_dps.patch:/usr/lib/python2.7/site-packages/ \
65     --upload ${BUILD_ROOT}/patches/neutron_openstacksdk_dps.patch:/usr/lib/python2.7/site-packages/ \
66     --upload ${BUILD_ROOT}/patches/neutron_openstackclient_dps.patch:/usr/lib/python2.7/site-packages/ \
67     --upload ${BUILD_ROOT}/patches/puppet-neutron-add-sfc.patch:/usr/share/openstack-puppet/modules/neutron/ \
68     --upload ${BUILD_ROOT}/patches/congress-parallel-execution.patch:/usr/lib/python2.7/site-packages/ \
69     -a overcloud-full_build.qcow2
70 #    --upload ${BUILD_ROOT}/patches/puppet-neutron-vpp-ml2-type_drivers-setting.patch:/usr/share/openstack-puppet/modules/neutron/ \
71 #    --run-command "cd /usr/share/openstack-puppet/modules/neutron && patch -p1 < puppet-neutron-vpp-ml2-type_drivers-setting.patch" \
72 #    --upload ${BUILD_ROOT}/patches/puppet-neutron-add-external_network_bridge-option.patch:/usr/share/openstack-puppet/modules/neutron/ \
73 #    --run-command "cd /usr/share/openstack-puppet/modules/neutron && patch -p1 < puppet-neutron-add-external_network_bridge-option.patch" \
74
75
76 # Arch dependent on x86
77 if [ "$(uname -i)" == 'x86_64' ]; then
78 dpdk_pkg_str=''
79 for package in ${dpdk_rpms[@]}; do
80   wget "$dpdk_uri_base/$package"
81   dpdk_pkg_str+=" --upload ${BUILD_DIR}/${package}:/root/dpdk_rpms"
82 done
83
84 # tar up the fd.io module
85 rm -rf puppet-fdio
86 git clone https://git.fd.io/puppet-fdio
87 pushd puppet-fdio > /dev/null
88 git archive --format=tar.gz --prefix=fdio/ HEAD > ${BUILD_DIR}/puppet-fdio.tar.gz
89 popd > /dev/null
90
91 # FD.IO Repo
92 cat > ${BUILD_DIR}/fdio.repo << EOF
93 [fdio-1710]
94 name=fd.io packages
95 baseurl=https://nexus.fd.io/content/repositories/fd.io.stable.1710.centos7/
96 enabled=1
97 gpgcheck=0
98 EOF
99
100 vpp_nosdn_pkg_str=''
101 for package in ${nosdn_vpp_rpms[@]}; do
102   wget $package
103   vpp_nosdn_pkg_str+=" --upload ${BUILD_DIR}/${package##*/}:/root/nosdn_vpp_rpms"
104 done
105
106 # Kubernetes Repo
107 cat > ${BUILD_DIR}/kubernetes.repo << EOF
108 [kubernetes]
109 name=Kubernetes
110 baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
111 enabled=1
112 gpgcheck=1
113 repo_gpgcheck=1
114 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
115         https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
116 EOF
117
118 # Get Real Time Kernel from kvm4nfv
119 populate_cache $kvmfornfv_uri_base/$kvmfornfv_kernel_rpm
120
121 # upload dpdk rpms but do not install
122 # install fd.io yum repo and packages
123 # upload puppet fdio
124 # git clone vsperf into the overcloud image
125 # upload the rt_kvm kernel
126 LIBGUESTFS_BACKEND=direct $VIRT_CUSTOMIZE \
127     --run-command "mkdir /root/dpdk_rpms" \
128     $dpdk_pkg_str \
129     --upload ${BUILD_DIR}/puppet-fdio.tar.gz:/etc/puppet/modules \
130     --run-command "cd /etc/puppet/modules && tar xzf puppet-fdio.tar.gz" \
131     --upload ${BUILD_DIR}/fdio.repo:/etc/yum.repos.d/ \
132     --run-command "mkdir /root/nosdn_vpp_rpms" \
133     $vpp_nosdn_pkg_str \
134     --upload ${BUILD_DIR}/kubernetes.repo:/etc/yum.repos.d/ \
135     --run-command "mkdir /root/fdio" \
136     --upload ${BUILD_DIR}/noarch/$netvpp_pkg:/root/nosdn_vpp_rpms \
137     --install honeycomb,vpp-plugins,vpp,vpp-lib,vpp-api-python \
138     --run-command "rm -f /etc/sysctl.d/80-vpp.conf" \
139     --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" \
140     --run-command "mkdir /root/ovs28" \
141     --run-command "yumdownloader --destdir=/root/ovs28 openvswitch*2.8* python-openvswitch-2.8*" \
142     --upload ${CACHE_DIR}/$kvmfornfv_kernel_rpm:/root/ \
143     --install python-etcd,puppet-etcd \
144     --install patch \
145     --install docker,kubelet,kubeadm,kubectl,kubernetes-cni \
146     -a overcloud-full_build.qcow2
147
148     # upload and install barometer packages
149     # FIXME collectd pkgs conflict during upgrade to Pike
150     # barometer_pkgs overcloud-full_build.qcow2
151
152 fi # end x86_64 specific items
153
154 mv -f overcloud-full_build.qcow2 overcloud-full.qcow2
155 popd > /dev/null