mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guangya Liu <gyliu...@gmail.com>
Subject Re: Review Request 36440: Enabled docker volume support for DockerContainerizer.
Date Tue, 14 Jun 2016 09:49:32 GMT

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

(Updated 六月 14, 2016, 9:49 a.m.)


Review request for mesos, Gilbert Song and Jie Yu.


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


Repository: mesos


Description
-------

Enabled docker volume support for DockerContainerizer.


Diffs (updated)
-----

  include/mesos/mesos.proto dbffb16f4317df786ee38999a49e4e89733ff9ff 
  include/mesos/v1/mesos.proto 39967fa09d2774d564f3df28277edea8ebcfb50d 
  src/docker/docker.cpp a6dcbe788abb8802baa2c70ec2fced1da75c7210 

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.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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message