[jira] [Commented] (MESOS-7655) Reservation Refinement: Update the resources logic.

2017-06-20 Thread Michael Park (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-7655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16055480#comment-16055480
 ] 

Michael Park commented on MESOS-7655:
-

{noformat}
commit 7877b46f74730b61daf5179121139b40df26c2a6
Author: Michael Park 
Date:   Sun Jun 18 21:15:14 2017 -0700

Introduced a utility function `Resources::reservationRole` [7/20].

Review: https://reviews.apache.org/r/60015
{noformat}
{noformat}
commit 76b0f4ed82a51ab9eec3dc2b0d1542c8b29d1ab6
Author: Michael Park 
Date:   Tue Jun 13 01:40:21 2017 -0700

Resources: Adjusted `parse` to produce new resource format [6/20].

Review: https://reviews.apache.org/r/60040
{noformat}
{noformat}
commit 0bae26707645f515317b3860b22df822dd85e718
Author: Michael Park 
Date:   Sun Jun 18 22:04:29 2017 -0700

Resources: Adjusted the utilities to the new resource format [5/20].

Review: https://reviews.apache.org/r/60017
{noformat}
{noformat}
commit 9ac264bf533b96629dbb742e42c93b537a88ef6e
Author: Michael Park 
Date:   Sun Jun 18 22:05:10 2017 -0700

Resources: Adjusted `operator<<` to the new resource format [4/20].

Review: https://reviews.apache.org/r/60184
{noformat}
{noformat}
commit 2d78e5aec75bdd2b6115d9a822a93e8b5fa70283
Author: Michael Park 
Date:   Thu May 25 17:20:37 2017 -0700

Resources: Adjusted the comparators to new resource format [3/20].

Review: https://reviews.apache.org/r/60016
{noformat}
{noformat}
commit 1e220035de84245694ccf92b1fd2307aff2d3342
Author: Michael Park 
Date:   Sun Jun 18 22:03:25 2017 -0700

Resources: Adjusted the predicates to the new resource format [2/20].

The predicate resource functions have the same preconditions as
the `Resources`, in that they require the given `Resource` object
to be validated, and in the "post-reservation-refinement" format.
As such, the corresponding preconditions have been added as a `CHECK`,
and the functions have been updated to inspect the correct fields.

Review: https://reviews.apache.org/r/60182
{noformat}
{noformat}
commit db2babf9829edbd20124c04b93910ce370d62f08
Author: Michael Park 
Date:   Sun Jun 18 21:55:12 2017 -0700

Resources: Updated the comment to mention the resource format [1/20].

With reservation refinement, `Resources` always stores `Resource`
objects that are validated, and in the "post-reservation-refinement"
format. Added this precondition to the top of `Resources` declaration.

Review: https://reviews.apache.org/r/60181
{noformat}

> Reservation Refinement: Update the resources logic.
> ---
>
> Key: MESOS-7655
> URL: https://issues.apache.org/jira/browse/MESOS-7655
> Project: Mesos
>  Issue Type: Bug
>Reporter: Michael Park
>Assignee: Michael Park
> Fix For: 1.4.0
>
>
> With reservation refinement, there is a new framework capability called 
> {{RESERVATION_REFINEMENT}}. The framework is required to use the 
> {{Resource.reservations}} field to express reservations if the capability is 
> set, otherwise it is required to use the {{Resource.role}} and 
> {{Resource.reservation}} fields.
> After the validation, we transform the resources from the old format to the 
> new format and deal with the new format internally.
> This allows us to only deal with the old format at the validation phase, and 
> update the code to only consider the new format for all other 
> Resources-related functions.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (MESOS-7655) Reservation Refinement: Update the resources logic.

2017-06-18 Thread Michael Park (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-7655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16053489#comment-16053489
 ] 

Michael Park commented on MESOS-7655:
-

https://reviews.apache.org/r/60181/
https://reviews.apache.org/r/60182/
https://reviews.apache.org/r/60184/
https://reviews.apache.org/r/60016/
https://reviews.apache.org/r/60017/
https://reviews.apache.org/r/60040/
https://reviews.apache.org/r/60015/

