3 # vim: ts=4 sw=4 sts=4 et tw=72 :
7 # RH Install build tools
8 echo "---> Installing RH build tools $(date +'%Y%m%dT%H%M%S')"
9 RH_TOOLS_PKGS="@development redhat-lsb glibc-static \
10 java-1.8.0-openjdk-devel yum-utils openssl-devel apr-devel indent rpm"
11 yum install -y ${RH_TOOLS_PKGS}
13 # Memory leakage checks
14 yum install -y valgrind
16 # RH Install Python dependencies
17 ###REMOVED mysql-devel
18 echo "---> Installing RH Python dependencies $(date +'%Y%m%dT%H%M%S')"
19 RH_PYTHON_PKGS="python-devel python-virtualenv python-setuptools \
20 python-pip kernel-devel"
21 yum install -y ${RH_PYTHON_PKGS}
23 # RH Install Documentation packages
24 ###Removed python-pyparsing
25 echo "---> Installing RH documentation packages $(date +'%Y%m%dT%H%M%S')"
26 RH_DOC_PKGS="doxygen graphviz python-jinja2 asciidoc \
27 dblatex source-highlight python-sphinx libxml2 libffi-devel python-cffi"
28 yum install -y install ${RH_DOC_PKGS}
30 # RH Install GCC packages
31 echo "---> Installing RH GCC packages $(date +'%Y%m%dT%H%M%S')"
32 RH_GCC_PKGS="cpp gcc c++ cmake make"
33 yum install -y ${RH_GCC_PKGS}
35 # RH Install components to build Ganglia modules
36 echo "---> Installing RH components $(date +'%Y%m%dT%H%M%S')"
37 RH_GANGLIA_MODS="libconfuse-devel ganglia-devel mock"
38 yum install -y --enablerepo=epel ${RH_GANGLIA_MODS}
40 # RH Install module for VPP project
41 echo uio_pci_generic >> /etc/modules
43 # RH Install VPP packages to shorten build times
44 echo "---> Installing VPP dependencies $(date +'%Y%m%dT%H%M%S')"
45 RH_VPP_PKGS="curl autoconf automake bison ccache dkms git libtool \
46 libconfuse-dev git-review cscope"
47 yum install -y ${RH_VPP_PKGS}
49 yum groupinstall "Development Tools"
50 # RH Install TLDK dependencies
51 RH_TLKD_PKGS="libpcap-devel libcap-devel scapy"
52 yum install -y ${RH_TLKD_PKGS}
54 # RH Install Puppet packages
55 PUPPET_PKGS="libxml2-devel libxslt-devel ruby-devel zlib-devel"
56 yum install -y ${PUPPET_PKGS}
58 # RH Install debuginfo packages
59 #echo "---> Installing debug packages $(date +'%Y%m%dT%H%M%S')"
60 #RH_DEBUG_PKGS="glibc openssl-libs zlib"
61 #debuginfo-install -y ${RH_DEBUG_PKGS}
63 # # RH Packer builds happen from the centos flavor images
64 # PACKERDIR=$(mktemp -d)
65 # # disable double quote checking
66 # # shellcheck disable=SC2086
68 # wget https://releases.hashicorp.com/packer/0.10.1/packer_0.10.1_linux_amd64.zip
69 # unzip packer_0.10.1_linux_amd64.zip -d /usr/local/bin/
70 # # rename packer to avoid conflicts with cracklib
71 # mv /usr/local/bin/packer /usr/local/bin/packer.io
73 # # cleanup from the installation
74 # # disable double quote checking
75 # # shellcheck disable=SC2086
77 # # cleanup from previous install process
78 # if [ -d /tmp/packer ]
86 # DEB add Toolchain repo
87 sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
89 #Configuring thirdparty Nexus repo
90 echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/thirdparty ./" > /etc/apt/sources.list.d/FD.io.thirdparty.list
92 # DEB Install PPA packages
93 echo "---> Adding '$1' PPA $(date +'%Y%m%dT%H%M%S')"
94 dpkg -l software-properties-common > /dev/null 2>&1 || software-properties-common
96 listfile=$(perl -e "print(q{$1} =~ m{^ppa:(.+)/ppa})")-ppa-${CODENAME}.list
97 if [ ! -f /etc/apt/sources.list.d/${listfile} ]
99 do_retry sudo apt-add-repository -y $1
105 echo "---> Installing cloud packages $(date +'%Y%m%dT%H%M%S')"
106 CLOUD_PKGS="cloud-initramfs-dyn-netconf cloud-initramfs-growroot \
107 cloud-initramfs-rescuevol"
108 apt install -y ${CLOUD_PKGS}
110 # DEB Install Python dependencies
111 echo "---> Installing Python dependencies $(date +'%Y%m%dT%H%M%S')"
112 PYTHON_PKGS="python-dev python-virtualenv python-setuptools python-pip \
113 libssl-dev libmysqlclient-dev python2.7 libffi-dev python-cffi"
114 apt install -y ${PYTHON_PKGS}
116 # Memory leakage checks
117 apt install -y valgrind
119 # DEB Install Documentation packages
120 echo "---> Installing documentation packages $(date +'%Y%m%dT%H%M%S')"
121 DOC_PKGS="doxygen graphviz python-pyparsing python-jinja2 asciidoc \
122 dblatex source-highlight"
123 apt install -y ${DOC_PKGS}
125 # DEB Install the correct version of toolchain packages
126 echo "---> Installing latest toolchain packages from PPA $(date +'%Y%m%dT%H%M%S')"
128 #Retry to prevent timeout failure
129 #echo "---> Updating package index $(date +'%Y%m%dT%H%M%S')"
130 #do_retry sudo apt-get update
131 #echo "<--- Updating package index $(date +'%Y%m%dT%H%M%S')"
132 #echo "<--- Adding '$1' PPA $(date +'%Y%m%dT%H%M%S')"
134 # DEB Install GCC packages
135 echo "---> Installing GCC-5 packages $(date +'%Y%m%dT%H%M%S')"
136 GCC_PKGS="cpp gcc g++ cmake lcov gcc-multilib"
137 apt install -y ${GCC_PKGS}
139 # DEB Install VPP packages to shorten build times
140 echo "---> Installing VPP DEB_DEPENDS packages $(date +'%Y%m%dT%H%M%S')"
141 VPP_PKGS="curl build-essential autoconf automake bison libssl-dev ccache \
142 debhelper dkms git libtool libganglia1-dev libapr1-dev dh-systemd \
143 libconfuse-dev git-review exuberant-ctags cscope indent pkg-config emacs"
144 apt install -y ${VPP_PKGS}
146 # DEB Install CSIT packages
147 CSIT_PKGS="libxml2 libxml2-dev libxslt-dev zlib1g-dev bc unzip"
148 apt install -y ${CSIT_PKGS}
150 # DEB Install latest kernel and uio
151 echo "---> Installing kernel image and header packages $(date +'%Y%m%dT%H%M%S')"
152 DEB_PKGS="linux-image-extra-virtual linux-headers-virtual linux-headers-`uname -r`"
153 apt install -y ${DEB_PKGS}
155 # DEB Install deb_dpdk packages to shorten build times
156 ###REMOVED sphinx-rtd-theme
157 echo "---> Installing deb_dpdk packages $(date +'%Y%m%dT%H%M%S')"
158 DEB_DPDK_PKGS="google-mock lsb-release dpkg-dev debian-xcontrol devscripts \
159 pristine-tar dh-python python-sphinx libpcap0.8-dev libstdc++5 \
160 python-scapy inkscape libxen-dev libxenstore3.0 python-sphinx-rtd-theme"
161 apt install -y ${DEB_DPDK_PKGS}
163 sudo apt install -y libcap-dev libpcap-dev
165 TEXLIVE_PKGS="texlive-fonts-recommended tex-common texlive-base \
166 texlive-binaries texlive-pictures texlive-latex-recommended \
167 preview-latex-style texlive-latex-extra"
168 apt install -y ${TEXLIVE_PKGS}
169 echo "<--- Installing deb_dpdk packages $(date +'%Y%m%dT%H%M%S')"
171 # DEB Manipulation tools, edits debugger, and LSB
172 echo "---> Installing tools packages $(date +'%Y%m%dT%H%M%S')"
173 TOOL_PKGS="iproute2 ethtool vlan bridge-utils vim gdb lsb-release gdbserver"
174 apt install -y ${TOOL_PKGS}
176 # DEB Updating CA certificates
177 echo "---> Forcing CA certificate update $(date +'%Y%m%dT%H%M%S')"
178 sudo update-ca-certificates -f > /dev/null 2>&1
179 echo "<--- Forcing CA certificate update $(date +'%Y%m%dT%H%M%S')"
184 echo 'Configure keep alive to prevent timeout during testing'
185 local SSH_CFG=/etc/ssh/ssh_config
186 echo "TCPKeepAlive true" | sudo tee -a ${SSH_CFG} >/dev/null 2>&1
187 echo "ServerAliveCountMax 30" | sudo tee -a ${SSH_CFG} >/dev/null 2>&1
188 echo "ServerAliveInterval 10" | sudo tee -a ${SSH_CFG} >/dev/null 2>&1
190 # Following installs hashicorp's packer binary which is required for
191 # ci-management-{verify,merge}-packer jobs
194 wget https://releases.hashicorp.com/packer/0.12.2/packer_0.12.2_linux_amd64.zip
195 unzip packer_0.12.2_linux_amd64.zip -d /usr/local/bin/
196 # note: rename to packer.io to avoid conflict with cracklib packer
197 mv /usr/local/bin/packer /usr/local/bin/packer.io
200 echo "---> Detecting OS"
201 ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
204 fedora|centos|redhat)
205 echo "---> RH type system detected"
209 echo "---> Ubuntu system detected"
213 echo "---> Unknown operating system"
217 # execute steps for all systems