Re: Review Request 45954: Added `subcommand` to `network/cni` isolator.

2016-04-12 Thread Jie Yu

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


Ship it!




Ship It!

- Jie Yu


On April 12, 2016, 2:09 a.m., Avinash sridharan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45954/
> ---
> 
> (Updated April 12, 2016, 2:09 a.m.)
> 
> 
> Review request for mesos, Jie Yu and Qian Zhang.
> 
> 
> Bugs: MESOS-4922
> https://issues.apache.org/jira/browse/MESOS-4922
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The `subcommand` allow configuring the container hostname and setting
> up network files in the container such as /etc/hosts, /etc/hostname,
> /etc/resolv.conf. This will allow for correct name to IP resolution
> within the container network namespace.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/network/cni/cni.hpp 
> 654137c552a7c416f394365e43ea80770fe1ef8d 
>   src/slave/containerizer/mesos/isolators/network/cni/cni.cpp 
> 159152a01b68a667dbd57fa6452c6c2a3422787c 
> 
> Diff: https://reviews.apache.org/r/45954/diff/
> 
> 
> Testing
> ---
> 
> make
> 
> * Ran mesos_execute along with a single master/slave setup to verify that the 
> container joins the CNI network and the hostname and /etc/hosts, 
> /etc/resolv.conf are setup correctly.
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>



Re: Review Request 45954: Added `subcommand` to `network/cni` isolator.

2016-04-11 Thread Avinash sridharan


> On April 11, 2016, 7 p.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/isolators/network/cni/cni.hpp, line 198
> > 
> >
> > Please stick to our style guide by moving '{' to the next line.

Removed this structure. Without the need to read the mount table, we don't need 
to store mount entries, so this structure becomes redundant.


> On April 11, 2016, 7 p.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/isolators/network/cni/cni.cpp, lines 1172-1192
> > 
> >
> > Why do you need to read the mount table? Does seem to be necessary to 
> > me.

Removed this code.


> On April 11, 2016, 7 p.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/isolators/network/cni/cni.cpp, lines 1239-1243
> > 
> >
> > Let's do ll the sanity checks before we actually doing the work.
> > 
> > Also, can we do the setns together in one place. I would suggest not 
> > splitting into 'hostname' and 'mount' helpers. Let's just put all logics in 
> > 'execute'.

Re-factored the code to remove `hostname()` and `mount()`.


> On April 11, 2016, 7 p.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/isolators/network/cni/cni.cpp, lines 1285-1291
> > 
> >
> > We cannot bindly call os::touch here. Let's just assume the mount point 
> > exists for now (just do os::exists check).

Keeping this code as per our discussion. Since these files might not exist in 
the container filesystem.


- Avinash


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


On April 12, 2016, 2:09 a.m., Avinash sridharan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45954/
> ---
> 
> (Updated April 12, 2016, 2:09 a.m.)
> 
> 
> Review request for mesos, Jie Yu and Qian Zhang.
> 
> 
> Bugs: MESOS-4922
> https://issues.apache.org/jira/browse/MESOS-4922
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The `subcommand` allow configuring the container hostname and setting
> up network files in the container such as /etc/hosts, /etc/hostname,
> /etc/resolv.conf. This will allow for correct name to IP resolution
> within the container network namespace.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/network/cni/cni.hpp 
> 654137c552a7c416f394365e43ea80770fe1ef8d 
>   src/slave/containerizer/mesos/isolators/network/cni/cni.cpp 
> 159152a01b68a667dbd57fa6452c6c2a3422787c 
> 
> Diff: https://reviews.apache.org/r/45954/diff/
> 
> 
> Testing
> ---
> 
> make
> 
> * Ran mesos_execute along with a single master/slave setup to verify that the 
> container joins the CNI network and the hostname and /etc/hosts, 
> /etc/resolv.conf are setup correctly.
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>



Re: Review Request 45954: Added `subcommand` to `network/cni` isolator.

2016-04-11 Thread Avinash sridharan

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

(Updated April 12, 2016, 2:09 a.m.)


Review request for mesos, Jie Yu and Qian Zhang.


Changes
---

Addressed Jie's comments.


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


Repository: mesos


Description
---

The `subcommand` allow configuring the container hostname and setting
up network files in the container such as /etc/hosts, /etc/hostname,
/etc/resolv.conf. This will allow for correct name to IP resolution
within the container network namespace.


Diffs (updated)
-

  src/slave/containerizer/mesos/isolators/network/cni/cni.hpp 
654137c552a7c416f394365e43ea80770fe1ef8d 
  src/slave/containerizer/mesos/isolators/network/cni/cni.cpp 
159152a01b68a667dbd57fa6452c6c2a3422787c 

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


Testing
---

make

* Ran mesos_execute along with a single master/slave setup to verify that the 
container joins the CNI network and the hostname and /etc/hosts, 
/etc/resolv.conf are setup correctly.


Thanks,

Avinash sridharan



Re: Review Request 45954: Added `subcommand` to `network/cni` isolator.

