2 TODO As things will change, then this document has to be revised before the
4 1. Verify that the instructions below are correct and have not been changed.
5 2. Add everything that is currently missing and should be included in this document.
6 3. Make sure each title has a paragraph or an introductory sentence under it.
7 4. Make sure each sentence is grammatically correct and easily understandable.
8 5. Remove this comment section.
13 Yardstick currently supports installation on Ubuntu 14.04 or by using a Docker
14 image. Detailed steps about installing Yardstick using both of these options
17 To use Yardstick you should have access to an OpenStack environment,
18 with at least Nova, Neutron, Glance, Keystone and Heat installed.
20 The steps needed to run Yardstick are:
22 1. Install Yardstick and create the test configuration .yaml file.
23 2. Build a guest image and load the image into the OpenStack environment.
24 3. Create a Neutron external network and load OpenStack environment variables.
28 Installing Yardstick on Ubuntu 14.04
29 ------------------------------------
31 .. _install-framework:
33 Installing Yardstick framework
34 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 sudo apt-get install python-virtualenv python-dev
39 sudo apt-get install libffi-dev libssl-dev git
41 Create a python virtual environment, source it and update setuptools:
44 virtualenv ~/yardstick_venv
45 source ~/yardstick_venv/bin/activate
46 easy_install -U setuptools
48 Download source code and install python dependencies:
51 git clone https://gerrit.opnfv.org/gerrit/yardstick
53 python setup.py install
55 There is also a YouTube video, showing the above steps:
57 .. image:: http://img.youtube.com/vi/4S4izNolmR0/0.jpg
58 :alt: http://www.youtube.com/watch?v=4S4izNolmR0
59 :target: http://www.youtube.com/watch?v=4S4izNolmR0
61 Installing extra tools
62 ^^^^^^^^^^^^^^^^^^^^^^
65 Yardstick has an internal plotting tool ``yardstick-plot``, which can be installed
66 using the following command:
69 python setup.py develop easy_install yardstick[plot]
73 Building a guest image
74 ^^^^^^^^^^^^^^^^^^^^^^
75 Yardstick has a tool for building an Ubuntu Cloud Server image containing all
76 the required tools to run test cases supported by Yardstick. It is necessary to
77 have sudo rights to use this tool.
79 This image can be built using the following command while in the directory where
80 Yardstick is installed (``~/yardstick`` if the framework is installed
81 by following the commands above):
84 sudo ./tools/yardstick-img-modify tools/ubuntu-server-cloudimg-modify.sh
86 **Warning:** the script will create files by default in:
87 ``/tmp/workspace/yardstick`` and the files will be owned by root!
89 The created image can be added to OpenStack using the ``glance image-create`` or
90 via the OpenStack Dashboard.
95 glance --os-image-api-version 1 image-create \
96 --name yardstick-trusty-server --is-public true \
97 --disk-format qcow2 --container-format bare \
98 --file /tmp/workspace/yardstick/yardstick-trusty-server.img
101 Installing Yardstick using Docker
102 ---------------------------------
104 Yardstick has two Docker images, first one (**Yardstick-framework**) serves as a
105 replacement for installing the Yardstick framework in a virtual environment (for
106 example as done in :ref:`install-framework`), while the other image is mostly for
107 CI purposes (**Yardstick-CI**).
109 Yardstick-framework image
110 ^^^^^^^^^^^^^^^^^^^^^^^^^
111 Download the source code:
115 git clone https://gerrit.opnfv.org/gerrit/yardstick
117 Build the Docker image and tag it as *yardstick-framework*:
122 docker build -t yardstick-framework .
124 Run the Docker instance:
128 docker run --name yardstick_instance -i -t yardstick-framework
130 To build a guest image for Yardstick, see :ref:`guest-image`.
134 Pull the Yardstick-CI Docker image from Docker hub:
138 docker pull opnfv/yardstick-ci
140 Run the Docker image:
148 -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
149 -e "INSTALLER_IP=${INSTALLER_IP}" \
153 Where ``${INSTALLER_TYPE}`` can be fuel, foreman or compass and ``${INSTALLER_IP}``
154 is the installer master node IP address (i.e. 10.20.0.2 is default for fuel).
156 Basic steps performed by the **Yardstick-CI** container:
158 1. clone yardstick and releng repos
159 2. setup OS credentials (releng scripts)
160 3. install yardstick and dependencies
161 4. build yardstick cloud image and upload it to glance
162 5. upload cirros-0.3.3 cloud image to glance
163 6. run yardstick test scenarios
167 OpenStack parameters and credentials
168 ------------------------------------
172 Most of the sample test cases in Yardstick are using an OpenStack flavor called
173 *yardstick-flavor* which deviates from the OpenStack standard m1.tiny flavor by the
174 disk size - instead of 1GB it has 3GB. Other parameters are the same as in m1.tiny.
176 Environment variables
177 ^^^^^^^^^^^^^^^^^^^^^
178 Before running Yardstick it is necessary to export OpenStack environment variables
179 from the OpenStack *openrc* file (using the ``source`` command) and export the
180 external network name ``export EXTERNAL_NETWORK="external-network-name"``,
181 the default name for the external network is ``net04_ext``.
183 Credential environment variables in the *openrc* file have to include at least:
190 Yardstick default key pair
191 ^^^^^^^^^^^^^^^^^^^^^^^^^^
192 Yardstick uses a SSH key pair to connect to the guest image. This key pair can
193 be found in the ``resources/files`` directory. To run the ``ping-hot.yaml`` test
194 sample, this key pair needs to be imported to the OpenStack environment.
197 Examples and verifying the install
198 ----------------------------------
200 It is recommended to verify that Yardstick was installed successfully
201 by executing some simple commands and test samples. Below is an example invocation
202 of yardstick help command and ping.py test sample:
206 yardstick task start samples/ping.yaml
208 Each testing tool supported by Yardstick has a sample configuration file.
209 These configuration files can be found in the **samples** directory.
211 Example invocation of ``yardstick-plot`` tool:
214 yardstick-plot -i /tmp/yardstick.out -o /tmp/plots/
216 Default location for the output is ``/tmp/yardstick.out``.
218 More info about the tool can be found by executing: