Apache Mesos 命令执行器的调度程序是什么?
What is the scheduler for Apache Mesos's Command Executor?
我正在研究 Mesos 代码,对执行一个简单的 docker 图像的内部工作流程感到非常困惑,
例如:
mesos-execute --master=XXX \
--containerizer=docker \
--name=test \
--docker_image=XXX \
--shell=false
我相信/src/cli/execute.cpp
就是这个"mesos-execute"的实现,在官方文档中叫做"Command Executor"
我看到 execute.cpp
内部设置了一个 CommandScheduler
, which has a void received(queue<Event> events)
function that listens for events from the master. If it receives an Event::OFFERS
,它将启动在提供的资源(代理)上执行任务的过程。
但是,我找不到提供给客户端可执行文件的资源的确切位置。
我看到有一个 void Master::offer(…)
function in /src/master/master.cpp
. But it sends a ResourceOffersMessage
,不是事件,也没有将事件转换为消息。
我发现只有 /src/sched/sched.cpp
可以接收和处理这种类型的消息。但是我看不出 sched.cpp
在其他代码中是如何使用的....
因此,我无法找到将提供的资源(从 master)发送到命令执行器的确切工作流程。 此命令执行器的调度程序是什么?
有人可以帮我理解吗?
谢谢
I believe /src/cli/execute.cpp
is the implementation of this "mesos-execute", which is called "Command Executor" in the official document.
Command Executor 是一个通用执行器,根据文档,它有 "enough functionality for a wide variety of framework requirements". Executor is responsible for launching a task described in TaskInfo
由调度程序准备的消息。
事实上,Master 发送了一条资源提供消息,但它 evolve
s 到具有正确类型的完整事件。
CLI 使用 scheduler::Mesos
根据文档是 "concrete implementation that connects a scheduler to a Mesos master. Abstracts master detection (connection and disconnection)." received
传递一个回调并由此库调用。
我正在研究 Mesos 代码,对执行一个简单的 docker 图像的内部工作流程感到非常困惑, 例如:
mesos-execute --master=XXX \
--containerizer=docker \
--name=test \
--docker_image=XXX \
--shell=false
我相信/src/cli/execute.cpp
就是这个"mesos-execute"的实现,在官方文档中叫做"Command Executor"
我看到 execute.cpp
内部设置了一个 CommandScheduler
, which has a void received(queue<Event> events)
function that listens for events from the master. If it receives an Event::OFFERS
,它将启动在提供的资源(代理)上执行任务的过程。
但是,我找不到提供给客户端可执行文件的资源的确切位置。
我看到有一个 void Master::offer(…)
function in /src/master/master.cpp
. But it sends a ResourceOffersMessage
,不是事件,也没有将事件转换为消息。
我发现只有 /src/sched/sched.cpp
可以接收和处理这种类型的消息。但是我看不出 sched.cpp
在其他代码中是如何使用的....
因此,我无法找到将提供的资源(从 master)发送到命令执行器的确切工作流程。 此命令执行器的调度程序是什么? 有人可以帮我理解吗?
谢谢
I believe
/src/cli/execute.cpp
is the implementation of this "mesos-execute", which is called "Command Executor" in the official document.
Command Executor 是一个通用执行器,根据文档,它有 "enough functionality for a wide variety of framework requirements". Executor is responsible for launching a task described in TaskInfo
由调度程序准备的消息。
事实上,Master 发送了一条资源提供消息,但它 evolve
s 到具有正确类型的完整事件。
CLI 使用 scheduler::Mesos
根据文档是 "concrete implementation that connects a scheduler to a Mesos master. Abstracts master detection (connection and disconnection)." received
传递一个回调并由此库调用。