Nicholas Parker created MESOS-4100:
--------------------------------------
Summary: Include ContainerID in certain Hook interface calls?
Key: MESOS-4100
URL: https://issues.apache.org/jira/browse/MESOS-4100
Project: Mesos
Issue Type: Improvement
Components: c++ api
Affects Versions: 0.25.0
Reporter: Nicholas Parker
Priority: Minor
I'm building an agent module which uses both the Isolator interface[1] to track
containers over their lifespan, and the Hook interface[2] to inject environment
variables into those containers.
Nearly all of the Isolator interface calls include the ContainerID, sometimes
as the sole identifier. Meanwhile the Hook.slaveExecutorEnvironmentDecorator
call is only given an ExecutorInfo, and doesn't have a ContainerID at all.
At the moment I'm working around the lack of ContainerID in the Hook call by
storing a temporary ExecutorInfo->ContainerID mapping when Isolator.prepare()
is called, then reading/clearing that mapping when
Hook.slaveExecutorEnvironmentDecorator() is called. While this workaround
appears to work for now, I worry that it will be brittle in the future, since
it depends on Isolator.prepare() consistently being called before
Hook.slaveExecutorEnvironmentDecorator().
The immediate issue is specific to including a ContainerID parameter within
Hook.slaveExecutorEnvironmentDecorator(), but it may make sense to determine if
other Hook calls should have similar updates.
[1]
https://git-wip-us.apache.org/repos/asf?p=mesos.git;a=blob;f=include/mesos/slave/isolator.hpp
[2]
https://git-wip-us.apache.org/repos/asf?p=mesos.git;a=blob;f=include/mesos/hook.hpp
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)