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

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

I debugged why the old (docker:://busybox) .. as in slave/docker,cpp __launch 
there is code which checks for ContainerInfo::DOCKER 


  if (containerInfo.get().type() != ContainerInfo::DOCKER) {
    LOG(INFO) << "Skipping non-docker container";
    return false;
  }

Anyways
.......................

Here is final version, I improvised a bit more, I will send this out by 
tomorrow morning (PST).

Hello,

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.

We would like to remove CommandInfo::ContainerInfo from the framework api. 
Please look through your code and let us know if anybody is using this. 

To explain more, the code marked "old", shall not work with this change.

The example code with old ContainerInfo used for launching 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”);

The example code with old ContainerInfo used for launching Docker Container:

CommandInfo command;
CommandInfo::ContainerInfo containerInfo;
containerInfo.set_image("docker:///busybox");
containerInfo.add_options("-v /tmp:/tmp");
command.set_value("echo hello");
command.mutable_container()->CopyFrom(containerInfo);
task.mutable_command()->CopyFrom(command);


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”);
ContainerInfo containerInfo;
containerInfo.set_type(ContainerInfo::DOCKER);
ContainerInfo::DockerInfo dockerInfo;
dockerInfo.set_image("busybox");
containerInfo.mutable_docker()->CopyFrom(dockerInfo);
task.mutable_container()->CopyFrom(containerInfo);


Thanks



> 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