Hi Frank,

the way I understand it, it will soon be possible to use custom and default 
Mesos isolators together with Docker via the unified container support in 
Mesos. Basically, goal is is to support docker image format without relying on 
docker daemon.

https://issues.apache.org/jira/browse/MESOS-2840

Best Regards,
Stephan
________________________________________
From: Frank Scholten <fr...@frankscholten.nl>
Sent: Wednesday, November 25, 2015 11:50 AM
To: modules@mesos.apache.org
Subject: Mesos Flocker - Custom Isolator and Docker

Hi all,

We (Frank Scholten and Phil Winder) are currently developing the Mesos
Flocker framework. As part of this framework we want to develop a
custom isolator module which interacts with the Flocker Control
Service.

After creating a simple stub isolator and installing it on one of the
agents we noticed it gets picked up we run a regular task but it does
not get picked up when we run a Docker container.

To us it seems that this is because isolators can only be used by the
MesosContainerizer. The MesosContainerizer configures isolation in its
create factory method while the DockerContainerizes does not:

MesosContainerizer

Try<MesosContainerizer*> MesosContainerizer::create(
    const Flags& flags,
    bool local,
    Fetcher* fetcher)
{
  string isolation;

  if (flags.isolation == "process") {
    LOG(WARNING) << "The 'process' isolation flag is deprecated, "
                 << "please update your flags to"
                 << " '--isolation=posix/cpu,posix/mem'.";

    isolation = "posix/cpu,posix/mem";
  } else if (flags.isolation == "cgroups") {
    LOG(WARNING) << "The 'cgroups' isolation flag is deprecated, "
                 << "please update your flags to"
                 << " '--isolation=cgroups/cpu,cgroups/mem'.";

    isolation = "cgroups/cpu,cgroups/mem";
  } else {
    isolation = flags.isolation;
  }

DockerContainerizer

Try<DockerContainerizer*> DockerContainerizer::create(
    const Flags& flags,
    Fetcher* fetcher)
{
  Try<Docker*> create = Docker::create(flags.docker, flags.docker_socket, true);
  if (create.isError()) {
    return Error("Failed to create docker: " + create.error());
  }

  Shared<Docker> docker(create.get());

  if (flags.docker_mesos_image.isSome()) {
    Try<Nothing> validateResult = docker->validateVersion(Version(1, 5, 0));
    if (validateResult.isError()) {
      string message = "Docker with mesos images requires docker 1.5+";
      message += validateResult.error();
      return Error(message);
    }
  }

  return new DockerContainerizer(flags, fetcher, docker);
}

The question now is how can we create an isolator to work together
with the DockerContainerizer. Should we subclass the
DockerContainerizer and create a FlockerContainerizer instead? Any
other suggestions?

Thanks in advance.

Cheers,

Frank and Phil

Reply via email to