Commit 720bd8a7 authored by Valentin Reis's avatar Valentin Reis
Browse files

[fix] Fixes dead manifest field access.

parent 6731ca05
Pipeline #8600 failed with stages
in 1 minute and 46 seconds
...@@ -77,7 +77,7 @@ class ContainerManager(object): ...@@ -77,7 +77,7 @@ class ContainerManager(object):
container_power['profile']['end'] = dict() container_power['profile']['end'] = dict()
if pp['policy'] != "NONE": if pp['policy'] != "NONE":
container_power['policy'] = pp['policy'] container_power['policy'] = pp['policy']
container_power['damper'] = manifest.ratelimit container_power['damper'] = str(manifest.app['monitoring']['ratelimit'])
container_power['slowdown'] = pp['slowdown'] container_power['slowdown'] = pp['slowdown']
# Compute hardware bindings # Compute hardware bindings
...@@ -136,7 +136,7 @@ class ContainerManager(object): ...@@ -136,7 +136,7 @@ class ContainerManager(object):
# monitoring section involves libnrm # monitoring section involves libnrm
if manifest.is_feature_enabled('monitoring'): if manifest.is_feature_enabled('monitoring'):
environ['ARGO_NRM_RATELIMIT'] = \ environ['ARGO_NRM_RATELIMIT'] = \
manifest.app['monitoring']['ratelimit'] str(manifest.app['monitoring']['ratelimit'])
if container.power.get('policy') or \ if container.power.get('policy') or \
manifest.is_feature_enabled('monitoring'): manifest.is_feature_enabled('monitoring'):
......
...@@ -13,7 +13,7 @@ from __future__ import print_function ...@@ -13,7 +13,7 @@ from __future__ import print_function
from applications import ApplicationManager from applications import ApplicationManager
from containers import ContainerManager, NodeOSRuntime, SingularityUserRuntime from containers import ContainerManager, NodeOSRuntime, SingularityUserRuntime
from controller import Controller, PowerActuator from controller import Controller, PowerActuator
from powerpolicy import PowerPolicyManager # from powerpolicy import PowerPolicyManager
from functools import partial from functools import partial
import logging import logging
import os import os
...@@ -68,7 +68,7 @@ class Daemon(object): ...@@ -68,7 +68,7 @@ class Daemon(object):
if c.power['policy']: if c.power['policy']:
app.update_phase_context(event) app.update_phase_context(event)
# Run container policy # Run container policy
self.controller.run_policy_container(c, app) # self.controller.run_policy_container(c, app)
elif event.tag == 'exit': elif event.tag == 'exit':
uuid = event.application_uuid uuid = event.application_uuid
if uuid in self.application_manager.applications: if uuid in self.application_manager.applications:
...@@ -98,12 +98,12 @@ class Daemon(object): ...@@ -98,12 +98,12 @@ class Daemon(object):
pid, container = self.container_manager.create(params) pid, container = self.container_manager.create(params)
container_uuid = container.uuid container_uuid = container.uuid
if len(container.processes) == 1: if len(container.processes) == 1:
if container.power['policy']: # if container.power['policy']:
container.power['manager'] = PowerPolicyManager( # container.power['manager'] = PowerPolicyManager(
container.resources.cpus, # container.resources.cpus,
container.power['policy'], # container.power['policy'],
float(container.power['damper']), # float(container.power['damper']),
float(container.power['slowdown'])) # float(container.power['slowdown']))
if container.power['profile']: if container.power['profile']:
p = container.power['profile'] p = container.power['profile']
p['start'] = self.machine_info['energy']['energy'] p['start'] = self.machine_info['energy']['energy']
...@@ -166,11 +166,12 @@ class Daemon(object): ...@@ -166,11 +166,12 @@ class Daemon(object):
limit=self.target) limit=self.target)
def do_control(self): def do_control(self):
plan = self.controller.planify(self.target, self.machine_info) pass
action, actuator = plan # plan = self.controller.planify(self.target, self.machine_info)
if action: # action, actuator = plan
self.controller.execute(action, actuator) # if action:
self.controller.update(action, actuator) # self.controller.execute(action, actuator)
# self.controller.update(action, actuator)
# Call policy only if there are containers # Call policy only if there are containers
# if self.container_manager.containers: # if self.container_manager.containers:
# self.controller.run_policy(self.container_manager.containers) # self.controller.run_policy(self.container_manager.containers)
...@@ -219,8 +220,8 @@ class Daemon(object): ...@@ -219,8 +220,8 @@ class Daemon(object):
# deal with container exit # deal with container exit
diff = {} diff = {}
p = container.power p = container.power
if p['policy']: # if p['policy']:
p['manager'].reset_all() # p['manager'].reset_all()
if p['profile']: if p['profile']:
e = p['profile']['end'] e = p['profile']['end']
self.machine_info = self.sensor_manager.do_update() self.machine_info = self.sensor_manager.do_update()
......
...@@ -35,7 +35,7 @@ class SensorManager: ...@@ -35,7 +35,7 @@ class SensorManager:
self.cputopology = coolr.clr_nodeinfo.cputopology() self.cputopology = coolr.clr_nodeinfo.cputopology()
self.coretemp = coolr.clr_hwmon.coretemp_reader() self.coretemp = coolr.clr_hwmon.coretemp_reader()
self.rapl = coolr.clr_rapl.rapl_reader() self.rapl = coolr.clr_rapl.rapl_reader()
self.msr = coolr.msr.Msr() # self.msr = coolr.msr.Msr()
def start(self): def start(self):
self.rapl.start_energy_counter() self.rapl.start_energy_counter()
......
...@@ -130,6 +130,7 @@ class NodeOSClient(object): ...@@ -130,6 +130,7 @@ class NodeOSClient(object):
# to escape spaces from arguments before. # to escape spaces from arguments before.
argv = [s.replace(' ', r'\ ') for s in argv] argv = [s.replace(' ', r'\ ') for s in argv]
cmd += " argv:'"+" ".join(argv)+"'" cmd += " argv:'"+" ".join(argv)+"'"
logger.error(environ)
env = ['{0}={1}'.format(envname, envval.replace(' ', r'\ ')) env = ['{0}={1}'.format(envname, envval.replace(' ', r'\ '))
for envname, envval in environ.items()] for envname, envval in environ.items()]
cmd += " env:'"+" ".join(env)+"'" cmd += " env:'"+" ".join(env)+"'"
......
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