Cool 2016-11-30 3:53 GMT+08:00 Jie Yu <[email protected]>:
> Hi folks, > > I just landed MESOS-6648 <https://issues.apache.org/jira/browse/MESOS-6648 > >, > which greatly simplified the launch path in MesosContainerizer. > > The patch chain made MesosContainerizer launch helper to take > ContainerLaunchInfo. Prior to this patch, the launch helper takes various > flags from MesosContainerizer to launch the container. This makes it very > hard to add more parameters to the launch helper. This patch chain > simplifies this by passing 'ContainerLaunchInfo' instead. > 'ContainerLaunchInfo' is also the protobuf message returned by isolators > during 'prepare()'. This makes it very easy to merge them and send it to > the launch helper. More importantly, this makes it very easy to add more > parameters to the launch helper in the future. > > Because of this change, there is a slight change to ContainerLaunchInfo. We > changed the namespaces fields to `repeated`. This makes it easy for the > caller to merge ContainerLaunchInfo (simply leverage protobuf merge > functionality). > > ``` > // (Linux only) The namespaces a nested container > // should enter in its parent before cloning. > - optional uint32 enter_namespaces = 9 [default = 0]; > + repeated int32 enter_namespaces = 9; > > // (Linux only) The namespaces that should be cloned for the container. > // The namespaces are created while launching the executor. > - optional uint32 clone_namespaces = 4 [default = 0]; > + repeated int32 clone_namespaces = 4; > ``` > > The isolator change to adapt to this is simple, simply a one line change > line the following: > > ``` > - launchInfo.set_clone_namespaces(CLONE_NEWPID); > + launchInfo.add_clone_namespaces(CLONE_NEWPID); > ``` > > - Jie > -- Deshi Xiao Twitter: xds2000 E-mail: xiaods(AT)gmail.com
