You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2013/02/25 20:44:21 UTC
svn commit: r1449834 - in /incubator/mesos/trunk:
hadoop/mesos/src/java/org/apache/hadoop/mapred/ include/mesos/
src/examples/ src/examples/java/ src/examples/python/ src/master/
src/slave/ src/webui/master/static/
Author: vinodkone
Date: Mon Feb 25 19:44:21 2013
New Revision: 1449834
URL: http://svn.apache.org/r1449834
Log:
Resource Monitoring 1.5: Added source to ExecutorInfo.
From: Ben Mahler <be...@gmail.com>
Review: https://reviews.apache.org/r/9552
Modified:
incubator/mesos/trunk/hadoop/mesos/src/java/org/apache/hadoop/mapred/MesosScheduler.java
incubator/mesos/trunk/include/mesos/mesos.proto
incubator/mesos/trunk/src/examples/balloon_framework.cpp
incubator/mesos/trunk/src/examples/java/TestFramework.java
incubator/mesos/trunk/src/examples/long_lived_framework.cpp
incubator/mesos/trunk/src/examples/python/test_framework.py
incubator/mesos/trunk/src/examples/test_framework.cpp
incubator/mesos/trunk/src/master/http.cpp
incubator/mesos/trunk/src/slave/http.cpp
incubator/mesos/trunk/src/slave/slave.hpp
incubator/mesos/trunk/src/webui/master/static/slave_executor.html
incubator/mesos/trunk/src/webui/master/static/slave_framework.html
Modified: incubator/mesos/trunk/hadoop/mesos/src/java/org/apache/hadoop/mapred/MesosScheduler.java
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/hadoop/mesos/src/java/org/apache/hadoop/mapred/MesosScheduler.java?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/hadoop/mesos/src/java/org/apache/hadoop/mapred/MesosScheduler.java (original)
+++ incubator/mesos/trunk/hadoop/mesos/src/java/org/apache/hadoop/mapred/MesosScheduler.java Mon Feb 25 19:44:21 2013
@@ -519,6 +519,8 @@ public class MesosScheduler extends Task
.newBuilder()
.setExecutorId(ExecutorID.newBuilder().setValue(
"executor_" + taskId.getValue()))
+ .setName("Hadoop TaskTracker")
+ .setSource(taskId.getValue())
.addResources(
Resource
.newBuilder()
Modified: incubator/mesos/trunk/include/mesos/mesos.proto
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/include/mesos/mesos.proto?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/include/mesos/mesos.proto (original)
+++ incubator/mesos/trunk/include/mesos/mesos.proto Mon Feb 25 19:44:21 2013
@@ -130,11 +130,15 @@ message ExecutorInfo {
optional FrameworkID framework_id = 8; // TODO(benh): Make this required.
required CommandInfo command = 7;
repeated Resource resources = 5;
+ optional string name = 9;
- // Note that name is exposed alongside the resource usage of the
+ // Source is an identifier style string used by frameworks to track
+ // the source of an executor. This is useful when it's possible for
+ // different executor ids to be related semantically.
+ // NOTE: Source is exposed alongside the resource usage of the
// executor via JSON on the slave. This allows users to import
// usage information into a time series database for monitoring.
- optional string name = 9;
+ optional string source = 10;
optional bytes data = 4;
}
Modified: incubator/mesos/trunk/src/examples/balloon_framework.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/examples/balloon_framework.cpp?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/src/examples/balloon_framework.cpp (original)
+++ incubator/mesos/trunk/src/examples/balloon_framework.cpp Mon Feb 25 19:44:21 2013
@@ -92,6 +92,7 @@ public:
task.mutable_task_id()->set_value("1");
task.mutable_slave_id()->MergeFrom(offer.slave_id());
task.mutable_executor()->MergeFrom(executor);
+ task.mutable_executor()->set_source("task_1");
task.set_data(stringify<size_t>(balloonLimit));
// Use up all the memory from the offer.
@@ -196,6 +197,7 @@ int main(int argc, char** argv)
ExecutorInfo executor;
executor.mutable_executor_id()->set_value("default");
executor.mutable_command()->set_value(uri);
+ executor.set_name("Balloon Executor");
Resource* mem = executor.add_resources();
mem->set_name("mem");
Modified: incubator/mesos/trunk/src/examples/java/TestFramework.java
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/examples/java/TestFramework.java?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/src/examples/java/TestFramework.java (original)
+++ incubator/mesos/trunk/src/examples/java/TestFramework.java Mon Feb 25 19:44:21 2013
@@ -75,7 +75,8 @@ public class TestFramework {
.setName("mem")
.setType(Value.Type.SCALAR)
.setScalar(Value.Scalar.newBuilder().setValue(128)))
- .setExecutor(executor)
+ .setExecutor(ExecutorInfo.newBuilder(executor)
+ .setSource("task_" + taskId.getValue()))
.build();
tasks.add(task);
}
Modified: incubator/mesos/trunk/src/examples/long_lived_framework.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/examples/long_lived_framework.cpp?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/src/examples/long_lived_framework.cpp (original)
+++ incubator/mesos/trunk/src/examples/long_lived_framework.cpp Mon Feb 25 19:44:21 2013
@@ -26,6 +26,7 @@
#include <mesos/scheduler.hpp>
#include <stout/os.hpp>
+#include <stout/stringify.hpp>
using namespace mesos;
@@ -98,6 +99,7 @@ public:
task.mutable_task_id()->set_value(lexical_cast<string>(taskId));
task.mutable_slave_id()->MergeFrom(offer.slave_id());
task.mutable_executor()->MergeFrom(executor);
+ task.mutable_executor()->set_source("task_" + stringify(taskId));
Resource* resource;
Modified: incubator/mesos/trunk/src/examples/python/test_framework.py
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/examples/python/test_framework.py?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/src/examples/python/test_framework.py (original)
+++ incubator/mesos/trunk/src/examples/python/test_framework.py Mon Feb 25 19:44:21 2013
@@ -56,6 +56,7 @@ class TestScheduler(mesos.Scheduler):
task.slave_id.value = offer.slave_id.value
task.name = "task %d" % tid
task.executor.MergeFrom(self.executor)
+ task.executor.source = "task_%d" % tid
cpus = task.resources.add()
cpus.name = "cpus"
Modified: incubator/mesos/trunk/src/examples/test_framework.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/examples/test_framework.cpp?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/src/examples/test_framework.cpp (original)
+++ incubator/mesos/trunk/src/examples/test_framework.cpp Mon Feb 25 19:44:21 2013
@@ -26,6 +26,7 @@
#include <mesos/scheduler.hpp>
#include <stout/os.hpp>
+#include <stout/stringify.hpp>
using namespace mesos;
@@ -102,6 +103,7 @@ public:
task.mutable_task_id()->set_value(lexical_cast<string>(taskId));
task.mutable_slave_id()->MergeFrom(offer.slave_id());
task.mutable_executor()->MergeFrom(executor);
+ task.mutable_executor()->set_source("task_" + stringify(taskId));
Resource* resource;
Modified: incubator/mesos/trunk/src/master/http.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master/http.cpp?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master/http.cpp (original)
+++ incubator/mesos/trunk/src/master/http.cpp Mon Feb 25 19:44:21 2013
@@ -117,7 +117,7 @@ JSON::Object model(const Attributes& att
// Returns a JSON object modeled on a Task.
-// TODO(bmahler): Expose the executor name.
+// TODO(bmahler): Expose the executor name / source.
JSON::Object model(const Task& task)
{
JSON::Object object;
Modified: incubator/mesos/trunk/src/slave/http.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/http.cpp?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/http.cpp (original)
+++ incubator/mesos/trunk/src/slave/http.cpp Mon Feb 25 19:44:21 2013
@@ -194,6 +194,7 @@ JSON::Object model(const Executor& execu
JSON::Object object;
object.values["id"] = executor.id.value();
object.values["name"] = executor.info.name();
+ object.values["source"] = executor.info.source();
object.values["uuid"] = executor.uuid.toString();
object.values["directory"] = executor.directory;
object.values["resources"] = model(executor.resources);
Modified: incubator/mesos/trunk/src/slave/slave.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/slave.hpp?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/slave.hpp (original)
+++ incubator/mesos/trunk/src/slave/slave.hpp Mon Feb 25 19:44:21 2013
@@ -382,6 +382,7 @@ struct Framework
executor.mutable_executor_id()->set_value(id);
executor.set_name("Command Executor");
+ executor.set_source(task.task_id().value());
// Copy the CommandInfo to get the URIs and environment, but
// update it to invoke 'mesos-executor' (unless we couldn't
Modified: incubator/mesos/trunk/src/webui/master/static/slave_executor.html
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/webui/master/static/slave_executor.html?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/src/webui/master/static/slave_executor.html (original)
+++ incubator/mesos/trunk/src/webui/master/static/slave_executor.html Mon Feb 25 19:44:21 2013
@@ -35,6 +35,8 @@
<dd>{{executor_id}}</dd>
<dt>Executor Name:</dt>
<dd>{{executor.name}}</dd>
+ <dt>Executor Source:</dt>
+ <dd>{{executor.source}}</dd>
</dl>
<dl class="inline clearfix">
Modified: incubator/mesos/trunk/src/webui/master/static/slave_framework.html
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/webui/master/static/slave_framework.html?rev=1449834&r1=1449833&r2=1449834&view=diff
==============================================================================
--- incubator/mesos/trunk/src/webui/master/static/slave_framework.html (original)
+++ incubator/mesos/trunk/src/webui/master/static/slave_framework.html Mon Feb 25 19:44:21 2013
@@ -78,6 +78,10 @@
ng-click="selectColumn('executors', 'name')">
<a href="">Name</a>
</th>
+ <th ng-class="columnClass('executors', 'source')"
+ ng-click="selectColumn('executors', 'source')">
+ <a href="">Source</a>
+ </th>
<th ng-class="columnClass('executors', 'tasks.length')"
ng-click="selectColumn('executors', 'tasks.length')">
<a href="">Active Tasks</a>
@@ -106,6 +110,7 @@
</a>
</td>
<td>{{executor.name}}</td>
+ <td>{{executor.source}}</td>
<td>{{executor.tasks.length | number}}</td>
<td>{{executor.queued_tasks.length | number}}</td>
<td>{{executor.resources.cpus | number}}</td>
@@ -132,6 +137,10 @@
ng-click="selectColumn('completed_executors', 'name')">
<a href="">Name</a>
</th>
+ <th ng-class="columnClass('completed_executors', 'source')"
+ ng-click="selectColumn('completed_executors', 'source')">
+ <a href="">Source</a>
+ </th>
<th ng-class="columnClass('completed_executors', 'sandbox')"
ng-click="selectColumn('completed_executors', 'sandbox')">
<a href="">Sandbox</a>
@@ -147,6 +156,7 @@
</a>
</td>
<td>{{completed_executor.name}}</td>
+ <td>{{completed_executor.source}}</td>
<td>
<a href="{{'#/slaves/' + slave_id + '/browse?path=' +
encodeURIComponent(completed_executor.directory)}}">