You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by James Peach <jp...@apache.org> on 2016/11/28 17:07:43 UTC

Re: Review Request 53627: Implement a namespaces/uts isolator.

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

(Updated Nov. 28, 2016, 5:07 p.m.)


Review request for mesos and Jie Yu.


Changes
-------

Rebased.


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


Repository: mesos


Description
-------

Implement a very simple namespaces/uts isolator that can be used to set
the hostname and domainname of a container without the necessity of a
CNI plugin.

Since we already had a `hostname` field in the ContainerInfo, we can
use that to set the host name once we are in the UTS namespace. Add a
corresponding `domainname` to the ContainerInfo to allow setting the
domain name.


Diffs (updated)
-----

  include/mesos/mesos.proto cbfcd8a666e0b4a486f6dcd9e8356c9d5a1cea05 
  include/mesos/slave/containerizer.proto 2621522ae59cf9275f607679b4678ac54508993d 
  src/Makefile.am 85eda538caf39f81f052896e744b7b0c724f81bb 
  src/cli/execute.cpp ddf7ecac21f2680c3027fafeb4194a2dd4a66d47 
  src/slave/containerizer/mesos/containerizer.cpp 9b33495d9babc3ee489a8712fe1977746c41043f 
  src/slave/containerizer/mesos/isolators/namespaces/uts.hpp PRE-CREATION 
  src/slave/containerizer/mesos/isolators/namespaces/uts.cpp PRE-CREATION 
  src/slave/containerizer/mesos/launch.hpp 155e3c5a27b8c710971ee4b508600d3b5589a2e0 
  src/slave/containerizer/mesos/launch.cpp 320e42748adbabf09f77cb4f5951e2a7ea58fe64 
  src/tests/containerizer/isolator_tests.cpp 9766aaf144722b18d88f694ff37ffd53974cb60d 

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


Testing
-------

make check.


Thanks,

James Peach


Re: Review Request 53627: Implement a namespaces/uts isolator.

Posted by haosdent huang <ha...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53627/#review157191
-----------------------------------------------------------




src/slave/containerizer/mesos/isolators/namespaces/uts.cpp (lines 67 - 68)
<https://reviews.apache.org/r/53627/#comment227631>

    Do we need to update this part to follow what we do in `namespace/pid` isolator?
    
    ```
    Future<Option<ContainerLaunchInfo>> NamespacesPidIsolatorProcess::prepare(
        const ContainerID& containerId,
        const ContainerConfig& containerConfig)
    {
      ContainerLaunchInfo launchInfo;
    
      if (containerId.has_parent()) {
        // If we are a nested container, then we want to enter our
        // parent's pid namespace before cloning a new one.
        launchInfo.set_enter_namespaces(CLONE_NEWPID);
    
        // However, if we are a nested container in the `DEBUG` class,
        // then we don't want to clone a new PID namespace at all, so we
        // short cirucuit here.
        if (containerConfig.has_container_class() &&
            containerConfig.container_class() == ContainerClass::DEBUG) {
          return launchInfo;
        }
      }
    
      launchInfo.set_clone_namespaces(CLONE_NEWPID);
    ```



src/tests/containerizer/isolator_tests.cpp (lines 59 - 64)
<https://reviews.apache.org/r/53627/#comment227632>

    Move this after
    
    ```
    #include "slave/containerizer/mesos/launcher.hpp"
    #include "slave/containerizer/mesos/paths.hpp"
    ```
    
    Since it works in other operate systems as well.



src/tests/containerizer/isolator_tests.cpp (lines 384 - 396)
<https://reviews.apache.org/r/53627/#comment227633>

    I think we could simpify these line to
    
    ```
      Owned<MasterDetector> detector = master.get()->createDetector();
      Try<Owned<cluster::Slave>> slave = StartSlave(detector.get(), agentFlags);
      ASSERT_SOME(slave);
    ```


- haosdent huang


