Merge "increase monitor number in cases." into stable/danube
[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 dpkg --add-architecture arm64
26
27 # install tools
28 apt-get update && apt-get install -y \
29     qemu-user-static/xenial \
30     libc6:arm64 \
31     wget \
32     expect \
33     curl \
34     git \
35     sshpass \
36     qemu-utils \
37     kpartx \
38     libffi-dev \
39     libssl-dev \
40     libzmq-dev \
41     python \
42     python-dev \
43     libxml2-dev \
44     libxslt1-dev \
45     nginx \
46     uwsgi \
47     uwsgi-plugin-python \
48     supervisor \
49     python-pip \
50     vim
51
52 apt-get -y autoremove && apt-get clean
53
54 git config --global http.sslVerify false
55
56
57 # install yardstick + dependencies
58 easy_install -U pip
59 pip install -r requirements.txt
60 pip install -e .
61
62 /bin/bash "$(pwd)/api/api-prepare.sh"
63
64 service nginx restart
65 uwsgi -i /etc/yardstick/yardstick.ini