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

(Updated Aug. 24, 2017, 12:48 a.m.)


Review request for mesos, Jie Yu and Qian Zhang.


Changes
-------

Rebased.


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


Repository: mesos


Description
-------

A docker container can have a v4 and a v6 address. Currently the docker
executor was returning only the IPv4 address. This changes allows the
executor to return the IPv4 and IPv6 address of the container.


Diffs (updated)
-----

  src/docker/docker.hpp 95e60a7dbbd6ccc659f70ca3dca8d13433f3ea07 
  src/docker/docker.cpp 192e170acce895f80df6c83e437da020489de468 
  src/docker/executor.cpp 99a62244b7805d25b926d0293cb62574981d2878 


Diff: https://reviews.apache.org/r/61237/diff/3/

Changes: https://reviews.apache.org/r/61237/diff/2-3/


Testing
-------

Start agent:
sudo ./bin/mesos-agent.sh --ip=10.0.2.15 --master=10.0.2.15:5050 
--work_dir=/tmp/mesos --containerizers=mesos,docker

Start master:
sudo ./bin/mesos-master.sh --ip=10.0.2.15 --work_dir=/tmp/mesos-master

Use mesos-execute to launch a docker container on an IPv6 network:
sudo src/mesos-execute --master=10.0.2.15:5050 
--task=file:///home/vagrant/dev/mesos_tasks/docker.json 2> log.txt

cat /home/vagrant/dev/mesos_tasks/docker.json
{
  "name": "test",
  "task_id": {"value" : "test"},
  "agent_id": {"value" : ""},
  "resources": [
    {
      "name": "cpus",
      "type": "SCALAR",
      "scalar": {
        "value": 0.1
      }
    },
    {
      "name": "mem",
      "type": "SCALAR",
      "scalar": {
        "value": 32
      }
    }
  ],
  "command": {
    "shell": false
  },
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "nginx",
      "network": "USER"
    },
    "network_infos": [
        {
          "name": "ipv6"
        }
    ]
  }
}


Curl the Mesos state to make sure that the right IPv6 addresses are reflected 
for the container:
 curl http://10.0.2.15:5051/state | jq

"role": "*",
              "statuses": [
                {
                  "state": "TASK_RUNNING",
                  "timestamp": 1501288232.79384,
                  "container_status": {
                    "container_id": {
                      "value": "59319a5b-a28b-46bf-a20f-8472e6598abd"
                    },
                    "network_infos": [
                      {
                        "ip_addresses": [
                          {
                            "protocol": "IPv4",
                            "ip_address": "172.19.0.2"
                          },
                          {
                            "protocol": "IPv6",
                            "ip_address": "fd00:0:0:1::2"
                          }
                        ],
                        "name": "ipv6"
                      }
                    ]
                  }
                }
              ],
              "container": {
                "type": "DOCKER",
                "docker": {
                  "image": "nginx",
                  "network": "USER",
                  "privileged": false
                },
                "network_infos": [
                  {
                    "name": "ipv6"
                  }
                ]
              }
            }
          ],


Thanks,

Avinash sridharan

Reply via email to