Contents |
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 starting from version 0.8.1 OTS supports custom distribution models.
More background information about the distribution optimization can be found in Optimising throughput.
Distribution models use setuptools entry point mechanism just like PublisherPlugins do. An example can be found in [examples/ots/plugin/example_distribution_model/]
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
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