1 .. This work is licensed under a Creative Commons Attribution 4.0 International
3 .. http://creativecommons.org/licenses/by/4.0
4 .. (c) OPNFV, Ericsson AB and others.
12 Yardstick currently supports installation on Ubuntu 14.04 or by using a Docker
13 image. Detailed steps about installing Yardstick using both of these options
16 To use Yardstick you should have access to an OpenStack environment,
17 with at least Nova, Neutron, Glance, Keystone and Heat installed.
19 The steps needed to run Yardstick are:
21 1. Install Yardstick and create the test configuration .yaml file.
22 2. Build a guest image and load the image into the OpenStack environment.
23 3. Create a Neutron external network and load OpenStack environment variables.
27 Installing Yardstick on Ubuntu 14.04
28 ------------------------------------
30 .. _install-framework:
32 Installing Yardstick framework
33 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37 sudo apt-get install python-virtualenv python-dev
38 sudo apt-get install libffi-dev libssl-dev git
40 Create a python virtual environment, source it and update setuptools:
43 virtualenv ~/yardstick_venv
44 source ~/yardstick_venv/bin/activate
45 easy_install -U setuptools
47 Download source code and install python dependencies:
50 git clone https://gerrit.opnfv.org/gerrit/yardstick
52 python setup.py install
54 There is also a YouTube video, showing the above steps:
56 .. image:: http://img.youtube.com/vi/4S4izNolmR0/0.jpg
57 :alt: http://www.youtube.com/watch?v=4S4izNolmR0
58 :target: http://www.youtube.com/watch?v=4S4izNolmR0
60 Installing extra tools
61 ^^^^^^^^^^^^^^^^^^^^^^
64 Yardstick has an internal plotting tool ``yardstick-plot``, which can be installed
65 using the following command:
68 python setup.py develop easy_install yardstick[plot]
72 Building a guest image
73 ^^^^^^^^^^^^^^^^^^^^^^
74 Yardstick has a tool for building an Ubuntu Cloud Server image containing all
75 the required tools to run test cases supported by Yardstick. It is necessary to
76 have sudo rights to use this tool.
78 This image can be built using the following command while in the directory where
79 Yardstick is installed (``~/yardstick`` if the framework is installed
80 by following the commands above):
83 sudo ./tools/yardstick-img-modify tools/ubuntu-server-cloudimg-modify.sh
85 **Warning:** the script will create files by default in:
86 ``/tmp/workspace/yardstick`` and the files will be owned by root!
88 The created image can be added to OpenStack using the ``glance image-create`` or
89 via the OpenStack Dashboard.
94 glance --os-image-api-version 1 image-create \
95 --name yardstick-trusty-server --is-public true \
96 --disk-format qcow2 --container-format bare \
97 --file /tmp/workspace/yardstick/yardstick-trusty-server.img
100 Installing Yardstick using Docker
101 ---------------------------------
103 Yardstick has two Docker images, first one (**Yardstick-framework**) serves as a
104 replacement for installing the Yardstick framework in a virtual environment (for
105 example as done in :ref:`install-framework`), while the other image is mostly for
106 CI purposes (**Yardstick-CI**).
108 Yardstick-framework image
109 ^^^^^^^^^^^^^^^^^^^^^^^^^
110 Download the source code:
114 git clone https://gerrit.opnfv.org/gerrit/yardstick
116 Build the Docker image and tag it as *yardstick-framework*:
121 docker build -t yardstick-framework .
123 Run the Docker instance:
127 docker run --name yardstick_instance -i -t yardstick-framework
129 To build a guest image for Yardstick, see :ref:`guest-image`.
133 Pull the Yardstick-CI Docker image from Docker hub:
137 docker pull opnfv/yardstick-ci
139 Run the Docker image:
147 -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
148 -e "INSTALLER_IP=${INSTALLER_IP}" \
152 Where ``${INSTALLER_TYPE}`` can be fuel, foreman or compass and ``${INSTALLER_IP}``
153 is the installer master node IP address (i.e. 10.20.0.2 is default for fuel).
155 Basic steps performed by the **Yardstick-CI** container:
157 1. clone yardstick and releng repos
158 2. setup OS credentials (releng scripts)
159 3. install yardstick and dependencies
160 4. build yardstick cloud image and upload it to glance
161 5. upload cirros-0.3.3 cloud image to glance
162 6. run yardstick test scenarios
166 OpenStack parameters and credentials
167 ------------------------------------
171 Most of the sample test cases in Yardstick are using an OpenStack flavor called
172 *yardstick-flavor* which deviates from the OpenStack standard m1.tiny flavor by the
173 disk size - instead of 1GB it has 3GB. Other parameters are the same as in m1.tiny.
175 Environment variables
176 ^^^^^^^^^^^^^^^^^^^^^
177 Before running Yardstick it is necessary to export OpenStack environment variables
178 from the OpenStack *openrc* file (using the ``source`` command) and export the
179 external network name ``export EXTERNAL_NETWORK="external-network-name"``,
180 the default name for the external network is ``net04_ext``.
182 Credential environment variables in the *openrc* file have to include at least:
189 Yardstick default key pair
190 ^^^^^^^^^^^^^^^^^^^^^^^^^^
191 Yardstick uses a SSH key pair to connect to the guest image. This key pair can
192 be found in the ``resources/files`` directory. To run the ``ping-hot.yaml`` test
193 sample, this key pair needs to be imported to the OpenStack environment.
196 Examples and verifying the install
197 ----------------------------------
199 It is recommended to verify that Yardstick was installed successfully
200 by executing some simple commands and test samples. Below is an example invocation
201 of yardstick help command and ping.py test sample:
205 yardstick task start samples/ping.yaml
207 Each testing tool supported by Yardstick has a sample configuration file.
208 These configuration files can be found in the **samples** directory.
210 Example invocation of ``yardstick-plot`` tool:
213 yardstick-plot -i /tmp/yardstick.out -o /tmp/plots/
215 Default location for the output is ``/tmp/yardstick.out``.
217 More info about the tool can be found by executing: