[DISCUSSION] python version requirement
by Ondrej Lichtner
Hi all,
since we've moved to python3 that is actively developed and versions
move between various long term/short term support cycles, we should also
adapt LNST to this cycle of updating which minimal version of python
LNST requires.
TL;DR: The main questions I'm asking are:
* how do we _implement_ a python version requirement?
* how do we _upgrade_/_migrate_ in the future?
* how do we _document_ a python version requirement?
* which version do we want to use _now_?
More context:
I think at the moment we have a "soft" requirement for python3.6. Soft
because we:
* probably haven't tested on anything older
* it's not explicitly configured/documented anywhere
At the same time, there are now at least two reasons to start thinking
about moving to python3.8:
* I remember Perry asking about the f-string feature introduced in 3.8
* while working with Adrian on the TRex refactoring I started thinking
about a feature for the lnst.Tests package that I've had in mind for a
while, which requires a 3.7 feature
* python3.8 is the current version on Fedora32, is available in RHEL8
(via dnf install python38), and python3.7 was skipped
The lnst.Tests feature I'm thinking of is "lazy" and "dynamic" loading
of BaseTestModule derived modules - for example at the moment, if a
Recipe imports any module from lnst.Tests (e.g. lnst.Tests.Ping), the
entire package is parsed and "loaded", which means that the python
environment will also parse and load lnst.Tests.TRex. This means that a
basic hello world recipe that simply calls Ping, will in some way
require load time dependencies of TRex.
The "lazy" and "dynamic" loading of test modules would ensure that when
a recipe calls:
from lnst.Tests import Ping
Only the Ping module will be parsed, loaded and imported, and nothing
else. And the dynamicity here could mean that we could be able to extend
test modules exported by the lnst.Tests package via the lnst-ctl config
file, for example for user/tester implemented test modules that are not
tracked in the main lnst repository.
I wrote a rough patch to experiment with this:
---
diff --git a/lnst/Tests/__init__.py b/lnst/Tests/__init__.py
index f7c6c90..a39b6f4 100644
--- a/lnst/Tests/__init__.py
+++ b/lnst/Tests/__init__.py
@@ -12,8 +12,26 @@
olichtne(a)redhat.com (Ondrej Lichtner)
"""
-from lnst.Tests.Ping import Ping
-from lnst.Tests.PacketAssert import PacketAssert
-from lnst.Tests.Iperf import IperfClient, IperfServer
+# from lnst.Tests.Ping import Ping
+# from lnst.Tests.PacketAssert import PacketAssert
+# from lnst.Tests.Iperf import IperfClient, IperfServer
+import importlib
+
+lazy_load_modules = {
+ "Ping": "lnst.Tests.Ping",
+ "PacketAssert": "lnst.Tests.PacketAssert",
+ "IperfClient": "lnst.Tests.Iperf",
+ "IperfServer": "lnst.Tests.Iperf",
+}
+
+
+def __getattr__(name):
+ if name not in lazy_load_modules:
+ raise ImportError("Cannot import {}".format(name))
+ mod = importlib.import_module(lazy_load_modules[name])
+ globals()[name] = getattr(mod, name)
+ return globals()[name]
+
+
+# #TODO add support for test classes from lnst-ctl.conf
-#TODO add support for test classes from lnst-ctl.conf
---
However this requires the ability to define __getattr__ for a module,
which is introduced as a python3.7 feature via PEP562 [0].
-Ondrej
[0] https://www.python.org/dev/peps/pep-0562/
2 years, 5 months
[RFC PATCH 0/8] ENRT Measurements and Perf refactoring
by olichtne@redhat.com
From: Ondrej Lichtner <olichtne(a)redhat.com>
Hi all,
This patchset is therefore NOT COMPLETE AND NOT FIT TO APPLY YET, I'm
seding this now to get an early round of reviews...
This is the first version of a patchset to refactor the Recipes.ENRT
package to make it more flexible wrt. generating measurements, this is a
pain point that we've hit with different type of recipes that we already
have:
* baremetal recipes, generating relatively simple iperf flows
* virtual recipes, being very similar however requiring different cpu
measurements generated along these flow measurements
* ipsec type recipes that generate more complex iperf flows
* ovs+dpdk type recipes that due to using trex have their own quirks
This version of the patchset was focused on adding support for the
second bullet in the list - the virtual recipes, and making sure that
baremetal recipes still work.
Ipsec recipes should still work the same way, the ovs+dpdk recipes;
however, likely require additional work.
There's also a note in the final commit that more work on adding type
hints to the Perf.* package.
And finally... documentation has not been updated and will be added in
the second version of the patchset.
Please take a look and provide any valuable feedback that I should work
on in the second version of the set.
-Ondrej
Ondrej Lichtner (8):
RecipeCommon.Perf.Measurements: add flows property to FlowMeasurements
RecipeCommon.Perf.Measurements.StatCPUMeasurement: sort hosts
create lnst.Recipes.ENRT.MeasurementGenerators
Recipes.ENRT.BaseEnrtRecipe: remove perf measurement generation
add lnst.Recipes.ENRT.BaremetalEnrtRecipe
add lnst.Recipes.ENRT.VirtualEnrtRecipe
refactor lnst.Recipes.ENRT.BaseEnrtRecipe
lnst.RecipeCommon.Perf: Evaluators refactor to add parent recipe
configuration
lnst/RecipeCommon/BaseResultEvaluator.py | 9 +-
.../Evaluators/BaselineCPUAverageEvaluator.py | 39 +++-
.../Perf/Evaluators/BaselineEvaluator.py | 77 ++++++--
.../BaselineFlowAverageEvaluator.py | 25 ++-
.../Perf/Evaluators/NonzeroFlowEvaluator.py | 18 +-
.../Perf/Measurements/BaseFlowMeasurement.py | 4 +
.../Perf/Measurements/IperfFlowMeasurement.py | 4 +
.../Perf/Measurements/StatCPUMeasurement.py | 2 +-
.../Perf/Measurements/TRexFlowMeasurement.py | 4 +
lnst/RecipeCommon/Perf/Recipe.py | 64 +++++--
lnst/Recipes/ENRT/BaremetalEnrtRecipe.py | 26 +++
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 178 +++---------------
lnst/Recipes/ENRT/BondRecipe.py | 4 +-
lnst/Recipes/ENRT/DoubleBondRecipe.py | 4 +-
lnst/Recipes/ENRT/DoubleTeamRecipe.py | 4 +-
lnst/Recipes/ENRT/IpsecEspAeadRecipe.py | 4 +-
lnst/Recipes/ENRT/IpsecEspAhCompRecipe.py | 4 +-
.../BaseMeasurementGenerator.py | 3 +
...lowEndpointsStatCPUMeasurementGenerator.py | 26 +++
.../HypervisorsStatCPUMeasurementGenerator.py | 19 ++
.../IperfMeasurementGenerator.py | 146 ++++++++++++++
.../ENRT/MeasurementGenerators/__init__.py | 0
lnst/Recipes/ENRT/NoVirtOvsVxlanRecipe.py | 4 +-
.../ENRT/ShortLivedConnectionsRecipe.py | 4 +-
lnst/Recipes/ENRT/SimpleMacsecRecipe.py | 4 +-
lnst/Recipes/ENRT/SimpleNetworkRecipe.py | 7 +-
lnst/Recipes/ENRT/TeamRecipe.py | 4 +-
lnst/Recipes/ENRT/TeamVsBondRecipe.py | 4 +-
lnst/Recipes/ENRT/VirtOvsVxlanRecipe.py | 4 +-
.../VirtualBridgeVlanInGuestMirroredRecipe.py | 4 +-
.../ENRT/VirtualBridgeVlanInGuestRecipe.py | 4 +-
.../VirtualBridgeVlanInHostMirroredRecipe.py | 4 +-
.../ENRT/VirtualBridgeVlanInHostRecipe.py | 4 +-
.../ENRT/VirtualBridgeVlansOverBondRecipe.py | 4 +-
lnst/Recipes/ENRT/VirtualEnrtRecipe.py | 28 +++
...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 4 +-
.../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 4 +-
...irtualOvsBridgeVlanInHostMirroredRecipe.py | 4 +-
.../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 4 +-
.../VirtualOvsBridgeVlansOverBondRecipe.py | 4 +-
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 4 +-
lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 4 +-
lnst/Recipes/ENRT/VlansRecipe.py | 4 +-
lnst/Recipes/ENRT/VxlanMulticastRecipe.py | 4 +-
lnst/Recipes/ENRT/VxlanRemoteRecipe.py | 4 +-
45 files changed, 528 insertions(+), 255 deletions(-)
create mode 100644 lnst/Recipes/ENRT/BaremetalEnrtRecipe.py
create mode 100644 lnst/Recipes/ENRT/MeasurementGenerators/BaseMeasurementGenerator.py
create mode 100644 lnst/Recipes/ENRT/MeasurementGenerators/FlowEndpointsStatCPUMeasurementGenerator.py
create mode 100644 lnst/Recipes/ENRT/MeasurementGenerators/HypervisorsStatCPUMeasurementGenerator.py
create mode 100644 lnst/Recipes/ENRT/MeasurementGenerators/IperfMeasurementGenerator.py
create mode 100644 lnst/Recipes/ENRT/MeasurementGenerators/__init__.py
create mode 100644 lnst/Recipes/ENRT/VirtualEnrtRecipe.py
--
2.29.2
2 years, 8 months
[PATCH 0/6] add OvSDPDKBondRecipe
by jurbanov@redhat.com
From: Jozef Urbanovsky <jurbanov(a)redhat.com>
Hi,
This patchset adds OvSDPDKBondRecipe and fixes some
issues with test tools required for the recipe.
Patchset has been reviewed in internal downstream,
before it was decided to split it to upstream and downstream.
It has been tested to be fully functional.
Jozef Urbanovsky (6):
lnst.Recipes.ENRT.OvSDPDKBondRecipe: add new recipe
lnst.Tests.TestPMD: add mode branching
lnst.Tests.TRex: add __repr__ methods, expose module parameter
lnst.RecipeCommon.Perf.Measurements.TRexFlowMeasurement: fixes
requirements: add dataclasses package
lnst.Recipes.ENRT.OvSDPDKBondRecipe: override *test_tweak methods
.../Perf/Measurements/TRexFlowMeasurement.py | 5 +-
lnst/Recipes/ENRT/OvSDPDKBondRecipe.py | 257 ++++++++++++++++++
lnst/Recipes/ENRT/__init__.py | 1 +
lnst/Tests/TRex.py | 27 ++
lnst/Tests/TestPMD.py | 36 ++-
requirements.txt | 1 +
6 files changed, 315 insertions(+), 12 deletions(-)
create mode 100644 lnst/Recipes/ENRT/OvSDPDKBondRecipe.py
--
2.28.0
2 years, 9 months