Search code examples
mesos

Mesos's resource information when executing a docker image


I'm working on Mesos code, and become very confused about the resource needed for executing a docker image.

In, src/cli/execute.cpp: CommandScheduler::offers(), it pulls out the resource from the task, and uses this resource information to check whether to accept or decline the offer.

However in CommandScheduler, I don't see anywhere the task's resource is updated. And in the main() function, where a CommandScheduler object is create, I only see a docker-image-string used to create the task-info, still no explicit compute resource usage information.

I need this resource information (code level) explicitly. Could anyone help me to understand this point?
I'm working on Mesos 1.2 right now.

Thanks


Solution

  • I got it. By default, the resource allocated is cpus:1;mem:128. It's done by flag default value for resources

    add(&Flags::resources,
        "resources",
        "Resources for the command.",
        "cpus:1;mem:128");