Commit 1c4e2816 authored by Sridutt Bhalachandra's avatar Sridutt Bhalachandra

Added option to manifest file to enable power policy

parent ed66373f
Pipeline #3630 passed with stages
in 19 seconds
......@@ -23,6 +23,13 @@
"value": {
"enabled": "1"
}
},
{
"name": "argo/powerpolicy",
"value": {
"enabled": "0",
"policy": "NONE"
}
}
]
}
......
......@@ -149,13 +149,44 @@ class PerfWrapper(SpecField):
return True
class PowerPolicy(SpecField):
"""Information on whether to use power policy for a container."""
policies = ['NONE', 'DDCM', 'DVFS', 'COMBINED']
fields = {"enabled": spec(unicode, False),
"policy": spec(unicode, False)
}
def __init__(self):
"""Create empty perf wrapper."""
pass
def load(self, data):
"""Load perf wrapper information."""
ret = super(PowerPolicy, self).load(data)
if not ret:
return ret
if self.enabled not in ["0", "False", "1", "True"]:
logger.error("Invalid value of powerpolicy enabled: %s",
self.enabled)
return False
if self.policy not in self.policies:
logger.error("Invalid value of powerpolicy policy: %s",
self.policy)
return False
return True
class IsolatorList(SpecField):
"""Represent the list of isolator in a Manifest."""
types = {"argo/scheduler": spec(Scheduler, False),
"argo/container": spec(Container, True),
"argo/perfwrapper": spec(PerfWrapper, False)
"argo/perfwrapper": spec(PerfWrapper, False),
"argo/powerpolicy": spec(PowerPolicy, False)
}
def __init__(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment