Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-10-13 Thread Jiang Yan Xu

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


Ship it!




Committing with minor edits.


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


Keep the logging?



src/slave/containerizer/mesos/isolators/filesystem/posix.cpp (lines 254 - 257)


Part of this paragraph is already said by the log line so I've simplified 
it into:

```
  // NOTE: We cannot enforce read-only access given the symlink without
  // changing the source so we just log a warning here.
```


- Jiang Yan Xu


On Oct. 13, 2016, 8:23 p.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45963/
> ---
> 
> (Updated Oct. 13, 2016, 8:23 p.m.)
> 
> 
> Review request for mesos, Greg Mann and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4324
> https://issues.apache.org/jira/browse/MESOS-4324
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Allow the task to specify the persistent volume access to be read-only
> or read-write. Note that the persistent volume is always created as
> read-write.
> If the task is the first consumer of the shared persistent volume, then
> set the ownership of the persistent volume to match that of the task.
> Otherwise, launch the task but if the task is unable to read/write the
> persistent volume, it would fail at that point of time.
> 
> 
> Diffs
> -
> 
>   src/master/validation.cpp e5da3c9bf0a1042b42522f1ab74ce798fbb1738d 
>   src/slave/containerizer/docker.cpp 9a1a8712bf4aba27927136b3a61beaca1b1af997 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> 8f62162519f12a157c28ca5f2a76502e466c1481 
>   src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
> af427c6e5691f1770ab3ebef79502eb2c2176c4a 
>   src/tests/containerizer/linux_filesystem_isolator_tests.cpp 
> eb191a32381f9d1ca84ec29adf352dde375c2f2d 
>   src/tests/master_validation_tests.cpp 
> 99e350e0587e73e9ee25ef20dd369cd146bd446a 
> 
> Diff: https://reviews.apache.org/r/45963/diff/
> 
> 
> Testing
> ---
> 
> Tests successful.
> 
> 
> Thanks,
> 
> Anindya Sinha
> 
>



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-10-13 Thread Anindya Sinha


> On Oct. 13, 2016, 9:58 p.m., Jiang Yan Xu wrote:
> > src/master/validation.cpp, lines 503-504
> > 
> >
> > MESOS-6374 is where we want eventually but for now the same check is in 
> > `validateDiskInfo()` as well so we don't have to duplicate it here?

Check for `volume.disk().has_volume()` is done since the next line calls 
`volume.disk().volume().mode()`.


> On Oct. 13, 2016, 9:58 p.m., Jiang Yan Xu wrote:
> > src/master/validation.cpp, lines 505-506
> > 
> >
> > This is called when you destroy a volume as well. So if the framework 
> > is has changed the volume to RO after creating it then it cannot destroy it 
> > (at least in the form it was created)...
> > 
> > I think we should just validate this in the following method?
> > 
> > ```
> > Option validate(
> > const Offer::Operation::Create& create,
> > const Resources& checkpointedResources,
> > const Option& principal) {}
> > ```

Since the offer to frameworks would only contain `Mode::RW`, this check is 
valid for both `CREATE` and `DESTROY` operations. So, we should not allow this 
volume as valid if the `DESTROY` operation marks this as `Mode::RO`.


> On Oct. 13, 2016, 9:58 p.m., Jiang Yan Xu wrote:
> > src/tests/containerizer/linux_filesystem_isolator_tests.cpp, line 1455
> > 
> >
> > Nit: use `frameworkInfo.set_role(DEFAULT_TEST_ROLE);`?

I will leave it as `role1` instead of `DEFAULT_TEST_ROLE` since the remaining 
tests in this file use `role1`. We can change to `DEFAULT_TEST_ROLE` in a 
follow up commit when all tests move to using `DEFAULT_TEST_ROLE`.


- Anindya


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


On Oct. 13, 2016, 5:24 a.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45963/
> ---
> 
> (Updated Oct. 13, 2016, 5:24 a.m.)
> 
> 
> Review request for mesos, Greg Mann and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4324
> https://issues.apache.org/jira/browse/MESOS-4324
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Allow the task to specify the persistent volume access to be read-only
> or read-write. Note that the persistent volume is always created as
> read-write.
> If the task is the first consumer of the shared persistent volume, then
> set the ownership of the persistent volume to match that of the task.
> Otherwise, launch the task but if the task is unable to read/write the
> persistent volume, it would fail at that point of time.
> 
> 
> Diffs
> -
> 
>   src/master/validation.cpp e5da3c9bf0a1042b42522f1ab74ce798fbb1738d 
>   src/slave/containerizer/docker.cpp d71386089bf7677872bcb1bd36e07da9263dcf0d 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> 8f62162519f12a157c28ca5f2a76502e466c1481 
>   src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
> af427c6e5691f1770ab3ebef79502eb2c2176c4a 
>   src/tests/containerizer/linux_filesystem_isolator_tests.cpp 
> eb191a32381f9d1ca84ec29adf352dde375c2f2d 
>   src/tests/master_validation_tests.cpp 
> 99e350e0587e73e9ee25ef20dd369cd146bd446a 
> 
> Diff: https://reviews.apache.org/r/45963/diff/
> 
> 
> Testing
> ---
> 
> Tests successful.
> 
> 
> Thanks,
> 
> Anindya Sinha
> 
>



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-10-13 Thread Anindya Sinha

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

(Updated Oct. 14, 2016, 3:23 a.m.)


Review request for mesos, Greg Mann and Jiang Yan Xu.


Changes
---

Addressed comments.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, launch the task but if the task is unable to read/write the
persistent volume, it would fail at that point of time.


Diffs (updated)
-

  src/master/validation.cpp e5da3c9bf0a1042b42522f1ab74ce798fbb1738d 
  src/slave/containerizer/docker.cpp 9a1a8712bf4aba27927136b3a61beaca1b1af997 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
8f62162519f12a157c28ca5f2a76502e466c1481 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
af427c6e5691f1770ab3ebef79502eb2c2176c4a 
  src/tests/containerizer/linux_filesystem_isolator_tests.cpp 
eb191a32381f9d1ca84ec29adf352dde375c2f2d 
  src/tests/master_validation_tests.cpp 
99e350e0587e73e9ee25ef20dd369cd146bd446a 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-10-13 Thread Jiang Yan Xu

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




src/master/validation.cpp (lines 500 - 501)


MESOS-6374 is where we want eventually but for now the same check is in 
`validateDiskInfo()` as well so we don't have to duplicate it here?



src/master/validation.cpp (lines 502 - 503)


This is called when you destroy a volume as well. So if the framework is 
has changed the volume to RO after creating it then it cannot destroy it (at 
least in the form it was created)...

I think we should just validate this in the following method?

```
Option validate(
const Offer::Operation::Create& create,
const Resources& checkpointedResources,
const Option& principal) {}
```



src/slave/containerizer/docker.cpp (line 469)


s/container directory/sandbox directory/ because the latter term is used 
widely and explained in documentation. "container directory" is not as clear. 
People may wonder "which contianer directory?".



src/slave/containerizer/docker.cpp (line 470)


We shouldn't use snake casing in this case. Admittedly a single letter `s` 
is usually discourged. So how about

```
struct stat s;

...

const uid_t uid = s.st_uid;
const gid_t gid = s.st_gid;
```

And we use `uid`, `gid` in the code that follows?



src/slave/containerizer/docker.cpp (lines 498 - 499)


If in use, we do nothing right? 

You already have a comment above `if (!isResourceInUse) {` that explains 
what's going to happen if this variable is true so here perhaps kill the 
comment? The variable name is pretty self-describing to me.



src/slave/containerizer/docker.cpp (line 500)


Here we are exclusively talking about persistent volumes so I think 
`isVolumeInUse` or even simpler `isInUse` is a better name.



src/slave/containerizer/docker.cpp (lines 509 - 514)


Consolidate the comments into one paragraph because they are tightly 
related? 

```
Set the ownership of the persistent volume to match that of the sandbox 
directory if the volume is not already in use. If the volume is currently in 
use by other containers, tasks in this container may fail to read from or write 
to the persistent volume due to incompatible ownership and file system 
permissions.
```



src/slave/containerizer/docker.cpp (lines 516 - 521)


This is no longer true, and the comment above already serves as the caution 
note so we can kill this.



src/slave/containerizer/docker.cpp (line 552)


What info in flags is relevant here?



src/slave/containerizer/docker.cpp (line 555)


From the persistent volume to the container?



src/slave/containerizer/docker.cpp (line 570)


s/(as read-only)/as read-only/ since the read-only part is the key info 
here and not "an aside"?



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


Comments for linux.cpp are the same as those for docker.cpp.



src/slave/containerizer/mesos/isolators/filesystem/posix.cpp (lines 153 - 158)


Comments for posix.cpp are the same as those for docker.cpp.



src/slave/containerizer/mesos/isolators/filesystem/posix.cpp (lines 266 - 268)


Log a warning if the volume is RO?



