GitLab maintenance scheduled form Friday, 2021-06-18 5:00pm to Satursday, 2021-06-19 10:00pm CT - Services will be unavailable during this time.

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 @@ ...@@ -23,6 +23,13 @@
"value": { "value": {
"enabled": "1" "enabled": "1"
} }
"name": "argo/powerpolicy",
"value": {
"enabled": "0",
"policy": "NONE"
} }
] ]
} }
...@@ -149,13 +149,44 @@ class PerfWrapper(SpecField): ...@@ -149,13 +149,44 @@ class PerfWrapper(SpecField):
return True 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."""
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",
return False
if self.policy not in self.policies:
logger.error("Invalid value of powerpolicy policy: %s",
return False
return True
class IsolatorList(SpecField): class IsolatorList(SpecField):
"""Represent the list of isolator in a Manifest.""" """Represent the list of isolator in a Manifest."""
types = {"argo/scheduler": spec(Scheduler, False), types = {"argo/scheduler": spec(Scheduler, False),
"argo/container": spec(Container, True), "argo/container": spec(Container, True),
"argo/perfwrapper": spec(PerfWrapper, False) "argo/perfwrapper": spec(PerfWrapper, False),
"argo/powerpolicy": spec(PowerPolicy, False)
} }
def __init__(self): def __init__(self):
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment