Commit c95f1f2b authored by Sridutt Bhalachandra's avatar Sridutt Bhalachandra

Modify environment to reflect powerpolicy manifest option

On enabling the powepolicy manifest option and setting the policy parameter to
any valid value (except "NONE") the application library providing contextual
information is loaded using LD_PRELOAD

See issue #10
parent a2274c7f
Pipeline #3633 failed with stages
...@@ -50,6 +50,8 @@ class ContainerManager(object): ...@@ -50,6 +50,8 @@ class ContainerManager(object):
environ['AC_APP_NAME'] = manifest.name environ['AC_APP_NAME'] = manifest.name
environ['AC_METADATA_URL'] = "localhost" environ['AC_METADATA_URL'] = "localhost"
logger.info("run: environ: %r", environ) logger.info("run: environ: %r", environ)
# TODO: Application library to load must be set during configuration
applicationpreloadlibrary = '.so'
# create container # create container
container_name = request['uuid'] container_name = request['uuid']
...@@ -74,6 +76,12 @@ class ContainerManager(object): ...@@ -74,6 +76,12 @@ class ContainerManager(object):
if manifest.app.isolators.perfwrapper.enabled in ["1", "True"]: if manifest.app.isolators.perfwrapper.enabled in ["1", "True"]:
argv.append('argo-perf-wrapper') argv.append('argo-perf-wrapper')
if hasattr(manifest.app.isolators, 'powerpolicy'):
if hasattr(manifest.app.isolators.powerpolicy, 'enabled'):
if manifest.app.isolators.powerpolicy.enabled in ["1", "True"]:
if manifest.app.isolators.powerpolicy.policy != "NONE":
environ['LD_PRELOAD'] = applicationpreloadlibrary
argv.append(command) argv.append(command)
argv.extend(args) argv.extend(args)
process = self.nodeos.execute(container_name, argv, environ) 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