src/tests/containerizer/linux_filesystem_isolator_tests.cpp (line 1427)


Add a summary that mentions "task attempts to write to the volume fails" 
and also "we use a shared persistent volume here but its sharedness is not 
important here. Regular persistent volumes works no differently".



src/tests/containerizer/linux_filesystem_isolator_tests.cpp (line 1428)



s/ROOT_SharedVolumeUsageReadOnlyMode/ROOT_WriteAccessSharedPersistentVolumeReadOnlyMode/

The name is slightly longer but the full spelling `SharedPersistentVolume` 
helps with code grepping.



src/tests/containerizer/linux_filesystem_isolator_tests.cpp (line 1438)


We don't need "disk/du" for the purpose of this test

Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-10-12 Thread Anindya Sinha


> On Oct. 7, 2016, 5:49 p.m., Greg Mann wrote:
> > src/slave/containerizer/mesos/isolators/filesystem/posix.hpp, line 55
> > 
> >
> > If you end up removing the check for persistent volumes in this 
> > function per Yan's comment, then perhaps we could also add a comment here 
> > saying that the function assumes that its input is a persistent volume. 
> > Renaming the resource parameter to `persistentVolume` could help make this 
> > clear as well.

I moved the functionality inline since the resource being looked into is a 
persistent volume.


> On Oct. 7, 2016, 5:49 p.m., Greg Mann wrote:
> > src/examples/persistent_shared_volume_framework.cpp, line 191
> > 
> >
> > s/used/uses/
> 
> Greg Mann wrote:
> It looks like this typo is still present? Or perhaps you meant to drop 
> the issue instead of resolve?

Will fix in https://reviews.apache.org/r/45962 when I update that. Please feel 
free to add that comment in https://reviews.apache.org/r/45962 so that it is 
not forgotten.


- Anindya


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


On Oct. 13, 2016, 5:24 a.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45963/
> ---
> 
> (Updated Oct. 13, 2016, 5:24 a.m.)
> 
> 
> Review request for mesos, Greg Mann and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4324
> https://issues.apache.org/jira/browse/MESOS-4324
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Allow the task to specify the persistent volume access to be read-only
> or read-write. Note that the persistent volume is always created as
> read-write.
> If the task is the first consumer of the shared persistent volume, then
> set the ownership of the persistent volume to match that of the task.
> Otherwise, launch the task but if the task is unable to read/write the
> persistent volume, it would fail at that point of time.
> 
> 
> Diffs
> -
> 
>   src/master/validation.cpp e5da3c9bf0a1042b42522f1ab74ce798fbb1738d 
>   src/slave/containerizer/docker.cpp d71386089bf7677872bcb1bd36e07da9263dcf0d 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> 8f62162519f12a157c28ca5f2a76502e466c1481 
>   src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
> af427c6e5691f1770ab3ebef79502eb2c2176c4a 
>   src/tests/containerizer/linux_filesystem_isolator_tests.cpp 
> eb191a32381f9d1ca84ec29adf352dde375c2f2d 
>   src/tests/master_validation_tests.cpp 
> 99e350e0587e73e9ee25ef20dd369cd146bd446a 
> 
> Diff: https://reviews.apache.org/r/45963/diff/
> 
> 
> Testing
> ---
> 
> Tests successful.
> 
> 
> Thanks,
> 
> Anindya Sinha
> 
>



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-10-12 Thread Anindya Sinha

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

(Updated Oct. 13, 2016, 5:24 a.m.)


Review request for mesos, Greg Mann and Jiang Yan Xu.


Changes
---

Addressed review comments.


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


Repository: mesos


Description (updated)
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, launch the task but if the task is unable to read/write the
persistent volume, it would fail at that point of time.


Diffs (updated)
-

  src/master/validation.cpp e5da3c9bf0a1042b42522f1ab74ce798fbb1738d 
  src/slave/containerizer/docker.cpp d71386089bf7677872bcb1bd36e07da9263dcf0d 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
8f62162519f12a157c28ca5f2a76502e466c1481 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
af427c6e5691f1770ab3ebef79502eb2c2176c4a 
  src/tests/containerizer/linux_filesystem_isolator_tests.cpp 
eb191a32381f9d1ca84ec29adf352dde375c2f2d 
  src/tests/master_validation_tests.cpp 
99e350e0587e73e9ee25ef20dd369cd146bd446a 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-10-12 Thread Anindya Sinha


> On Oct. 7, 2016, 4:49 p.m., Jiang Yan Xu wrote:
> > src/master/validation.hpp, lines 72-74
> > 
> >
> > Not quite sure what `isTaskContext` is?

