[
https://issues.apache.org/jira/browse/MESOS-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14972947#comment-14972947
]
Vaibhav Khanduja commented on MESOS-2315:
-----------------------------------------
I believe this should be right, but i must admit I could not verify the “old
way” .., it does not seem to work for me ….I will work on MESOS example - OLD &
NEW ....once I know this is right ...
/// Old Way
CommandInfo command;
CommandInfo::ContainerInfo* containerInfo = command.mutable_container();
containerInfo->set_image("docker:///busybox");
command.set_value(“sleep 120“);
task.mutable_command()->CopyFrom(command);
Resource* resource;
resource = task.add_resources();
resource->set_name("cpus");
resource->set_type(Value::SCALAR);
resource->mutable_scalar()->set_value(CPUS_PER_TASK);
resource = task.add_resources();
resource->set_name("mem");
resource->set_type(Value::SCALAR);
resource->mutable_scalar()->set_value(MEM_PER_TASK);
tasks.push_back(task);
cpus -= CPUS_PER_TASK;
mem -= MEM_PER_TASK;
// New Way
task.mutable_command()->set_value("echo hello");
ContainerInfo containerInfo;
containerInfo.set_type(ContainerInfo::DOCKER);
ContainerInfo::DockerInfo dockerInfo;
dockerInfo.set_image("busybox");
containerInfo.mutable_docker()->CopyFrom(dockerInfo);
task.mutable_container()->CopyFrom(containerInfo);
Resource* resource;
resource = task.add_resources();
resource->set_name("cpus");
resource->set_type(Value::SCALAR);
resource->mutable_scalar()->set_value(CPUS_PER_TASK);
resource = task.add_resources();
resource->set_name("mem");
resource->set_type(Value::SCALAR);
resource->mutable_scalar()->set_value(MEM_PER_TASK);
tasks.push_back(task);
cpus -= CPUS_PER_TASK;
mem -= MEM_PER_TASK;
> 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)