Commit b666f1c2 authored by Kamil Iskra's avatar Kamil Iskra
Browse files

Configure perf-wrapper using the manifest

parent 1498ec1b
......@@ -17,6 +17,12 @@
"cpus": "4",
"mems": "1"
"name": "argo/perfwrapper",
"value": {
"enabled": "1"
......@@ -125,13 +125,35 @@ class Container(SpecField):
"""Load container information."""
return super(Container, self).load(data)
class PerfWrapper(SpecField):
"""Information on whether to use perf for a container."""
fields = {"enabled": spec(unicode, False)
def __init__(self):
"""Create empty perf wrapper."""
def load(self, data):
"""Load perf wrapper information."""
ret = super(PerfWrapper, self).load(data)
if not ret:
return ret
if self.enabled not in ["0", "False", "1", "True"]:
logger.error("Invalid value of perfwrapper enabled: %s",
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/container": spec(Container, True),
"argo/perfwrapper": spec(PerfWrapper, False)
def __init__(self):
......@@ -65,6 +65,11 @@ class ContainerManager(object):
argv = []
# for now we place it within the container, but it's probably better
# if it's outside (so move it to NodeOSClient?)
if hasattr(, 'perfwrapper') and hasattr(, 'enabled') and in ["1", "True"]:
process = self.nodeos.execute(container_name, argv, environ)
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