> Reservation Refinement: Update the resources logic.
> ---
>
> Key: MESOS-7655
> URL: https://issues.apache.org/jira/browse/MESOS-7655
> Project: Mesos
>  Issue Type: Bug
>Reporter: Michael Park
>Assignee: Michael Park
>
> With reservation refinement, there is a new framework capability called 
> {{RESERVATION_REFINEMENT}}. The framework is required to use the 
> {{Resource.reservations}} field to express reservations if the capability is 
> set, otherwise it is required to use the {{Resource.role}} and 
> {{Resource.reservation}} fields.
> After the validation, we transform the resources from the old format to the 
> new format and deal with the new format internally.
> This allows us to only deal with the old format at the validation phase, and 
> update the code to only consider the new format for all other 
> Resources-related functions.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (MESOS-7655) Reservation Refinement: Update the resources logic.

2017-06-18 Thread Michael Park (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-7655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16053434#comment-16053434
 ] 

Michael Park commented on MESOS-7655:
-

{noformat}
commit ff5dce24ec20a27d1eaee30f084081861231982c
Author: Neil Conway 
Date:   Sun Jun 18 20:12:43 2017 -0700

Added test for endpoint resource format.

Review: https://reviews.apache.org/r/60178/
{noformat}

> Reservation Refinement: Update the resources logic.
> ---
>
> Key: MESOS-7655
> URL: https://issues.apache.org/jira/browse/MESOS-7655
> Project: Mesos
>  Issue Type: Bug
>Reporter: Michael Park
>Assignee: Michael Park
>
> With reservation refinement, there is a new framework capability called 
> {{RESERVATION_REFINEMENT}}. The framework is required to use the 
> {{Resource.reservations}} field to express reservations if the capability is 
> set, otherwise it is required to use the {{Resource.role}} and 
> {{Resource.reservation}} fields.
> After the validation, we transform the resources from the old format to the 
> new format and deal with the new format internally.
> This allows us to only deal with the old format at the validation phase, and 
> update the code to only consider the new format for all other 
> Resources-related functions.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (MESOS-7655) Reservation Refinement: Update the resources logic.

2017-06-18 Thread Michael Park (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-7655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16053433#comment-16053433
 ] 

Michael Park commented on MESOS-7655:
-

{noformat}
commit cf96042ecf4f294723882ed5dfda9d12e63d6519
Author: Michael Park 
Date:   Sun Jun 18 18:21:09 2017 -0700

Avoided exposing `role` in JSON for resources with refined reservations.

With reservation refinement, we use the `Resource.reservations` field to
express the reservation state. Due to the fact that `Resource.role` is
an optional field __and__ has a default value, our generic Protobuf to
JSON code injects the `role` field with the default value even if it's
not set. Since this will likely confuse users, here we manually remove
the `Resource.role` field if the resource has refined reservations.

Review: https://reviews.apache.org/r/60036
{noformat}
{noformat}
commit f39f846160ff934e42294ace2662eee2a8f658fb
Author: Michael Park 
Date:   Sat Jun 17 15:11:12 2017 -0700

Introduced `convertResourceFormat` to convert between resource formats.

With reservation refinement, we introduced a new resource format to
enable creating a refined reservation on top of an existing reservation.
We still have the "pre-reservation-refinement" format which uses
the `Resource.role` and `Resource.reservation` fields, and we now also
have the "post-reservation-refinement" format which uses
the `Resource.reservations` field to represent the reservation state.

In order to simplify our code, we use `convertResourceFormat` to
canonicalize the resources into the "post-reservation-refinement" in
memory, and convert them back as necessary.

Review: https://reviews.apache.org/r/60022
{noformat}
{noformat}
commit 5124602beca53dea153781167121aaaedb30291e
Author: Michael Park 
Date:   Sat Jun 17 21:03:30 2017 -0700

Introduced a utility function `Resources::hasRefinedReservations`.

Review: https://reviews.apache.org/r/60175
{noformat}
{noformat}
commit 49e090dbb8ab1b7be9dc59cf31a4a26e337c9304
Author: Michael Park 
Date:   Sat Jun 17 20:47:20 2017 -0700

Updated the resources validation logic to allow for the endpoint format.

For backwards compatibility of external tools consuming endpoints,
We'll inject the "pre-reservation-refinement" format for resources
without refined reservations. That is, the `Resource.role` and
`Resource.reservation` fields will be present as well as
the in with the single `Resource.reservations` field.

Since the users of the endpoints are likely to feed the result back into
Mesos, we need to update the validation logic to allow these resources
to be considered valid.

Review: https://reviews.apache.org/r/60174
{noformat}

