Merge "Rename job to performance"
[ci-management.git] / vagrant / basebuild / bootstrap.sh
1
2 ubuntu_systems() {
3     # Standard update + upgrade dance
4     apt-get update
5     apt-get upgrade -y
6
7     # Fix the silly notion that /bin/sh should point to dash by pointing it to bash
8
9     sudo update-alternatives --install /bin/sh sh /bin/bash 100
10
11     # Install build tools
12     apt-get install -y build-essential autoconf automake bison libssl-dev ccache libtool git dkms debhelper libganglia1-dev libapr1-dev libconfuse-dev dh-systemd
13
14     # Install other stuff
15     apt-get install -y --force-yes bridge-utils vim gdb iproute2
16
17     # Install debian packaging tools
18     apt-get install -y debhelper dkms
19
20     # Install uio
21     apt-get install -y linux-image-extra-`uname -r`
22
23     # Install jdk and maven
24     apt-get install -y openjdk-7-jdk
25     # $$$ comment out for the moment
26     # apt-get install -y --force-yes maven3
27
28     # Load the uio kernel module
29     modprobe uio_pci_generic
30
31     # Make sure uio loads at boot time
32     echo uio_pci_generic >> /etc/modules
33
34     # Setup for hugepages using upstart so it persists across reboots
35     sysctl -w vm.nr_hugepages=1024
36     mkdir -p /mnt/huge
37     echo "hugetlbfs       /mnt/huge  hugetlbfs       defaults        0 0" >> /etc/fstab
38     mount /mnt/huge
39
40     # Install virtualenv for test execution
41     apt-get install -y --force-yes python-virtualenv python-pip python-dev
42 }
43
44 rh_systems() {
45     # Install build tools
46     yum groupinstall 'Development Tools' -y
47     yum install openssl-devel -y
48     yum install glibc-static -y
49
50     # Install jdk and maven
51     yum install -y java-1.8.0-openjdk-devel
52
53     # Install EPEL
54     yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
55
56     # Install components to build Ganglia modules
57     yum install -y apr-devel
58     yum install -y --enablerepo=epel libconfuse-devel
59     yum install -y --enablerepo=epel ganglia-devel
60     yum install -y --enablerepo=epel mock
61 }
62
63 echo "---> Attempting to detect OS"
64 # OS selector
65 if [ -f /usr/bin/yum ]
66 then
67     OS='RH'
68 else
69     OS='UBUNTU'
70 fi
71
72 case "$OS" in
73     RH)
74         echo "---> RH type system detected"
75         rh_systems
76     ;;
77     UBUNTU)
78         echo "---> Ubuntu system detected"
79         ubuntu_systems
80     ;;
81     *)
82         echo "---> Unknown operating system"
83     ;;
84 esac