[
https://issues.apache.org/jira/browse/AURORA-633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14114056#comment-14114056
]
Jay Buffington commented on AURORA-633:
---------------------------------------
I spoke with [~wickman] about this a couple of weeks ago. He suggested we make
a {{Docker()}} at the same level as {{Task()}}. Based on that suggestion,
[~anindya.sinha] and I came up with this:
{noformat}
container = Container(
name="my-docker-task",
type="docker",
image="centos:6u5',
volumes=Volumes(
container_path="/mnt/foo",
host_path="/foo",
mode=RW
)
processes=[process_a, process_b],
constraints=order(process_a, process_b),
resources=Resources(cpu=1, disk=10*GB, ram=1*GB)
)
job = Job( task=container, ... )
{noformat}
Just like {{Service()}} is a {{Job(service=True)}}, {{Docker()}} is a
{{Container(type="docker")}}
The image no longer needs to be prefixed with docker:///. When Mesos's docker
containerizer was being developed docker:/// was going to be required, but that
requirement was dropped before 0.20 was released.
This supports all features in the ContainerInfo protobuf in Mesos 0.20 (see
https://github.com/apache/mesos/blob/master/include/mesos/mesos.proto#L849),
which is basically just image and volumes.
Notice the introduction of two new constants for Volume mode. Possible values
are RW and RO.
Thoughts?
> Support running Docker containers
> ---------------------------------
>
> Key: AURORA-633
> URL: https://issues.apache.org/jira/browse/AURORA-633
> Project: Aurora
> Issue Type: Epic
> Components: Client, Scheduler
> Reporter: Jay Buffington
> Assignee: Jay Buffington
>
> Mesos 0.20 will be released soon, and it will likely include support for a
> docker containerizer. See MESOS-1524.
> To make use of this feature, I propose modifying aurora's DSL to support
> running docker containers both with and without the aurora executor.
> Task would be changed to introduce a container field and make processes
> optional when a container is specified. A Task to launch a Docker container
> using the entry point (aka command) specified in the container would look
> like this:
> {noformat}
> Task(
> name="my-task",
> container=Docker(
> image="docker:///centos:6u5',
> ),
> resources=Resources(cpu=1, disk=10*GB, ram=1*GB)
> )
> {noformat}
> If you specify processes in your Task then the docker containerizer will
> fetch and launch the aurora executor for you. This would run {{process_a}}
> then {{process_b}} inside the same docker container using the aurora executor:
> {noformat}
> Task(
> name="my-task",
> container=Docker(
> image="docker:///centos:6u5',
> ),
> processes=[process_a, process_b],
> constraints=order(process_a, process_b),
> resources=Resources(cpu=1, disk=10*GB, ram=1*GB)
> )
> {noformat}
> The Docker() struct would closely model the fields that will be in the
> DockerInfo protobuf message detailed here:
> https://github.com/tnachen/mesos/wiki/DockerInfo-design
--
This message was sent by Atlassian JIRA
(v6.2#6252)