> Reservation Refinement: Update the resources logic.
> ---
>
> Key: MESOS-7655
> URL: https://issues.apache.org/jira/browse/MESOS-7655
> Project: Mesos
>  Issue Type: Bug
>Reporter: Michael Park
>Assignee: Michael Park
>
> With reservation refinement, there is a new framework capability called 
> {{RESERVATION_REFINEMENT}}. The framework is required to use the 
> {{Resource.reservations}} field to express reservations if the capability is 
> set, otherwise it is required to use the {{Resource.role}} and 
> {{Resource.reservation}} fields.
> After the validation, we transform the resources from the old format to the 
> new format and deal with the new format internally.
> This allows us to only deal with the old format at the validation phase, and 
> update the code to only consider the new format for all other 
> Resources-related functions.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (MESOS-7655) Reservation Refinement: Update the resources logic.

2017-06-17 Thread Michael Park (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-7655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16052774#comment-16052774
 ] 

Michael Park commented on MESOS-7655:
-

{noformat}
commit fe6a3eb48af793b5cf2e1308d9164cdec1c4875a
Author: Michael Park 
Date:   Sat Jun 17 01:41:55 2017 -0700

Resources: Updated the validation logic.

This patch updates `Resources::validate`, and `resource::validate`.

The `Resources::validate` function ensures that the resources are
either in the 'pre-' or 'post-' reservation-refinement formats,
but not both.

The `resource::validate` function takes an optional framework
capabilities and ensures that the resources format matches
the framework's RESERVATION_REFINEMENT capbility.

Review: https://reviews.apache.org/r/60013/
{noformat}
{noformat}
commit 4f16535704ac6f8417dfcef6c6347658114db97e
Author: Michael Park 
Date:   Wed Jun 14 21:28:04 2017 -0700

Resources: Added `toUnreserved()` and `(push|pop)Reservation`.

This patches introduces utilities `toUnreserved`, `pushReservation` and
`popReservation`. They are intended to replace the current `flatten`.
We'll switch over to use them once the 'post-reservation-refinement'
format is used for `Resources`.

Review: https://reviews.apache.org/r/60020
{noformat}

> Reservation Refinement: Update the resources logic.
> ---
>
> Key: MESOS-7655
> URL: https://issues.apache.org/jira/browse/MESOS-7655
> Project: Mesos
>  Issue Type: Bug
>Reporter: Michael Park
>Assignee: Michael Park
>
> With reservation refinement, there is a new framework capability called 
> {{RESERVATION_REFINEMENT}}. The framework is required to use the 
> {{Resource.reservations}} field to express reservations if the capability is 
> set, otherwise it is required to use the {{Resource.role}} and 
> {{Resource.reservation}} fields.
> After the validation, we transform the resources from the old format to the 
> new format and deal with the new format internally.
> This allows us to only deal with the old format at the validation phase, and 
> update the code to only consider the new format for all other 
> Resources-related functions.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (MESOS-7655) Reservation Refinement: Update the resources logic.

2017-06-16 Thread Michael Park (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-7655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16052396#comment-16052396
 ] 

Michael Park commented on MESOS-7655:
-

{noformat}
commit 9cfae1bdea14ab07b879d5aba8ec2c8ac2f76693
Author: Michael Park 
Date:   Tue Jun 13 16:35:30 2017 -0700

Updated `isAllocatableTo` to use the `roles::isStrictSubroleOf` utility.

This patch simplifies the `isAllocatableTo` function by leveraging
the `roles::isStrictSubroleOf` function introduced in
https://reviews.apache.org/r/60064.

Review: https://reviews.apache.org/r/60064
{noformat}
{noformat}
commit dfa37ed8af4647fbfb58471caa46acfcf8f5fba8
Author: Michael Park 
Date:   Tue Jun 13 16:10:51 2017 -0700

Introduced `roles::isStrictSubroleOf` function.

This patch introduces a utility to determine whether
a role is a strict subrole of another role.

Review: https://reviews.apache.org/r/60063
{noformat}

> Reservation Refinement: Update the resources logic.
> ---
>
> Key: MESOS-7655
> URL: https://issues.apache.org/jira/browse/MESOS-7655
> Project: Mesos
>  Issue Type: Bug
>Reporter: Michael Park
>Assignee: Michael Park
>
> With reservation refinement, there is a new framework capability called 
> {{RESERVATION_REFINEMENT}}. The framework is required to use the 
> {{Resource.reservations}} field to express reservations if the capability is 
> set, otherwise it is required to use the {{Resource.role}} and 
> {{Resource.reservation}} fields.
> After the validation, we transform the resources from the old format to the 
> new format and deal with the new format internally.
> This allows us to only deal with the old format at the validation phase, and 
> update the code to only consider the new format for all other 
> Resources-related functions.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)