We want to make sure persistent volumes when CREATEd have a mode as `RW`, but 
for tasks it can be either `RO` or `RW`. As discussed, we shall not check for 
mode in this function. Instead, that check shall be contained within 
`Option validatePersistentVolume(const RepeatedPtrField& 
volumes)` which is only called when validating volumes in `CREATE` or `DESTROY` 
calls.


> On Oct. 7, 2016, 4:49 p.m., Jiang Yan Xu wrote:
> > src/master/validation.cpp, lines 426-428
> > 
> >
> > Not sure about the meaning of `isTaskContext` but for simplicty I think 
> > we can just remove this check. Previously it didn't make sense to ever 
> > allow the volume to be RO but now the situation is changed with shared 
> > persistent volumes. Even when the persistent volume is not shared, the task 
> > is just going to fail if it attempts to write to a read-only volume so it 
> > seems no harm to me that we remove this check.

See previous response.


> On Oct. 7, 2016, 4:49 p.m., Jiang Yan Xu wrote:
> > src/slave/containerizer/mesos/isolators/filesystem/linux.cpp, lines 659-660
> > 
> >
> > What's the problem with the previous formatting?

It crosses 80 chars mainly because it is not in a nested block.


> On Oct. 7, 2016, 4:49 p.m., Jiang Yan Xu wrote:
> > src/slave/containerizer/mesos/isolators/filesystem/linux.cpp, lines 698-701
> > 
> >
> > This may not work, IIRC I needed to mount twice previously:
> > 
> > 
> > https://github.com/apache/mesos/blob/4ea9651aabd01f623f2578d2823271488d924c5b/src/slave/containerizer/mesos/provisioner/backends/bind.cpp#L133-L158
> > 
> > But could you verify? i.e., a unit test?

Great catch. Apparently, this inconsistency has been fixed in util-linux v2.27. 
Prior to this version, we need to do a bind mount followed by a remount as 
read-only. Post util-linux v2.27, a single bind mount as read-only should 
suffice.
So, I moved this to a 2-stage mount.


- Anindya


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


On Oct. 13, 2016, 5:24 a.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45963/
> ---
> 
> (Updated Oct. 13, 2016, 5:24 a.m.)
> 
> 
> Review request for mesos, Greg Mann and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4324
> https://issues.apache.org/jira/browse/MESOS-4324
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Allow the task to specify the persistent volume access to be read-only
> or read-write. Note that the persistent volume is always created as
> read-write.
> If the task is the first consumer of the shared persistent volume, then
> set the ownership of the persistent volume to match that of the task.
> Otherwise, launch the task but if the task is unable to read/write the
> persistent volume, it would fail at that point of time.
> 
> 
> Diffs
> -
> 
>   src/master/validation.cpp e5da3c9bf0a1042b42522f1ab74ce798fbb1738d 
>   src/slave/containerizer/docker.cpp d71386089bf7677872bcb1bd36e07da9263dcf0d 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> 8f62162519f12a157c28ca5f2a76502e466c1481 
>   src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
> af427c6e5691f1770ab3ebef79502eb2c2176c4a 
>   src/tests/containerizer/linux_filesystem_isolator_tests.cpp 
> eb191a32381f9d1ca84ec29adf352dde375c2f2d 
>   src/tests/master_validation_tests.cpp 
> 99e350e0587e73e9ee25ef20dd369cd146bd446a 
> 
> Diff: https://reviews.apache.org/r/45963/diff/
> 
> 
> Testing
> ---
> 
> Tests successful.
> 
> 
> Thanks,
> 
> Anindya Sinha
> 
>



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-10-10 Thread Greg Mann


> On Oct. 7, 2016, 5:49 p.m., Greg Mann wrote:
> > src/examples/persistent_shared_volume_framework.cpp, line 191
> > 
> >
> > s/used/uses/

It looks like this typo is still present? Or perhaps you meant to drop the 
issue instead of resolve?


- Greg


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


