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 2018/05/11 18:31:42 UTC

Review Request 67094: Split linux chroot into prepare and enter phases.

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

Review request for mesos, Gilbert Song, Jason Lai, Jie Yu, and Zhitao Li.


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


Repository: mesos


Description
-------

Since we will need to perform additional work to configure
the chroot before entering it, split the Linux chroot API
into `fs::chroot::prepare()` and `fs::chroot::enter()`.


Diffs
-----

  src/linux/fs.hpp 76dc09c38996eefd8487ba6ef4977ef2f7c9df4c 
  src/linux/fs.cpp fbd03b19abb9b56dbf3fb8a84d09a39171bbc1b0 
  src/slave/containerizer/mesos/launch.cpp f25d90651ef32495c9161c3eaed8a327d1b2b926 


Diff: https://reviews.apache.org/r/67094/diff/1/


Testing
-------

manual


Thanks,

James Peach


Re: Review Request 67094: Split linux chroot into prepare and enter phases.

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

> On May 11, 2018, 11:26 p.m., Jason Lai wrote:
> > src/linux/fs.cpp
> > Lines 968-1034 (original), 973-1041 (patched)
> > <https://reviews.apache.org/r/67094/diff/1/?file=2020531#file2020531line973>
> >
> >     We can also consider changing `fs::chroot::enter` with the [`pivotRoot` implementation in runc's `rootfs_linux.go`](https://github.com/opencontainers/runc/blob/0cbfd8392fff2462701507296081e835b3b0b99a/libcontainer/rootfs_linux.go#L645-L702)

Yes, we should look into that, but I'd prefer to separate that work from this review chain. Dropping this issue for now.


- James


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


On May 11, 2018, 6:31 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67094/
> -----------------------------------------------------------
> 
> (Updated May 11, 2018, 6:31 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Jason Lai, and Jie Yu.
> 
> 
> Bugs: MESOS-8792
>     https://issues.apache.org/jira/browse/MESOS-8792
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Since we will need to perform additional work to configure
> the chroot before entering it, split the Linux chroot API
> into `fs::chroot::prepare()` and `fs::chroot::enter()`.
> 
> 
> Diffs
> -----
> 
>   src/linux/fs.hpp 76dc09c38996eefd8487ba6ef4977ef2f7c9df4c 
>   src/linux/fs.cpp fbd03b19abb9b56dbf3fb8a84d09a39171bbc1b0 
>   src/slave/containerizer/mesos/launch.cpp f25d90651ef32495c9161c3eaed8a327d1b2b926 
> 
> 
> Diff: https://reviews.apache.org/r/67094/diff/2/
> 
> 
> Testing
> -------
> 
> make check (Fedora 27)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 67094: Split linux chroot into prepare and enter phases.

Posted by Jason Lai <ja...@jasonlai.net>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67094/#review202976
-----------------------------------------------------------




src/linux/fs.cpp
Lines 968-1034 (original), 973-1041 (patched)
<https://reviews.apache.org/r/67094/#comment285038>

    We can also consider changing `fs::chroot::enter` with the [`pivotRoot` implementation in runc's `rootfs_linux.go`](https://github.com/opencontainers/runc/blob/0cbfd8392fff2462701507296081e835b3b0b99a/libcontainer/rootfs_linux.go#L645-L702)


- Jason Lai


On May 11, 2018, 6:31 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67094/
> -----------------------------------------------------------
> 
> (Updated May 11, 2018, 6:31 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Jason Lai, Jie Yu, and Zhitao Li.
> 
> 
> Bugs: MESOS-8792
>     https://issues.apache.org/jira/browse/MESOS-8792
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Since we will need to perform additional work to configure
> the chroot before entering it, split the Linux chroot API
> into `fs::chroot::prepare()` and `fs::chroot::enter()`.
> 
> 
> Diffs
> -----
> 
>   src/linux/fs.hpp 76dc09c38996eefd8487ba6ef4977ef2f7c9df4c 
>   src/linux/fs.cpp fbd03b19abb9b56dbf3fb8a84d09a39171bbc1b0 
>   src/slave/containerizer/mesos/launch.cpp f25d90651ef32495c9161c3eaed8a327d1b2b926 
> 
> 
> Diff: https://reviews.apache.org/r/67094/diff/1/
> 
> 
> Testing
> -------
> 
> manual
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 67094: Split linux chroot into prepare and enter phases.

Posted by Jason Lai <ja...@jasonlai.net>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67094/#review202969
-----------------------------------------------------------



Great to see the split of `fs::enter::prepare` from `fs::enter::chroot`. Let's make sure the parts dealing with `$rootfs/tmp` are symmetric within `fs::enter::chroot` first and I'm fine with the rest.

We could even consider moving some parts of `fs::enter::prepare` into `launch.cpp` after my chain gets merged into master.


src/linux/fs.cpp
Lines 940-966 (original), 940-966 (patched)
<https://reviews.apache.org/r/67094/#comment285032>

    I would suggest that `fs::chroot::enter` starts here, as later in `fs::chroot::enter` we have `fs::umount("/tmp")`. We should consider making `fs::chroot::enter` symmetric when dealing with `$rootfs/tmp`, as well as making it an extended `pivot_root(2)` with no unnecessary preparations and cleanups.


- Jason Lai


On May 11, 2018, 6:31 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67094/
> -----------------------------------------------------------
> 
> (Updated May 11, 2018, 6:31 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Jason Lai, Jie Yu, and Zhitao Li.
> 
> 
> Bugs: MESOS-8792
>     https://issues.apache.org/jira/browse/MESOS-8792
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Since we will need to perform additional work to configure
> the chroot before entering it, split the Linux chroot API
> into `fs::chroot::prepare()` and `fs::chroot::enter()`.
> 
> 
> Diffs
> -----
> 
>   src/linux/fs.hpp 76dc09c38996eefd8487ba6ef4977ef2f7c9df4c 
>   src/linux/fs.cpp fbd03b19abb9b56dbf3fb8a84d09a39171bbc1b0 
>   src/slave/containerizer/mesos/launch.cpp f25d90651ef32495c9161c3eaed8a327d1b2b926 
> 
> 
> Diff: https://reviews.apache.org/r/67094/diff/1/
> 
> 
> Testing
> -------
> 
> manual
> 
> 
> Thanks,
> 
> James Peach
> 
>


Re: Review Request 67094: Split linux chroot into prepare and enter phases.

Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67094/#review202971
-----------------------------------------------------------


Fix it, then Ship it!





src/slave/containerizer/mesos/launch.cpp
Lines 465 (patched)
<https://reviews.apache.org/r/67094/#comment285035>

    Fix the TODO format here:
    ```
    // TODO(jpeach): xxx
    ```


- Jie Yu


On May 11, 2018, 6:31 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67094/
> -----------------------------------------------------------
> 
> (Updated May 11, 2018, 6:31 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Jason Lai, Jie Yu, and Zhitao Li.
> 
> 
> Bugs: MESOS-8792
>     https://issues.apache.org/jira/browse/MESOS-8792
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Since we will need to perform additional work to configure
> the chroot before entering it, split the Linux chroot API
> into `fs::chroot::prepare()` and `fs::chroot::enter()`.
> 
> 
> Diffs
> -----
> 
>   src/linux/fs.hpp 76dc09c38996eefd8487ba6ef4977ef2f7c9df4c 
>   src/linux/fs.cpp fbd03b19abb9b56dbf3fb8a84d09a39171bbc1b0 
>   src/slave/containerizer/mesos/launch.cpp f25d90651ef32495c9161c3eaed8a327d1b2b926 
> 
> 
> Diff: https://reviews.apache.org/r/67094/diff/1/
> 
> 
> Testing
> -------
> 
> manual
> 
> 
> Thanks,
> 
> James Peach
> 
>