Wenzhao,

I am sure your read some docs about Mesos, have you seen overview pages [1,
2, 3]? I think they will help to better understand the big picture, what
the moving parts are and how they interact.

To your questions,

1. There are two types of schedulers: those using "legacy" aka "libprocess"
API and those using HTTP API. The differences are in the way the scheduler
is connected to the master, the actual communication process is the same.
Simplified, it looks like "connect to the master -> get registered -> get
some resources offers -> decline resource offers / use some resources to
launch tasks -> get updates about launched tasks' statuses". Have a look at
[4] to get a better understanding how the scheduler<->master communication
protocol looks like.

File "execute.cpp" is a very simple scheduler, not executor. It relies on
one of the built-in executors to run its tasks. If you want to have a look,
[5] is one of such executors.

2. Framework info is not directly distributed to slaves (we prefer to call
them agents). Once a framework decides to launch a task on offered
resources, master forwards the task specification to the respective agent.
All the agent cares about is instructions how to launch the task, which
includes which executor to use (if omitted, a built-in executors is used).

Alex.

[1] https://mesos.apache.org/documentation/latest/architecture/
[2]
https://mesos.apache.org/documentation/latest/app-framework-development-guide/
[3] https://mesos.apache.org/documentation/latest/scheduler-http-api/
[4]
https://github.com/apache/mesos/blob/master/include/mesos/scheduler/scheduler.proto
[5] https://github.com/apache/mesos/blob/master/src/launcher/executor.cpp

On Fri, Jun 2, 2017 at 12:11 AM, Wenzhao Zhang <[email protected]> wrote:

> Hi, All:
>
> I just start working on Mesos source code for a research project. I become
> confused about the starting procedure, thus need some help.
> I'm talking about the working procedure of using, "mesos-execute" to
> execute a docker image.
>
> 1. How is resource offered to the framework (docker) from master?
> In Master::offer(), I find a "ResourceOffersMessage" is sent.
> I search the source code, find that only "mesos-1.2.0/src/sched/*sched.
> cpp*"
> has a function to receive this message, and this function finally invokes a
> scheduler-driver to finish the task.
> But, I believe this is not the procedure in which resource is offered to
> the docker-image, as I don't see any logic of "mesos-1.2.0/src/cli/
> *execute.cpp*" using "*sched.cpp*";    and according to the documentation,
>  "Mesos provides a simple executor that can execute shell commands and
> Docker containers on behalf of the framework scheduler".
>
>    In "*execute.cpp*", I see a "offers()" function, which finally executes
> some executors. But I don't see where this function is call from the
> master?
>    How does this simple executor executes shell commands and Docker
> containers on behalf of the framework scheduler?
>    How is the "*sched.cpp*" used in the source code?
>
>
> 2. After "execute.cpp" subscribes to the master, "framework" information is
> created in the master.
>    But how is this "framework" info distributed to the slaves?  I become
> confused about this procedure.
>
> Could anyone kindly give some suggestions?
> Thanks very much
>
> Wenzhao
>

Reply via email to