On Nov. 28, 2016, 5:07 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53627/
> -----------------------------------------------------------
> 
> (Updated Nov. 28, 2016, 5:07 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-6556
>     https://issues.apache.org/jira/browse/MESOS-6556
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implement a very simple namespaces/uts isolator that can be used to set
> the hostname and domainname of a container without the necessity of a
> CNI plugin.
> 
> Since we already had a `hostname` field in the ContainerInfo, we can
> use that to set the host name once we are in the UTS namespace. Add a
> corresponding `domainname` to the ContainerInfo to allow setting the
> domain name.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto cbfcd8a666e0b4a486f6dcd9e8356c9d5a1cea05 
>   include/mesos/slave/containerizer.proto 2621522ae59cf9275f607679b4678ac54508993d 
>   src/Makefile.am 85eda538caf39f81f052896e744b7b0c724f81bb 
>   src/cli/execute.cpp ddf7ecac21f2680c3027fafeb4194a2dd4a66d47 
>   src/slave/containerizer/mesos/containerizer.cpp 9b33495d9babc3ee489a8712fe1977746c41043f 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.hpp PRE-CREATION 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.cpp PRE-CREATION 
>   src/slave/containerizer/mesos/launch.hpp 155e3c5a27b8c710971ee4b508600d3b5589a2e0 
>   src/slave/containerizer/mesos/launch.cpp 320e42748adbabf09f77cb4f5951e2a7ea58fe64 
>   src/tests/containerizer/isolator_tests.cpp 9766aaf144722b18d88f694ff37ffd53974cb60d 
> 
> Diff: https://reviews.apache.org/r/53627/diff/
> 
> 
> Testing
> -------
> 
> make check.
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 53627: Implement a namespaces/uts isolator.

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

> On Nov. 29, 2016, 7:02 p.m., Avinash sridharan wrote:
> > src/slave/containerizer/mesos/launch.cpp, line 431
> > <https://reviews.apache.org/r/53627/diff/6/?file=1571137#file1571137line431>
> >
> >     Wouldn't we need to set up something in `/etc/hosts`. I believe DNS lookups on the hostname would fail if the `/etc/nsswitch.conf` does not have `myhostname` set in the `hosts` field.
> 
> James Peach wrote:
>     There's no requirement for the hostname to be resolvable or map to any IP address on the system. However, since the hostname is set by the framework, one option could be to set it to the name of the service VIP.

I think libprocess might find this problematic. Currently libprocess tries to resolve the `hostname` to an IP if no IP is explicitly provided:
https://github.com/apache/mesos/blob/1fc0551db54cd4492c3772d68212b9d7c6571728/3rdparty/libprocess/src/process.cpp#L1145

Setting the name to the service IP might not work since the service IP (as I understand) could be a virtual IP and might not exist on the host, and for libprocess this needs to be a "bindable" IP. I am assuming you were implying that by setting the name to the service VIP the hostname can be resolved through DNS?


- Avinash


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


On Nov. 28, 2016, 5:07 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53627/
> -----------------------------------------------------------
> 
> (Updated Nov. 28, 2016, 5:07 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-6556
>     https://issues.apache.org/jira/browse/MESOS-6556
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implement a very simple namespaces/uts isolator that can be used to set
> the hostname and domainname of a container without the necessity of a
> CNI plugin.
> 
> Since we already had a `hostname` field in the ContainerInfo, we can
> use that to set the host name once we are in the UTS namespace. Add a
> corresponding `domainname` to the ContainerInfo to allow setting the
> domain name.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto cbfcd8a666e0b4a486f6dcd9e8356c9d5a1cea05 
>   include/mesos/slave/containerizer.proto 2621522ae59cf9275f607679b4678ac54508993d 
>   src/Makefile.am 85eda538caf39f81f052896e744b7b0c724f81bb 
>   src/cli/execute.cpp ddf7ecac21f2680c3027fafeb4194a2dd4a66d47 
>   src/slave/containerizer/mesos/containerizer.cpp 9b33495d9babc3ee489a8712fe1977746c41043f 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.hpp PRE-CREATION 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.cpp PRE-CREATION 
>   src/slave/containerizer/mesos/launch.hpp 155e3c5a27b8c710971ee4b508600d3b5589a2e0 
>   src/slave/containerizer/mesos/launch.cpp 320e42748adbabf09f77cb4f5951e2a7ea58fe64 
>   src/tests/containerizer/isolator_tests.cpp 9766aaf144722b18d88f694ff37ffd53974cb60d 
> 
> Diff: https://reviews.apache.org/r/53627/diff/
> 
> 
> Testing
> -------
> 
> make check.
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 53627: Implement a namespaces/uts isolator.

Posted by James Peach <jp...@apache.org>.

> On Nov. 29, 2016, 7:02 p.m., Avinash sridharan wrote:
> > src/slave/containerizer/mesos/launch.cpp, line 431
> > <https://reviews.apache.org/r/53627/diff/6/?file=1571137#file1571137line431>
> >
> >     Wouldn't we need to set up something in `/etc/hosts`. I believe DNS lookups on the hostname would fail if the `/etc/nsswitch.conf` does not have `myhostname` set in the `hosts` field.
> 
> James Peach wrote:
>     There's no requirement for the hostname to be resolvable or map to any IP address on the system. However, since the hostname is set by the framework, one option could be to set it to the name of the service VIP.
> 
> Avinash sridharan wrote:
>     I think libprocess might find this problematic. Currently libprocess tries to resolve the `hostname` to an IP if no IP is explicitly provided:
>     https://github.com/apache/mesos/blob/1fc0551db54cd4492c3772d68212b9d7c6571728/3rdparty/libprocess/src/process.cpp#L1145
>     
>     Setting the name to the service IP might not work since the service IP (as I understand) could be a virtual IP and might not exist on the host, and for libprocess this needs to be a "bindable" IP. I am assuming you were implying that by setting the name to the service VIP the hostname can be resolved through DNS?

I'd call that libprocess code optimistic :)


- James


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


On Nov. 28, 2016, 5:07 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53627/
> -----------------------------------------------------------
> 
> (Updated Nov. 28, 2016, 5:07 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-6556
>     https://issues.apache.org/jira/browse/MESOS-6556
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implement a very simple namespaces/uts isolator that can be used to set
> the hostname and domainname of a container without the necessity of a
> CNI plugin.
> 
> Since we already had a `hostname` field in the ContainerInfo, we can
> use that to set the host name once we are in the UTS namespace. Add a
> corresponding `domainname` to the ContainerInfo to allow setting the
> domain name.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto cbfcd8a666e0b4a486f6dcd9e8356c9d5a1cea05 
>   include/mesos/slave/containerizer.proto 2621522ae59cf9275f607679b4678ac54508993d 
>   src/Makefile.am 85eda538caf39f81f052896e744b7b0c724f81bb 
>   src/cli/execute.cpp ddf7ecac21f2680c3027fafeb4194a2dd4a66d47 
>   src/slave/containerizer/mesos/containerizer.cpp 9b33495d9babc3ee489a8712fe1977746c41043f 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.hpp PRE-CREATION 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.cpp PRE-CREATION 
>   src/slave/containerizer/mesos/launch.hpp 155e3c5a27b8c710971ee4b508600d3b5589a2e0 
>   src/slave/containerizer/mesos/launch.cpp 320e42748adbabf09f77cb4f5951e2a7ea58fe64 
>   src/tests/containerizer/isolator_tests.cpp 9766aaf144722b18d88f694ff37ffd53974cb60d 
> 
> Diff: https://reviews.apache.org/r/53627/diff/
> 
> 
> Testing
> -------
> 
> make check.
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 53627: Implement a namespaces/uts isolator.

Posted by James Peach <jp...@apache.org>.

> On Nov. 29, 2016, 7:02 p.m., Avinash sridharan wrote:
> > src/slave/containerizer/mesos/launch.cpp, line 431
> > <https://reviews.apache.org/r/53627/diff/6/?file=1571137#file1571137line431>
> >
> >     Wouldn't we need to set up something in `/etc/hosts`. I believe DNS lookups on the hostname would fail if the `/etc/nsswitch.conf` does not have `myhostname` set in the `hosts` field.

There's no requirement for the hostname to be resolvable or map to any IP address on the system. However, since the hostname is set by the framework, one option could be to set it to the name of the service VIP.


- James


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


On Nov. 28, 2016, 5:07 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53627/
> -----------------------------------------------------------
> 
> (Updated Nov. 28, 2016, 5:07 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-6556
>     https://issues.apache.org/jira/browse/MESOS-6556
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implement a very simple namespaces/uts isolator that can be used to set
> the hostname and domainname of a container without the necessity of a
> CNI plugin.
> 
> Since we already had a `hostname` field in the ContainerInfo, we can
> use that to set the host name once we are in the UTS namespace. Add a
> corresponding `domainname` to the ContainerInfo to allow setting the
> domain name.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto cbfcd8a666e0b4a486f6dcd9e8356c9d5a1cea05 
>   include/mesos/slave/containerizer.proto 2621522ae59cf9275f607679b4678ac54508993d 
>   src/Makefile.am 85eda538caf39f81f052896e744b7b0c724f81bb 
>   src/cli/execute.cpp ddf7ecac21f2680c3027fafeb4194a2dd4a66d47 
>   src/slave/containerizer/mesos/containerizer.cpp 9b33495d9babc3ee489a8712fe1977746c41043f 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.hpp PRE-CREATION 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.cpp PRE-CREATION 
>   src/slave/containerizer/mesos/launch.hpp 155e3c5a27b8c710971ee4b508600d3b5589a2e0 
>   src/slave/containerizer/mesos/launch.cpp 320e42748adbabf09f77cb4f5951e2a7ea58fe64 
>   src/tests/containerizer/isolator_tests.cpp 9766aaf144722b18d88f694ff37ffd53974cb60d 
> 
> Diff: https://reviews.apache.org/r/53627/diff/
> 
> 
> Testing
> -------
> 
> make check.
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 53627: Implement a namespaces/uts isolator.

Posted by Avinash sridharan <av...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53627/#review157300
-----------------------------------------------------------




src/slave/containerizer/mesos/launch.cpp (line 431)
<https://reviews.apache.org/r/53627/#comment227842>

    Wouldn't we need to set up something in `/etc/hosts`. I believe DNS lookups on the hostname would fail if the `/etc/nsswitch.conf` does not have `myhostname` set in the `hosts` field.


- Avinash sridharan


On Nov. 28, 2016, 5:07 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53627/
> -----------------------------------------------------------
> 
> (Updated Nov. 28, 2016, 5:07 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-6556
>     https://issues.apache.org/jira/browse/MESOS-6556
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implement a very simple namespaces/uts isolator that can be used to set
> the hostname and domainname of a container without the necessity of a
> CNI plugin.
> 
> Since we already had a `hostname` field in the ContainerInfo, we can
> use that to set the host name once we are in the UTS namespace. Add a
> corresponding `domainname` to the ContainerInfo to allow setting the
> domain name.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto cbfcd8a666e0b4a486f6dcd9e8356c9d5a1cea05 
>   include/mesos/slave/containerizer.proto 2621522ae59cf9275f607679b4678ac54508993d 
>   src/Makefile.am 85eda538caf39f81f052896e744b7b0c724f81bb 
>   src/cli/execute.cpp ddf7ecac21f2680c3027fafeb4194a2dd4a66d47 
>   src/slave/containerizer/mesos/containerizer.cpp 9b33495d9babc3ee489a8712fe1977746c41043f 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.hpp PRE-CREATION 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.cpp PRE-CREATION 
>   src/slave/containerizer/mesos/launch.hpp 155e3c5a27b8c710971ee4b508600d3b5589a2e0 
>   src/slave/containerizer/mesos/launch.cpp 320e42748adbabf09f77cb4f5951e2a7ea58fe64 
>   src/tests/containerizer/isolator_tests.cpp 9766aaf144722b18d88f694ff37ffd53974cb60d 
> 
> Diff: https://reviews.apache.org/r/53627/diff/
> 
> 
> Testing
> -------
> 
> make check.
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 53627: Implement a namespaces/uts isolator.

Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53627/
-----------------------------------------------------------

(Updated Nov. 29, 2016, 9:19 p.m.)


Review request for mesos and Jie Yu.


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


Repository: mesos


Description
-------

Implement a very simple namespaces/uts isolator that can be used to set
the hostname and domainname of a container without the necessity of a
CNI plugin.

Since we already had a `hostname` field in the ContainerInfo, we can
use that to set the host name once we are in the UTS namespace. Add a
corresponding `domainname` to the ContainerInfo to allow setting the
domain name.


Diffs (updated)
-----

  include/mesos/mesos.proto cbfcd8a666e0b4a486f6dcd9e8356c9d5a1cea05 
  include/mesos/slave/containerizer.proto 2621522ae59cf9275f607679b4678ac54508993d 
  src/Makefile.am 85eda538caf39f81f052896e744b7b0c724f81bb 
  src/cli/execute.cpp ddf7ecac21f2680c3027fafeb4194a2dd4a66d47 
  src/slave/containerizer/mesos/containerizer.cpp 9b33495d9babc3ee489a8712fe1977746c41043f 
  src/slave/containerizer/mesos/isolators/namespaces/uts.hpp PRE-CREATION 
  src/slave/containerizer/mesos/isolators/namespaces/uts.cpp PRE-CREATION 
  src/slave/containerizer/mesos/launch.hpp 155e3c5a27b8c710971ee4b508600d3b5589a2e0 
  src/slave/containerizer/mesos/launch.cpp 320e42748adbabf09f77cb4f5951e2a7ea58fe64 
  src/tests/containerizer/isolator_tests.cpp 9766aaf144722b18d88f694ff37ffd53974cb60d 

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


Testing
-------

make check.


Thanks,

James Peach


Re: Review Request 53627: Implement a namespaces/uts isolator.

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

> On Nov. 29, 2016, 6:48 p.m., Avinash sridharan wrote:
> > src/slave/containerizer/mesos/isolators/namespaces/uts.cpp, lines 70-79
> > <https://reviews.apache.org/r/53627/diff/6/?file=1571135#file1571135line70>
> >
> >     Wouldn't this conflict with what we are doing in the `network/cni` isolator. For containers with a `NetworkInfo` we end up creating a new UTS namespace in the `network/cni` isolator. More importantly the isolator sets the hostname to the `ContianerID` and also sets this information up in `/etc/hosts` for DNS to resolve correctly. 
> >     
> >     Since the `network/cni` isolator is enabled by default, this would end up conflicting with the UTS isolator.

would it make sense to add support for `hostname` and `domainname` in the `network/cni` isolator and avoid having a separate UTS isolator? Or is the requirement to not use the CNI isolator (and use the port-mapping isolator) ?


- Avinash


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


On Nov. 28, 2016, 5:07 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53627/
> -----------------------------------------------------------
> 
> (Updated Nov. 28, 2016, 5:07 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-6556
>     https://issues.apache.org/jira/browse/MESOS-6556
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implement a very simple namespaces/uts isolator that can be used to set
> the hostname and domainname of a container without the necessity of a
> CNI plugin.
> 
> Since we already had a `hostname` field in the ContainerInfo, we can
> use that to set the host name once we are in the UTS namespace. Add a
> corresponding `domainname` to the ContainerInfo to allow setting the
> domain name.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto cbfcd8a666e0b4a486f6dcd9e8356c9d5a1cea05 
>   include/mesos/slave/containerizer.proto 2621522ae59cf9275f607679b4678ac54508993d 
>   src/Makefile.am 85eda538caf39f81f052896e744b7b0c724f81bb 
>   src/cli/execute.cpp ddf7ecac21f2680c3027fafeb4194a2dd4a66d47 
>   src/slave/containerizer/mesos/containerizer.cpp 9b33495d9babc3ee489a8712fe1977746c41043f 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.hpp PRE-CREATION 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.cpp PRE-CREATION 
>   src/slave/containerizer/mesos/launch.hpp 155e3c5a27b8c710971ee4b508600d3b5589a2e0 
>   src/slave/containerizer/mesos/launch.cpp 320e42748adbabf09f77cb4f5951e2a7ea58fe64 
>   src/tests/containerizer/isolator_tests.cpp 9766aaf144722b18d88f694ff37ffd53974cb60d 
> 
> Diff: https://reviews.apache.org/r/53627/diff/
> 
> 
> Testing
> -------
> 
> make check.
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 53627: Implement a namespaces/uts isolator.

Posted by Avinash sridharan <av...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53627/#review157294
-----------------------------------------------------------




src/slave/containerizer/mesos/isolators/namespaces/uts.cpp (lines 70 - 79)
<https://reviews.apache.org/r/53627/#comment227830>

    Wouldn't this conflict with what we are doing in the `network/cni` isolator. For containers with a `NetworkInfo` we end up creating a new UTS namespace in the `network/cni` isolator. More importantly the isolator sets the hostname to the `ContianerID` and also sets this information up in `/etc/hosts` for DNS to resolve correctly. 
    
    Since the `network/cni` isolator is enabled by default, this would end up conflicting with the UTS isolator.


- Avinash sridharan


On Nov. 28, 2016, 5:07 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53627/
> -----------------------------------------------------------
> 
> (Updated Nov. 28, 2016, 5:07 p.m.)
> 
> 
> Review request for mesos and Jie Yu.
> 
> 
> Bugs: MESOS-6556
>     https://issues.apache.org/jira/browse/MESOS-6556
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implement a very simple namespaces/uts isolator that can be used to set
> the hostname and domainname of a container without the necessity of a
> CNI plugin.
> 
> Since we already had a `hostname` field in the ContainerInfo, we can
> use that to set the host name once we are in the UTS namespace. Add a
> corresponding `domainname` to the ContainerInfo to allow setting the
> domain name.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto cbfcd8a666e0b4a486f6dcd9e8356c9d5a1cea05 
>   include/mesos/slave/containerizer.proto 2621522ae59cf9275f607679b4678ac54508993d 
>   src/Makefile.am 85eda538caf39f81f052896e744b7b0c724f81bb 
>   src/cli/execute.cpp ddf7ecac21f2680c3027fafeb4194a2dd4a66d47 
>   src/slave/containerizer/mesos/containerizer.cpp 9b33495d9babc3ee489a8712fe1977746c41043f 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.hpp PRE-CREATION 
>   src/slave/containerizer/mesos/isolators/namespaces/uts.cpp PRE-CREATION 
>   src/slave/containerizer/mesos/launch.hpp 155e3c5a27b8c710971ee4b508600d3b5589a2e0 
>   src/slave/containerizer/mesos/launch.cpp 320e42748adbabf09f77cb4f5951e2a7ea58fe64 
>   src/tests/containerizer/isolator_tests.cpp 9766aaf144722b18d88f694ff37ffd53974cb60d 
> 
> Diff: https://reviews.apache.org/r/53627/diff/
> 
> 
> Testing
> -------
> 
> make check.
> 
> 
> Thanks,
> 
> James Peach
> 
>