On Oct. 5, 2016, 12:04 a.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45963/
> ---
> 
> (Updated Oct. 5, 2016, 12:04 a.m.)
> 
> 
> Review request for mesos, Greg Mann and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4324
> https://issues.apache.org/jira/browse/MESOS-4324
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Allow the task to specify the persistent volume access to be read-only
> or read-write. Note that the persistent volume is always created as
> read-write.
> If the task is the first consumer of the shared persistent volume, then
> set the ownership of the persistent volume to match that of the task.
> Otherwise, allow the task to be executed only if the ownership of the
> persistent volume matches that of the task.
> Added an option to run the test in mixed (default) mode or shared-only
> mode. In mixed mode, multiple shards alternate between shared and
> unshared persistent volumes for the tasks. In shared-only mode, all
> shards use shared persistent volumes for the tasks.
> 
> 
> Diffs
> -
> 
>   src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
>   src/master/validation.hpp 035f721c610ae566c89a1cf0e65ff0df11679f15 
>   src/master/validation.cpp e5da3c9bf0a1042b42522f1ab74ce798fbb1738d 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
> 0a85935550e36c9142d845465cfa70a1634a647a 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> ea418252956c8089acc5a491888ed7f6df6cafcd 
>   src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
> 794b6e5990db5f8eb21a6535872f284ca02e0553 
>   src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
> af427c6e5691f1770ab3ebef79502eb2c2176c4a 
> 
> Diff: https://reviews.apache.org/r/45963/diff/
> 
> 
> Testing
> ---
> 
> Tests successful.
> 
> 
> Thanks,
> 
> Anindya Sinha
> 
>



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-10-07 Thread Greg Mann

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



See my comment in https://reviews.apache.org/r/45962/ as well; do you think it 
might make more sense to add the example framework shared volume features to 
the existing persistent volume framework, since the code for the two frameworks 
is so similar?

In addition to the example framework, it would be great to verify this patch 
with a smaller integration test - i.e., verify that when a volume is used by a 
task, the ownership is set correctly, and that another task without write 
permissions would fail when attempting RW.


src/examples/persistent_shared_volume_framework.cpp (line 191)


s/used/uses/



src/slave/containerizer/mesos/isolators/filesystem/posix.hpp (line 55)


If you end up removing the check for persistent volumes in this function 
per Yan's comment, then perhaps we could also add a comment here saying that 
the function assumes that its input is a persistent volume. Renaming the 
resource parameter to `persistentVolume` could help make this clear as well.


- Greg Mann


On Oct. 5, 2016, 12:04 a.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45963/
> ---
> 
> (Updated Oct. 5, 2016, 12:04 a.m.)
> 
> 
> Review request for mesos, Greg Mann and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4324
> https://issues.apache.org/jira/browse/MESOS-4324
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Allow the task to specify the persistent volume access to be read-only
> or read-write. Note that the persistent volume is always created as
> read-write.
> If the task is the first consumer of the shared persistent volume, then
> set the ownership of the persistent volume to match that of the task.
> Otherwise, allow the task to be executed only if the ownership of the
> persistent volume matches that of the task.
> Added an option to run the test in mixed (default) mode or shared-only
> mode. In mixed mode, multiple shards alternate between shared and
> unshared persistent volumes for the tasks. In shared-only mode, all
> shards use shared persistent volumes for the tasks.
> 
> 
> Diffs
> -
> 
>   src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
>   src/master/validation.hpp 035f721c610ae566c89a1cf0e65ff0df11679f15 
>   src/master/validation.cpp e5da3c9bf0a1042b42522f1ab74ce798fbb1738d 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
> 0a85935550e36c9142d845465cfa70a1634a647a 
>   src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
> ea418252956c8089acc5a491888ed7f6df6cafcd 
>   src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
> 794b6e5990db5f8eb21a6535872f284ca02e0553 
>   src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
> af427c6e5691f1770ab3ebef79502eb2c2176c4a 
> 
> Diff: https://reviews.apache.org/r/45963/diff/
> 
> 
> Testing
> ---
> 
> Tests successful.
> 
> 
> Thanks,
> 
> Anindya Sinha
> 
>



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-10-07 Thread Jiang Yan Xu

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



- Can we move this patch to before the example framework so we can commit this 
one first and consolidate the example framework into one patch? My apologies if 
it was the case before but now it seems this patch has higher priority. :) 
- The same logic exists in src/slave/containerizer/docker.cpp which we need to 
take care together.
- Unit test (at least for the linux filesystem isolator)?


src/master/validation.hpp (lines 72 - 74)


Not quite sure what `isTaskContext` is?



src/master/validation.cpp (lines 426 - 428)


Not sure about the meaning of `isTaskContext` but for simplicty I think we 
can just remove this check. Previously it didn't make sense to ever allow the 
volume to be RO but now the situation is changed with shared persistent 
volumes. Even when the persistent volume is not shared, the task is just going 
to fail if it attempts to write to a read-only volume so it seems no harm to me 
that we remove this check.



src/slave/containerizer/mesos/isolators/filesystem/linux.cpp (lines 635 - 643)


