Re: Review Request 46858: Skipped the bind mounting of the agent's work_dir if possible.

2016-05-02 Thread Gilbert Song

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


Ship it!




Ship It!

- Gilbert Song


On May 2, 2016, 4:59 p.m., Jie Yu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46858/
> ---
> 
> (Updated May 2, 2016, 4:59 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Ian Downes, and Timothy Chen.
> 
> 
> Bugs: MESOS-5239
> https://issues.apache.org/jira/browse/MESOS-5239
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> In filesystem/linux isolator, we will need to make sure the mount that
> contains the agent's working directory is a shared mount in its own
> peer group so that cloning the host mount table (e.g., when launching
> a container with a new mount namespace) does not create an extra
> reference to the mounts under the agent's work_dir.
> 
> However, if the mount containing the agent's working directory is
> already a shared mount in its own peer group, we don't have to create
> another bind mount for the agent's working directory. This patch
> allows the filesystem/linux isolator to skip the bind mount if
> possible.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> 8805143a2e5569a3479bbeab26cda12d2cd396a9 
>   src/tests/containerizer/filesystem_isolator_tests.cpp 
> 29d313051865761306029f331eb36684c3252ffb 
> 
> Diff: https://reviews.apache.org/r/46858/diff/
> 
> 
> Testing
> ---
> 
> sudo make check
> 
> 
> Thanks,
> 
> Jie Yu
> 
>



Re: Review Request 46858: Skipped the bind mounting of the agent's work_dir if possible.

2016-05-02 Thread Jie Yu

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

(Updated May 2, 2016, 11:59 p.m.)


Review request for mesos, Gilbert Song, Ian Downes, and Timothy Chen.


Changes
---

Added more notes.


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


Repository: mesos


Description
---

In filesystem/linux isolator, we will need to make sure the mount that
contains the agent's working directory is a shared mount in its own
peer group so that cloning the host mount table (e.g., when launching
a container with a new mount namespace) does not create an extra
reference to the mounts under the agent's work_dir.

However, if the mount containing the agent's working directory is
already a shared mount in its own peer group, we don't have to create
another bind mount for the agent's working directory. This patch
allows the filesystem/linux isolator to skip the bind mount if
possible.


Diffs (updated)
-

  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
8805143a2e5569a3479bbeab26cda12d2cd396a9 
  src/tests/containerizer/filesystem_isolator_tests.cpp 
29d313051865761306029f331eb36684c3252ffb 

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


Testing
---

sudo make check


Thanks,

Jie Yu



Re: Review Request 46858: Skipped the bind mounting of the agent's work_dir if possible.

2016-05-02 Thread Jie Yu


> On May 2, 2016, 10:17 p.m., Timothy Chen wrote:
> > src/slave/containerizer/mesos/isolators/filesystem/linux.cpp, line 113
> > 
> >
> > Trying to understand the new logic here, when do we expect the agent to 
> > mount workdir so that we can find it here?
> 
> Jie Yu wrote:
> We use 'strings::startsWith' to find a mount that contains slave's 
> work_dir. It has to be something. For instance, '/' or '/var', or 
> '/var/lib/mesos'. If the mount is not found, it means something really wrong 
> happens in the mount table.

I'll add a NOTE here.


- Jie


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


On May 2, 2016, 9:04 p.m., Jie Yu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46858/
> ---
> 
> (Updated May 2, 2016, 9:04 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Ian Downes, and Timothy Chen.
> 
> 
> Bugs: MESOS-5239
> https://issues.apache.org/jira/browse/MESOS-5239
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> In filesystem/linux isolator, we will need to make sure the mount that
> contains the agent's working directory is a shared mount in its own
> peer group so that cloning the host mount table (e.g., when launching
> a container with a new mount namespace) does not create an extra
> reference to the mounts under the agent's work_dir.
> 
> However, if the mount containing the agent's working directory is
> already a shared mount in its own peer group, we don't have to create
> another bind mount for the agent's working directory. This patch
> allows the filesystem/linux isolator to skip the bind mount if
> possible.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> 8805143a2e5569a3479bbeab26cda12d2cd396a9 
>   src/tests/containerizer/filesystem_isolator_tests.cpp 
> 29d313051865761306029f331eb36684c3252ffb 
> 
> Diff: https://reviews.apache.org/r/46858/diff/
> 
> 
> Testing
> ---
> 
> sudo make check
> 
> 
> Thanks,
> 
> Jie Yu
> 
>



Re: Review Request 46858: Skipped the bind mounting of the agent's work_dir if possible.

2016-05-02 Thread Jie Yu


> On May 2, 2016, 10:23 p.m., Gilbert Song wrote:
> > src/slave/containerizer/mesos/isolators/filesystem/linux.cpp, lines 112-134
> > 
> >
> > Why do we must alredy have a workdir mount in host mount table in the 
> > the very beginning?
> > 
> > Any posibility that it does not exist?

Answered above.


- Jie


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


On May 2, 2016, 9:04 p.m., Jie Yu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46858/
> ---
> 
> (Updated May 2, 2016, 9:04 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Ian Downes, and Timothy Chen.
> 
> 
> Bugs: MESOS-5239
> https://issues.apache.org/jira/browse/MESOS-5239
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> In filesystem/linux isolator, we will need to make sure the mount that
> contains the agent's working directory is a shared mount in its own
> peer group so that cloning the host mount table (e.g., when launching
> a container with a new mount namespace) does not create an extra
> reference to the mounts under the agent's work_dir.
> 
> However, if the mount containing the agent's working directory is
> already a shared mount in its own peer group, we don't have to create
> another bind mount for the agent's working directory. This patch
> allows the filesystem/linux isolator to skip the bind mount if
> possible.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> 8805143a2e5569a3479bbeab26cda12d2cd396a9 
>   src/tests/containerizer/filesystem_isolator_tests.cpp 
> 29d313051865761306029f331eb36684c3252ffb 
> 
> Diff: https://reviews.apache.org/r/46858/diff/
> 
> 
> Testing
> ---
> 
> sudo make check
> 
> 
> Thanks,
> 
> Jie Yu
> 
>



Re: Review Request 46858: Skipped the bind mounting of the agent's work_dir if possible.

2016-05-02 Thread Jie Yu


> On May 2, 2016, 10:17 p.m., Timothy Chen wrote:
> > src/slave/containerizer/mesos/isolators/filesystem/linux.cpp, line 113
> > 
> >
> > Trying to understand the new logic here, when do we expect the agent to 
> > mount workdir so that we can find it here?

We use 'strings::startsWith' to find a mount that contains slave's work_dir. It 
has to be something. For instance, '/' or '/var', or '/var/lib/mesos'. If the 
mount is not found, it means something really wrong happens in the mount table.


- Jie


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


On May 2, 2016, 9:04 p.m., Jie Yu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46858/
> ---
> 
> (Updated May 2, 2016, 9:04 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Ian Downes, and Timothy Chen.
> 
> 
> Bugs: MESOS-5239
> https://issues.apache.org/jira/browse/MESOS-5239
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> In filesystem/linux isolator, we will need to make sure the mount that
> contains the agent's working directory is a shared mount in its own
> peer group so that cloning the host mount table (e.g., when launching
> a container with a new mount namespace) does not create an extra
> reference to the mounts under the agent's work_dir.
> 
> However, if the mount containing the agent's working directory is
> already a shared mount in its own peer group, we don't have to create
> another bind mount for the agent's working directory. This patch
> allows the filesystem/linux isolator to skip the bind mount if
> possible.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> 8805143a2e5569a3479bbeab26cda12d2cd396a9 
>   src/tests/containerizer/filesystem_isolator_tests.cpp 
> 29d313051865761306029f331eb36684c3252ffb 
> 
> Diff: https://reviews.apache.org/r/46858/diff/
> 
> 
> Testing
> ---
> 
> sudo make check
> 
> 
> Thanks,
> 
> Jie Yu
> 
>



Re: Review Request 46858: Skipped the bind mounting of the agent's work_dir if possible.

2016-05-02 Thread Gilbert Song

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




src/slave/containerizer/mesos/isolators/filesystem/linux.cpp (lines 110 - 112)


Why do we must alredy have a workdir mount in host mount table in the the 
very beginning?

Any posibility that it does not exist?



src/slave/containerizer/mesos/isolators/filesystem/linux.cpp (lines 125 - 128)


May be more clear using:
  if (entry.id != workDirMount->id &&
  entry.shared() == workDirMount->shared() &&
  strings::startsWith(workDir.get(), entry.target &&
  workDir.get() != entry.target)) {


- Gilbert Song


On May 2, 2016, 2:04 p.m., Jie Yu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46858/
> ---
> 
> (Updated May 2, 2016, 2:04 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Ian Downes, and Timothy Chen.
> 
> 
> Bugs: MESOS-5239
> https://issues.apache.org/jira/browse/MESOS-5239
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> In filesystem/linux isolator, we will need to make sure the mount that
> contains the agent's working directory is a shared mount in its own
> peer group so that cloning the host mount table (e.g., when launching
> a container with a new mount namespace) does not create an extra
> reference to the mounts under the agent's work_dir.
> 
> However, if the mount containing the agent's working directory is
> already a shared mount in its own peer group, we don't have to create
> another bind mount for the agent's working directory. This patch
> allows the filesystem/linux isolator to skip the bind mount if
> possible.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> 8805143a2e5569a3479bbeab26cda12d2cd396a9 
>   src/tests/containerizer/filesystem_isolator_tests.cpp 
> 29d313051865761306029f331eb36684c3252ffb 
> 
> Diff: https://reviews.apache.org/r/46858/diff/
> 
> 
> Testing
> ---
> 
> sudo make check
> 
> 
> Thanks,
> 
> Jie Yu
> 
>



Re: Review Request 46858: Skipped the bind mounting of the agent's work_dir if possible.

2016-05-02 Thread Timothy Chen

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




src/slave/containerizer/mesos/isolators/filesystem/linux.cpp (line 111)


Trying to understand the new logic here, when do we expect the agent to 
mount workdir so that we can find it here?


- Timothy Chen


On May 2, 2016, 9:04 p.m., Jie Yu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46858/
> ---
> 
> (Updated May 2, 2016, 9:04 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Ian Downes, and Timothy Chen.
> 
> 
> Bugs: MESOS-5239
> https://issues.apache.org/jira/browse/MESOS-5239
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> In filesystem/linux isolator, we will need to make sure the mount that
> contains the agent's working directory is a shared mount in its own
> peer group so that cloning the host mount table (e.g., when launching
> a container with a new mount namespace) does not create an extra
> reference to the mounts under the agent's work_dir.
> 
> However, if the mount containing the agent's working directory is
> already a shared mount in its own peer group, we don't have to create
> another bind mount for the agent's working directory. This patch
> allows the filesystem/linux isolator to skip the bind mount if
> possible.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> 8805143a2e5569a3479bbeab26cda12d2cd396a9 
>   src/tests/containerizer/filesystem_isolator_tests.cpp 
> 29d313051865761306029f331eb36684c3252ffb 
> 
> Diff: https://reviews.apache.org/r/46858/diff/
> 
> 
> Testing
> ---
> 
> sudo make check
> 
> 
> Thanks,
> 
> Jie Yu
> 
>



Re: Review Request 46858: Skipped the bind mounting of the agent's work_dir if possible.

2016-05-02 Thread Jie Yu

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

(Updated May 2, 2016, 9:04 p.m.)


Review request for mesos, Gilbert Song, Ian Downes, and Timothy Chen.


Changes
---

Fixed the tests.


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


Repository: mesos


Description
---

In filesystem/linux isolator, we will need to make sure the mount that
contains the agent's working directory is a shared mount in its own
peer group so that cloning the host mount table (e.g., when launching
a container with a new mount namespace) does not create an extra
reference to the mounts under the agent's work_dir.

However, if the mount containing the agent's working directory is
already a shared mount in its own peer group, we don't have to create
another bind mount for the agent's working directory. This patch
allows the filesystem/linux isolator to skip the bind mount if
possible.


Diffs (updated)
-

  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
8805143a2e5569a3479bbeab26cda12d2cd396a9 
  src/tests/containerizer/filesystem_isolator_tests.cpp 
29d313051865761306029f331eb36684c3252ffb 

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


Testing
---

sudo make check


Thanks,

Jie Yu



Re: Review Request 46858: Skipped the bind mounting of the agent's work_dir if possible.

2016-04-29 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [46807, 46858]

Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' 
COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On April 29, 2016, 10:19 p.m., Jie Yu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46858/
> ---
> 
> (Updated April 29, 2016, 10:19 p.m.)
> 
> 
> Review request for mesos, Gilbert Song, Ian Downes, and Timothy Chen.
> 
> 
> Bugs: MESOS-5239
> https://issues.apache.org/jira/browse/MESOS-5239
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> In filesystem/linux isolator, we will need to make sure the mount that
> contains the agent's working directory is a shared mount in its own
> peer group so that cloning the host mount table (e.g., when launching
> a container with a new mount namespace) does not create an extra
> reference to the mounts under the agent's work_dir.
> 
> However, if the mount containing the agent's working directory is
> already a shared mount in its own peer group, we don't have to create
> another bind mount for the agent's working directory. This patch
> allows the filesystem/linux isolator to skip the bind mount if
> possible.
> 
> 
> Diffs
> -
> 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> a6e748ae777b6280f5dab0a6fec7305f931f2c22 
> 
> Diff: https://reviews.apache.org/r/46858/diff/
> 
> 
> Testing
> ---
> 
> sudo make check
> 
> 
> Thanks,
> 
> Jie Yu
> 
>



Review Request 46858: Skipped the bind mounting of the agent's work_dir if possible.

2016-04-29 Thread Jie Yu

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

Review request for mesos, Gilbert Song, Ian Downes, and Timothy Chen.


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


Repository: mesos


Description
---

In filesystem/linux isolator, we will need to make sure the mount that
contains the agent's working directory is a shared mount in its own
peer group so that cloning the host mount table (e.g., when launching
a container with a new mount namespace) does not create an extra
reference to the mounts under the agent's work_dir.

However, if the mount containing the agent's working directory is
already a shared mount in its own peer group, we don't have to create
another bind mount for the agent's working directory. This patch
allows the filesystem/linux isolator to skip the bind mount if
possible.


Diffs
-

  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
a6e748ae777b6280f5dab0a6fec7305f931f2c22 

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


Testing
---

sudo make check


Thanks,

Jie Yu