This is an automatically generated e-mail. To reply, visit:

(Updated 四月 19, 2016, 4:45 p.m.)

Review request for mesos, Gilbert Song and Jie Yu.

Repository: mesos


PoC: Docker Volume Isolator.

Diffs (updated)

  src/CMakeLists.txt aabb33dfd4b985fe5774f87bb63b4ec1ec853962 
  src/Makefile.am 5a2b4efa781752863d6751f98614fb78bece73ac 
  src/cli/execute.cpp 087a73143d739f41638b8335c7e24dfcd14bc7fb 
  src/slave/containerizer/mesos/isolators/docker/volume/driver.hpp PRE-CREATION 
  src/slave/containerizer/mesos/isolators/docker/volume/driver.cpp PRE-CREATION 
  src/slave/containerizer/mesos/isolators/docker/volume/paths.hpp PRE-CREATION 
  src/slave/containerizer/mesos/isolators/docker/volume/paths.cpp PRE-CREATION 
  src/slave/containerizer/mesos/isolators/docker/volume/state.hpp PRE-CREATION 
  src/slave/slave.cpp d82dec2b10d496065013eb4ad6a35dc054b72553 

Diff: https://reviews.apache.org/r/45673/diff/

Testing (updated)


message DockerVolumeMount {
  required string volume_driver = 1;
  required string volume_name = 2;

message DockerVolumeMountList {
  repeated DockerVolumeMount mounts = 1;

message DockerVolumeInfo {
  // Docker volume mount info for volume driver and volume name.
  required DockerVolumeMount dvm = 1;

  // Container path, this is optional as this is not needed by recover()
  // but only for prepare() .
  optional string container_path = 2;

  // Mount point for the container, this is optiona as this is only needed
  // by prepare().
  optional string mount_point = 3;
  // Volume driver mount options.
  optional Parameters driver_options = 4;

DockerVolumeMount will be checkpointed.

//   /var/run/mesos/isolators/docker/volume
//    |- <ID of Container1>/
//    |  |-- DockerVolumeMountList
//    |-- <ID of Container2>/
//    |  |-- DockerVolumeMountList
//    |-<ID of Container3>/
//    |- ...

Info structure
We assume that one container do not use multiple same volume driver and volume 
name pair.
struct Info
  Info (const list<DockerVolumeInfo>& _volumeInfos)
    : volumeInfos(_volumeInfos) {}

  list<DockerVolumeInfo> volumeInfos;

Hashmap in isolator:
hashmap<ContainerID, process::Owned<Info>> infos;
hashmap<string, int> volumeReference; // string is volume_driver::volume_name, 
e.g. convoy:dvd1

When cleanup, check the container’s mount point reference counter, if it is 
greater than 1, do not remove the mount point; If it is 1, unmount the mount 
We need to transfer the whole mount info to mount() as parameter to make sure 
that the container path can get its own related mount point. If the mount() 
only return a string, then we cannot get the relationship of container path and 
mount point.


Guangya Liu

Reply via email to