2016-04-11 Thread Jie Yu

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




src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 174)


s/CniSetupContainer/NetworkCniIsolatorSetup/



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 178)


insert a new line above



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 185)


s/hosts/etc_hosts_path/

we use snake_case for flag names.



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 186)


etc_hostname_path



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 187)


etc_resolv_conf



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 197)


insert a new line above.



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 198)


Please stick to our style guide by moving '{' to the next line.



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (lines 198 - 201)


We don't have to put that in the member field. Let's just create local 
variables in 'execute()'



src/slave/containerizer/mesos/isolators/network/cni/cni.cpp (line 1117)


Instead of using 1 and 0, can we replace them with EXIT_SUCCESS AND 
EXIT_FAILURE



src/slave/containerizer/mesos/isolators/network/cni/cni.cpp (line 1151)


s/NOTE/TODO/



src/slave/containerizer/mesos/isolators/network/cni/cni.cpp (lines 1161 - 1166)


Do you want to check the result of 'mount' here?



src/slave/containerizer/mesos/isolators/network/cni/cni.cpp (lines 1168 - 1188)


Why do you need to read the mount table? Does seem to be necessary to me.



src/slave/containerizer/mesos/isolators/network/cni/cni.cpp (lines 1235 - 1239)


Let's do ll the sanity checks before we actually doing the work.

Also, can we do the setns together in one place. I would suggest not 
splitting into 'hostname' and 'mount' helpers. Let's just put all logics in 
'execute'.



src/slave/containerizer/mesos/isolators/network/cni/cni.cpp (lines 1281 - 1287)


We cannot bindly call os::touch here. Let's just assume the mount point 
exists for now (just do os::exists check).


- Jie Yu


On April 9, 2016, 5:46 p.m., Avinash sridharan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45954/
> ---
> 
> (Updated April 9, 2016, 5:46 p.m.)
> 
> 
> Review request for mesos, Jie Yu and Qian Zhang.
> 
> 
> Bugs: MESOS-4922
> https://issues.apache.org/jira/browse/MESOS-4922
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> The `subcommand` allow configuring the container hostname and setting
> up network files in the container such as /etc/hosts, /etc/hostname,
> /etc/resolv.conf. This will allow for correct name to IP resolution
> within the container network namespace.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/network/cni/cni.hpp 
> 654137c552a7c416f394365e43ea80770fe1ef8d 
>   src/slave/containerizer/mesos/isolators/network/cni/cni.cpp 
> 159152a01b68a667dbd57fa6452c6c2a3422787c 
> 
> Diff: https://reviews.apache.org/r/45954/diff/
> 
> 
> Testing
> ---
> 
> make
> 
> * Ran mesos_execute along with a single master/slave setup to verify that the 
> container joins the CNI network and the hostname and /etc/hosts, 
> /etc/resolv.conf are setup correctly.
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>



Re: Review Request 45954: Added `subcommand` to `network/cni` isolator.

2016-04-09 Thread Avinash sridharan

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

(Updated April 9, 2016, 5:46 p.m.)


Review request for mesos, Jie Yu and Qian Zhang.


Changes
---

Using fs::mount instead of `mount` executable to mount the network files.


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


Repository: mesos


Description
---

The `subcommand` allow configuring the container hostname and setting
up network files in the container such as /etc/hosts, /etc/hostname,
/etc/resolv.conf. This will allow for correct name to IP resolution
within the container network namespace.


Diffs (updated)
-

  src/slave/containerizer/mesos/isolators/network/cni/cni.hpp 
654137c552a7c416f394365e43ea80770fe1ef8d 
  src/slave/containerizer/mesos/isolators/network/cni/cni.cpp 
159152a01b68a667dbd57fa6452c6c2a3422787c 

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


Testing
---

make

* Ran mesos_execute along with a single master/slave setup to verify that the 
container joins the CNI network and the hostname and /etc/hosts, 
/etc/resolv.conf are setup correctly.


Thanks,

Avinash sridharan



Review Request 45954: Added `subcommand` to `network/cni` isolator.

2016-04-08 Thread Avinash sridharan

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

Review request for mesos, Jie Yu and Qian Zhang.


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


Repository: mesos


Description
---

The `subcommand` allow configuring the container hostname and setting
up network files in the container such as /etc/hosts, /etc/hostname,
/etc/resolv.conf. This will allow for correct name to IP resolution
within the container network namespace.


Diffs
-

  src/slave/containerizer/mesos/isolators/network/cni/cni.hpp 
654137c552a7c416f394365e43ea80770fe1ef8d 
  src/slave/containerizer/mesos/isolators/network/cni/cni.cpp 
159152a01b68a667dbd57fa6452c6c2a3422787c 

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


Testing
---

make

* Ran mesos_execute along with a single master/slave setup to verify that the 
container joins the CNI network and the hostname and /etc/hosts, 
/etc/resolv.conf are setup correctly.


Thanks,

Avinash sridharan