A task doesn't get its own cgroup because task was supposed to represent a unit of work. That unit of work doesn't have to be necessarily done via a unix process or container. For example, the executor might realize a task as a thread!
That said, we did talk about providing an API for executors to launch tasks in nested containers. I think https://issues.apache.org/jira/browse/MESOS-3333 is the tracking ticket. On Mon, Jun 27, 2016 at 7:00 AM, Timothy Anderegg < [email protected]> wrote: > The same is true with all frameworks I've used, such as Marathon - each > executor manages one task (although it can have multiple "runs"). > > On Mon, Jun 27, 2016 at 9:49 AM haosdent <[email protected]> wrote: > > > Hi, @Dave If you use mesos-executor or mesos-docker-executor. It only > would > > launch one Task during executor lifecycle, so your problem does not > exist. > > > > On Mon, Jun 27, 2016 at 5:38 PM, Dave Webb <[email protected]> wrote: > > > > > Hi, > > > > > > I'm currently familiarizing myself with the Mesos source code and have > a > > > conceptual question about executors, tasks and the containerizer. > > > Basically, each executor gets its own container (and thus its own > cgroup > > > subtree ".../mesos/executor0" when using cgroup isolation). This > achieves > > > isolation between different executors. > > > > > > However, all Tasks which are eligible for the same executor, are just > > > assigned to it and the corresponding executor is "enlarged". > > > Yet, the individual tasks do not get their own container (and therefore > > no > > > cgroup subtree ".../mesos/executor0/task0" is created). > > > > > > From my understanding, this behavior implies that tasks within the same > > > executor are not isolated at all (at least when using cgroups). > > > Also when implementing your own executor, the API does not offer the > > > possibility to create individual containers for tasks. > > > > > > I find this quite inconsistent: > > > Tasks contain information about their assigned resources, but this > > > information has different meaning depending on the executors. > > > If a task has its own executor, its resources are isolated. But if > there > > > are multiple tasks within one executor, the sum of all resources is > > shared > > > within these tasks. > > > > > > Have I missed anything or why was this behavior chosen? > > > Wouldn't it be more consistent if resource were assigned to executors > > > instead of tasks? > > > > > > Thank you very much! > > > Dave > > > > > > > > > > > -- > > Best Regards, > > Haosdent Huang > > >
