-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36440/
-----------------------------------------------------------

(Updated May 9, 2016, 5:25 a.m.)


Review request for mesos, Gilbert Song and Jie Yu.


Summary (updated)
-----------------

Enabled docker volume support for DockerContainerizer.


Bugs: MESOS-5341
    https://issues.apache.org/jira/browse/MESOS-5341


Repository: mesos


Description (updated)
-------

Enabled docker volume support for DockerContainerizer.


Diffs (updated)
-----

  include/mesos/mesos.proto 73d4bc0ec3f34033eddf04aa41893c1fc66933b3 
  include/mesos/v1/mesos.proto 44b4f8a059f9dfdcbf02f0c30c1b859898c2e617 
  src/docker/docker.cpp 19cf424dfd5748ae66a7023840aa2b0652e8f2c0 

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


Testing (updated)
-------

make
make check

1) Start convoy
2) Create a volume named as c1
root@kvm-002605:~# convoy list
{
        "f3459d44-bbed-4e01-a7f6-6c6aa4b70cad": {
                "UUID": "f3459d44-bbed-4e01-a7f6-6c6aa4b70cad",
                "Name": "c1",
                "Driver": "devicemapper",
                "MountPoint": "",
                "CreatedTime": "Mon May 09 09:38:52 +0800 2016",
                "DriverInfo": {
                        "DevID": "1",
                        "Device": 
"/dev/mapper/f3459d44-bbed-4e01-a7f6-6c6aa4b70cad",
                        "Driver": "devicemapper",
                        "MountPoint": "",
                        "Size": "107374182400"
                },
                "Snapshots": {}
        }
}
3) Update  mesos-execte to set up volume
index 4711e80..6c712a2 100644
--- a/src/cli/execute.cpp
+++ b/src/cli/execute.cpp
@@ -72,6 +72,8 @@ using mesos::v1::TaskID;
 using mesos::v1::TaskInfo;
 using mesos::v1::TaskState;
 using mesos::v1::TaskStatus;
+using mesos::v1::Volume;
+using mesos::v1::Parameters;
 
 using mesos::v1::scheduler::Call;
 using mesos::v1::scheduler::Event;
@@ -581,6 +583,18 @@ private:
 
       containerInfo.set_type(ContainerInfo::DOCKER);
       containerInfo.mutable_docker()->set_image(dockerImage.get());
+      //containerInfo.mutable_docker()->set_volume_driver("convoy");
+
+      Volume* volume1 = containerInfo.add_volumes();
+      //volume1->set_host_path("c1");
+      volume1->set_container_path("/tmp");
+      volume1->mutable_source()->set_type(Volume::Source::DOCKER_VOLUME);
+      volume1->mutable_source()->mutable_docker_volume()->set_driver(
+          "convoy");
+      volume1->mutable_source()->mutable_docker_volume()->set_name(
+          "c1");
+      volume1->set_mode(Volume::RW);
+      cout << "Add Voume 1" << endl;
 
       if (networks.isSome() && !networks->empty()) {
         vector<string> tokens = strings::tokenize(networks.get(), ",");
4) Start master
./bin/mesos-master.sh --work_dir=/tmp/mesos/master
5) Start agent
GLOG_v=1 ./bin/mesos-slave.sh --master=10.0.0.65:5050 
--isolation=filesystem/linux,docker/runtime --containerizers=docker 
--work_dir=/tmp/mesos --image_providers=docker
5) Start mesos-execute
src/mesos-execute --master=10.0.0.65:5050 --name=test --command="sleep 10000" 
--docker_image=ubuntu:14.04 --containerizer=docker
I0509 13:14:56.118808  8320 scheduler.cpp:177] Version: 0.29.0
I0509 13:14:56.120827  8346 scheduler.cpp:479] New master detected at 
master@10.0.0.65:5050
Subscribed with ID 'acff7546-e8bf-4fad-a651-307c73297db0-0000'
Add Voume 1
Submitted task 'test' to agent '5454a953-83d0-42a4-b7fe-0825a6667f8c-S0'
Received status update TASK_RUNNING for task 'test'
  source: SOURCE_EXECUTOR
Received status update TASK_LOST for task 'test'

6) Inspect container
docker inspect xxxx
...........
{
    "Name": "c1",
    "Source": 
"/var/lib/convoy/devicemapper/mounts/f3459d44-bbed-4e01-a7f6-6c6aa4b70cad",
    "Destination": "/tmp",
    "Driver": "convoy",
    "Mode": "rw",
    "RW": true,
    "Propagation": "rprivate"
}
...........
7) Check sandbox executer log
I0509 13:14:56.313102  8361 logging.cpp:195] Logging to STDERR
I0509 13:14:56.315385  8361 process.cpp:999] libprocess is initialized on 
10.0.0.65:52853 with 16 worker threads
I0509 13:14:56.316789  8361 exec.cpp:150] Version: 0.29.0
I0509 13:14:56.321717  8387 exec.cpp:200] Executor started at: 
executor(1)@10.0.0.65:52853 with pid 8361
I0509 13:14:56.325158  8388 exec.cpp:225] Executor registered on agent 
5454a953-83d0-42a4-b7fe-0825a6667f8c-S0
I0509 13:14:56.326740  8388 exec.cpp:237] Executor::registered took 325332ns
I0509 13:14:56.327030  8388 exec.cpp:312] Executor asked to run task 'test'
I0509 13:14:56.327163  8388 exec.cpp:321] Executor::launchTask took 98803ns
I0509 13:14:56.327354  8386 docker.cpp:546] Volume config 'c1:/tmp' driver 
'convoy' for container 
'mesos-5454a953-83d0-42a4-b7fe-0825a6667f8c-S0.d2fb7a57-d364-41b8-a671-30b95c5cebb4'
I0509 13:14:56.327437  8386 docker.cpp:707] Running docker -H 
unix:///var/run/docker.sock run --cpu-shares 1024 --memory 134217728 -e 
MESOS_SANDBOX=/mnt/mesos/sandbox -e 
MESOS_CONTAINER_NAME=mesos-5454a953-83d0-42a4-b7fe-0825a6667f8c-S0.d2fb7a57-d364-41b8-a671-30b95c5cebb4
 --volume-driver=convoy -v c1:/tmp:rw -v 
/tmp/mesos/slaves/5454a953-83d0-42a4-b7fe-0825a6667f8c-S0/frameworks/acff7546-e8bf-4fad-a651-307c73297db0-0000/executors/test/runs/d2fb7a57-d364-41b8-a671-30b95c5cebb4:/mnt/mesos/sandbox
 --net host --entrypoint /bin/sh --name 
mesos-5454a953-83d0-42a4-b7fe-0825a6667f8c-S0.d2fb7a57-d364-41b8-a671-30b95c5cebb4
 ubuntu:14.04 -c sleep 10000


Thanks,

Guangya Liu

Reply via email to