Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Nested Containers & Task Groups

Vinod Kone
November 19, 2016

Nested Containers & Task Groups

Keynote - MesosCon Asia 2016

Vinod Kone

November 19, 2016
Tweet

More Decks by Vinod Kone

Other Decks in Technology

Transcript

  1. About Us Vinod Kone • Apache Mesos Committer (since ‘12)

    • Engineer Manager @ Mesosphere • Previously: Tech Lead @ Twitter • PhD @ UCSB Jie Yu • Apache Mesos Committer (since ‘14) • Tech Lead @ Mesosphere • Previously: Sr. Engineer @ Twitter • PhD @ UMich
  2. History of Containers in Mesos 0.10.0 0.18.0 Cgroups support (cpu,

    mem) Pluggable Isolators 0.20.0 Docker containers + Network monitoring 0.28.0 Docker containers without Docker daemon 1.0.0 CNI 1.1.0 Nested containers
  3. Primitives: Executors and Tasks • Schedulers launch tasks ◦ Tasks

    specify executor • Executors run tasks ◦ Multiple tasks per executor ◦ Executor per container Agent Executor Executor Task Task Task Task Container Container
  4. Limitations • Managing a group of co-located tasks is hard

    ◦ All or nothing semantics • One image per container ◦ Tasks cannot have a different image than executor • No resource isolation between tasks within executor
  5. A new primitive: A Mesos “Pod” • Ability to manage

    co-located and co-scheduled tasks as a single unit • Tasks should be able to share some but not all resources ◦ e.g., Sharing: Network namespace, Volumes ◦ e.g., Exclusive: Container Image • Dynamically updatable ◦ e.g., Resources can be added or removed at run time • Hierarchical isolation
  6. New Primitive: Task Group • Schedulers can launch a group

    of tasks together ◦ ‘TaskGroupInfo’ object ◦ ‘LAUNCH_GROUP’ offer operation • Executors atomically received task group ◦ ‘LAUNCH_GROUP’ event
  7. New Primitive: Nested Container • Support arbitrary levels of nesting

    • Re-use all existing isolators • Allow dynamically creation of nested containers Agent Container Executor Container Container Task Task
  8. New Agent API for Nested Containers message agent::Call { enum

    Type { // Calls for managing nested containers // under an executor's container. LAUNCH_NESTED_CONTAINER = 14; WAIT_NESTED_CONTAINER = 15; KILL_NESTED_CONTAINER = 16; } }
  9. Nested containerization semantics • Controlled by the isolators configured by

    the operator ◦ Flexible ◦ Customizable • Current default behavior ◦ NET and UTS namespaces are shared ◦ MNT namespace is not shared ◦ Cgroup is shared
  10. New executor: Default executor • Handles task groups • Uses

    v1 HTTP API • Will eventually replace command executor • Current restart policy ◦ Suicide if any container terminates with non zero exit status ◦ Will support a more sophisticated restart policy later