[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
[PATCH v2 0/6] add per-iteration perf_test tweaks
by Jan Tluka
This patchset modifies the current implementation of the performance test
tweaks.
Before the patch set the user was unable to add performance test tweaks
on per iteration basis. It was only possible to add/remove tweaks
before/after the whole set of the performance test measurement iterations.
The patchset adds BasePerfTestIterationTweakMixin to RecipeCommon.Perf.Recipe
that provides a common API for that. The actual tasks to be performed
before/after each iteration needs to be defined by a specific mixin
class.
In the same manner the already existing BasePerfTestTweakMixin has been
moved to RecipeCommon.Perf.Recipe to have both APIs at the same place.
Jan Tluka (6):
RecipeCommon.Perf.PerfTestMixins: add BasePerfTestIterationTweakMixin
RecipeCommon.Perf.Recipe: add per-iteration tweaks using
BasePerfTestIterationTweakMixin
lnst.Recipes.ENRT.PerfTestMixins: move BasePerfTestTweakMixin to
RecipeCommon
RecipeCommon.Perf.PerfTestMixins.BasePerfTestTweakMixin: move
get_flow_measurement_from_config to standalone function
lnst.Recipes.ENRT.PerfTestMixins: add DropCachesPerfTestMixin
Recipes.ENRT.PerfTestMixins: extend CommonPerfTestTweakMixin with
DropCachesMixin
.../BasePerfTestIterationTweakMixin.py | 18 +++++++++
.../PerfTestMixins/BasePerfTestTweakMixin.py | 6 ---
lnst/RecipeCommon/Perf/Recipe.py | 30 ++++++++++++--
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 9 +----
.../CommonPerfTestTweakMixin.py | 3 +-
.../PerfTestMixins/DropCachesPerfTestMixin.py | 39 +++++++++++++++++++
.../SctpFirewallPerfTestMixin.py | 11 +++---
lnst/Recipes/ENRT/PerfTestMixins/Utils.py | 5 +++
lnst/Recipes/ENRT/PerfTestMixins/__init__.py | 2 +-
9 files changed, 100 insertions(+), 23 deletions(-)
create mode 100644 lnst/RecipeCommon/Perf/PerfTestMixins/BasePerfTestIterationTweakMixin.py
rename lnst/{Recipes/ENRT => RecipeCommon/Perf}/PerfTestMixins/BasePerfTestTweakMixin.py (63%)
create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/DropCachesPerfTestMixin.py
create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/Utils.py
--
2.21.3
2 years, 10 months
[PATCH 0/6] add per-iteration perf_test tweaks
by Jan Tluka
This patchset modifies the current implementation of the performance test
tweaks.
Before the patch set the user was unable to add performance test tweaks
on per iteration basis. It was only possible to add/remove tweaks
before/after the whole set of the performance test measurement iterations.
The patchset adds BasePerfTestIterationTweakMixin to RecipeCommon.Perf.Recipe
that provides a common API for that. The actual tasks to be performed
before/after each iteration needs to be defined by a specific mixin
class.
In the same manner the already existing BasePerfTestTweakMixin has been
moved to RecipeCommon.Perf.Recipe to have both APIs at the same place.
Jan Tluka (6):
RecipeCommon.Perf.PerfTestMixins: add BasePerfTestIterationTweakMixin
RecipeCommon.Perf.Recipe: add per-iteration tweaks using
BasePerfTestIterationTweakMixin
lnst.Recipes.ENRT.PerfTestMixins: move BasePerfTestTweakMixin to
RecipeCommon
RecipeCommon.Perf.PerfTestMixins.BasePerfTestTweakMixin: move
get_flow_measurements_from_config to standalone function
lnst.Recipes.ENRT.PerfTestMixins: add DropCachesPerfTestMixin
Recipes.ENRT.PerfTestMixins: extend CommonPerfTestTweakMixin with
DropCachesMixin
.../BasePerfTestIterationTweakMixin.py | 18 ++++++++
.../PerfTestMixins/BasePerfTestTweakMixin.py | 6 ---
lnst/RecipeCommon/Perf/Recipe.py | 41 ++++++++++++++-----
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 9 +---
.../CommonPerfTestTweakMixin.py | 3 +-
.../PerfTestMixins/DropCachesPerfTestMixin.py | 36 ++++++++++++++++
.../SctpFirewallPerfTestMixin.py | 7 ++--
lnst/Recipes/ENRT/PerfTestMixins/Utils.py | 5 +++
lnst/Recipes/ENRT/PerfTestMixins/__init__.py | 2 +-
9 files changed, 99 insertions(+), 28 deletions(-)
create mode 100644 lnst/RecipeCommon/Perf/PerfTestMixins/BasePerfTestIterationTweakMixin.py
rename lnst/{Recipes/ENRT => RecipeCommon/Perf}/PerfTestMixins/BasePerfTestTweakMixin.py (63%)
create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/DropCachesPerfTestMixin.py
create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/Utils.py
--
2.21.3
2 years, 10 months
[PATCH] README.md: Adding Perry as contributor.
by pgagne@redhat.com
From: Perry Gagne <pgagne(a)redhat.com>
Signed-off-by: Perry Gagne <pgagne(a)redhat.com>
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 7932f74..6f28f03 100644
--- a/README.md
+++ b/README.md
@@ -47,6 +47,7 @@ Documentation is available in the `docs/` directory, you can build it with
* Jan Tluka <jtluka(a)redhat.com>
* Ondrej Lichtner <olichtne(a)redhat.com> (current maintainer)
* Jozef Urbanovsky <jurbanov(a)redhat.com>
+* Perry Gagne <pgagne(a)redhat.com>
* Christos Sfakianakis (not active anymore)
* Jiri Prochazka (not active anymore)
* Kamil Jerabek (not active anymore)
--
2.26.2
2 years, 11 months
[PATCH v3 0/8] add DisableIdleStatesMixin and DisableIdleStatesMixin
by Jan Tluka
The following patch set is another iteration of the implementation of mixin
classes to control CPU features - idle states and turboboost.
Differences to v2:
* since the host_list properties are equivalent for all of the recipes
that inherit from BaseEnrtRecipe, the definition of these properties
is moved to the BaseEnrtRecipe
Differences to v1:
* mixin classes now inherit from BaseSubConfigMixin instead of
PerfTestTweakMixin
* added disable_turboboost_host_list and disable_idlestates properties
to specify on which hosts the CPU feature should be disabled
* added documentation for both mixins
Jan Tluka (8):
Recipes.ENRT.PerfTestMixins.SctpFirewallPerfTestMixin: move
_get_flow_measurement_from_config() to base class
Recipes.ENRT.ConfigMixins: add DisableIdleStatesMixin
Recipes.ENRT.ConfigMixins: add DisableTurboboostMixin
Recipes.ENRT.PerfTestMixins: add CommonPerfTestTweakMixin
Recipes.ENRT.BaseEnrtRecipe: inherit from CommonPerfTestTweakMixin
Recipes.ENRT.BaseEnrtRecipe: add DisableTurboboost and
DisableIdleStates mixins
docs: add DisableTurboboostMixin documentation
docs: add DisableIdleStatesMixin documentation
.../disable_idlestates_mixin.rst | 6 ++
.../disable_turboboost_mixin.rst | 6 ++
docs/source/config_mixins.rst | 2 +
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 40 ++++++++++-
.../ConfigMixins/DisableIdleStatesMixin.py | 57 +++++++++++++++
.../ConfigMixins/DisableTurboboostMixin.py | 71 +++++++++++++++++++
.../PerfTestMixins/BasePerfTestTweakMixin.py | 6 ++
.../CommonPerfTestTweakMixin.py | 6 ++
.../SctpFirewallPerfTestMixin.py | 6 --
lnst/Recipes/ENRT/PerfTestMixins/__init__.py | 1 +
10 files changed, 193 insertions(+), 8 deletions(-)
create mode 100644 docs/source/config_mixin_classes/disable_idlestates_mixin.rst
create mode 100644 docs/source/config_mixin_classes/disable_turboboost_mixin.rst
create mode 100644 lnst/Recipes/ENRT/ConfigMixins/DisableIdleStatesMixin.py
create mode 100644 lnst/Recipes/ENRT/ConfigMixins/DisableTurboboostMixin.py
create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/CommonPerfTestTweakMixin.py
--
2.21.3
2 years, 11 months
[PATCH 0/2] Recipe Run export API change
by pgagne@redhat.com
From: Perry Gagne <pgagne(a)redhat.com>
These patches rework the API for exporting RecipeRuns.
Rather then using a wrapper object RecipeRunData, we just export the
RecipeRun itself. Also, compression was added to reduce file size.
Perry Gagne (2):
RecipeResults.py: Stop excluding RemoteDevices from export
Recipe.py: Changed run export/import API, added compression, fixedup
docs.
docs/source/recipe_run_export.rst | 16 +++++
docs/source/tester_api.rst | 1 +
lnst/Common/ConnectionHandler.py | 7 ++
lnst/Controller/Controller.py | 2 +-
lnst/Controller/Machine.py | 8 +++
lnst/Controller/Recipe.py | 97 ++++++++++++++++++++++++-
lnst/Controller/RecipeResults.py | 5 --
lnst/Controller/RecipeRunExport.py | 112 -----------------------------
lnst/Devices/RemoteDevice.py | 2 +
9 files changed, 131 insertions(+), 119 deletions(-)
create mode 100644 docs/source/recipe_run_export.rst
delete mode 100644 lnst/Controller/RecipeRunExport.py
--
2.26.2
2 years, 11 months
[PATCH 0/5] Recipe Run API Fix
by pgagne@redhat.com
From: Perry Gagne <pgagne(a)redhat.com>
These patches rework the API for exporting RecipeRuns.
Rather then using a wrapper object RecipeRunData, we just export the
RecipeRun itself. Also, compression was added to reduce file size.
fixes https://gitlab.cee.redhat.com/lnst-team/lnst/-/issues/29
Perry Gagne (5):
RecipeResults.py: Stop excluding RemoteDevices from export
RecipeRunExport.py: Changed API, added compression, fixedup docs.
Recipe.py: Made Recipe pickle-able
Recipe.py: Make export/import of runs based on RecipeRun directly
Recipe.py: Removed Recipe name property.
docs/source/recipe_run_export.rst | 16 +++++
docs/source/tester_api.rst | 1 +
lnst/Common/ConnectionHandler.py | 7 ++
lnst/Controller/Controller.py | 2 +-
lnst/Controller/Machine.py | 8 +++
lnst/Controller/Recipe.py | 97 ++++++++++++++++++++++++-
lnst/Controller/RecipeResults.py | 5 --
lnst/Controller/RecipeRunExport.py | 112 -----------------------------
lnst/Devices/RemoteDevice.py | 2 +
9 files changed, 131 insertions(+), 119 deletions(-)
create mode 100644 docs/source/recipe_run_export.rst
delete mode 100644 lnst/Controller/RecipeRunExport.py
--
2.26.2
2 years, 11 months
[PATCH v2 0/9] add DisableIdleStatesMixin and DisableIdleStatesMixin
by Jan Tluka
The following patch set is a second iteration of the implementation of mixin
classes to control CPU features - idle states and turboboost.
Differences to v1:
* mixin classes now inherit from BaseSubConfigMixin instead of
PerfTestTweakMixin
* added disable_turboboost_host_list and disable_idlestates properties
to specify on which hosts the CPU feature should be disabled
* added documentation for both mixins
*** BLURB HERE ***
Jan Tluka (9):
Recipes.ENRT.PerfTestMixins.SctpFirewallPerfTestMixin: move
_get_flow_measurement_from_config() to base class
Recipes.ENRT.ConfigMixins: add DisableIdleStatesMixin
Recipes.ENRT.ConfigMixins: add DisableTurboboostMixin
Recipes.ENRT.PerfTestMixins: add CommonPerfTestTweakMixin
Recipes.ENRT.BaseEnrtRecipe: inherit from CommonPerfTestTweakMixin
Recipes.ENRT.BaseEnrtRecipe: add DisableTurboboost and
DisableIdleStates mixins
Recipes.ENRT: define disable_turboboost_host_list and
disable_idlestates_host_list properties
docs: add DisableTurboboostMixin documentation
docs: add DisableIdleStatesMixin documentation
.../disable_idlestates_mixin.rst | 6 ++
.../disable_turboboost_mixin.rst | 6 ++
docs/source/config_mixins.rst | 2 +
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 10 ++-
lnst/Recipes/ENRT/BondRecipe.py | 28 ++++++++
.../ConfigMixins/DisableIdleStatesMixin.py | 57 +++++++++++++++
.../ConfigMixins/DisableTurboboostMixin.py | 71 +++++++++++++++++++
lnst/Recipes/ENRT/DoubleBondRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/DoubleTeamRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/IpsecEspAeadRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/IpsecEspAhCompRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/NoVirtOvsVxlanRecipe.py | 28 ++++++++
.../PerfTestMixins/BasePerfTestTweakMixin.py | 6 ++
.../CommonPerfTestTweakMixin.py | 6 ++
.../SctpFirewallPerfTestMixin.py | 6 --
lnst/Recipes/ENRT/PerfTestMixins/__init__.py | 1 +
.../ENRT/ShortLivedConnectionsRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/SimpleMacsecRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/SimpleNetworkRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/TeamRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/TeamVsBondRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/VirtOvsVxlanRecipe.py | 28 ++++++++
.../VirtualBridgeVlanInGuestMirroredRecipe.py | 28 ++++++++
.../ENRT/VirtualBridgeVlanInGuestRecipe.py | 28 ++++++++
.../VirtualBridgeVlanInHostMirroredRecipe.py | 28 ++++++++
.../ENRT/VirtualBridgeVlanInHostRecipe.py | 28 ++++++++
.../ENRT/VirtualBridgeVlansOverBondRecipe.py | 28 ++++++++
...rtualOvsBridgeVlanInGuestMirroredRecipe.py | 28 ++++++++
.../ENRT/VirtualOvsBridgeVlanInGuestRecipe.py | 28 ++++++++
...irtualOvsBridgeVlanInHostMirroredRecipe.py | 28 ++++++++
.../ENRT/VirtualOvsBridgeVlanInHostRecipe.py | 28 ++++++++
.../VirtualOvsBridgeVlansOverBondRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/VlansRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/VxlanMulticastRecipe.py | 28 ++++++++
lnst/Recipes/ENRT/VxlanRemoteRecipe.py | 28 ++++++++
37 files changed, 919 insertions(+), 8 deletions(-)
create mode 100644 docs/source/config_mixin_classes/disable_idlestates_mixin.rst
create mode 100644 docs/source/config_mixin_classes/disable_turboboost_mixin.rst
create mode 100644 lnst/Recipes/ENRT/ConfigMixins/DisableIdleStatesMixin.py
create mode 100644 lnst/Recipes/ENRT/ConfigMixins/DisableTurboboostMixin.py
create mode 100644 lnst/Recipes/ENRT/PerfTestMixins/CommonPerfTestTweakMixin.py
--
2.21.3
2 years, 11 months
[PATCH 1/5] Recipes.ENRT.PerfTestMixins.SctpFirewallPerfTestMixin: move _get_flow_measurement_from_config() to base class
by Jan Tluka
This method will be reused by other mixin classes.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py | 6 ++++++
.../ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py b/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py
index 380fc72e..5e008a68 100644
--- a/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py
+++ b/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py
@@ -1,3 +1,5 @@
+from lnst.RecipeCommon.Perf.Measurements.BaseFlowMeasurement import BaseFlowMeasurement
+
class BasePerfTestTweakMixin(object):
"""
This is a base class that defines common API for specific *perf test*
@@ -13,3 +15,7 @@ class BasePerfTestTweakMixin(object):
def remove_perf_test_tweak(self, perf_config):
# TODO: check if anything left in the perf_config.perf_test_tweak_config
pass
+
+ def _get_flow_measurement_from_config(self, perf_config):
+ flow_measurements = [ m for m in perf_config.measurements if isinstance(m, BaseFlowMeasurement) ]
+ return flow_measurements[0]
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py
index 6c6cc416..c0520405 100644
--- a/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py
+++ b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py
@@ -1,13 +1,7 @@
from lnst.Controller.RecipeResults import ResultLevel
from lnst.Recipes.ENRT.PerfTestMixins import BasePerfTestTweakMixin
-from lnst.RecipeCommon.Perf.Measurements.BaseFlowMeasurement import BaseFlowMeasurement
class SctpFirewallPerfTestMixin(BasePerfTestTweakMixin):
-
- def _get_flow_measurement_from_config(self, perf_config):
- flow_measurements = [ m for m in perf_config.measurements if isinstance(m, BaseFlowMeasurement) ]
- return flow_measurements[0]
-
def apply_perf_test_tweak(self, perf_config):
super().apply_perf_test_tweak(perf_config)
--
2.21.3
2 years, 11 months
[PATCH] Recipes.ENRT.ConfigMixins.BaseHWConfigMixin: do not
initialize config if dev_list is empty
by Jan Tluka
If a specific config mixin's dev_list property is left unset, the mixin's description
would be silently discarded. In such cases the mixin should report that configuration
of the feature has been skipped. That should be similar to the case when the parameter
controlling the mixin is not specified.
Fixes issue 199
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py b/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
index c860291c..6fce028d 100644
--- a/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
+++ b/lnst/Recipes/ENRT/ConfigMixins/BaseHWConfigMixin.py
@@ -10,7 +10,9 @@ class BaseHWConfigMixin(object):
def _configure_dev_attribute(self, config, dev_list, attr_name, value):
hw_config = config.hw_config
- attr_cfg = hw_config[attr_name + "_configuration"] = {}
+ if len(dev_list) > 0:
+ attr_cfg = hw_config[attr_name + "_configuration"] = {}
+
for dev in dev_list:
attr_cfg[dev] = {}
attr_cfg[dev]["original"] = getattr(dev, attr_name)
--
2.21.3
2 years, 11 months