Commit c7bdd5b2 authored by Swann Perarnau's avatar Swann Perarnau

[refactor] more sensible prefix order

Some of these commands prefix were in a bit of a weird order. In
particular, it makes sense to have perfwrapper at the end.
parent 9652c95d
...@@ -61,12 +61,6 @@ class ContainerManager(object): ...@@ -61,12 +61,6 @@ class ContainerManager(object):
logger.error("Manifest is invalid") logger.error("Manifest is invalid")
return None return None
if manifest.is_feature_enabled('scheduler'):
sched = manifest.app.isolators.scheduler
argv = self.chrt.getwrappedcmd(sched)
else:
argv = []
# Check if container exists else create it # Check if container exists else create it
if container_name in self.containers: if container_name in self.containers:
container = self.containers[container_name] container = self.containers[container_name]
...@@ -135,12 +129,11 @@ class ContainerManager(object): ...@@ -135,12 +129,11 @@ class ContainerManager(object):
else: else:
environ['NRM_DAMPER'] = pp.damper environ['NRM_DAMPER'] = pp.damper
# It would've been better if argo-perf-wrapper wrapped around # build prefix to the entire command based on enabled features
# argo-nodeos-config and not the final command -- that way it would argv = []
# be running outside of the container. However, because if manifest.is_feature_enabled('scheduler'):
# argo-nodeos-config is suid root, perf can't monitor it. sched = manifest.app.isolators.scheduler
if manifest.is_feature_enabled('perfwrapper'): argv = self.chrt.getwrappedcmd(sched)
argv.append(self.perfwrapper)
# Use hwloc-bind to launch each process in the conatiner by prepending # Use hwloc-bind to launch each process in the conatiner by prepending
# it as an argument to the command line, if enabled in manifest. # it as an argument to the command line, if enabled in manifest.
...@@ -153,6 +146,13 @@ class ContainerManager(object): ...@@ -153,6 +146,13 @@ class ContainerManager(object):
argv.append('--membind') argv.append('--membind')
argv.append('numa:'+str(hwbindings['distrib'][bind_index].mems[0])) argv.append('numa:'+str(hwbindings['distrib'][bind_index].mems[0]))
# It would've been better if argo-perf-wrapper wrapped around
# argo-nodeos-config and not the final command -- that way it would
# be running outside of the container. However, because
# argo-nodeos-config is suid root, perf can't monitor it.
if manifest.is_feature_enabled('perfwrapper'):
argv.append(self.perfwrapper)
argv.append(command) argv.append(command)
argv.extend(args) argv.extend(args)
......
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