.. (c) 2016 ZTE Corp.
-##################
+******************
QTIP Release Notes
-##################
+******************
.. toctree::
:maxdepth: 2
-**********************************************
-QTIP RESTful Application Programming Interface
-**********************************************
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
-Abstract
-########
+
+***************************************
+API - Application Programming Interface
+***************************************
QTIP consists of different tools(metrics) to benchmark the NFVI. These metrics
fall under different NFVI subsystems(QPI's) such as compute, storage and network.
.. (c) 2017 ZTE Corp.
-########################
-QTIP Architecture Design
-########################
+************
+Architecture
+************
In Danube, QTIP releases its standalone mode, which is also know as ``solo``:
-- Which framework has been used and why
-- How to extend to more commands
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
-Original content from DEVELOP.md
- ### CLI
+****************************
+CLI - Command Line Interface
+****************************
- Click currently supports Bash completion. The prerequisite for this is that the program
- needs to be installed correctly. To install Qtip, execute the following command in root
- folder of Qtip:
+QTIP consists of different tools(metrics) to benchmark the NFVI. These metrics fall under different NFVI
+subsystems(QPI's) such as compute, storage and network. A plan consists of one or more QPI's, depending upon how
+the end user would want to measure performance. CLI is designed to help the user, execute benchmarks and
+view respective scores.
- ```
- cd <project root>
- pip install -e .
- ```
+Framework
+=========
- Once the installation has been completed successfully, the following needs to be added to
- the `.bashrc` file:
+QTIP CLI has been created using the Python package `Click`_, Command Line Interface Creation Kit. It has been
+chosen for number of reasons. It presents the user with a very simple yet powerful API to build complex
+applications. One of the most striking features is command nesting.
- ```
- eval "$(_QTIP_COMPLETE=source qtip)"
- ```
+As explained, QTIP consists of metrics, QPI's and plans. CLI is designed to provide interface to all
+these components. It is responsible for execution, as well as provide listing and details of each individual
+element making up these components.
- The above would activate command completion for Qtip.
+Design
+======
+
+CLI's entry point extends Click's built in MultiCommand class object. It provides two methods, which are
+overridden to provide custom configurations.
+
+.. code-block:: python
+
+ class QtipCli(click.MultiCommand):
+
+ def list_commands(self, ctx):
+ rv = []
+ for filename in os.listdir(cmd_folder):
+ if filename.endswith('.py') and \
+ filename.startswith('cmd_'):
+ rv.append(filename[4:-3])
+ rv.sort()
+ return rv
+
+ def get_command(self, ctx, name):
+ try:
+ if sys.version_info[0] == 2:
+ name = name.encode('ascii', 'replace')
+ mod = __import__('qtip.cli.commands.cmd_' + name,
+ None, None, ['cli'])
+ except ImportError:
+ return
+ return mod.cli
+
+Commands and subcommands will then be loaded by the ``get_command`` method above.
+
+Extending the Framework
+=======================
+
+Framework can be easily extended, as per the users requirements. One such example can be to override the builtin
+configurations with user defined ones. These can be written in a file, loaded via a Click Context and passed
+through to all the commands.
+
+.. code-block:: python
+
+ class Context:
+
+ def __init__():
+
+ self.config = ConfigParser.ConfigParser()
+ self.config.read('path/to/configuration_file')
+
+ def get_paths():
+
+ paths = self.config.get('section', 'path')
+ return paths
+
+The above example loads configuration from user defined paths, which then need to be provided to the actual
+command definitions.
+
+.. code-block:: python
+
+ from qtip.cli.entry import Context
+
+ pass_context = click.make_pass_decorator(Context, ensure=False)
+
+ @cli.command('list', help='List the Plans')
+ @pass_context
+ def list(ctx):
+ plans = Plan.list_all(ctx.paths())
+ table = utils.table('Plans', plans)
+ click.echo(table)
+
+.. _Click: http://click.pocoo.org/5/
.. (c) 2016 ZTE Corp.
-##########################
-QTIP Design Specifications
-##########################
+***************
+Developer Guide
+***************
.. toctree::
:maxdepth: 2
.. (c) 2017 ZTE Corporation
-########
+********
Overview
-########
+********
QTIP uses Python as primary programming language and build the framework from the following packages
testing `pytest`_ - a mature full-featured Python testing tool that helps you write better programs
======== ===============================================================================================================
-***********
+
Source Code
-***********
+===========
- The structure of repository is based on the recommended sample in
-`The Hitchhiker's Guide to Python`_
+The structure of repository is based on the recommended sample in `The Hitchhiker's Guide to Python`_
-================== ========================================================================================================
+================== ====================================================================================================
Path Content
-================== ========================================================================================================
+================== ====================================================================================================
``./benchmarks/`` builtin benchmark assets including plan, QPI and metrics
``./contrib/`` independent project/plugin/code contributed to QTIP
``./docker/`` configuration for building Docker image for QTIP deployment
``./qtip/`` the actual package
``./tests/`` package functional and unit tests
``./third-party/`` third part included in QTIP project
-================== ========================================================================================================
+================== ====================================================================================================
+
-************
Coding Style
-************
+============
QTIP follows `OpenStack Style Guidelines`_ for source code and commit message.
in commit message to create an automatic link.
-*******
+
Testing
-*******
+=======
All testing related code are stored in ``./tests/``
-================== ========================================================================================================
+================== ====================================================================================================
Path Content
-================== ========================================================================================================
+================== ====================================================================================================
``./tests/data/`` data fixtures for testing
``./tests/unit/`` unit test for each module, follow the same layout as ./qtip/
``./conftest.py`` pytest configuration in project scope
-================== ========================================================================================================
+================== ====================================================================================================
`tox`_ is used to automate the testing tasks
.. (c) 2016 ZTE Corp.
-#################
-QTIP Config Guide
-#################
+*********************************
+QTIP Installation & Configuration
+*********************************
.. toctree::
:maxdepth: 2
-**************
-QTIP API Usage
-**************
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+
+
+***************
+API User Manual
+***************
QTIP consists of a number of benchmarking tools or metrics, grouped under QPI's. QPI's map to the different
components of an NFVI ecosystem, such as compute, network and storage. Depending on the type of application,
-**************
-QTIP CLI Usage
-**************
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+
+
+***************
+CLI User Manual
+***************
QTIP consists of a number of benchmarking tools or metrics, grouped under QPI's. QPI's map to the different
components of a NFVI ecosystem, such as compute, network and storage. Depending on the type of application,
.. (c) 2016 ZTE Corp.
-Compute QPI
-===========
-
-Introduction
-------------
+********************************
+Compute Performance Benchmarking
+********************************
The compute QPI aims to benchmark the compute components of an OPNFV platform.
Such components include, the CPU performance, the memory performance.
and whetstone. The suite would be updated for better benchmarks such as Linbench for
the OPNFV E release.
-Getting start with compute QPI
-------------------------------
+
+Getting started
+===============
Notice: All descriptions are based on QTIP container.
Inventory File
-^^^^^^^^^^^^^^
+--------------
QTIP uses Ansible to trigger benchmark test. Ansible uses an inventory file to
determine what hosts to work against. QTIP can automatically generate a inventory
10.20.0.12
QTIP key Pair
-^^^^^^^^^^^^^
+-------------
QTIP use a SSH key pair to connect to remote hosts. When users execute compute QPI,
QTIP will generate a key pair named *QtipKey* under ``/home/opnfv/qtip/`` and pass
remote hosts before the execution ends. Please make sure the key deleted from remote
hosts or it can introduce a security flaw.
-Commands to run compute QPI
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Commands
+--------
In a QTIP container, you can run compute QPI by using QTIP CLI:
::
you can get more details from *userguide/cli.rst*.
-Benchmarks
-----------
+Metrics
+-------
The benchmarks include:
.. (c) 2016 ZTE Corp.
-###############
+***************
QTIP User Guide
-###############
+***************
.. toctree::
:maxdepth: 2
overview.rst
cli.rst
api.rst
- qpi-compute.rst
+ compute.rst
.. (c) 2017 ZTE Corp.
-############
-Introduction
-############
+********
+Overview
+********
`QTIP`_ is the project for **Platform Performance Benchmarking** in `OPNFV`_. It aims to provide user a simple indicator
for performance, simple but supported by comprehensive testing data and transparent calculation formula.
- *Understandable*: QPI is broke down into section scores, and workload scores in report to help user to understand
- *Extensible*: users may create their own QPI by composing the existed metrics in QTIP or extend new metrics
-##########
+
Benchmarks
-##########
+==========
The builtin benchmarks of QTIP are located in ``<package_root>/benchmarks`` folder