> On March 12, 2016, 3:28 a.m., Jie Yu wrote: > > src/slave/containerizer/mesos/isolators/network/cni.cpp, line 48 > > <https://reviews.apache.org/r/44555/diff/1/?file=1293049#file1293049line48> > > > > Let's remove this 'empty' check here since you hae the os::exists check > > below. > > Qian Zhang wrote: > They are for different purposes, `os::exist` is used to check if the > directory exists or not, and here > `flags.network_cni_plugins_dir.get().empty()` is used to check if operator > does not specify the value of `--network_cni_plugins_dir` (e.g., > "`--network_cni_plugins_dir=`") when starting agent. > > Jie Yu wrote: > ok, can you use flags.network_ci_plugin_dir->empty()?
`flags.network_ci_plugin_dir` is an `Option<std::string>`, and I think there is no `empty()` method in `Option` class. > On March 12, 2016, 3:28 a.m., Jie Yu wrote: > > src/slave/containerizer/mesos/isolators/network/cni.cpp, lines 177-181 > > <https://reviews.apache.org/r/44555/diff/1/?file=1293049#file1293049line177> > > > > Again, this check should be removed to support containers that do not > > specify NetworkInfo. > > Qian Zhang wrote: > We do support containers that do not specify NetworkInfo, please take a > look at the diff of https://reviews.apache.org/r/44514/, in `prepare()`, if > the container does not specify NetworkInfo, then it will not do anything > (just a no-op) and subsequently `isolate()` will not do anything for this > kind of container too. > > So my idea is, if operator decides to use `network/cni` isolator, then > s/he must specify CNI network configuration and plugin which should be > acceptable since CNI isolator needs CNI network configuration and plugin > sounds a reasonable requirement to me. But for framework, they do not have to > launch container to join CNI network, if they do not want a container to join > any CNI networks, then just do not specify NetworkInfo or specify NetworkInfo > without `name` field, we should definitly support it. > > Avinash sridharan wrote: > I agree with Qian on this. If the `network/cni` isolator is being used > then we "must" have associated network configs. If frameworks don't want to > use the cni network they can opt-out by not setting anything in the `name` > field for `NetworkInfo`. > > Jie Yu wrote: > ok, what I am thinking is that we made network/cni isolator the default > network isolator (like the default filesystem isolator). I think we need a > network isolator anyway because imagine a situation where no network isolator > is specified, but the framework specifies a name in the NetworkInfo, in that > case, we don't have a way to reject this task. Therefore, we can either build > a default network isolator which does nothing but reject containers that > specify networkInfo.name, or we make network/cni isolator the default, and > use it even if no cni plugins are specified by the operator (in that case, > it'll also reject any containers the specify a networkinfo.name). Does that > make sense? Agree. - Qian ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/44555/#review123192 ----------------------------------------------------------- On March 15, 2016, 11:02 p.m., Qian Zhang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/44555/ > ----------------------------------------------------------- > > (Updated March 15, 2016, 11:02 p.m.) > > > Review request for mesos, Avinash sridharan, Gilbert Song, and Jie Yu. > > > Bugs: MESOS-4759 > https://issues.apache.org/jira/browse/MESOS-4759 > > > Repository: mesos > > > Description > ------- > > Implemented the framework and create() method of "network/cni" isolator. > > > Diffs > ----- > > src/CMakeLists.txt 0517dd1ae7125ac1ae85cc83b6daaca66a10b8b4 > src/Makefile.am 7ee5a653fc96907021f14ab28f74c0b3ed0649d9 > src/slave/containerizer/mesos/isolators/network/cni.hpp PRE-CREATION > src/slave/containerizer/mesos/isolators/network/cni.cpp PRE-CREATION > > Diff: https://reviews.apache.org/r/44555/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Qian Zhang > >