You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2017/07/27 01:00:36 UTC
[1/2] mesos git commit: Multi-role: Adjusted `long-lived-framework`
to use allocated resources.
Repository: mesos
Updated Branches:
refs/heads/1.3.x bef61dd5b -> 567775dc7
Multi-role: Adjusted `long-lived-framework` to use allocated resources.
With multi-role support, resources have an explicit notion of
an allocation role. The allocation role is used in the `contains` check
for example. The task/executor resources that the long-lived-framework
uses therefore need to be updated such that the check works correctly.
Review: https://reviews.apache.org/r/61094
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/36737d58
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/36737d58
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/36737d58
Branch: refs/heads/1.3.x
Commit: 36737d586d852451ba76ab3c52d0dec47a15d426
Parents: bef61dd
Author: Michael Park <mp...@apache.org>
Authored: Mon Jul 24 16:14:05 2017 -0700
Committer: Michael Park <mp...@apache.org>
Committed: Wed Jul 26 17:35:01 2017 -0700
----------------------------------------------------------------------
src/examples/long_lived_framework.cpp | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/36737d58/src/examples/long_lived_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/long_lived_framework.cpp b/src/examples/long_lived_framework.cpp
index bbe8606..7ee4f27 100644
--- a/src/examples/long_lived_framework.cpp
+++ b/src/examples/long_lived_framework.cpp
@@ -106,9 +106,13 @@ public:
master(_master),
framework(_framework),
executor(_executor),
- taskResources(Resources::parse(
- "cpus:" + stringify(CPUS_PER_TASK) +
- ";mem:" + stringify(MEM_PER_TASK)).get()),
+ taskResources([&_framework]() {
+ Resources resources = Resources::parse(
+ "cpus:" + stringify(CPUS_PER_TASK) +
+ ";mem:" + stringify(MEM_PER_TASK)).get();
+ resources.allocate(_framework.role());
+ return resources;
+ }()),
tasksLaunched(0),
credential(_credential),
metrics(*this)
@@ -237,7 +241,11 @@ protected:
{
CHECK_EQ(SUBSCRIBED, state);
- static const Resources EXECUTOR_RESOURCES = Resources(executor.resources());
+ const Resources executorResources = [this]() {
+ Resources resources(executor.resources());
+ resources.allocate(framework.role());
+ return resources;
+ }();
metrics.offers_received += offers.size();
@@ -247,7 +255,7 @@ protected:
// Launch a new task with executor.
if (Resources(offer.resources()).flatten()
- .contains(EXECUTOR_RESOURCES + taskResources)) {
+ .contains(taskResources + executorResources)) {
LOG(INFO)
<< "Starting executor and task " << tasksLaunched
<< " on " << offer.hostname();
[2/2] mesos git commit: Added MESOS-7252 to 1.3.1 CHANGELOG.
Posted by mp...@apache.org.
Added MESOS-7252 to 1.3.1 CHANGELOG.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/567775dc
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/567775dc
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/567775dc
Branch: refs/heads/1.3.x
Commit: 567775dc7acc0f1a532e4fcd3680fd7a6b47aa29
Parents: 36737d5
Author: Michael Park <mp...@apache.org>
Authored: Wed Jul 26 17:49:51 2017 -0700
Committer: Michael Park <mp...@apache.org>
Committed: Wed Jul 26 17:49:51 2017 -0700
----------------------------------------------------------------------
CHANGELOG | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/567775dc/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index c717ec4..5fc7a5f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,6 +7,7 @@ All Issues:
* [MESOS-7429] - Allow isolators to inject task-specific environment variables.
* [MESOS-7540] - Add an agent flag for executor re-registration timeout.
* [MESOS-7546] - WAIT_NESTED_CONTAINER sometimes returns 404.
+ * [MESOS-7252] - Need to fix resource check in long-lived framework.
* [MESOS-7569] - Allow "old" executors with half-open connections to be preserved during agent upgrade / restart.
* [MESOS-7581] - Fix interference of external Boost installations when using some unbundled dependencies.
* [MESOS-7689] - Libprocess can crash on malformed request paths for libprocess messages.