Merge "cleanup: remove fuel plugin since fuel@opnfv uses mcp"
[yardstick.git] / install.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2017 Huawei Technologies Co.,Ltd 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
11 # fit for arm64
12 source_file=/etc/apt/sources.list
13 sed -i -e 's/^deb \([^/[]\)/deb [arch=amd64] \1/g' "${source_file}"
14 sed -i -e 's/^deb-src /# deb-src /g' "${source_file}"
15 echo "APT::Default-Release \"trusty\";" > /etc/apt/apt.conf.d/default-distro
16
17 sub_source_file=/etc/apt/sources.list.d/yardstick.list
18 touch "${sub_source_file}"
19 echo -e "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial-updates universe
20 deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty main universe multiverse restricted
21 deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main universe multiverse restricted
22 deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-security main universe multiverse restricted
23 deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-proposed main universe multiverse restricted" > "${sub_source_file}"
24 echo "vm.mmap_min_addr = 0" > /etc/sysctl.d/mmap_min_addr.conf
25
26 proc_type=$(uname -m)
27 if [[ $proc_type == "arm"* ]]; then
28     dpkg --add-architecture arm64
29 fi
30
31 # install tools
32 apt-get update && apt-get install -y \
33     qemu-user-static/xenial \
34     wget \
35     expect \
36     curl \
37     git \
38     sshpass \
39     qemu-utils \
40     kpartx \
41     libffi-dev \
42     libssl-dev \
43     libzmq-dev \
44     python \
45     python-dev \
46     libxml2-dev \
47     libxslt1-dev \
48     nginx \
49     uwsgi \
50     uwsgi-plugin-python \
51     supervisor \
52     python-pip \
53     vim
54
55 if [[ $proc_type == "arm"* ]]; then
56     apt-get install -y libc6:arm64
57 fi
58
59 apt-get -y autoremove && apt-get clean
60
61 git config --global http.sslVerify false
62
63
64 # install yardstick + dependencies
65 easy_install -U pip
66 pip install -r requirements.txt
67 pip install -e .
68
69 /bin/bash "$(pwd)/api/api-prepare.sh"
70
71 service nginx restart
72 uwsgi -i /etc/yardstick/yardstick.ini