Merge "yardstick offline support"
[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 # install tools
12 apt-get update && apt-get install -y \
13     wget \
14     expect \
15     curl \
16     git \
17     sshpass \
18     qemu-utils \
19     kpartx \
20     libffi-dev \
21     libssl-dev \
22     python \
23     python-dev \
24     python-pip \
25     flake8
26     libxml2-dev \
27     libxslt1-dev \
28     nginx \
29     uwsgi \
30     uwsgi-plugin-python \
31     supervisor \
32     python-setuptools && \
33     easy_install -U setuptools
34
35 apt-get -y autoremove && apt-get clean
36
37
38 # fit for arm64
39 source_file=/etc/apt/sources.list
40 sed -i -e 's/^deb \([^/[]\)/deb [arch=amd64] \1/g' "${source_file}"
41 sed -i -e 's/^deb-src /# deb-src /g' "${source_file}"
42
43 sub_source_file=/etc/apt/sources.list.d/yardstick.list
44 touch "${sub_source_file}"
45 echo -e "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty main universe multiverse restricted
46 deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main universe multiverse restricted
47 deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-security main universe multiverse restricted
48 deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ trusty-proposed main universe multiverse restricted" > "${sub_source_file}"
49 echo "vm.mmap_min_addr = 0" > /etc/sysctl.d/mmap_min_addr.conf
50 dpkg --add-architecture arm64
51 apt-get install -y qemu-user-static libc6:arm64
52
53 # install yardstick + dependencies
54 easy_install -U pip
55 pip install -r requirements.txt
56 pip install .