Re: Review Request 61237: Updated docker executor to return IPv6 address of a container.

2017-08-24 Thread Avinash sridharan

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

(Updated Aug. 25, 2017, 6:54 a.m.)


Review request for mesos, Jie Yu and Qian Zhang.


Changes
---

Fixed Qian's comments.


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/4/

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


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



Re: Review Request 61237: Updated docker executor to return IPv6 address of a container.

2017-08-24 Thread Qian Zhang

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




src/docker/docker.cpp
Line 326 (original), 329 (patched)


Not yours. s/fail back/fallback/


- Qian Zhang


On Aug. 24, 2017, 8:48 a.m., Avinash sridharan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61237/
> ---
> 
> (Updated Aug. 24, 2017, 8:48 a.m.)
> 
> 
> Review request for mesos, Jie Yu and Qian Zhang.
> 
> 
> 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
> -
> 
>   src/docker/docker.hpp 95e60a7dbbd6ccc659f70ca3dca8d13433f3ea07 
>   src/docker/docker.cpp 192e170acce895f80df6c83e437da020489de468 
>   src/docker/executor.cpp 99a62244b7805d25b926d0293cb62574981d2878 
> 
> 
> Diff: https://reviews.apache.org/r/61237/diff/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
> 
>



Re: Review Request 61237: Updated docker executor to return IPv6 address of a container.

2017-08-23 Thread Avinash sridharan

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



Re: Review Request 61237: Updated docker executor to return IPv6 address of a container.

2017-08-02 Thread Avinash sridharan

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

(Updated Aug. 2, 2017, 6:57 p.m.)


Review request for mesos, Jie Yu and Qian Zhang.


Changes
---

Addressed Qian's comments.


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 5593cb635e073334c6c2566be3d803cd7febb1c3 
  src/docker/docker.cpp 8081c0203bf62cf62aa3b93d745f0e829ad65509 
  src/docker/executor.cpp e03f24461ec7b19cacae79c020406f0a475f2d19 


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

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


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



Re: Review Request 61237: Updated docker executor to return IPv6 address of a container.

2017-07-30 Thread Qian Zhang

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


Fix it, then Ship it!





src/docker/docker.hpp
Lines 112-113 (original), 112-113 (patched)


Not yours, the word `no IP has been not assigned` seems incorrect, should 
it be `no IP has been assigned`?



src/docker/docker.cpp
Line 342 (original), 345 (patched)


Not yours, should `failback` be `fallback`?



src/docker/docker.cpp
Lines 361 (patched)


It seems we need one more space here for indent.



src/docker/executor.cpp
Lines 236-238 (patched)


I think these 3 lines can be merged into 2 lines, like:
```
  // NOTE: By default the protocol is set to IPv4 and therefore
  // we explicitly set the protocol only for an IPv6 address.

```


- Qian Zhang


On July 29, 2017, 8:51 a.m., Avinash sridharan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61237/
> ---
> 
> (Updated July 29, 2017, 8:51 a.m.)
> 
> 
> Review request for mesos, Jie Yu and Qian Zhang.
> 
> 
> 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
> -
> 
>   src/docker/docker.hpp 5593cb635e073334c6c2566be3d803cd7febb1c3 
>   src/docker/docker.cpp 8081c0203bf62cf62aa3b93d745f0e829ad65509 
>   src/docker/executor.cpp e03f24461ec7b19cacae79c020406f0a475f2d19 
> 
> 
> Diff: https://reviews.apache.org/r/61237/diff/1/
> 
> 
> 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
> 
>