Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-4100

Include ContainerID in certain Hook interface calls?

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 0.25.0
    • None
    • c++ api
    • None

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            nickbp Nicholas Parker
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: