You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2017/05/08 14:10:39 UTC

[1/2] mesos git commit: Added basic resource provider Event/Call types.

Repository: mesos
Updated Branches:
  refs/heads/master e0ad7a8f0 -> 18220a50d


Added basic resource provider Event/Call types.

This patch added the basic Event/Call for resource providers to
subscribe and apply offer operations.

Review: https://reviews.apache.org/r/59046


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d32f85ec
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d32f85ec
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d32f85ec

Branch: refs/heads/master
Commit: d32f85ec13b1437a6c19851558c808f854549f9b
Parents: e0ad7a8
Author: Jie Yu <yu...@gmail.com>
Authored: Mon May 8 13:48:57 2017 +0200
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon May 8 14:18:33 2017 +0200

----------------------------------------------------------------------
 .../resource_provider/resource_provider.proto   | 28 ++++++++++++++++++++
 .../resource_provider/resource_provider.proto   | 28 ++++++++++++++++++++
 2 files changed, 56 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d32f85ec/include/mesos/resource_provider/resource_provider.proto
----------------------------------------------------------------------
diff --git a/include/mesos/resource_provider/resource_provider.proto b/include/mesos/resource_provider/resource_provider.proto
index 73cfd31..0efef33 100644
--- a/include/mesos/resource_provider/resource_provider.proto
+++ b/include/mesos/resource_provider/resource_provider.proto
@@ -29,9 +29,24 @@ message Event {
     // is UNKNOWN. This enables enum values to be added
     // in a backwards-compatible way. See: MESOS-4997.
     UNKNOWN = 0;
+
+    SUBSCRIBED = 1;   // See 'Subscribed' below.
+    OPERATION = 2;    // See 'Operation' below.
+  }
+
+  // First event received by the resource provider when it subscribes
+  // to the master.
+  message Subscribed {
+  }
+
+  // Received when the master wants to send an operation to the
+  // resource provider.
+  message Operation {
   }
 
   optional Type type = 1;
+  optional Subscribed subscribed = 2;
+  optional Operation operation = 3;
 }
 
 
@@ -42,7 +57,20 @@ message Call {
     // is UNKNOWN. This enables enum values to be added
     // in a backwards-compatible way. See: MESOS-4997.
     UNKNOWN = 0;
+
+    SUBSCRIBE = 1;    // See 'Subscribe' below.
+    UPDATE = 2;       // See 'Update' below.
+  }
+
+  // Request to subscribe with the master.
+  message Subscribe {
+  }
+
+  // Notify the master about the status of an operation.
+  message Update {
   }
 
   optional Type type = 1;
+  optional Subscribe subscribe = 2;
+  optional Update update = 3;
 }

http://git-wip-us.apache.org/repos/asf/mesos/blob/d32f85ec/include/mesos/v1/resource_provider/resource_provider.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/resource_provider/resource_provider.proto b/include/mesos/v1/resource_provider/resource_provider.proto
index f83586d..82e6741 100644
--- a/include/mesos/v1/resource_provider/resource_provider.proto
+++ b/include/mesos/v1/resource_provider/resource_provider.proto
@@ -29,9 +29,24 @@ message Event {
     // is UNKNOWN. This enables enum values to be added
     // in a backwards-compatible way. See: MESOS-4997.
     UNKNOWN = 0;
+
+    SUBSCRIBED = 1;   // See 'Subscribed' below.
+    OPERATION = 2;    // See 'Operation' below.
+  }
+
+  // First event received by the resource provider when it subscribes
+  // to the master.
+  message Subscribed {
+  }
+
+  // Received when the master wants to send an operation to the
+  // resource provider.
+  message Operation {
   }
 
   optional Type type = 1;
+  optional Subscribed subscribed = 2;
+  optional Operation operation = 3;
 }
 
 
@@ -42,7 +57,20 @@ message Call {
     // is UNKNOWN. This enables enum values to be added
     // in a backwards-compatible way. See: MESOS-4997.
     UNKNOWN = 0;
+
+    SUBSCRIBE = 1;    // See 'Subscribe' below.
+    UPDATE = 2;       // See 'Update' below.
+  }
+
+  // Request to subscribe with the master.
+  message Subscribe {
+  }
+
+  // Notify the master about the status of an operation.
+  message Update {
   }
 
   optional Type type = 1;
+  optional Subscribe subscribe = 2;
+  optional Update update = 3;
 }


[2/2] mesos git commit: Added internal wrapper messages for local resource provider Event/Call.

Posted by ji...@apache.org.
Added internal wrapper messages for local resource provider Event/Call.

For local resource providers, the agent will serve as a proxy between
local resource provider and the master. It'll forward resource
provider Events and Calls.

Review: https://reviews.apache.org/r/59047


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/18220a50
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/18220a50
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/18220a50

Branch: refs/heads/master
Commit: 18220a50d3033a4debffd7cc61f1514ede7e2c2b
Parents: d32f85e
Author: Jie Yu <yu...@gmail.com>
Authored: Mon May 8 14:16:30 2017 +0200
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon May 8 16:06:06 2017 +0200

----------------------------------------------------------------------
 src/messages/messages.proto | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/18220a50/src/messages/messages.proto
----------------------------------------------------------------------
diff --git a/src/messages/messages.proto b/src/messages/messages.proto
index eae9ce5..2c08626 100644
--- a/src/messages/messages.proto
+++ b/src/messages/messages.proto
@@ -17,6 +17,7 @@
 syntax = "proto2";
 
 import "mesos/mesos.proto";
+import "mesos/resource_provider/resource_provider.proto";
 
 package mesos.internal;
 
@@ -601,6 +602,36 @@ message UpdateSlaveMessage {
 
 
 /**
+ * A wrapper message that is sent for a local resource provider Call
+ * by the agent to the master. The agent serves as a proxy between the
+ * local resource provider and the master.
+ */
+message ResourceProviderCallMessage {
+  required resource_provider.Call call = 1;
+
+  // This field will be set for the initial 'Subscribe' Call where the
+  // resource provider ID hasn't been assigned yet. This 'uuid' will
+  // be echoed back in the corresponding 'Subscribed' Event, allowing
+  // the agent to tell which resource provider the Event is for.
+  optional bytes uuid = 2;
+}
+
+
+/**
+ * A wrapper message that is sent for a local resource provider Event
+ * by the master to the agent. The agent serves as a proxy between the
+ * local resource provider and the master.
+ */
+message ResourceProviderEventMessage {
+  required ResourceProviderID resource_provider_id = 1;
+  required resource_provider.Event event = 2;
+
+  // See the comments in 'ResourceProviderCallMessage'.
+  optional bytes uuid = 3;
+}
+
+
+/**
  * Subscribes the executor with the agent to receive events.
  *
  * See executor::Call::Subscribe.