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:05 UTC
svn commit: r1449833 - in /incubator/mesos/trunk: 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:04 2013
New Revision: 1449833
URL: http://svn.apache.org/r1449833
Log:
Resource Monitoring 1: Added name to ExecutorInfo.
From: Ben Mahler <be...@gmail.com>
Review: https://reviews.apache.org/r/9089
Modified:
incubator/mesos/trunk/include/mesos/mesos.proto
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/include/mesos/mesos.proto
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/include/mesos/mesos.proto?rev=1449833&r1=1449832&r2=1449833&view=diff
==============================================================================
--- incubator/mesos/trunk/include/mesos/mesos.proto (original)
+++ incubator/mesos/trunk/include/mesos/mesos.proto Mon Feb 25 19:44:04 2013
@@ -130,6 +130,11 @@ message ExecutorInfo {
optional FrameworkID framework_id = 8; // TODO(benh): Make this required.
required CommandInfo command = 7;
repeated Resource resources = 5;
+
+ // Note that name 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 bytes data = 4;
}
Modified: incubator/mesos/trunk/src/examples/java/TestFramework.java
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/examples/java/TestFramework.java?rev=1449833&r1=1449832&r2=1449833&view=diff
==============================================================================
--- incubator/mesos/trunk/src/examples/java/TestFramework.java (original)
+++ incubator/mesos/trunk/src/examples/java/TestFramework.java Mon Feb 25 19:44:04 2013
@@ -70,17 +70,11 @@ public class TestFramework {
.addResources(Resource.newBuilder()
.setName("cpus")
.setType(Value.Type.SCALAR)
- .setScalar(Value.Scalar.newBuilder()
- .setValue(1)
- .build())
- .build())
+ .setScalar(Value.Scalar.newBuilder().setValue(1)))
.addResources(Resource.newBuilder()
.setName("mem")
.setType(Value.Type.SCALAR)
- .setScalar(Value.Scalar.newBuilder()
- .setValue(128)
- .build())
- .build())
+ .setScalar(Value.Scalar.newBuilder().setValue(128)))
.setExecutor(executor)
.build();
tasks.add(task);
@@ -145,8 +139,9 @@ public class TestFramework {
String uri = new File("./test-executor").getCanonicalPath();
ExecutorInfo executor = ExecutorInfo.newBuilder()
- .setExecutorId(ExecutorID.newBuilder().setValue("default").build())
- .setCommand(CommandInfo.newBuilder().setValue(uri).build())
+ .setExecutorId(ExecutorID.newBuilder().setValue("default"))
+ .setCommand(CommandInfo.newBuilder().setValue(uri))
+ .setName("Test Executor (Java)")
.build();
FrameworkInfo framework = FrameworkInfo.newBuilder()
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=1449833&r1=1449832&r2=1449833&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:04 2013
@@ -168,6 +168,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("Long Lived Executor (C++)");
LongLivedScheduler scheduler(executor);
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=1449833&r1=1449832&r2=1449833&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:04 2013
@@ -122,6 +122,7 @@ if __name__ == "__main__":
executor = mesos_pb2.ExecutorInfo()
executor.executor_id.value = "default"
executor.command.value = os.path.abspath("./test-executor")
+ executor.name = "Test Executor (Python)"
framework = mesos_pb2.FrameworkInfo()
framework.user = "" # Have Mesos fill in the current user.
Modified: incubator/mesos/trunk/src/examples/test_framework.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/examples/test_framework.cpp?rev=1449833&r1=1449832&r2=1449833&view=diff
==============================================================================
--- incubator/mesos/trunk/src/examples/test_framework.cpp (original)
+++ incubator/mesos/trunk/src/examples/test_framework.cpp Mon Feb 25 19:44:04 2013
@@ -180,6 +180,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("Test Executor (C++)");
TestScheduler scheduler(executor);
Modified: incubator/mesos/trunk/src/master/http.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/master/http.cpp?rev=1449833&r1=1449832&r2=1449833&view=diff
==============================================================================
--- incubator/mesos/trunk/src/master/http.cpp (original)
+++ incubator/mesos/trunk/src/master/http.cpp Mon Feb 25 19:44:04 2013
@@ -117,6 +117,7 @@ JSON::Object model(const Attributes& att
// Returns a JSON object modeled on a Task.
+// TODO(bmahler): Expose the executor name.
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=1449833&r1=1449832&r2=1449833&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/http.cpp (original)
+++ incubator/mesos/trunk/src/slave/http.cpp Mon Feb 25 19:44:04 2013
@@ -146,6 +146,7 @@ JSON::Object model(const ExecutorInfo& e
{
JSON::Object object;
object.values["executor_id"] = executorInfo.executor_id().value();
+ object.values["name"] = executorInfo.name();
object.values["data"] = executorInfo.data();
object.values["framework_id"] = executorInfo.framework_id().value();
object.values["command"] = model(executorInfo.command());
@@ -192,6 +193,7 @@ JSON::Object model(const Executor& execu
{
JSON::Object object;
object.values["id"] = executor.id.value();
+ object.values["name"] = executor.info.name();
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=1449833&r1=1449832&r2=1449833&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/slave.hpp (original)
+++ incubator/mesos/trunk/src/slave/slave.hpp Mon Feb 25 19:44:04 2013
@@ -381,6 +381,7 @@ struct Framework
}
executor.mutable_executor_id()->set_value(id);
+ executor.set_name("Command Executor");
// 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=1449833&r1=1449832&r2=1449833&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:04 2013
@@ -31,7 +31,10 @@
<div class="span3">
<div class="well">
<dl class="inline clearfix">
- <dt>{{executor_id}}</dt>
+ <dt>Executor ID:</dt>
+ <dd>{{executor_id}}</dd>
+ <dt>Executor Name:</dt>
+ <dd>{{executor.name}}</dd>
</dl>
<dl class="inline clearfix">
@@ -39,7 +42,7 @@
<dd>{{cluster}}</dd>
<dt>Master:</dt>
<dd>{{state.master_hostname}}</dd>
- <dt>ID:</dt>
+ <dt>Framework ID:</dt>
<dd>
<a href="" rel="popover" ng-click="popover($event, 'right')" data-content="{{framework_id}}" data-original-title="ID">
{{framework_id | truncateMesosID}}
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=1449833&r1=1449832&r2=1449833&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:04 2013
@@ -74,6 +74,10 @@
ng-click="selectColumn('executors', 'id')">
<a href="">ID</a>
</th>
+ <th ng-class="columnClass('executors', 'name')"
+ ng-click="selectColumn('executors', 'name')">
+ <a href="">Name</a>
+ </th>
<th ng-class="columnClass('executors', 'tasks.length')"
ng-click="selectColumn('executors', 'tasks.length')">
<a href="">Active Tasks</a>
@@ -101,6 +105,7 @@
{{executor.id}}
</a>
</td>
+ <td>{{executor.name}}</td>
<td>{{executor.tasks.length | number}}</td>
<td>{{executor.queued_tasks.length | number}}</td>
<td>{{executor.resources.cpus | number}}</td>
@@ -123,6 +128,10 @@
ng-click="selectColumn('completed_executors', 'id')">
<a href="">ID</a>
</th>
+ <th ng-class="columnClass('completed_executors', 'name')"
+ ng-click="selectColumn('completed_executors', 'name')">
+ <a href="">Name</a>
+ </th>
<th ng-class="columnClass('completed_executors', 'sandbox')"
ng-click="selectColumn('completed_executors', 'sandbox')">
<a href="">Sandbox</a>
@@ -137,6 +146,7 @@
{{completed_executor.id}}
</a>
</td>
+ <td>{{completed_executor.name}}</td>
<td>
<a href="{{'#/slaves/' + slave_id + '/browse?path=' +
encodeURIComponent(completed_executor.directory)}}">