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 2016/01/06 23:46:46 UTC

[1/3] mesos git commit: Revert "Added unit tests for new vip and instance_port fields."

Repository: mesos
Updated Branches:
  refs/heads/master c9ce5bf26 -> cbd23b886


Revert "Added unit tests for new vip and instance_port fields."

This reverts commit 5b145adea3b3ecabf5cb99217f2564ce228be0a0.


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

Branch: refs/heads/master
Commit: 05e68182a35866464e46cead3e807608ce5178b3
Parents: c9ce5bf
Author: Jie Yu <yu...@gmail.com>
Authored: Wed Jan 6 14:45:59 2016 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Jan 6 14:45:59 2016 -0800

----------------------------------------------------------------------
 src/tests/common/http_tests.cpp | 25 +------------------------
 src/tests/slave_tests.cpp       | 28 +++++++---------------------
 2 files changed, 8 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/05e68182/src/tests/common/http_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/common/http_tests.cpp b/src/tests/common/http_tests.cpp
index 69dac17..0ea0634 100644
--- a/src/tests/common/http_tests.cpp
+++ b/src/tests/common/http_tests.cpp
@@ -76,7 +76,6 @@ TEST(HTTPTest, ModelTask)
   Ports ports;
   Port* port = ports.add_ports();
   port->set_number(80);
-  port->set_instance_port(8081);
   port->mutable_labels()->CopyFrom(labels);
 
   DiscoveryInfo discovery;
@@ -84,12 +83,6 @@ TEST(HTTPTest, ModelTask)
   discovery.set_name("discover");
   discovery.mutable_ports()->CopyFrom(ports);
 
-  IPAddress* vip1 = discovery.add_vips()->mutable_vip();
-  vip1->set_ip_address("10.0.0.1");
-
-  IPAddress* vip2 = discovery.add_vips()->mutable_vip();
-  vip2->set_ip_address("10.0.0.2");
-
   TaskInfo task;
   task.set_name("task");
   task.mutable_task_id()->CopyFrom(taskId);
@@ -142,26 +135,10 @@ TEST(HTTPTest, ModelTask)
       "              \"value\":\"port:7987 DENY\""
       "             }"
       "           ]"
-      "         },"
-      "         \"instance_port\":8081"
+      "         }"
       "       }"
       "     ]"
       "   },"
-      "   \"vips\":"
-      "    ["
-      "      {"
-      "        \"vip\" :"
-      "         {"
-      "           \"ip_address\":\"10.0.0.1\""
-      "         }"
-      "      },"
-      "      {"
-      "        \"vip\" :"
-      "         { "
-      "           \"ip_address\":\"10.0.0.2\""
-      "         }"
-      "      }"
-      "    ],"
       "   \"visibility\":\"CLUSTER\""
       " }"
       "}");

http://git-wip-us.apache.org/repos/asf/mesos/blob/05e68182/src/tests/slave_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index 77750ed..328c853 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -2189,25 +2189,16 @@ TEST_F(SlaveTest, DiscoveryInfoAndPorts)
   Port* port1 = ports.add_ports();
   port1->set_number(80);
   port1->mutable_labels()->CopyFrom(labels1);
-  port1->set_instance_port(2222);
 
   Port* port2 = ports.add_ports();
   port2->set_number(8081);
   port2->mutable_labels()->CopyFrom(labels2);
-  port2->set_instance_port(2223);
-
 
   DiscoveryInfo discovery;
   discovery.set_name("test_discovery");
   discovery.set_visibility(DiscoveryInfo::CLUSTER);
   discovery.mutable_ports()->CopyFrom(ports);
 
-  IPAddress* vip1 = discovery.add_vips()->mutable_vip();
-  vip1->set_ip_address("10.0.0.1");
-
-  IPAddress* vip2 = discovery.add_vips()->mutable_vip();
-  vip2->set_ip_address("10.0.0.2");
-
   task.mutable_discovery()->CopyFrom(discovery);
 
   EXPECT_CALL(exec, registered(_, _, _, _));
@@ -2237,23 +2228,18 @@ TEST_F(SlaveTest, DiscoveryInfoAndPorts)
   JSON::Object discoveryObject = discoveryResult.get();
   EXPECT_EQ(JSON::Object(JSON::protobuf(discovery)), discoveryObject);
 
