[ 
https://issues.apache.org/jira/browse/MESOS-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14965898#comment-14965898
 ] 

Vaibhav Khanduja commented on MESOS-2315:
-----------------------------------------

Apologies for not coming on this quickly. Please correct me if I am wrong.  

........
Mesos 0.20.0 shipped new ContainerInfo type. The framework making using of it, 
should use TaskInfo with semantics:

a) The new ContainerInfo message has type field “type” field. The current 
supported options are Docker & Mesos and is designed so as it can be extended.
b) CommandInfo: launches a command in a container.
c) CommandInfo and ContainerInfo  runs the supplied command as a task with the 
CommandExecutor inside the specified container.

The example code with old ContainerInfo

TaskInfo task;
task.set_name("Task " + lexical_cast<string>(taskId));
task.mutable_task_id()->set_value(lexical_cast<string>(taskId));
task.mutable_slave_id()->MergeFrom(offer.slave_id());
task.mutable_command()->set_value(“touch hello.txt”);


The example code with new ContainerInfo for Docker container

TaskInfo task;
task.set_name("Task " + lexical_cast<string>(taskId));
task.mutable_task_id()->set_value(lexical_cast<string>(taskId));
task.mutable_slave_id()->MergeFrom(offer.slave_id());
task.mutable_command()->set_value(“touch hello.txt”);


// Use Docker to run the task.
ContainerInfo containerInfo;
containerInfo.set_type(ContainerInfo::DOCKER);
ContainerInfo::DockerInfo dockerInfo;
dockerInfo.set_image("busybox");
containerInfo.mutable_docker()->CopyFrom(dockerInfo);
task.mutable_container()->CopyFrom(containerInfo);

The example code with new ContainerInfo for Mesos container


TaskInfo task;
task.set_name("Task " + lexical_cast<string>(taskId));
task.mutable_task_id()->set_value(lexical_cast<string>(taskId));
task.mutable_slave_id()->MergeFrom(offer.slave_id());
task.mutable_command()->set_value(“touch hello.txt”);
 
 // Use Mesos to run the task.
ContainerInfo containerInfo;
containerInfo.set_type(ContainerInfo::MESOS);
ContainerInfo::MesosInfo mesosInfo;
task.mutable_command()->set_shell(true);
task.mutable_container()->CopyFrom(containerInfo);

> Deprecate / Remove CommandInfo::ContainerInfo
> ---------------------------------------------
>
>                 Key: MESOS-2315
>                 URL: https://issues.apache.org/jira/browse/MESOS-2315
>             Project: Mesos
>          Issue Type: Task
>            Reporter: Ian Downes
>            Assignee: Vaibhav Khanduja
>            Priority: Minor
>              Labels: mesosphere, newbie
>
> IIUC this has been deprecated and all current code (except 
> examples/docker_no_executor_framework.cpp) uses the top-level ContainerInfo?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to