But the group id doesn't always need to match, and the volume is created 
with a `0755` so "same group" is as good as "world". It may be worthwhile to do 
something more comprehensive to improve filesystem security of sandboxes and 
volumes but at the moment I'd say we don't go beyond the current expectations: 
use some sensible defaults without guessing too hard in the absence of explict 
user input what "should work a little better".

In light of MESOS-4324 and considering the fact that users may opt not to 
set explicit perms when creating persistent volumes, here I think we just need 
to:

- When the volume is not in use, we change the owner to the task user.
- When the volume is in use, do nothing. If the task user cannot write to 
the volume, it'll fail.

Note that it's possible that the volume was first used by task user1 (with 
files written as user1), then unused, then used by task user2. In this case we 
still change the ownership of the volume to user2 but not the files in it. This 
is by design.



src/slave/containerizer/mesos/isolators/filesystem/linux.cpp (lines 659 - 660)


What's the problem with the previous formatting?



src/slave/containerizer/mesos/isolators/filesystem/linux.cpp (lines 698 - 701)


This may not work, IIRC I needed to mount twice previously:


https://github.com/apache/mesos/blob/4ea9651aabd01f623f2578d2823271488d924c5b/src/slave/containerizer/mesos/provisioner/backends/bind.cpp#L133-L158

But could you verify? i.e., a unit test?



src/slave/containerizer/mesos/isolators/filesystem/linux.cpp (lines 779 - 783)


The caller already guarantees that it's a persistent volume so this is 
unnecessary.



src/slave/containerizer/mesos/isolators/filesystem/linux.cpp (lines 785 - 789)


We are then left with just these lines in this method with a single caller. 
Doesn't appear that we need it as a method. Can we kill it and move these lines 
to the call-site?


- Jiang Yan Xu


On Oct. 4, 2016, 5:04 p.m., Anindya Sinha wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45963/
> ---
> 
> (Updated Oct. 4, 2016, 5:04 p.m.)
> 
> 
> Review request for mesos, Greg Mann and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-4324
> https://issues.apache.org/jira/browse/MESOS-4324
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Allow the task to specify the persistent volume access to be read-only
> or read-write. Note that the persistent volume is always created as
> read-write.
> If the task is the first consumer of the shared persistent volume, then
> set the ownership of the persistent volume to match that of the task.
> Otherwise, allow the task to be executed only if the ownership of the
> persistent volume matches that of the task.
> Added an option to run the test in mixed (default) mode or shared-only
> mode. In mixed mode, multiple shards alternate between shared and
> unshared persistent volumes for the tasks. In shared-only mode, all
> shards use shared persistent volumes for the tasks.
> 
> 
> Diffs
> -
> 
>   src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
>   src/master/validation.hpp 035f721c610ae566c89a1cf0e65ff0df11679f15

Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-09-27 Thread Anindya Sinha

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

(Updated Sept. 28, 2016, 12:15 a.m.)


Review request for mesos and Jiang Yan Xu.


Changes
---

Rebased.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp 035f721c610ae566c89a1cf0e65ff0df11679f15 
  src/master/validation.cpp e5da3c9bf0a1042b42522f1ab74ce798fbb1738d 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
0a85935550e36c9142d845465cfa70a1634a647a 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
ea418252956c8089acc5a491888ed7f6df6cafcd 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
794b6e5990db5f8eb21a6535872f284ca02e0553 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
af427c6e5691f1770ab3ebef79502eb2c2176c4a 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-09-26 Thread Anindya Sinha

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

(Updated Sept. 26, 2016, 11:50 p.m.)


Review request for mesos and Jiang Yan Xu.


Changes
---

Rebased.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp 035f721c610ae566c89a1cf0e65ff0df11679f15 
  src/master/validation.cpp aa743d730bebebc0353fa0a7a31f68bc94e7e25d 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
0a85935550e36c9142d845465cfa70a1634a647a 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
ea418252956c8089acc5a491888ed7f6df6cafcd 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
794b6e5990db5f8eb21a6535872f284ca02e0553 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
af427c6e5691f1770ab3ebef79502eb2c2176c4a 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-09-21 Thread Anindya Sinha

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

(Updated Sept. 22, 2016, 12:35 a.m.)


Review request for mesos and Jiang Yan Xu.


Changes
---

Rebased.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp 035f721c610ae566c89a1cf0e65ff0df11679f15 
  src/master/validation.cpp aa743d730bebebc0353fa0a7a31f68bc94e7e25d 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