-  // Verify that the VIPs retrieved from state.json are the ones that were set.
-  Result<JSON::Object> vipResult1 = parse.get().find<JSON::Object>(
-      "frameworks[0].executors[0].tasks[0].discovery.vips[0]");
-  Result<JSON::Object> vipResult2 = parse.get().find<JSON::Object>(
-      "frameworks[0].executors[0].tasks[0].discovery.vips[1]");
-
-  EXPECT_SOME_EQ(JSON::Object(JSON::protobuf(discovery.vips(0))), vipResult1);
-  EXPECT_SOME_EQ(JSON::Object(JSON::protobuf(discovery.vips(1))), vipResult2);
-
-  // Verify that the ports retrieved from state.json are the ones that were set.
+  // Check the ports are set in the `DiscoveryInfo` object.
   Result<JSON::Object> portResult1 = parse.get().find<JSON::Object>(
       "frameworks[0].executors[0].tasks[0].discovery.ports.ports[0]");
   Result<JSON::Object> portResult2 = parse.get().find<JSON::Object>(
       "frameworks[0].executors[0].tasks[0].discovery.ports.ports[1]");
 
-  EXPECT_SOME_EQ(JSON::Object(JSON::protobuf(*port1)), portResult1);
-  EXPECT_SOME_EQ(JSON::Object(JSON::protobuf(*port2)), portResult2);
+  EXPECT_SOME(portResult1);
+  EXPECT_SOME(portResult2);
+
+  // Verify that the ports retrieved from state.json are the ones that were set.
+  EXPECT_EQ(JSON::Object(JSON::protobuf(*port1)), portResult1.get());
+  EXPECT_EQ(JSON::Object(JSON::protobuf(*port2)), portResult2.get());
 
   EXPECT_CALL(exec, shutdown(_))
     .Times(AtMost(1));


[2/3] mesos git commit: Revert "Cleaned up VIP comments."

Posted by ji...@apache.org.
Revert "Cleaned up VIP comments."

This reverts commit 8f4688c660f851375bae8e2cd92e1c4b62751655.


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

Branch: refs/heads/master
Commit: 79d74961c941591dcc77df496f6f05310b1d3de6
Parents: 05e6818
Author: Jie Yu <yu...@gmail.com>
Authored: Wed Jan 6 14:46:01 2016 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Jan 6 14:46:01 2016 -0800

----------------------------------------------------------------------
 include/mesos/mesos.proto    | 13 +++++++------
 include/mesos/v1/mesos.proto | 13 +++++++------
 2 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/79d74961/include/mesos/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 158e087..72166ef 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -1554,9 +1554,10 @@ message Port {
   // This can be used to decorate the message with metadata to be
   // interpreted by external applications such as firewalls.
   optional Labels labels = 5;
-  // The backend port on which the task is running. This could be different than
-  // the `number` field (1), e.g. when an agent achieves network isolation
-  // between containers using port (layer 4) segregation.
+  // This field represents the backend port on which the task is
+  // running. It could potentially be different than the `number` field (1), for
+  // instance, when an agent achieves network isolation between containers using
+  // port (layer 4) segregation.
   optional uint32 instance_port = 6;
 }
 
