Adam,

Having an HTTP API to kill a task would help.
I'd also suggest considering a 'native' killTask C++ API that can be 
called from within a resource allocation module (
https://issues.apache.org/jira/browse/MESOS-2160).
This is a more direct route, since the module runs inside the master 
process.
Currently, an allocation module is given one callback (to send resource 
offers) upon initialization. Technically, it should be possible to add 
another callback, for killing the tasks.
Authorization-wise, its not a problem, given the power already provided to 
such plug-in modules, that can easily starve frameworks etc.


From: Adam Bordelon <[email protected]>
Date: Mon, Jul 6, 2015 at 11:48 AM
Subject: Re: Task revocation
To: dev <[email protected]>


Gidon,

If your allocation module is capable of sending protobuf messages to the
master, you could send a KillTaskMessage with the proper frameworkId and
taskId and hack a way around the if condition at
https://github.com/apache/mesos/blob/0.23.0-rc1/src/master/master.cpp#L2946

I think in general, it would be great to add an authenticated/authorized
killTask endpoint on the master, for operators, tools, or services like
your allocator to use to kill tasks. This may be incorporated in the
upcoming HTTP API redesign.

On Thu, Jul 2, 2015 at 8:42 AM, Gidon Gershinsky <[email protected]> wrote:

> Thanks.
>
> Yep, that's what I meant by an out-of-band option. I wonder if there is 
a
> direct way to kill a task from inside a resource allocation module. Or 
to
> send a message from the resource allocation module to a framework.
>
> On Thu, Jul 2, 2015 at 6:09 PM, haosdent <[email protected]> wrote:
>
> > Hi, @Gidon. In fact, when you call framework.killTask. The framework
> would
> > send a KillTaskMessage contains frameworkId and taskId to Master. And
> then
> > Master forward this message to Slave. Ask Slave to kill this task.
> >
> > On Thu, Jul 2, 2015 at 10:18 PM, Gidon Gershinsky <[email protected]>
> > wrote:
> >
> > > Hi,
> > >
> > > We are developing a resource allocation module, using the new 
plug-in
> > > mechanism (taken directly from Github, thanks Alex, works smooth).
> > >
> > > Our module will need to revoke/kill tasks, eg to make space for more
> > > important ones (say when they call driver.requestResources, and no
> > > resources are available). I know task revocation can't be done
> currently
> > > from the master/module, but there is a driver API that enables
> frameworks
> > > to kill their tasks.
> > >
> > > I can implement an out-of-band mechanism, where the module will
> > communicate
> > > with frameworks on a proprietary protocol, and tell them to kill a
> task.
> > > But I wonder if there is another option for master-framework 
messaging
> > > (callable from the allocation module), maybe similar to
> > executor-framework
> > > messaging? Or plans to add kill task API in the master/module?
> > >
> > > Thanks, Gidon
> > >
> >
> >
> >
> > --
> > Best Regards,
> > Haosdent Huang
> >
>

Reply via email to