You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Avinash sridharan <av...@mesosphere.io> on 2016/04/09 00:32:16 UTC

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

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


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

Posted by Avinash sridharan <av...@mesosphere.io>.

> On April 11, 2016, 7 p.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/isolators/network/cni/cni.hpp, line 198
> > <https://reviews.apache.org/r/45954/diff/2/?file=1338335#file1338335line198>
> >
> >     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
> > <https://reviews.apache.org/r/45954/diff/2/?file=1338336#file1338336line1172>
> >
> >     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
> > <https://reviews.apache.org/r/45954/diff/2/?file=1338336#file1338336line1239>
> >
> >     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
> > <https://reviews.apache.org/r/45954/diff/2/?file=1338336#file1338336line1285>
> >
> >     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.

Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
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)
<https://reviews.apache.org/r/45954/#comment191531>

    s/CniSetupContainer/NetworkCniIsolatorSetup/



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 178)
<https://reviews.apache.org/r/45954/#comment191529>

    insert a new line above



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 185)
<https://reviews.apache.org/r/45954/#comment191547>

    s/hosts/etc_hosts_path/
    
    we use snake_case for flag names.



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 186)
<https://reviews.apache.org/r/45954/#comment191548>

    etc_hostname_path



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 187)
<https://reviews.apache.org/r/45954/#comment191550>

    etc_resolv_conf



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 197)
<https://reviews.apache.org/r/45954/#comment191533>

    insert a new line above.



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (line 198)
<https://reviews.apache.org/r/45954/#comment191535>

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



src/slave/containerizer/mesos/isolators/network/cni/cni.hpp (lines 198 - 201)
<https://reviews.apache.org/r/45954/#comment191592>

    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)
<https://reviews.apache.org/r/45954/#comment191591>

    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)
<https://reviews.apache.org/r/45954/#comment191594>

    s/NOTE/TODO/



src/slave/containerizer/mesos/isolators/network/cni/cni.cpp (lines 1161 - 1166)
<https://reviews.apache.org/r/45954/#comment191595>

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



src/slave/containerizer/mesos/isolators/network/cni/cni.cpp (lines 1168 - 1188)
<https://reviews.apache.org/r/45954/#comment191597>

    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)
<https://reviews.apache.org/r/45954/#comment191581>

    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)
<https://reviews.apache.org/r/45954/#comment191598>

    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.

Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
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.

Posted by Avinash sridharan <av...@mesosphere.io>.
-----------------------------------------------------------
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.

Posted by Avinash sridharan <av...@mesosphere.io>.
-----------------------------------------------------------
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