@@ -1573,9 +1574,9 @@ message Ports {
  * An IP address.
  */
 message IPAddress {
-  // TODO(asridharan): We skip tag number 1 in case we later want to be binary
-  // compatible with `NetworkInfo.IPAddress`. See MESOS-4243 for more details.
-  // optional Protocol protocol = 1;
+  // TODO (asridharan): We are setting the positional identifier of this
+  // field to 2, in order to maintain backward compatibility with the `IPAddress`
+  // message definition within `NetworkInfo`. See MESOS-4243 for more details.
   optional string ip_address = 2;
 }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/79d74961/include/mesos/v1/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index c6c5a81..a287683 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -1553,9 +1553,10 @@ message Port {
   // This can be used to decorate the message with metadata to be
   // interpreted by external applications such as firewalls.
   optional Labels labels = 5;
-  // The backend port on which the task is running. This could be different than
-  // the `number` field (1), e.g. when an agent achieves network isolation
-  // between containers using port (layer 4) segregation.
+  // This field represents the backend port on which the task is
+  // running. It could potentially be different than the `number` field (1), for
+  // instance, when an agent achieves network isolation between containers using
+  // port (layer 4) segregation.
   optional uint32 instance_port = 6;
 }
 
@@ -1572,9 +1573,9 @@ message Ports {
  * An IP address.
  */
 message IPAddress {
-  // TODO(asridharan): We skip tag number 1 in case we later want to be binary
-  // compatible with `NetworkInfo.IPAddress`. See MESOS-4243 for more details.
-  // optional Protocol protocol = 1;
+  // TODO (asridharan): We are setting the positional identifier of this
+  // field to 2, in order to maintain backward compatibility with the `IPAddress`
+  // message definition within `NetworkInfo`. See MESOS-4243 for more details.
   optional string ip_address = 2;
 }
 


[3/3] mesos git commit: Revert "Added repeated vip to DiscoveryInfo and instance_port to Port."

Posted by ji...@apache.org.
Revert "Added repeated vip to DiscoveryInfo and instance_port to Port."

This reverts commit b87e42a2b141722f4048b999bea18d5b7b2b8a47.


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

Branch: refs/heads/master
Commit: cbd23b886f14b5c75455e98d18fe8e41a01852c1
Parents: 79d7496
Author: Jie Yu <yu...@gmail.com>
Authored: Wed Jan 6 14:46:02 2016 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Jan 6 14:46:02 2016 -0800

----------------------------------------------------------------------
 include/mesos/mesos.proto    | 29 -----------------------------
 include/mesos/v1/mesos.proto | 29 -----------------------------
 2 files changed, 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/cbd23b88/include/mesos/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 72166ef..2431fdd 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -1554,11 +1554,6 @@ message Port {
   // This can be used to decorate the message with metadata to be
   // interpreted by external applications such as firewalls.
   optional Labels labels = 5;
-  // This field represents the backend port on which the task is
-  // running. It could potentially be different than the `number` field (1), for
-  // instance, when an agent achieves network isolation between containers using
-  // port (layer 4) segregation.
-  optional uint32 instance_port = 6;
 }
 
 
@@ -1571,25 +1566,6 @@ message Ports {
 
 
 /**
- * An IP address.
- */
-message IPAddress {
-  // TODO (asridharan): We are setting the positional identifier of this
-  // field to 2, in order to maintain backward compatibility with the `IPAddress`
-  // message definition within `NetworkInfo`. See MESOS-4243 for more details.
-  optional string ip_address = 2;
-}
-
-
-/**
- * Holds information about a virtual IP.
- */
-message VIPInfo {
-  required IPAddress vip = 1;
-}
-
-
-/**
 * Service discovery information.
 * The visibility field restricts discovery within a framework (FRAMEWORK),
 * within a Mesos cluster (CLUSTER), or places no restrictions (EXTERNAL).
@@ -1617,11 +1593,6 @@ message DiscoveryInfo {
   optional string version = 5;
   optional Ports ports = 6;
   optional Labels labels = 7;
-  // The virtual IP is used as a single endpoint to represent multiple instances
-  // of a given service. An application might need multiple virtual IPs if it
-  // exposes multiple services, or if the same service is exposed on different
-  // virtual IPs.
-  repeated VIPInfo vips = 8;
 }
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/cbd23b88/include/mesos/v1/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index a287683..4aed098 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -1553,11 +1553,6 @@ message Port {
   // This can be used to decorate the message with metadata to be
   // interpreted by external applications such as firewalls.
   optional Labels labels = 5;
-  // This field represents the backend port on which the task is
-  // running. It could potentially be different than the `number` field (1), for
-  // instance, when an agent achieves network isolation between containers using
-  // port (layer 4) segregation.
-  optional uint32 instance_port = 6;
 }
 
 
@@ -1570,25 +1565,6 @@ message Ports {
 
 
 /**
- * An IP address.
- */
-message IPAddress {
-  // TODO (asridharan): We are setting the positional identifier of this
-  // field to 2, in order to maintain backward compatibility with the `IPAddress`
-  // message definition within `NetworkInfo`. See MESOS-4243 for more details.
-  optional string ip_address = 2;
-}
-
-
-/**
- * Holds information about a virtual IP.
- */
-message VIPInfo {
-  required IPAddress vip = 1;
-}
-
-
-/**
 * Service discovery information.
 * The visibility field restricts discovery within a framework (FRAMEWORK),
 * within a Mesos cluster (CLUSTER), or places no restrictions (EXTERNAL).
@@ -1616,9 +1592,4 @@ message DiscoveryInfo {
   optional string version = 5;
   optional Ports ports = 6;
   optional Labels labels = 7;
-  // The virtual IP is used as a single endpoint to represent multiple instances
-  // of a given service. An application might need multiple virtual IPs if it
-  // exposes multiple services, or if the same service is exposed on different
-  // virtual IPs.
-  repeated VIPInfo vips = 8;
 }