Hi, All: I'm studying Mesos code, become very confused about the internal working flow of executing a simple docker image, such as "mesos-execute --master=XXX --containerizer=docker --name=test --docker_image=XXX --shell=false". I believe "mesos-1.2.0/src/cli/*execute.cpp*" is the implementation of this "mesos-execute", which is called "Command Executor" in the official document.
I see "*execute.cpp*" internally setups a "CommandScheduler", which has a "received()" function that listens for events from the master. If it receives an "*Event::OFFERS*", it will start the procedure of executing the tasks on the offered resources (slaves). However, I cannot find exactly where is the resource offered to the client executable. I see there is an "offer()" function in "mesos-1.2.0/src/master/*master.cpp*". But it sends a "*ResourceOffersMessage*", not an event, and no transforming the event to a message. I find that only "mesos-1.2.0/src/sched/*sched.cpp*" can receive and process this type of message. But I don't see how is "*sched.cpp*" used in other code.... So, I cannot find the exact workflow of sending the offered resource (from master), to the Command Executor. What's the scheduler for this Command Executor? Could someone help me to understand? Thanks