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
35 git clone https://github.com/trozet/os-net-config.git -b stable/colorado
36 pushd os-net-config/os_net_config > /dev/null
37 git archive --format=tar.gz --prefix=os_net_config/ HEAD > ${BUILD_DIR}/os-net-config.tar.gz
41 for package in ${dpdk_rpms[@]}; do
42 wget "$dpdk_uri_base/$package"
43 dpdk_pkg_str+=" --upload ${BUILD_DIR}/${package}:/root/dpdk_rpms"
46 # tar up the congress puppet module
47 rm -rf puppet-congress
48 git clone https://github.com/openstack/puppet-congress
49 pushd puppet-congress > /dev/null
50 git archive --format=tar.gz --prefix=congress/ HEAD > ${BUILD_DIR}/puppet-congress.tar.gz
53 # tar up the fd.io module
55 git clone https://git.fd.io/puppet-fdio
56 pushd puppet-fdio > /dev/null
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/ HEAD > ${BUILD_DIR}/puppet-tacker.tar.gz
73 cat > ${BUILD_DIR}/fdio.repo << EOF
75 name=fd.io master branch latest merge
76 baseurl=https://nexus.fd.io/content/repositories/fd.io.master.centos7/
81 # Increase disk size by 500MB to accommodate more packages
82 qemu-img resize overcloud-full_build.qcow2 +500MB
84 # expand file system to max disk size
85 # installing forked opnfv-puppet-tripleo
86 # enable connection tracking for protocal sctp
87 # upload dpdk rpms but do not install
88 # enable connection tracking for protocal sctp
89 # install the congress rpms
90 # upload and explode the congress puppet module
91 # install fd.io yum repo and packages
93 # git clone vsperf into the overcloud image
94 # upload the tacker puppet module and untar it
96 LIBGUESTFS_BACKEND=direct virt-customize \
97 --run-command "xfs_growfs /dev/sda" \
98 --upload ${BUILD_DIR}/opnfv-puppet-tripleo.tar.gz:/etc/puppet/modules \
99 --run-command "yum update -y python-ipaddress rabbitmq-server erlang*" \
100 --run-command "if ! rpm -qa | grep python-redis; then yum install -y python-redis; fi" \
101 --run-command "sed -i 's/^#UseDNS.*$/UseDNS no/' /etc/ssh/sshd_config" \
102 --run-command "sed -i 's/^GSSAPIAuthentication.*$/GSSAPIAuthentication no/' /etc/ssh/sshd_config" \
103 --run-command "cd /etc/puppet/modules && rm -rf tripleo && tar xzf opnfv-puppet-tripleo.tar.gz" \
104 --run-command "echo 'nf_conntrack_proto_sctp' > /etc/modules-load.d/nf_conntrack_proto_sctp.conf" \
105 --run-command "mkdir /root/dpdk_rpms" \
106 --upload ${BUILD_DIR}/fdio.repo:/etc/yum.repos.d/fdio.repo \
108 --run-command "yum install --downloadonly --downloaddir=/root/fdio vpp vpp-devel vpp-lib vpp-python-api vpp-plugins" \
109 --upload ${BUILD_DIR}/noarch/$netvpp_pkg:/root/fdio \
110 --run-command "yum install -y etcd" \
111 --run-command "pip install python-etcd" \
112 --run-command "puppet module install cristifalcas/etcd" \
113 --run-command "yum update -y puppet" \
114 --install "centos-release-qemu-ev" \
115 --run-command "yum install -y qemu-kvm-ev-2.3.0-31.el7_2.21.1.x86_64" \
116 --run-command "yum remove -y qemu-system-x86" \
117 --upload ${BUILD_DIR}/os-net-config.tar.gz:/usr/lib/python2.7/site-packages \
118 --run-command "cd /usr/lib/python2.7/site-packages/ && rm -rf os_net_config && tar xzf os-net-config.tar.gz" \
119 --upload ${BUILD_DIR}/noarch/$congress_pkg:/root/ \
120 --install /root/$congress_pkg \
121 --install "python2-congressclient" \
122 --upload ${BUILD_DIR}/puppet-congress.tar.gz:/etc/puppet/modules/ \
123 --run-command "cd /etc/puppet/modules/ && tar xzf puppet-congress.tar.gz" \
124 --run-command "yum install -y /root/fdio/*.rpm" \
125 --run-command "rm -f /etc/sysctl.d/80-vpp.conf" \
127 --upload ${BUILD_DIR}/puppet-fdio.tar.gz:/etc/puppet/modules \
128 --run-command "cd /etc/puppet/modules && tar xzf puppet-fdio.tar.gz" \
129 --upload ${BUILD_DIR}/vsperf.tar.gz:/var/opt \
130 --run-command "cd /var/opt && tar xzf vsperf.tar.gz" \
131 --upload ${BUILD_DIR}/puppet-tacker.tar.gz:/etc/puppet/modules/ \
132 --run-command "cd /etc/puppet/modules/ && tar xzf puppet-tacker.tar.gz" \
133 --upload ${BUILD_DIR}/noarch/$tacker_pkg:/root/ \
134 --install /root/$tacker_pkg \
135 --upload ${BUILD_DIR}/noarch/$tackerclient_pkg:/root/ \
136 --install /root/$tackerclient_pkg \
137 --run-command "pip install python-senlinclient" \
138 --upload ${BUILD_ROOT}/neutron/agent/interface/interface.py:/usr/lib/python2.7/site-packages/neutron/agent/linux/ \
139 --run-command "mkdir /root/fdio_neutron_l3" \
140 --upload ${BUILD_ROOT}/neutron/agent/l3/namespaces.py:/root/fdio_neutron_l3/ \
141 --upload ${BUILD_ROOT}/neutron/agent/l3/router_info.py:/root/fdio_neutron_l3/ \
142 --upload ${BUILD_ROOT}/puppet-neutron/manifests/agents/ml2/networking-vpp.pp:/etc/puppet/modules/neutron/manifests/agents/ml2/ \
143 --upload ${BUILD_ROOT}/puppet-neutron/manifests/plugins/ml2/networking-vpp.pp:/etc/puppet/modules/neutron/manifests/plugins/ml2/ \
144 --upload ${BUILD_ROOT}/puppet-neutron/lib/puppet/type/neutron_agent_vpp.rb:/etc/puppet/modules/neutron/lib/puppet/type/ \
145 --mkdir /etc/puppet/modules/neutron/lib/puppet/provider/neutron_agent_vpp \
146 --upload ${BUILD_ROOT}/puppet-neutron/lib/puppet/provider/neutron_agent_vpp/ini_setting.rb:/etc/puppet/modules/neutron/lib/puppet/provider/neutron_agent_vpp/ \
147 --run-command "sed -i -E 's/timeout=[0-9]+/timeout=60/g' /usr/share/openstack-puppet/modules/rabbitmq/lib/puppet/provider/rabbitmqctl.rb" \
148 --upload ${BUILD_ROOT}/osc_auth_fix.diff:/tmp/ \
149 --run-command "cd /usr/lib/python2.7/site-packages/ && git apply /tmp/osc_auth_fix.diff" \
150 -a overcloud-full_build.qcow2
152 mv -f overcloud-full_build.qcow2 overcloud-full.qcow2