Commit f41ef987 authored by Sridutt Bhalachandra's avatar Sridutt Bhalachandra
Browse files

[Feature] Update container creation info in CManager

The container creation information (resources and powerpolicy) added to
`ContainerManager` class can be used to intiliaze power policy parameters
in the present and more in the future

See Issue #10
parent 7f94d98b
......@@ -7,7 +7,8 @@ import os
from subprograms import ChrtClient, NodeOSClient, resources
logger = logging.getLogger('nrm')
Container = namedtuple('Container', ['uuid', 'manifest', 'process'])
Container = namedtuple('Container', ['uuid', 'manifest', 'resources',
'powerpolicy', 'process'])
class ContainerManager(object):
......@@ -56,7 +57,8 @@ class ContainerManager(object):
environ['ARGO_CONTAINER_UUID'] = container_name"creating container %s", container_name)
self.nodeos.create(container_name, allocation)"created container %s", container_name)
container_resources = dict()
container_resources['cpus'], container_resources['mems'] = allocation
# Container power policy information
container_powerpolicy = dict()
......@@ -95,9 +97,11 @@ class ContainerManager(object):
process = self.nodeos.execute(container_name, argv, environ)
c = Container(container_name, manifest, process)
c = Container(container_name, manifest, container_resources,
container_powerpolicy, process)
self.pids[] = c
self.containers[container_name] = c"Container %s created and running : %r", container_name, c)
return c
def delete(self, uuid):
......@@ -86,6 +86,7 @@ class Daemon(object):
'uuid': container_uuid,
'errno': 0 if container else -1,
'powerpolicy': container.powerpolicy['policy']
# setup io callbacks
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