This is an automated email from the ASF dual-hosted git repository. mzhu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mesos.git
commit dd62817372fad7c8883515cef2797bfee2c58fc5 Author: Meng Zhu <[email protected]> AuthorDate: Fri Feb 22 11:10:25 2019 -0800 Updated `UPDATE_QUOTA` call with a new schema. A new message `QuotaConfig` is introduced to describe a role's quota configuration. It uses name-value pairs to specify resources in the quota. This will replace the existing `QuotaInfo` message in APIs and registries. Review: https://reviews.apache.org/r/70159 --- include/mesos/master/master.proto | 10 ++++--- include/mesos/quota/quota.proto | 11 ++++++++ include/mesos/v1/master/master.proto | 10 ++++--- include/mesos/v1/quota/quota.proto | 52 ++++++++++++++++++++++++++++++++++++ 4 files changed, 77 insertions(+), 6 deletions(-) diff --git a/include/mesos/master/master.proto b/include/mesos/master/master.proto index 0dc2d68..4a653ce 100644 --- a/include/mesos/master/master.proto +++ b/include/mesos/master/master.proto @@ -229,10 +229,14 @@ message Call { // // This feature is not implementation complete. // - // Updates quota given the provided requests, the requests are - // applied in an all-or-nothing manner. + // Updates quota given the provided quota configurations, these configurations + // are applied in an all-or-nothing manner. message UpdateQuota { - repeated quota.QuotaRequest quota_requests = 1; + // Determines whether to skip the capacity validation. See + // `quota.QuotaConfig` for more details. + optional bool force = 1; + + repeated quota.QuotaConfig quota_configs = 2; } // Sets the quota for resources to be used by a particular role. diff --git a/include/mesos/quota/quota.proto b/include/mesos/quota/quota.proto index 3e6b899..34d4b69 100644 --- a/include/mesos/quota/quota.proto +++ b/include/mesos/quota/quota.proto @@ -47,6 +47,17 @@ message QuotaRequest { /** + * See v1 `QuotaConfig`. + */ +message QuotaConfig { + required string role = 1; + + map<string, Value.Scalar> guarantees = 2; + map<string, Value.Scalar> limits = 3; +} + + +/** * See v1 `QuotaStatus`. */ message QuotaStatus { diff --git a/include/mesos/v1/master/master.proto b/include/mesos/v1/master/master.proto index 3816ab4..d4dd3fc 100644 --- a/include/mesos/v1/master/master.proto +++ b/include/mesos/v1/master/master.proto @@ -227,10 +227,14 @@ message Call { // // This feature is not implementation complete. // - // Updates quota given the provided requests, the requests are - // applied in an all-or-nothing manner. + // Updates quota given the provided quota configurations, these configurations + // are applied in an all-or-nothing manner. message UpdateQuota { - repeated quota.QuotaRequest quota_requests = 1; + // Determines whether to skip the capacity validation. See + // `quota.QuotaConfig` for more details. + optional bool force = 1; + + repeated quota.QuotaConfig quota_configs = 2; } // Sets the quota for resources to be used by a particular role. diff --git a/include/mesos/v1/quota/quota.proto b/include/mesos/v1/quota/quota.proto index 44a416d..8a6a64a 100644 --- a/include/mesos/v1/quota/quota.proto +++ b/include/mesos/v1/quota/quota.proto @@ -110,6 +110,58 @@ message QuotaRequest { repeated Resource limit = 4; } +/** + * Describes a role's quota configuration. + */ +message QuotaConfig { + required string role = 1; + + // Name-value pairs that define the resource guarantees. + // Only scalar resources are currently supported. + // + // Mesos will try its best to ensure that the role can be + // allocated at least as many resources as the guarantee. + // Despite this, it's possible for the guarantee to not be + // satisfiable, if: + // (1) The operator has overcommitted guarantees. + // (2) There is a loss of agents that such that the + // guarantees overcommit the cluster. + // (3) The scheduler is pickier than mesos knows about, + // e.g. the scheduler needs resources from agents + // with specific attributes. + // + // The provided guarantees will be validated to ensure it + // is not overcommitting the cluster. The operator can + // disable this via `UpdateQuota.force`. + // + // If the guarantee is omitted, there is no guarantee. + // + // Operators may want to set up alerting to let them know + // when a guarantee cannot be satisfied. + map<string, Value.Scalar> guarantees = 2; + + // Name-value pairs that define the resource limits. + // Only scalar resources are currently supported. + // + // Imposes a limit on the amount of resources allocated to the + // role. Mesos will try its best to ensure that the role does + // not exceed this limit. Despite this, the limit can be exceeded + // when: + // (1) The limit is lowered below the allocation. + // (2) Some agents are partitioned and re-connect with + // resources allocated to the role. + // + // The provided limits will be validated to ensure it does not + // exceed the total cluster size. The operator can disable + // this check via `UpdateQuota.force`. + // + // If the limit is omitted, there is no limit. + // + // Operators may want to set up alerting to let them know + // when the limit is exceeded. + map<string, Value.Scalar> limits = 3; +} + /** * `QuotaStatus` describes the internal representation for the
