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 2015/09/16 23:08:41 UTC
[1/2] mesos git commit: Updated unversioned Executor protobuf.
Repository: mesos
Updated Branches:
refs/heads/master 5d6a06082 -> be2c6ca76
Updated unversioned Executor protobuf.
Added last changes of the executor HTTP API design to the unversioned
protobuf.
Review: https://reviews.apache.org/r/38278
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9e8ab16c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9e8ab16c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9e8ab16c
Branch: refs/heads/master
Commit: 9e8ab16cd60fa5f54627e5501792ef8eecacdf52
Parents: 5d6a060
Author: Isabel Jimenez <co...@isabeljimenez.com>
Authored: Wed Sep 16 13:51:15 2015 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Wed Sep 16 13:51:15 2015 -0700
----------------------------------------------------------------------
include/mesos/executor/executor.proto | 35 +++++++++++++++---------------
1 file changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/9e8ab16c/include/mesos/executor/executor.proto
----------------------------------------------------------------------
diff --git a/include/mesos/executor/executor.proto b/include/mesos/executor/executor.proto
index 52c84b3..34bddc4 100644
--- a/include/mesos/executor/executor.proto
+++ b/include/mesos/executor/executor.proto
@@ -39,7 +39,10 @@ message Event {
KILL = 3; // See 'Kill' below.
ACKNOWLEDGED = 4; // See 'Acknowledged' below.
MESSAGE = 5; // See 'Message' below.
- SHUTDOWN = 6; // See 'Type' below.
+
+ // Received when the slave asks the executor to shutdown/kill itself.
+ SHUTDOWN = 6;
+
ERROR = 7; // See 'Error' below.
}
@@ -118,16 +121,15 @@ message Event {
// Possible call types, followed by message definitions if
// applicable.
enum Type {
- SUBSCRIBE = 1; // See 'executor_info' below.
- RESUBSCRIBE = 2; // See 'Resubscribe' below.
- UPDATE = 3; // See 'Update' below.
- MESSAGE = 4; // See 'Message' below.
+ SUBSCRIBE = 1; // See 'Subscribe' below.
+ UPDATE = 2; // See 'Update' below.
+ MESSAGE = 3; // See 'Message' below.
}
- // Request to resubscribe with the slave. It must include a list of
- // all the tasks and updates which haven't been acknoledged by the
- // scheduler.
- message Resubscribe {
+ // Request to subscribe with the slave. If subscribing after a disconnection,
+ // it must include a list of all the tasks and updates which haven't been
+ // acknowledged by the scheduler.
+ message Subscribe {
repeated TaskInfo tasks = 1;
repeated Update updates = 2;
}
@@ -155,17 +157,16 @@ message Event {
required bytes data = 2;
}
- // Identifies who generated this call. Always necessary, but the
- // only thing that needs to be set for certain calls, e.g.,
- // SUBSCRIBE.
- required ExecutorInfo executor_info = 1;
+ // Identifies the executor which generated this call.
+ required ExecutorID executor_id = 1;
+ required FrameworkID framework_id = 2;
// Type of the call, indicates which optional field below should be
// present if that type has a nested message definition.
// In case type is SUBSCRIBED, no message needs to be set.
- required Type type = 2;
+ required Type type = 3;
- optional Resubscribe resubscribe = 3;
- optional Update update = 4;
- optional Message message = 5;
+ optional Subscribe subscribe = 4;
+ optional Update update = 5;
+ optional Message message = 6;
}
[2/2] mesos git commit: Added executor HTTP API protobuf to V1.
Posted by vi...@apache.org.
Added executor HTTP API protobuf to V1.
Review: https://reviews.apache.org/r/38143
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/be2c6ca7
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/be2c6ca7
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/be2c6ca7
Branch: refs/heads/master
Commit: be2c6ca769b3094612dd40b7fb7444b9d2266dc4
Parents: 9e8ab16
Author: Isabel Jimenez <co...@isabeljimenez.com>
Authored: Wed Sep 16 13:51:57 2015 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Wed Sep 16 13:51:57 2015 -0700
----------------------------------------------------------------------
include/mesos/v1/executor/executor.hpp | 26 ++++
include/mesos/v1/executor/executor.proto | 172 ++++++++++++++++++++++++++
src/Makefile.am | 32 +++++
3 files changed, 230 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/be2c6ca7/include/mesos/v1/executor/executor.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/v1/executor/executor.hpp b/include/mesos/v1/executor/executor.hpp
new file mode 100644
index 0000000..f50533f
--- /dev/null
+++ b/include/mesos/v1/executor/executor.hpp
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __MESOS_V1_EXECUTOR_PROTO_HPP__
+#define __MESOS_V1_EXECUTOR_PROTO_HPP__
+
+// NOTE: This header only becomes valid after running protoc
+// and generating the equivalent .ph.h files
+#include <mesos/v1/executor/executor.pb.h>
+
+#endif // __MESOS_V1_EXECUTOR_PROTO_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/be2c6ca7/include/mesos/v1/executor/executor.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/executor/executor.proto b/include/mesos/v1/executor/executor.proto
new file mode 100644
index 0000000..3f63d30
--- /dev/null
+++ b/include/mesos/v1/executor/executor.proto
@@ -0,0 +1,172 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import "mesos/v1/mesos.proto";
+
+package mesos.v1.executor;
+
+option java_package = "org.apache.mesos.v1.executor";
+option java_outer_classname = "Protos";
+
+
+/**
+ * Executor event API.
+ *
+ * An event is described using the standard protocol buffer "union"
+ * trick, see https://developers.google.com/protocol-buffers/docs/techniques#union.
+ */
+message Event {
+ // Possible event types, followed by message definitions if
+ // applicable.
+ enum Type {
+ SUBSCRIBED = 1; // See 'Subscribed' below.
+ LAUNCH = 2; // See 'Launch' below.
+ KILL = 3; // See 'Kill' below.
+ ACKNOWLEDGED = 4; // See 'Acknowledged' below.
+ MESSAGE = 5; // See 'Message' below.
+
+ // Received when the agent asks the executor to shutdown/kill itself.
+ SHUTDOWN = 6;
+
+ ERROR = 7; // See 'Error' below.
+ }
+
+ // First event received when the executor subscribes.
+ // The 'id' field in the 'framework_info' will be set.
+ message Subscribed {
+ required ExecutorInfo executor_info = 1;
+ required FrameworkInfo framework_info = 2;
+ required AgentInfo agent_info = 3;
+ }
+
+ // Received when the framework attempts to launch a task. Once
+ // the task is successfully launched, the executor must respond with
+ // a TASK_RUNNING update (See TaskState in v1/mesos.proto).
+ message Launch {
+ required TaskInfo task = 1;
+ }
+
+ // Received when the scheduler wants to kill a specific task. Once
+ // the task is terminated, the executor should send a TASK_KILLED
+ // (or TASK_FAILED) update. The terminal update is necessary so
+ // Mesos can release the resources associated with the task.
+ message Kill {
+ required TaskID task_id = 1;
+ }
+
+ // Received when the agent acknowledges the receipt of status
+ // update. Schedulers are responsible for explicitly acknowledging
+ // the receipt of status updates that have 'update.status().uuid()'
+ // field set. Unacknowledged updates can be retried by the executor.
+ // They should also be sent by the executor whenever it
+ // re-subscribes.
+ message Acknowledged {
+ required TaskID task_id = 1;
+ required bytes uuid = 2;
+ }
+
+ // Received when a custom message generated by the scheduler is
+ // forwarded by the agent. Note that this message is not
+ // interpreted by Mesos and is only forwarded (without reliability
+ // guarantees) to the executor. It is up to the scheduler to retry
+ // if the message is dropped for any reason.
+ message Message {
+ required bytes data = 1;
+ }
+
+ // Received in case the executor sends invalid calls (e.g.,
+ // required values not set).
+ // TODO(arojas): Remove this once the old executor driver is no
+ // longer supported. With HTTP API all errors will be signaled via
+ // HTTP response codes.
+ message Error {
+ required string message = 1;
+ }
+
+ // Type of the event, indicates which optional field below should be
+ // present if that type has a nested message definition.
+ required Type type = 1;
+
+ optional Subscribed susbcribed = 2;
+ optional Acknowledged acknowledged = 3;
+ optional Launch launch = 4;
+ optional Kill kill = 5;
+ optional Message message = 6;
+ optional Error error = 7;
+}
+
+
+/**
+ * Executor call API.
+ *
+ * Like Event, a Call is described using the standard protocol buffer
+ * "union" trick (see above).
+ */
+ message Call {
+ // Possible call types, followed by message definitions if
+ // applicable.
+ enum Type {
+ SUBSCRIBE = 1; // See 'Subscribe' below.
+ UPDATE = 2; // See 'Update' below.
+ MESSAGE = 3; // See 'Message' below.
+ }
+
+ // Request to subscribe with the agent. If subscribing after a disconnection,
+ // it must include a list of all the tasks and updates which haven't been
+ // acknowledged by the scheduler.
+ message Subscribe {
+ repeated TaskInfo tasks = 1;
+ repeated Update updates = 2;
+ }
+
+ // Notifies the scheduler that a task has transitioned from one
+ // state to another. Status updates should be used by executors
+ // to reliably communicate the status of the tasks that they
+ // manage. It is crucial that a terminal update (see TaskState
+ // in v1/mesos.proto) is sent to the scheduler as soon as the task
+ // terminates, in order for Mesos to release the resources allocated
+ // to the task. It is the responsibility of the scheduler to
+ // explicitly acknowledge the receipt of a status update. See
+ // 'Acknowledged' in the 'Events' section above for the semantics.
+ message Update {
+ required TaskStatus status = 1;
+ required double timestamp = 2;
+ required bytes uuid = 3;
+ }
+
+ // Sends arbitrary binary data to the scheduler. Note that Mesos
+ // neither interprets this data nor makes any guarantees about the
+ // delivery of this message to the scheduler.
+ // See 'Message' in the 'Events' section.
+ message Message {
+ required bytes data = 2;
+ }
+
+ // Identifies the executor which generated this call.
+ required ExecutorID executor_id = 1;
+ required FrameworkID framework_id = 2;
+
+ // Type of the call, indicates which optional field below should be
+ // present if that type has a nested message definition.
+ // In case type is SUBSCRIBED, no message needs to be set.
+ required Type type = 3;
+
+ optional Subscribe subscribe = 4;
+ optional Update update = 5;
+ optional Message message = 6;
+}
http://git-wip-us.apache.org/repos/asf/mesos/blob/be2c6ca7/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 509256f..db2f8d9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -150,6 +150,9 @@ CONTAINERIZER_PROTO = \
EXECUTOR_PROTO = \
$(top_srcdir)/include/mesos/executor/executor.proto
+V1_EXECUTOR_PROTO = \
+ $(top_srcdir)/include/mesos/v1/executor/executor.proto
+
FETCHER_PROTO = \
$(top_srcdir)/include/mesos/fetcher/fetcher.proto
@@ -201,6 +204,8 @@ CXX_PROTOS = \
../include/mesos/slave/oversubscription.pb.h \
../include/mesos/v1/mesos.pb.cc \
../include/mesos/v1/mesos.pb.h \
+ v1/executor/executor.pb.cc \
+ ../include/mesos/v1/executor/executor.pb.h \
v1/scheduler/scheduler.pb.cc \
../include/mesos/v1/scheduler/scheduler.pb.h
@@ -277,6 +282,12 @@ executor/%.pb.cc ../include/mesos/executor/%.pb.h: $(EXECUTOR_PROTO)
$(PROTOC) $(PROTOCFLAGS) --cpp_out=../include $^
mv ../include/mesos/executor/*.pb.cc $(@D)
+v1/executor/%.pb.cc ../include/mesos/v1/executor/%.pb.h: $(V1_EXECUTOR_PROTO)
+ $(MKDIR_P) $(@D)
+ $(MKDIR_P) ../include/mesos/v1/executor
+ $(PROTOC) $(PROTOCFLAGS) --cpp_out=../include $^
+ mv ../include/mesos/v1/executor/*.pb.cc $(@D)
+
fetcher/%.pb.cc ../include/mesos/fetcher/%.pb.h: $(FETCHER_PROTO)
$(MKDIR_P) $(@D)
$(MKDIR_P) ../include/mesos/fetcher
@@ -352,6 +363,10 @@ java/generated/org/apache/mesos/executor/Protos.java: $(EXECUTOR_PROTO)
$(MKDIR_P) $(@D)
$(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^
+java/generated/org/apache/mesos/v1/executor/Protos.java: $(V1_EXECUTOR_PROTO)
+ $(MKDIR_P) $(@D)
+ $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^
+
python/interface/src/mesos/interface/mesos_pb2.py: $(MESOS_PROTO)
$(MKDIR_P) $(@D)
$(PROTOC) -I$(top_srcdir)/include/mesos \
@@ -395,6 +410,13 @@ python/interface/src/mesos/interface/executor_pb2.py: $(EXECUTOR_PROTO)
--python_out=python/interface/src/mesos/interface $^
sed -e 's/mesos\.mesos_pb2/mesos_pb2/' <$@ >$@
+python/interface/src/mesos/v1/interface/executor_pb2.py: $(V1_EXECUTOR_PROTO)
+ $(MKDIR_P) $(@D)
+ $(PROTOC) -I$(top_srcdir)/include/mesos/v1/executor \
+ $(PROTOCFLAGS) \
+ --python_out=python/interface/src/mesos/v1/interface $^
+ sed -e 's/mesos\.mesos_pb2/mesos_pb2/' <$@ >$@
+
# We even use a convenience library for most of Mesos so that we can
# exclude third party libraries so setuptools/distribute can build a
# self-contained Python library and statically link in the third party
@@ -639,6 +661,14 @@ v1scheduler_HEADERS = \
nodist_v1scheduler_HEADERS = ../include/mesos/v1/scheduler/scheduler.pb.h
+v1executordir = $(pkgincludedir)/v1/executor
+
+v1executor_HEADERS = \
+ $(top_srcdir)/include/mesos/v1/executor/executor.hpp \
+ $(top_srcdir)/include/mesos/v1/executor/executor.proto
+
+nodist_v1executor_HEADERS = ../include/mesos/v1/executor/executor.pb.h
+
if OS_LINUX
libmesos_no_3rdparty_la_SOURCES += linux/cgroups.cpp
libmesos_no_3rdparty_la_SOURCES += linux/fs.cpp
@@ -935,6 +965,7 @@ libmesos_la_SOURCES = \
$(EXECUTOR_PROTO) \
$(ISOLATOR_PROTO) \
$(OVERSUBSCRIPTION_PROTO) \
+ $(V1_EXECUTOR_PROTO) \
$(V1_MESOS_PROTO) \
$(V1_SCHEDULER_PROTO)
@@ -1228,6 +1259,7 @@ libjava_la_CPPFLAGS += -I$(srcdir)/java/jni -Ijava/jni
libjava_la_DEPENDENCIES = \
$(CONTAINERIZER_PROTO) \
$(MESOS_PROTO) \
+ $(V1_EXECUTOR_PROTO) \
$(V1_MESOS_PROTO) \
$(V1_SCHEDULER_PROTO)