0a85935550e36c9142d845465cfa70a1634a647a 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
ea418252956c8089acc5a491888ed7f6df6cafcd 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
794b6e5990db5f8eb21a6535872f284ca02e0553 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
af427c6e5691f1770ab3ebef79502eb2c2176c4a 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-09-07 Thread Anindya Sinha

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

(Updated Sept. 7, 2016, 5:57 p.m.)


Review request for mesos and Jiang Yan Xu.


Changes
---

Rebase.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp 3205ee1e699d0fb7ca16ced96a07be3a07cf8956 
  src/master/validation.cpp 15e2ecc2de99d6bed522f45f855ba686bf19c008 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
0a85935550e36c9142d845465cfa70a1634a647a 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
ea418252956c8089acc5a491888ed7f6df6cafcd 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
794b6e5990db5f8eb21a6535872f284ca02e0553 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
af427c6e5691f1770ab3ebef79502eb2c2176c4a 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-08-24 Thread Anindya Sinha

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

(Updated Aug. 25, 2016, 4:15 a.m.)


Review request for mesos and Jiang Yan Xu.


Changes
---

Rebased.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp 3205ee1e699d0fb7ca16ced96a07be3a07cf8956 
  src/master/validation.cpp 3d2965e4cfaae075f988fd43386bd00c7d807b2e 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
0a85935550e36c9142d845465cfa70a1634a647a 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
ea418252956c8089acc5a491888ed7f6df6cafcd 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
794b6e5990db5f8eb21a6535872f284ca02e0553 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
af427c6e5691f1770ab3ebef79502eb2c2176c4a 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-08-04 Thread Anindya Sinha

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

(Updated Aug. 4, 2016, 8:26 p.m.)


Review request for mesos and Jiang Yan Xu.


Changes
---

Rebased.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp 43d876b00511d4ef652c2685d4950c994b5eef31 
  src/master/validation.cpp af18e5aef3be59830b0a7b0235bbc739dba1029c 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
0a85935550e36c9142d845465cfa70a1634a647a 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
6bf9a4a6438697657750f62980480205c558b6cc 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
794b6e5990db5f8eb21a6535872f284ca02e0553 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
af427c6e5691f1770ab3ebef79502eb2c2176c4a 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-07-19 Thread Anindya Sinha

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

(Updated July 19, 2016, 10:53 p.m.)


Review request for mesos and Jiang Yan Xu.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp 43d876b00511d4ef652c2685d4950c994b5eef31 
  src/master/validation.cpp 50ba372d1301d16d1738a3e4f4882b51f9ce06cd 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
0afe9272900cfa4b39887eb259070a9a2df2ab93 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
db3ed8f69de8b52633194b252b0e5aba38ec69c0 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
794b6e5990db5f8eb21a6535872f284ca02e0553 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
0809e8ec35232fbdafee171a7a960cbdec272134 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-07-18 Thread Anindya Sinha

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

(Updated July 18, 2016, 2:31 p.m.)


Review request for mesos and Jiang Yan Xu.


Changes
---

rebased.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp 43d876b00511d4ef652c2685d4950c994b5eef31 
  src/master/validation.cpp 50ba372d1301d16d1738a3e4f4882b51f9ce06cd 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
0afe9272900cfa4b39887eb259070a9a2df2ab93 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
db3ed8f69de8b52633194b252b0e5aba38ec69c0 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
794b6e5990db5f8eb21a6535872f284ca02e0553 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
0809e8ec35232fbdafee171a7a960cbdec272134 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-07-17 Thread Anindya Sinha

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

(Updated July 17, 2016, 6:29 p.m.)


Review request for mesos and Jiang Yan Xu.


Changes
---

Minor updates needed to shorten duration of the test.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp 43d876b00511d4ef652c2685d4950c994b5eef31 
  src/master/validation.cpp 50ba372d1301d16d1738a3e4f4882b51f9ce06cd 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
0afe9272900cfa4b39887eb259070a9a2df2ab93 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
db3ed8f69de8b52633194b252b0e5aba38ec69c0 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
794b6e5990db5f8eb21a6535872f284ca02e0553 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
0809e8ec35232fbdafee171a7a960cbdec272134 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-06-22 Thread Anindya Sinha

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

(Updated June 23, 2016, 1:28 a.m.)


Review request for mesos and Jiang Yan Xu.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp 43d876b00511d4ef652c2685d4950c994b5eef31 
  src/master/validation.cpp 9120b71fc7725bdf7094aac6619d8aadcc352df5 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
