You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mesos.apache.org by Chengwei Yang <ch...@gmail.com> on 2015/04/30 05:55:57 UTC

Kill task with configurable options?

Hi List,

Is there a way to configure how mesos to kill task?

The background is we have a type of task, which running with mesos native docker
support. The task is a kind of message consumer which will take task from
message queue and take care of it. However, a task may be very large, costs
hours to finish, so we'd like to kill the container like this: send an
signal(TERM maybe) to it and wait for a configurable timeout to kill it with
KILL. So our task consumer can handle TERM and will exit once it finished
current task.

Is there a good way to do that or any other tips?

Thank you all in advance.


-- 
Thanks,
Chengwei

Spark on Mesos

Posted by Gidon Gershinsky <GI...@il.ibm.com>.
Hi all,

I have a few questions on how Spark is integrated with Mesos, thought I'd 
ask here first :), before going to the Spark list.
Any details, or pointers to a design document / relevant source, will be 
much appreciated.

I'm aware of this description,
https://github.com/apache/spark/blob/master/docs/running-on-mesos.md

But its pretty high-level as far as the design is concerned, while I'm 
looking into lower details on how Spark actually calls the Mesos APIs, how 
it launches the tasks, etc

Namely, 
1. Does Spark creates a Mesos Framework instance for each Spark 
application (SparkContext)?

2. Citing from the link above,
"In "fine-grained" mode (default), each Spark task runs as a separate 
Mesos task ... comes with an additional overhead in launching each task  "
Does it mean that the Mesos slave launches a Spark Executor for each task? 
(unlikely..) Or the slave host has a number of Spark Executors 
pre-launched (one per application), and sends the task to its 
application's executor? 
What is the resource offer then? Is it a host's cpu slice offered to any 
Framework (Spark app/context), that sends the task to run on it? Or its a 
'slice of app Executor' that got idle, and is offered to its Framework?

2. "The "coarse-grained" mode will instead launch only one long-running 
Spark task on each Mesos machine, and dynamically schedule its own 
"mini-tasks" within it. "
What is this special task? Is it the Spark app Executor? How these 
mini-tasks are different from 'regular' Spark tasks? How the resources are 
allocated/offered in this mode?



Regards, 
Gidon




Re: Kill task with configurable options?

Posted by Tim Chen <ti...@mesosphere.io>.
Hi Chengwei,

If you're launching tasks with Docker Containerizer, then we support a flag
you can set on the slave (docker_stop_timeout) then basically does what you
described.

At first when you kill a docker task, we're using the docker stop command
with that timeout value, which basically the docker daemon sends a SIGTERM
and escaltes to SIGKILL after the timeout.

Tim

On Wed, Apr 29, 2015 at 11:33 PM, Adam Bordelon <ad...@mesosphere.io> wrote:

> Chengwei, see the discussion of configurable SIGTERM/KILL escalation on
> https://issues.apache.org/jira/browse/MESOS-1571
>
> On Wed, Apr 29, 2015 at 8:55 PM, Chengwei Yang <chengwei.yang.cn@gmail.com
> > wrote:
>
>> Hi List,
>>
>> Is there a way to configure how mesos to kill task?
>>
>> The background is we have a type of task, which running with mesos native
>> docker
>> support. The task is a kind of message consumer which will take task from
>> message queue and take care of it. However, a task may be very large,
>> costs
>> hours to finish, so we'd like to kill the container like this: send an
>> signal(TERM maybe) to it and wait for a configurable timeout to kill it
>> with
>> KILL. So our task consumer can handle TERM and will exit once it finished
>> current task.
>>
>> Is there a good way to do that or any other tips?
>>
>> Thank you all in advance.
>>
>>
>> --
>> Thanks,
>> Chengwei
>>
>
>

Re: Kill task with configurable options?

Posted by Adam Bordelon <ad...@mesosphere.io>.
Chengwei, see the discussion of configurable SIGTERM/KILL escalation on
https://issues.apache.org/jira/browse/MESOS-1571

On Wed, Apr 29, 2015 at 8:55 PM, Chengwei Yang <ch...@gmail.com>
wrote:

> Hi List,
>
> Is there a way to configure how mesos to kill task?
>
> The background is we have a type of task, which running with mesos native
> docker
> support. The task is a kind of message consumer which will take task from
> message queue and take care of it. However, a task may be very large, costs
> hours to finish, so we'd like to kill the container like this: send an
> signal(TERM maybe) to it and wait for a configurable timeout to kill it
> with
> KILL. So our task consumer can handle TERM and will exit once it finished
> current task.
>
> Is there a good way to do that or any other tips?
>
> Thank you all in advance.
>
>
> --
> Thanks,
> Chengwei
>