Meego Wiki
Views

Quality/QA-tools/OTS/DeveloperDocs/CreatingACustomDistributionModel

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "== How to Customize Test Package Distribution in OTS == OTS supports 2 distribution models. By default all packages are executed in one task. In practice this means that one wor…")
(Creating a Custom Distribution Model)
Line 9: Line 9:
=== Creating a Custom Distribution Model ===
=== Creating a Custom Distribution Model ===
-
Distribution models use setuptools entry point mechanism just like PublisherPlugins do. An example can be found in [[http://meego.gitorious.org/meego-quality-assurance/ots/trees/master/examples/ots.plugin.example_distribution_model  ots.plugin.example_distribution_model]]
+
Distribution models use setuptools entry point mechanism just like PublisherPlugins do. An example can be found in [[http://meego.gitorious.org/meego-quality-assurance/ots/trees/master/examples/ots.plugin.example_distribution_model  examples/ots/plugin/example_distribution_model/]]
==== Defining the Distribution Model in setup.py ====
==== Defining the Distribution Model in setup.py ====

Revision as of 10:45, 4 February 2011

Contents

How to Customize Test Package Distribution in OTS

OTS supports 2 distribution models. By default all packages are executed in one task. In practice this means that one worker will take care of the whole testrun by flashing the device and running all test packages one after another. If "perpackage" distribution model is used, a separate task will be created for each package. If enough workers are free, all packages will be tested on a separate worker in parallel. This is in theory the fastest possible way to execute the packages.

In reality the device preparation takes a lot of time and there usually is not enough workers free so some kind of optimized distribution model between these two extremes might make the system more useful. To make this possible OTS supports custom distribution models.

More background information about the distribution optimization can be found in Optimising throughput.

Creating a Custom Distribution Model

Distribution models use setuptools entry point mechanism just like PublisherPlugins do. An example can be found in [examples/ots/plugin/example_distribution_model/]

Defining the Distribution Model in setup.py

An entry point named "ots_distribution_model" needs to be defined in the setup.py to make OTS find the custom distribution model:

    entry_points={"ots_distribution_model":
                      ["example_model = ots.plugin.example_distribution_model.example_model:get_model"]
                  },

The name "example_model" is the name of the custom model. It maps directly to the OTS testrun parameter distribution_model and ots_trigger parameter -c DISTMODEL, --distribution=DISTMODEL

Implementing the Distribution Model

The actual distribution model is loaded with a factory method that gets all testrun options as parameters. It should return a callable that takes test package list as input and returns conductor commands as a list.

A plugin example is available in examples/ots/plugin/example_distribution_model/example_model.py

Fully implemented distribution models can be found in ots/server/allocator/default_distribution_models.py

Personal tools