0afe9272900cfa4b39887eb259070a9a2df2ab93 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
adacde191132a7a92c1fdf27ef8a4a41d2afa003 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
794b6e5990db5f8eb21a6535872f284ca02e0553 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
0809e8ec35232fbdafee171a7a960cbdec272134 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-06-13 Thread Anindya Sinha

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

(Updated June 13, 2016, 7:20 a.m.)


Review request for mesos and Jiang Yan Xu.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp e1271bbaebaac52a078eedfdc2299c7c6f4474f8 
  src/master/validation.cpp 7b9c2281b2ab1295211f0dd385cd77947fbd63be 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
0afe9272900cfa4b39887eb259070a9a2df2ab93 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
35213ce8f9d0e81fdd2da15c7a2cee1c779f3555 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
794b6e5990db5f8eb21a6535872f284ca02e0553 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
d45166f1909649b9d3508c1216c394715d44280b 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-05-22 Thread Anindya Sinha

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

(Updated May 22, 2016, 7:21 a.m.)


Review request for mesos and Jiang Yan Xu.


Changes
---

Cosmetic changes.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp f29f9753c75e5abc3402ed23381edcea26517ab3 
  src/master/validation.cpp f490b899758bdac9676a6f6939918efa6ac52781 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
c99f33a77e4db5407cc26361a2f253b00e91f5b5 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
5edbce95cc9eb4d6d22f9ab1528902cc745780af 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
c6cea98e16f2bdea2da0220c235468080bbcd17b 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
01c0ad6dbb6d509e62e769365586b3d23dcb240d 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-04-28 Thread Anindya Sinha

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

(Updated April 29, 2016, 12:16 a.m.)


Review request for mesos and Jiang Yan Xu.


Changes
---

Updated based on changes in api to convert Resources to protobuf.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp 7fa1b892c1aff7453658c31e534dc272d1759b17 
  src/master/validation.cpp f458100d22ec1f9f10921c1c91b6931a5671e28f 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
cb181265482c884b02bdfc576f906aa0dd9f00f2 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
a6e748ae777b6280f5dab0a6fec7305f931f2c22 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
c6cea98e16f2bdea2da0220c235468080bbcd17b 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
01c0ad6dbb6d509e62e769365586b3d23dcb240d 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Re: Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-04-08 Thread Anindya Sinha

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

(Updated April 9, 2016, 2:27 a.m.)


Review request for mesos and Jiang Yan Xu.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs (updated)
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp d1f2323172cbf3bb052942a119b8531f9ccad48d 
  src/master/validation.cpp 504cd9b8bd5d40bb591b7aa5a23bd74cc210c2fc 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
cb181265482c884b02bdfc576f906aa0dd9f00f2 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
9fc7c48f99155750fd3c18c7c102507e2726362b 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
c6cea98e16f2bdea2da0220c235468080bbcd17b 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
01c0ad6dbb6d509e62e769365586b3d23dcb240d 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha



Review Request 45963: Allow tasks to set persistent volume as readonly or readwrite resource.

2016-04-08 Thread Anindya Sinha

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

Review request for mesos and Jiang Yan Xu.


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


Repository: mesos


Description
---

Allow the task to specify the persistent volume access to be read-only
or read-write. Note that the persistent volume is always created as
read-write.
If the task is the first consumer of the shared persistent volume, then
set the ownership of the persistent volume to match that of the task.
Otherwise, allow the task to be executed only if the ownership of the
persistent volume matches that of the task.
Added an option to run the test in mixed (default) mode or shared-only
mode. In mixed mode, multiple shards alternate between shared and
unshared persistent volumes for the tasks. In shared-only mode, all
shards use shared persistent volumes for the tasks.


Diffs
-

  src/examples/persistent_shared_volume_framework.cpp PRE-CREATION 
  src/master/validation.hpp d1f2323172cbf3bb052942a119b8531f9ccad48d 
  src/master/validation.cpp 504cd9b8bd5d40bb591b7aa5a23bd74cc210c2fc 
  src/slave/containerizer/mesos/isolators/filesystem/linux.hpp 
cb181265482c884b02bdfc576f906aa0dd9f00f2 
  src/slave/containerizer/mesos/isolators/filesystem/linux.cpp 
9fc7c48f99155750fd3c18c7c102507e2726362b 
  src/slave/containerizer/mesos/isolators/filesystem/posix.hpp 
c6cea98e16f2bdea2da0220c235468080bbcd17b 
  src/slave/containerizer/mesos/isolators/filesystem/posix.cpp 
01c0ad6dbb6d509e62e769365586b3d23dcb240d 

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


Testing
---

Tests successful.


Thanks,

Anindya Sinha