You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ne...@apache.org on 2017/07/11 18:03:43 UTC
[2/8] mesos git commit: Added REGION_AWARE framework capability.
Added REGION_AWARE framework capability.
Added REGION_AWARE framework capability.
Review: https://reviews.apache.org/r/59760/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4189a450
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4189a450
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4189a450
Branch: refs/heads/master
Commit: 4189a4504bf0ccc2b47e0edcf0a43fde94a7cbca
Parents: 1789278
Author: Neil Conway <ne...@gmail.com>
Authored: Tue Jul 11 10:43:19 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Tue Jul 11 10:43:19 2017 -0700
----------------------------------------------------------------------
include/mesos/mesos.proto | 12 ++++++++++++
include/mesos/v1/mesos.proto | 12 ++++++++++++
src/common/protobuf_utils.hpp | 4 ++++
src/tests/protobuf_utils_tests.cpp | 6 ++++++
4 files changed, 34 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/4189a450/include/mesos/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 8355371..2ee3861 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -369,6 +369,18 @@ message FrameworkInfo {
// reservations if it uses the `Resource.reservations` field, and
// `Resource.reservations_size() > 1`.
RESERVATION_REFINEMENT = 7; // EXPERIMENTAL.
+
+ // Indicates that the framework is prepared to receive offers
+ // for agents whose region is different from the master's
+ // region. Network links between hosts in different regions
+ // typically have higher latency and lower bandwidth than
+ // network links within a region, so frameworks should be
+ // careful to only place suitable workloads in remote regions.
+ // Frameworks that are not region-aware will never receive
+ // offers for remote agents; region-aware frameworks are assumed
+ // to implement their own logic to decide which workloads (if
+ // any) are suitable for placement on remote agents.
+ REGION_AWARE = 8;
}
// Enum fields should be optional, see: MESOS-4997.
http://git-wip-us.apache.org/repos/asf/mesos/blob/4189a450/include/mesos/v1/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index 4d5cebd..b143df8 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -369,6 +369,18 @@ message FrameworkInfo {
// reservations if it uses the `Resource.reservations` field, and
// `Resource.reservations_size() > 1`.
RESERVATION_REFINEMENT = 7; // EXPERIMENTAL.
+
+ // Indicates that the framework is prepared to receive offers
+ // for agents whose region is different from the master's
+ // region. Network links between hosts in different regions
+ // typically have higher latency and lower bandwidth than
+ // network links within a region, so frameworks should be
+ // careful to only place suitable workloads in remote regions.
+ // Frameworks that are not region-aware will never receive
+ // offers for remote agents; region-aware frameworks are assumed
+ // to implement their own logic to decide which workloads (if
+ // any) are suitable for placement on remote agents.
+ REGION_AWARE = 8;
}
// Enum fields should be optional, see: MESOS-4997.
http://git-wip-us.apache.org/repos/asf/mesos/blob/4189a450/src/common/protobuf_utils.hpp
----------------------------------------------------------------------
diff --git a/src/common/protobuf_utils.hpp b/src/common/protobuf_utils.hpp
index 5476d2e..2156f6d 100644
--- a/src/common/protobuf_utils.hpp
+++ b/src/common/protobuf_utils.hpp
@@ -355,6 +355,9 @@ struct Capabilities
case FrameworkInfo::Capability::RESERVATION_REFINEMENT:
reservationRefinement = true;
break;
+ case FrameworkInfo::Capability::REGION_AWARE:
+ regionAware = true;
+ break;
}
}
}
@@ -367,6 +370,7 @@ struct Capabilities
bool partitionAware = false;
bool multiRole = false;
bool reservationRefinement = false;
+ bool regionAware = false;
};
http://git-wip-us.apache.org/repos/asf/mesos/blob/4189a450/src/tests/protobuf_utils_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/protobuf_utils_tests.cpp b/src/tests/protobuf_utils_tests.cpp
index 6ec3a8e..2be26a5 100644
--- a/src/tests/protobuf_utils_tests.cpp
+++ b/src/tests/protobuf_utils_tests.cpp
@@ -220,6 +220,9 @@ TEST(ProtobufUtilTest, FrameworkCapabilities)
if (capabilities.multiRole) {
result.insert(FrameworkInfo::Capability::MULTI_ROLE);
}
+ if (capabilities.regionAware) {
+ result.insert(FrameworkInfo::Capability::REGION_AWARE);
+ }
return result;
};
@@ -266,6 +269,9 @@ TEST(ProtobufUtilTest, FrameworkCapabilities)
expected = { FrameworkInfo::Capability::MULTI_ROLE };
EXPECT_EQ(expected, backAndForth(expected));
+
+ expected = { FrameworkInfo::Capability::REGION_AWARE };
+ EXPECT_EQ(expected, backAndForth(expected));
}