From c95f1f2b50d9928aed4a553eb89a59e97e8218c0 Mon Sep 17 00:00:00 2001 From: Sridutt Bhalachandra Date: Tue, 17 Jul 2018 13:59:42 -0500 Subject: [PATCH] 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 --- nrm/containers.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nrm/containers.py b/nrm/containers.py index 4167fa0..55ce22b 100644 --- a/nrm/containers.py +++ b/nrm/containers.py @@ -50,6 +50,8 @@ class ContainerManager(object): environ['AC_APP_NAME'] = manifest.name environ['AC_METADATA_URL'] = "localhost" logger.info("run: environ: %r", environ) + # TODO: Application library to load must be set during configuration + applicationpreloadlibrary = '.so' # create container container_name = request['uuid'] @@ -74,6 +76,12 @@ class ContainerManager(object): if manifest.app.isolators.perfwrapper.enabled in ["1", "True"]: 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.extend(args) process = self.nodeos.execute(container_name, argv, environ) -- 2.26.2