[20/27] mesos git commit: Added benchmarks for new registry operations.

2016-09-19 Thread vinodkone
Added benchmarks for new registry operations.

These benchmarks cover:

  1. The time taken to make all registered agents unreachable and then
 reachable. This is similar to what happens during a severe network
 partition.

  2. The time taken to GC a significant fraction (50%) of the
 unreachable list from the registry.

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


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

Branch: refs/heads/master
Commit: aae819684f61f4cb811e0629731a57bdd6f8f3fe
Parents: 47bd3e4
Author: Neil Conway 
Authored: Mon Sep 19 15:49:04 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:49:04 2016 -0700

--
 src/tests/registrar_tests.cpp | 141 -
 1 file changed, 139 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/aae81968/src/tests/registrar_tests.cpp
--
diff --git a/src/tests/registrar_tests.cpp b/src/tests/registrar_tests.cpp
index 745cded..928bc66 100644
--- a/src/tests/registrar_tests.cpp
+++ b/src/tests/registrar_tests.cpp
@@ -1263,8 +1263,6 @@ TEST_P(Registrar_BENCHMARK_Test, Performance)
   Registrar registrar(flags, state);
   AWAIT_READY(registrar.recover(master));
 
-  vector infos;
-
   Attributes attributes = Attributes::parse("foo:bar;baz:quux");
   Resources resources =
 Resources::parse("cpus(*):1.0;mem(*):512;disk(*):2048").get();
@@ -1272,6 +1270,7 @@ TEST_P(Registrar_BENCHMARK_Test, Performance)
   size_t slaveCount = GetParam();
 
   // Create slaves.
+  vector infos;
   for (size_t i = 0; i < slaveCount; ++i) {
 // Simulate real slave information.
 SlaveInfo info;
@@ -1333,6 +1332,144 @@ TEST_P(Registrar_BENCHMARK_Test, Performance)
   cout << "Removed " << slaveCount << " agents in " << watch.elapsed() << endl;
 }
 
+
+// Test the performance of marking all registered slaves unreachable,
+// then marking them reachable again. This might occur if there is a
+// network partition and then the partition heals.
+TEST_P(Registrar_BENCHMARK_Test, MarkUnreachableThenReachable)
+{
+  Registrar registrar(flags, state);
+  AWAIT_READY(registrar.recover(master));
+
+  Attributes attributes = Attributes::parse("foo:bar;baz:quux");
+  Resources resources =
+Resources::parse("cpus(*):1.0;mem(*):512;disk(*):2048").get();
+
+  size_t slaveCount = GetParam();
+
+  // Create slaves.
+  vector infos;
+  for (size_t i = 0; i < slaveCount; ++i) {
+// Simulate real slave information.
+SlaveInfo info;
+info.set_hostname("localhost");
+info.mutable_id()->set_value(
+string("201310101658-2280333834-5050-48574-") + stringify(i));
+info.mutable_resources()->MergeFrom(resources);
+info.mutable_attributes()->MergeFrom(attributes);
+infos.push_back(info);
+  }
+
+  // Admit slaves.
+  Stopwatch watch;
+  watch.start();
+  Future result;
+  foreach (const SlaveInfo& info, infos) {
+result = registrar.apply(Owned(new AdmitSlave(info)));
+  }
+  AWAIT_READY_FOR(result, Minutes(5));
+  LOG(INFO) << "Admitted " << slaveCount << " agents in " << watch.elapsed();
+
+  // Shuffle the slaves so that we mark them unreachable in random
+  // order (same as in production).
+  std::random_shuffle(infos.begin(), infos.end());
+
+  // Mark all slaves unreachable.
+  TimeInfo unreachableTime = protobuf::getCurrentTime();
+
+  watch.start();
+  foreach (const SlaveInfo& info, infos) {
+result = registrar.apply(
+Owned(new MarkSlaveUnreachable(info, unreachableTime)));
+  }
+  AWAIT_READY_FOR(result, Minutes(5));
+  cout << "Marked " << slaveCount << " agents unreachable in "
+   << watch.elapsed() << endl;
+
+  // Shuffles the slaves again so that we mark them reachable in
+  // random order (same as in production).
+  std::random_shuffle(infos.begin(), infos.end());
+
+  // Mark all slaves reachable.
+  watch.start();
+  foreach (const SlaveInfo& info, infos) {
+result = registrar.apply(
+Owned(new MarkSlaveReachable(info)));
+  }
+  AWAIT_READY_FOR(result, Minutes(5));
+  cout << "Marked " << slaveCount << " agents reachable in "
+   << watch.elapsed() << endl;
+}
+
+
+// Test the performance of garbage collecting a large portion of the
+// unreachable list in a single operation. We use a fixed percentage
+// at the moment (50%).
+TEST_P(Registrar_BENCHMARK_Test, GcManyAgents)
+{
+  Registrar registrar(flags, state);
+  AWAIT_READY(registrar.recover(master));
+
+  Attributes attributes = Attributes::parse("foo:bar;baz:quux");
+  Resources resources =
+

[04/27] mesos git commit: Fixed outdated comment.

2016-09-19 Thread vinodkone
Fixed outdated comment.

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


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

Branch: refs/heads/master
Commit: 06506faea2b9ead713907e8dd19ab53505dc93cf
Parents: 504e05e
Author: Neil Conway 
Authored: Mon Sep 19 15:47:19 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:47:19 2016 -0700

--
 src/master/master.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/06506fae/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 7e501ec..89fde24 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -7630,8 +7630,8 @@ InverseOffer* Master::getInverseOffer(const OfferID& 
inverseOfferId)
 
 
 // Create a new framework ID. We format the ID as MASTERID-FWID, where
-// MASTERID is the ID of the master (launch date plus fault tolerant ID)
-// and FWID is an increasing integer.
+// MASTERID is the ID of the master (randomly generated UUID) and FWID
+// is an increasing integer.
 FrameworkID Master::newFrameworkId()
 {
   std::ostringstream out;



[22/27] mesos git commit: Changed registrar operations to no longer depend on "strict" flag.

2016-09-19 Thread vinodkone
Changed registrar operations to no longer depend on "strict" flag.

Registrar operations to admit and remove slaves now behave the same way,
regardless of the value of the "strict" flag.

This commit changes the behavior of these operations by enabling the
previous "strict" behavior. For example, removing a slave that is not
registered results in an `Error`, rather than silently ignoring the
problem. However, the master should never attempt to remove a slave that
is not registered, so this is a useful invariant to check. Similarly,
attempting to admit a slave that is already admitted will now result in
an `Error`; this should only occur when there is a slave ID collision,
so again it seems appropriate to produce an error rather than ignoring
the problem.

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


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

Branch: refs/heads/master
Commit: 9fa99618eec85624f44b026804c89be509e18f26
Parents: d9d6f7c
Author: Neil Conway 
Authored: Mon Sep 19 15:49:13 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:49:13 2016 -0700

--
 src/master/master.cpp |  2 ++
 src/master/master.hpp | 22 --
 src/tests/registrar_tests.cpp | 25 -
 3 files changed, 14 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/9fa99618/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 20ccd8b..763c5e7 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -7372,6 +7372,8 @@ void Master::_removeSlave(
<< " from the registrar: " << registrarResult.failure();
   }
 
+  // Should not happen: the master will only try to remove agents that
+  // are currently admitted.
   CHECK(registrarResult.get())
 << "Agent " << slave->info.id() << " (" << slave->info.hostname() << ") "
 << "already removed from the registrar";

http://git-wip-us.apache.org/repos/asf/mesos/blob/9fa99618/src/master/master.hpp
--
diff --git a/src/master/master.hpp b/src/master/master.hpp
index dbcaa3d..a051742 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -1932,18 +1932,14 @@ protected:
   virtual Try perform(
   Registry* registry,
   hashset* slaveIDs,
-  bool strict)
+  bool)
   {
 // Check if this slave is currently admitted. This should only
 // happen if there is a slaveID collision, but that is extremely
 // unlikely in practice: slaveIDs are prefixed with the master ID,
 // which is a randomly generated UUID.
 if (slaveIDs->contains(info.id())) {
-  if (strict) {
-return Error("Agent already admitted");
-  } else {
-return false; // No mutation.
-  }
+  return Error("Agent already admitted");
 }
 
 Registry::Slave* slave = registry->mutable_slaves()->add_slaves();
@@ -1971,7 +1967,7 @@ protected:
   virtual Try perform(
   Registry* registry,
   hashset* slaveIDs,
-  bool strict)
+  bool)
   {
 // As currently implemented, this should not be possible: the
 // master will only mark slaves unreachable that are currently
@@ -2024,7 +2020,7 @@ protected:
   virtual Try perform(
   Registry* registry,
   hashset* slaveIDs,
-  bool strict)
+  bool)
   {
 // A slave might try to reregister that appears in the list of
 // admitted slaves. This can occur when the master fails over:
@@ -2125,7 +2121,7 @@ protected:
   virtual Try perform(
   Registry* registry,
   hashset* slaveIDs,
-  bool strict)
+  bool)
   {
 for (int i = 0; i < registry->slaves().slaves().size(); i++) {
   const Registry::Slave& slave = registry->slaves().slaves(i);
@@ -2136,11 +2132,9 @@ protected:
   }
 }
 
-if (strict) {
-  return Error("Agent not yet admitted");
-} else {
-  return false; // No mutation.
-}
+// Should not happen: the master will only try to remove agents
+// that are currently admitted.
+return Error("Agent not yet admitted");
   }
 
 private:

http://git-wip-us.apache.org/repos/asf/mesos/blob/9fa99618/src/tests/registrar_tests.cpp
--
diff --git a/src/tests/registrar_tests.cpp b/src/tests/registrar_tests.cpp
index 928bc66..6c42fd1 100644
--- a/src/tests/registrar_tests.cpp
+++ b/src/tests/registrar_tests.cpp
@@ -274,12 +274,7 @@ TEST_P(RegistrarTest, Admit)
   

[07/27] mesos git commit: Clarified a log message.

2016-09-19 Thread vinodkone
Clarified a log message.

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


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

Branch: refs/heads/master
Commit: df037de65facd02ac179cecd7dc5c62243694fc5
Parents: 3cecdbd
Author: Neil Conway 
Authored: Mon Sep 19 15:47:41 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:47:41 2016 -0700

--
 src/master/master.cpp | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/df037de6/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 34de462..008ff32 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5835,8 +5835,8 @@ void Master::_markUnreachable(
   // Notify all frameworks of the lost slave.
   foreachvalue (Framework* framework, frameworks.registered) {
 LOG(INFO) << "Notifying framework " << *framework << " of lost agent "
-  << slaveInfo.id() << " (" << slaveInfo.hostname() << ") "
-  << "after recovering";
+  << slaveInfo.id() << " (" << slaveInfo.hostname() << ")";
+
 LostSlaveMessage message;
 message.mutable_slave_id()->MergeFrom(slaveInfo.id());
 framework->send(message);
@@ -7295,8 +7295,8 @@ void Master::_removeSlave(
   // Notify all frameworks of the lost slave.
   foreachvalue (Framework* framework, frameworks.registered) {
 LOG(INFO) << "Notifying framework " << *framework << " of lost agent "
-  << slaveInfo.id() << " (" << slaveInfo.hostname() << ") "
-  << "after recovering";
+  << slaveInfo.id() << " (" << slaveInfo.hostname() << ")";
+
 LostSlaveMessage message;
 message.mutable_slave_id()->MergeFrom(slaveInfo.id());
 framework->send(message);



[17/27] mesos git commit: Updated master to send TASK_UNREACHABLE task state.

2016-09-19 Thread vinodkone
Updated master to send TASK_UNREACHABLE task state.

When a task launched by a partition-aware framework is running on an
agent that becomes partitioned from the master, the framework will now
receive TASK_UNREACHABLE, not TASK_LOST.

Similarly, when a partition-aware framework does explicit reconciliation
for an agent ID that appears in the "unreachable" list in the registry,
the master will now return TASK_UNREACHABLE rather than TASK_LOST.

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


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

Branch: refs/heads/master
Commit: fac32e4d7f430d612b9ffc985e4c55a0ae3312fc
Parents: 81fe779
Author: Neil Conway 
Authored: Mon Sep 19 15:48:42 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:48:42 2016 -0700

--
 src/master/master.cpp  | 37 +---
 src/tests/partition_tests.cpp  | 62 +++--
 src/tests/reconciliation_tests.cpp | 11 --
 3 files changed, 69 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/fac32e4d/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 38ca425..beea5ff 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5858,9 +5858,9 @@ void Master::markUnreachable(const SlaveID& slaveId)
   TimeInfo unreachableTime = protobuf::getCurrentTime();
 
   // Update the registry to move this slave from the list of admitted
-  // slaves to the list of unreachable slaves. After this is
-  // completed, we can update the master's in-memory state to remove
-  // the slave and send TASK_LOST status updates to the frameworks.
+  // slaves to the list of unreachable slaves. After this is complete,
+  // we can remove the slave from the master's in-memory state and
+  // send TASK_UNREACHABLE / TASK_LOST updates to the frameworks.
   registrar->apply(Owned(
   new MarkSlaveUnreachable(slave->info, unreachableTime)))
 .onAny(defer(self(),
@@ -5909,19 +5909,25 @@ void Master::_markUnreachable(
   // the slave is already removed.
   allocator->removeSlave(slave->id);
 
-  // Transition the tasks to TASK_LOST and remove them.
-  // TODO(neilc): Update this to send TASK_UNREACHABLE for
-  // PARTITION_AWARE frameworks.
+  // Transition tasks to TASK_UNREACHABLE / TASK_LOST and remove them.
+  // We only use TASK_UNREACHABLE if the framework has opted in to the
+  // PARTITION_AWARE capability.
   foreachkey (const FrameworkID& frameworkId, utils::copy(slave->tasks)) {
 Framework* framework = getFramework(frameworkId);
 CHECK_NOTNULL(framework);
 
+TaskState newTaskState = TASK_UNREACHABLE;
+if (!protobuf::frameworkHasCapability(
+framework->info, FrameworkInfo::Capability::PARTITION_AWARE)) {
+  newTaskState = TASK_LOST;
+}
+
 foreachvalue (Task* task, utils::copy(slave->tasks[frameworkId])) {
   const StatusUpdate& update = protobuf::createStatusUpdate(
   task->framework_id(),
   task->slave_id(),
   task->task_id(),
-  TASK_LOST,
+  newTaskState,
   TaskStatus::SOURCE_MASTER,
   None(),
   "Slave " + slave->info.hostname() + " is unreachable",
@@ -6120,7 +6126,7 @@ void Master::_reconcileTasks(
   //   (2) Task is known: send the latest state.
   //   (3) Task is unknown, slave is registered: TASK_LOST.
   //   (4) Task is unknown, slave is transitioning: no-op.
-  //   (5) Task is unknown, slave is unreachable: TASK_LOST.
+  //   (5) Task is unknown, slave is unreachable: TASK_UNREACHABLE.
   //   (6) Task is unknown, slave is unknown: TASK_LOST.
   //
   // When using a non-strict registry, case (6) may result in
@@ -6190,16 +6196,23 @@ void Master::_reconcileTasks(
 << " for framework " << *framework
 << " because there are transitional agents";
 } else if (slaveId.isSome() && slaves.unreachable.contains(slaveId.get())) 
{
-  // (5) Slave is unreachable: TASK_LOST. The status update
-  // includes the time at which the slave was marked as
-  // unreachable.
+  // (5) Slave is unreachable: TASK_UNREACHABLE. If the framework
+  // does not have the PARTITION_AWARE capability, send TASK_LOST
+  // for backward compatibility. In either case, the status update
+  // also includes the time when the slave was marked unreachable.
   TimeInfo unreachableTime = slaves.unreachable[slaveId.get()];
 
+  TaskState taskState = TASK_UNREACHABLE;
+  if (!protobuf::frameworkHasCapability(
+   

[14/27] mesos git commit: Tweaked logging for UnregisterSlaveMessage handler.

2016-09-19 Thread vinodkone
Tweaked logging for UnregisterSlaveMessage handler.

Remove a redundant log line: rather than logging when we receive
an UnregisterSlaveMessage, it is sufficient to log how we handle
that message. Also ensure that we log when ignoring an agent
unregister message for an unknown agent, and do some minor code
cleanup.

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


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

Branch: refs/heads/master
Commit: 0d85e7eb4b2da50ebd79f4ef53183745eba42f48
Parents: 9dad0b0
Author: Neil Conway 
Authored: Mon Sep 19 15:48:23 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:48:23 2016 -0700

--
 src/master/master.cpp | 25 ++---
 1 file changed, 14 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/0d85e7eb/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 5089b99..4e0df8a 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5458,20 +5458,23 @@ void Master::unregisterSlave(const UPID& from, const 
SlaveID& slaveId)
 {
   ++metrics->messages_unregister_slave;
 
-  LOG(INFO) << "Asked to unregister agent " << slaveId;
-
   Slave* slave = slaves.registered.get(slaveId);
 
-  if (slave != nullptr) {
-if (slave->pid != from) {
-  LOG(WARNING) << "Ignoring unregister agent message from " << from
-   << " because it is not the agent " << slave->pid;
-  return;
-}
-removeSlave(slave,
-"the agent unregistered",
-metrics->slave_removals_reason_unregistered);
+  if (slave == nullptr) {
+LOG(WARNING) << "Ignoring unregister agent message from " << from
+ << " for unknown agent";
+return;
   }
+
+  if (slave->pid != from) {
+LOG(WARNING) << "Ignoring unregister agent message from " << from
+ << " because it is not the agent " << slave->pid;
+return;
+  }
+
+  removeSlave(slave,
+  "the agent unregistered",
+  metrics->slave_removals_reason_unregistered);
 }
 
 



[26/27] mesos git commit: Removed "strictness" parameter from RegistrarTest and PartitionTest.

2016-09-19 Thread vinodkone
Removed "strictness" parameter from RegistrarTest and PartitionTest.

This parameter should no longer result in any difference in behavior.

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


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

Branch: refs/heads/master
Commit: 6280299bf78f42929daecd271cbdad4e6ce24f62
Parents: 89a78b8
Author: Neil Conway 
Authored: Mon Sep 19 15:49:34 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:49:34 2016 -0700

--
 src/tests/partition_tests.cpp | 55 ++
 src/tests/registrar_tests.cpp | 49 +
 2 files changed, 32 insertions(+), 72 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/6280299b/src/tests/partition_tests.cpp
--
diff --git a/src/tests/partition_tests.cpp b/src/tests/partition_tests.cpp
index 895a073..7c38f0e 100644
--- a/src/tests/partition_tests.cpp
+++ b/src/tests/partition_tests.cpp
@@ -79,21 +79,14 @@ namespace internal {
 namespace tests {
 
 
-class PartitionTest : public MesosTest,
-  public WithParamInterface {};
-
-
-// The Registrar tests are parameterized by "strictness".
-INSTANTIATE_TEST_CASE_P(Strict, PartitionTest, ::testing::Bool());
+class PartitionTest : public MesosTest {};
 
 
 // This test checks that a scheduler gets a slave lost
 // message for a partitioned slave.
-TEST_P(PartitionTest, PartitionedSlave)
+TEST_F(PartitionTest, PartitionedSlave)
 {
   master::Flags masterFlags = CreateMasterFlags();
-  masterFlags.registry_strict = GetParam();
-
   Try master = StartMaster(masterFlags);
   ASSERT_SOME(master);
 
@@ -171,13 +164,11 @@ TEST_P(PartitionTest, PartitionedSlave)
 // This test checks that a slave can reregister with the master after
 // a partition, and that PARTITION_AWARE tasks running on the slave
 // continue to run.
-TEST_P(PartitionTest, ReregisterSlavePartitionAware)
+TEST_F(PartitionTest, ReregisterSlavePartitionAware)
 {
   Clock::pause();
 
   master::Flags masterFlags = CreateMasterFlags();
-  masterFlags.registry_strict = GetParam();
-
   Try master = StartMaster(masterFlags);
   ASSERT_SOME(master);
 
@@ -317,13 +308,11 @@ TEST_P(PartitionTest, ReregisterSlavePartitionAware)
 // This test checks that a slave can reregister with the master after
 // a partition, and that non-PARTITION_AWARE tasks running on the
 // slave are shutdown.
-TEST_P(PartitionTest, ReregisterSlaveNotPartitionAware)
+TEST_F(PartitionTest, ReregisterSlaveNotPartitionAware)
 {
   Clock::pause();
 
   master::Flags masterFlags = CreateMasterFlags();
-  masterFlags.registry_strict = GetParam();
-
   Try master = StartMaster(masterFlags);
   ASSERT_SOME(master);
 
@@ -480,13 +469,11 @@ TEST_P(PartitionTest, ReregisterSlaveNotPartitionAware)
 // not. Both tasks should survive the reregistration of the partitioned
 // agent: we allow the non-partition-aware task to continue running for
 // backward compatibility with the "non-strict" Mesos 1.0 behavior.
-TEST_P(PartitionTest, PartitionedSlaveReregistrationMasterFailover)
+TEST_F(PartitionTest, PartitionedSlaveReregistrationMasterFailover)
 {
   Clock::pause();
 
   master::Flags masterFlags = CreateMasterFlags();
-  masterFlags.registry_strict = GetParam();
-
   Try master = StartMaster(masterFlags);
   ASSERT_SOME(master);
 
@@ -733,13 +720,11 @@ TEST_P(PartitionTest, 
PartitionedSlaveReregistrationMasterFailover)
 // a task for a PARTITION_AWARE scheduler. The scheduler disconnects
 // before the partition heals. Right now, the task is left running as
 // an orphan; once MESOS-4659 is fixed, the task should be shutdown.
-TEST_P(PartitionTest, PartitionedSlaveOrphanedTask)
+TEST_F(PartitionTest, PartitionedSlaveOrphanedTask)
 {
   Clock::pause();
 
   master::Flags masterFlags = CreateMasterFlags();
-  masterFlags.registry_strict = GetParam();
-
   Try master = StartMaster(masterFlags);
   ASSERT_SOME(master);
 
@@ -903,13 +888,11 @@ TEST_P(PartitionTest, PartitionedSlaveOrphanedTask)
 // master (e.g., because of a spurious Zk leader flag at the slave),
 // the master does not kill any tasks on the slave, even if those
 // tasks are not PARTITION_AWARE.
-TEST_P(PartitionTest, SpuriousSlaveReregistration)
+TEST_F(PartitionTest, SpuriousSlaveReregistration)
 {
   Clock::pause();
 
   master::Flags masterFlags = CreateMasterFlags();
-  masterFlags.registry_strict = GetParam();
-
   Try master = StartMaster(masterFlags);
   ASSERT_SOME(master);
 
@@ -1006,13 +989,11 @@ TEST_P(PartitionTest, 

[15/27] mesos git commit: Handled agents failing health checks multiple times.

2016-09-19 Thread vinodkone
Handled agents failing health checks multiple times.

Now that we wait for the agent to be removed from the registry before
stopping the SlaveObserver, it is possible for an agent to fail health
checks multiple times if the registry operation takes longer than
`agent_ping_timeout`.

This commit updates the master logic to handle this by ignoring health
check failures while the registry operation to mark the agent
unreachable is still in progress.

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


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

Branch: refs/heads/master
Commit: 5e66002cec7855055245e328c34a783a55c542f6
Parents: 0d85e7e
Author: Neil Conway 
Authored: Mon Sep 19 15:48:30 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:48:30 2016 -0700

--
 src/master/master.cpp |  12 
 src/tests/partition_tests.cpp | 124 +
 2 files changed, 136 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/5e66002c/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 4e0df8a..3095f8a 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5827,6 +5827,18 @@ void Master::markUnreachable(const SlaveID& slaveId)
 return;
   }
 
+  if (slaves.markingUnreachable.contains(slaveId)) {
+// Possible if marking the slave unreachable in the registry takes
+// a long time. While the registry operation is in progress, the
+// `SlaveObserver` will continue to ping the slave; if the slave
+// fails another health check, the `SlaveObserver` will trigger
+// another attempt to mark it unreachable.
+LOG(WARNING) << "Not marking agent " << slaveId
+ << " unreachable because another unreachable"
+ << " transition is already in progress";
+return;
+  }
+
   LOG(INFO) << "Marking agent " << *slave
 << " unreachable: health check timed out";
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/5e66002c/src/tests/partition_tests.cpp
--
diff --git a/src/tests/partition_tests.cpp b/src/tests/partition_tests.cpp
index 54d07b7..d2fce57 100644
--- a/src/tests/partition_tests.cpp
+++ b/src/tests/partition_tests.cpp
@@ -58,6 +58,7 @@ using process::Future;
 using process::Message;
 using process::Owned;
 using process::PID;
+using process::Promise;
 using process::Time;
 
 using process::http::OK;
@@ -67,6 +68,7 @@ using std::vector;
 
 using testing::_;
 using testing::AtMost;
+using testing::DoAll;
 using testing::Eq;
 using testing::Return;
 
@@ -1869,6 +1871,128 @@ TEST_P(PartitionTest, RegistryGcByAge)
 }
 
 
+// This test checks that the master behaves correctly if a slave fails
+// health checks twice. At present, this can only occur if the registry
+// operation to mark the slave unreachable takes so long that the
+// slave fails an additional health check in the mean time.
+TEST_P(PartitionTest, FailHealthChecksTwice)
+{
+  master::Flags masterFlags = CreateMasterFlags();
+  masterFlags.registry_strict = GetParam();
+
+  Try master = StartMaster(masterFlags);
+  ASSERT_SOME(master);
+
+  // Set these expectations up before we spawn the slave so that we
+  // don't miss the first PING.
+  Future ping = FUTURE_MESSAGE(
+  Eq(PingSlaveMessage().GetTypeName()), _, _);
+
+  // Drop all the PONGs to simulate slave partition.
+  DROP_PROTOBUFS(PongSlaveMessage(), _, _);
+
+  Owned detector = master.get()->createDetector();
+  Try slave = StartSlave(detector.get());
+  ASSERT_SOME(slave);
+
+  MockScheduler sched;
+  MesosSchedulerDriver driver(
+  , DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
+
+  EXPECT_CALL(sched, registered(, _, _));
+
+  Future resourceOffers;
+  EXPECT_CALL(sched, resourceOffers(, _))
+.WillOnce(FutureSatisfy())
+.WillRepeatedly(Return()); // Ignore subsequent offers.
+
+  driver.start();
+
+  // Need to make sure the framework AND slave have registered with
+  // master. Waiting for resource offers should accomplish both.
+  AWAIT_READY(resourceOffers);
+
+  Clock::pause();
+
+  EXPECT_CALL(sched, offerRescinded(, _))
+.Times(AtMost(1));
+
+  Future slaveLost;
+  EXPECT_CALL(sched, slaveLost(, _))
+.WillOnce(FutureSatisfy());
+
+  // Now advance through the PINGs.
+  size_t pings = 0;
+  while (true) {
+AWAIT_READY(ping);
+pings++;
+if (pings == masterFlags.max_agent_ping_timeouts) {
+  break;
+}
+ping = 

[16/27] mesos git commit: Fixed races between "unreachable" and "unregister" slave transitions.

2016-09-19 Thread vinodkone
Fixed races between "unreachable" and "unregister" slave transitions.

Now that we update the registry before updating the master's state when
performing these transitions, it is possible for the master to already
be marking a slave unreachable when an `UnregisterSlaveMessage` is
received, or vice versa. Detect these situations and ignore whichever
transition is triggered second.

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


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

Branch: refs/heads/master
Commit: 81fe779b46e48eff2fde51e8d21402cb7eee006b
Parents: 5e66002
Author: Neil Conway 
Authored: Mon Sep 19 15:48:36 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:48:36 2016 -0700

--
 src/master/master.cpp |  24 -
 src/tests/slave_tests.cpp | 229 +
 2 files changed, 252 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/81fe779b/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 3095f8a..38ca425 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5839,6 +5839,12 @@ void Master::markUnreachable(const SlaveID& slaveId)
 return;
   }
 
+  if (slaves.removing.contains(slaveId)) {
+LOG(WARNING) << "Not marking agent " << slaveId
+ << " unreachable because it is unregistering";
+return;
+  }
+
   LOG(INFO) << "Marking agent " << *slave
 << " unreachable: health check timed out";
 
@@ -7284,10 +7290,26 @@ void Master::removeSlave(
 {
   CHECK_NOTNULL(slave);
 
-  LOG(INFO) << "Removing agent " << *slave << ": " << message;
+  // It would be better to remove the slave here instead of continuing
+  // to mark it unreachable, but probably not worth the complexity.
+  if (slaves.markingUnreachable.contains(slave->id)) {
+LOG(WARNING) << "Ignoring removal of agent " << *slave
+ << " that is in the process of being marked unreachable";
+return;
+  }
+
+  // This should not be possible, but we protect against it anyway for
+  // the sake of paranoia.
+  if (slaves.removing.contains(slave->id)) {
+LOG(WARNING) << "Ignoring removal of agent " << *slave
+ << " that is in the process of being removed";
+return;
+  }
 
   slaves.removing.insert(slave->id);
 
+  LOG(INFO) << "Removing agent " << *slave << ": " << message;
+
   // Remove this slave from the registrar. Note that we update the
   // registry BEFORE we update the master's in-memory state; this
   // means that until the registry operation has completed, the slave

http://git-wip-us.apache.org/repos/asf/mesos/blob/81fe779b/src/tests/slave_tests.cpp
--
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index aa30118..8ad3547 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -2886,6 +2886,235 @@ TEST_F(SlaveTest, HealthCheckUnregisterRace)
 }
 
 
+// This test checks that the master behaves correctly when a slave
+// fails health checks and is in the process of being marked
+// unreachable in the registry, but concurrently the slave unregisters
+// from the master.
+TEST_F(SlaveTest, UnreachableThenUnregisterRace)
+{
+  master::Flags masterFlags = CreateMasterFlags();
+  Try master = StartMaster(masterFlags);
+  ASSERT_SOME(master);
+
+  // Set these expectations up before we spawn the slave so that we
+  // don't miss the first PING.
+  Future ping = FUTURE_MESSAGE(
+  Eq(PingSlaveMessage().GetTypeName()), _, _);
+
+  // Drop all the PONGs to simulate slave partition.
+  DROP_PROTOBUFS(PongSlaveMessage(), _, _);
+
+  Owned detector = master.get()->createDetector();
+  Try slave = StartSlave(detector.get());
+  ASSERT_SOME(slave);
+
+  MockScheduler sched;
+  MesosSchedulerDriver driver(
+  , DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
+
+  EXPECT_CALL(sched, registered(, _, _));
+
+  Future resourceOffers;
+  EXPECT_CALL(sched, resourceOffers(, _))
+.WillOnce(FutureSatisfy())
+.WillRepeatedly(Return()); // Ignore subsequent offers.
+
+  driver.start();
+
+  // Need to make sure the framework AND slave have registered with
+  // master. Waiting for resource offers should accomplish both.
+  AWAIT_READY(resourceOffers);
+
+  Clock::pause();
+
+  EXPECT_CALL(sched, offerRescinded(, _))
+.Times(AtMost(1));
+
+  Future slaveLost;
+  EXPECT_CALL(sched, slaveLost(, _))
+.WillOnce(FutureSatisfy());
+
+  // Now advance through the 

[01/27] mesos git commit: Changed master to allow partitioned slaves to reregister.

2016-09-19 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 34e1240d5 -> 29236068f


Changed master to allow partitioned slaves to reregister.

The previous behavior was to shutdown partitioned agents that attempt to
reregister---unless the master has failed over, in which case the
reregistration is allowed (when running in "non-strict" mode).

The new behavior is always to allow partitioned agents to reregister.
This is part of a longer-term project to allow frameworks to define
their own policies for handling tasks running on partitioned agents.

In particular, if a framework has the PARTITION_AWARE capability, any
tasks running on the partitioned agent will continue to run after
reregistration. If the framework is not PARTITION_AWARE, any tasks that
were running on such an agent will be killed after the agent reregisters
(unless the master has failed over). This is for backward compatibility
with the previous ("non-strict") behavior. Note that regardless of the
PARTITION_AWARE capability, the agent will not be shutdown, which is a
change from the previous Mesos behavior.

This commit also changes the master so that if an agent is removed and
then the master receives a message from that agent, the master will no
longer attempt to shutdown the agent. This is consistent with the goal
of getting the master out of the business of shutting down agents that
we suspect are unhealthy. Such an agent will eventually realize it is
not registered with the master (e.g., because it won't receive any pings
from the master), which will cause it to reregister.

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


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

Branch: refs/heads/master
Commit: 937c85f2f6528d1ac56ea9a7aa174ca0bd371d0c
Parents: 34e1240
Author: Neil Conway 
Authored: Mon Sep 19 15:47:01 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:47:01 2016 -0700

--
 src/master/master.cpp | 471 -
 src/master/master.hpp |  64 ++---
 src/tests/master_tests.cpp|  16 +-
 src/tests/partition_tests.cpp | 460 
 4 files changed, 642 insertions(+), 369 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/937c85f2/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index b88472f..7e501ec 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -190,10 +190,10 @@ protected:
 timeouts = 0;
 pinged = false;
 
-// Cancel any pending shutdown.
-if (shuttingDown.isSome()) {
+// Cancel any pending unreachable transitions.
+if (markingUnreachable.isSome()) {
   // Need a copy for non-const access.
-  Future future = shuttingDown.get();
+  Future future = markingUnreachable.get();
   future.discard();
 }
   }
@@ -205,64 +205,64 @@ protected:
   if (timeouts >= maxSlavePingTimeouts) {
 // No pong has been received for the last
 // 'maxSlavePingTimeouts' pings.
-shutdown();
+markUnreachable();
   }
 }
 
-// NOTE: We keep pinging even if we schedule a shutdown. This is
-// because if the slave eventually responds to a ping, we can
-// cancel the shutdown.
+// NOTE: We keep pinging even if we schedule a transition to
+// UNREACHABLE. This is because if the slave eventually responds
+// to a ping, we can cancel the UNREACHABLE transition.
 ping();
   }
 
-  // NOTE: The shutdown of the slave is rate limited and can be
-  // canceled if a pong was received before the actual shutdown is
-  // called.
-  void shutdown()
+  // Marking slaves unreachable is rate-limited and can be canceled if
+  // a pong is received before `_markUnreachable` is called.
+  //
+  // TODO(neilc): Using a rate-limit when marking slaves unreachable
+  // is only necessary for frameworks that are not PARTITION_AWARE.
+  // For such frameworks, we shutdown their tasks when an unreachable
+  // agent reregisters, so a rate-limit is a useful safety
+  // precaution. Once all frameworks are PARTITION_AWARE, we can
+  // likely remove the rate-limit (MESOS-5948).
+  void markUnreachable()
   {
-if (shuttingDown.isSome()) {
-  return;  // Shutdown is already in progress.
+if (markingUnreachable.isSome()) {
+  return; // Unreachable transition is already in progress.
 }
 
 Future acquire = Nothing();
 
 if (limiter.isSome()) {
-  LOG(INFO) << "Scheduling shutdown of agent " << slaveId
-<< " due to health check 

[09/27] mesos git commit: Change registry update order on removal, mark-unreachable.

2016-09-19 Thread vinodkone
Change registry update order on removal, mark-unreachable.

This commit changes the master so that we always update the registry
for an important change (e.g., removing an agent or marking an agent
unreachable), before updating the important parts of the master's
in-memory state (e.g., the in-memory list of registered agents).
Previously, the registry was updated first for registration and
reregistration, but second for removal and marking unreachable.
Updating the registry first is simpler, and also avoids possibly
leaking inaccurate information (e.g., via HTTP endpoints) if the
registry operation fails.

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


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

Branch: refs/heads/master
Commit: 88b2533a72ff5897bc6cc5d7861a313c6fd7ea28
Parents: 0cb2480
Author: Neil Conway 
Authored: Mon Sep 19 15:47:53 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:47:53 2016 -0700

--
 src/master/master.cpp | 332 ++---
 src/master/master.hpp |  16 +-
 src/tests/master_tests.cpp|   1 +
 src/tests/partition_tests.cpp |  26 +--
 src/tests/slave_tests.cpp |   1 +
 5 files changed, 193 insertions(+), 183 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/88b2533a/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 008ff32..71caea6 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -1757,21 +1757,20 @@ Nothing Master::markUnreachableAfterFailover(const 
Registry::Slave& slave)
<< " after master failover; marking it unreachable";
 
   ++metrics->slave_unreachable_completed;
-  ++metrics->recovery_slave_removals;
 
   slaves.recovered.erase(slave.info().id());
 
+  TimeInfo unreachableTime = protobuf::getCurrentTime();
+
   if (flags.registry_strict) {
 slaves.markingUnreachable.insert(slave.info().id());
 
 registrar->apply(Owned(
-new MarkSlaveUnreachable(slave.info(), protobuf::getCurrentTime(
+new MarkSlaveUnreachable(slave.info(), unreachableTime)))
   .onAny(defer(self(),
-   ::_markUnreachable,
+   ::_markUnreachableAfterFailover,
slave.info(),
-   vector(), // No TASK_LOST updates to send.
-   lambda::_1,
-   "did not re-register after master failover"));
+   lambda::_1));
   } else {
 // When a non-strict registry is in use, we want to ensure the
 // registry is used in a write-only manner. Therefore we remove
@@ -1781,7 +1780,7 @@ Nothing Master::markUnreachableAfterFailover(const 
Registry::Slave& slave)
   "Failed to mark agent " + stringify(slave.info().id()) + " unreachable";
 
 registrar->apply(Owned(
-new MarkSlaveUnreachable(slave.info(), protobuf::getCurrentTime(
+new MarkSlaveUnreachable(slave.info(), unreachableTime)))
   .onFailed(lambda::bind(fail, message, lambda::_1));
   }
 
@@ -1789,6 +1788,54 @@ Nothing Master::markUnreachableAfterFailover(const 
Registry::Slave& slave)
 }
 
 
+void Master::_markUnreachableAfterFailover(
+const SlaveInfo& slaveInfo,
+const Future& registrarResult)
+{
+  CHECK(slaves.markingUnreachable.contains(slaveInfo.id()));
+  slaves.markingUnreachable.erase(slaveInfo.id());
+
+  if (registrarResult.isFailed()) {
+LOG(FATAL) << "Failed to mark agent " << slaveInfo.id()
+   << " (" << slaveInfo.hostname() << ")"
+   << " unreachable in the registry: "
+   << registrarResult.failure();
+  }
+
+  CHECK(!registrarResult.isDiscarded());
+
+  // `MarkSlaveUnreachable` registry operation should never fail.
+  CHECK(registrarResult.get());
+
+  LOG(INFO) << "Marked agent " << slaveInfo.id() << " ("
+<< slaveInfo.hostname() << ") unreachable: "
+<< "did not re-register after master failover";
+
+  ++metrics->slave_removals;
+  ++metrics->slave_removals_reason_unhealthy;
+  ++metrics->recovery_slave_removals;
+
+  sendSlaveLost(slaveInfo);
+}
+
+
+void Master::sendSlaveLost(const SlaveInfo& slaveInfo)
+{
+  foreachvalue (Framework* framework, frameworks.registered) {
+LOG(INFO) << "Notifying framework " << *framework << " of lost agent "
+  << slaveInfo.id() << " (" << slaveInfo.hostname() << ")";
+
+LostSlaveMessage message;
+message.mutable_slave_id()->MergeFrom(slaveInfo.id());
+framework->send(message);
+  }
+
+  if (HookManager::hooksAvailable()) {
+

[13/27] mesos git commit: Added GC of unreachable agent metadata from the registry.

2016-09-19 Thread vinodkone
Added GC of unreachable agent metadata from the registry.

Information about agents that have been marked unreachable is stored
in the registry. Since the number of unreachable agents can grow without
bound, this commit implements a garbage collection scheme. The current
leading master will periodically examine the registry and discard
information about unreachable agents according to two criteria:
`registry_max_agent_age` and `registry_max_agent_count`. The frequency
with which the master examines the registry is controlled by a third
parameter, `registry_gc_interval`.

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


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

Branch: refs/heads/master
Commit: 9dad0b034c99403cab43cab0a6ea8a55e99e71fa
Parents: 592da1e
Author: Neil Conway 
Authored: Mon Sep 19 15:48:16 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:48:16 2016 -0700

--
 src/master/constants.hpp  |   6 +
 src/master/flags.cpp  |  31 ++
 src/master/flags.hpp  |   3 +
 src/master/master.cpp | 104 +++
 src/master/master.hpp |  66 -
 src/master/registry.proto |   6 +
 src/tests/partition_tests.cpp | 590 +
 src/tests/registrar_tests.cpp |  46 +++
 8 files changed, 848 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/9dad0b03/src/master/constants.hpp
--
diff --git a/src/master/constants.hpp b/src/master/constants.hpp
index cd80dac..5dd0667 100644
--- a/src/master/constants.hpp
+++ b/src/master/constants.hpp
@@ -91,6 +91,12 @@ constexpr Duration WHITELIST_WATCH_INTERVAL = Seconds(5);
 // Default number of tasks (limit) for /master/tasks endpoint.
 constexpr size_t TASK_LIMIT = 100;
 
+constexpr Duration DEFAULT_REGISTRY_GC_INTERVAL = Minutes(15);
+
+constexpr Duration DEFAULT_REGISTRY_MAX_AGENT_AGE = Weeks(2);
+
+constexpr size_t DEFAULT_REGISTRY_MAX_AGENT_COUNT = 100 * 1024;
+
 /**
  * Label used by the Leader Contender and Detector.
  *

http://git-wip-us.apache.org/repos/asf/mesos/blob/9dad0b03/src/master/flags.cpp
--
diff --git a/src/master/flags.cpp b/src/master/flags.cpp
index 19ae6c1..aea8bd4 100644
--- a/src/master/flags.cpp
+++ b/src/master/flags.cpp
@@ -557,4 +557,35 @@ mesos::internal::master::Flags::Flags()
   "should exist in a module specified through the --modules flag.\n"
   "Cannot be used in conjunction with --zk.\n"
   "Must be used in conjunction with --master_contender.");
+
+  add(::registry_gc_interval,
+  "registry_gc_interval",
+  "How often to garbage collect the registry. The current leading\n"
+  "master will periodically discard information from the registry.\n"
+  "How long registry state is retained is controlled by other\n"
+  "parameters (e.g., registry_max_agent_age, registry_max_agent_count);\n"
+  "this parameter controls how often the master will examine the\n"
+  "registry to see if data should be discarded.",
+  DEFAULT_REGISTRY_GC_INTERVAL);
+
+  add(::registry_max_agent_age,
+  "registry_max_agent_age",
+  "Maximum length of time to store information in the registry about\n"
+  "agents that are not currently connected to the cluster. This\n"
+  "information allows frameworks to determine the status of unreachable\n"
+  "and removed agents. Note that the registry always stores information\n"
+  "on all connected agents. If there are more than\n"
+  "`registry_max_agent_count` partitioned or removed agents, agent\n"
+  "information may be discarded from the registry sooner than indicated\n"
+  "by this parameter.",
+  DEFAULT_REGISTRY_MAX_AGENT_AGE);
+
+  add(::registry_max_agent_count,
+  "registry_max_agent_count",
+  "Maximum number of disconnected agents to store in the registry.\n"
+  "This informtion allows frameworks to determine the status of\n"
+  "disconnected agents. Note that the registry always stores\n"
+  "information about all connected agents. See also the\n"
+  "`registry_max_agent_age` flag.",
+  DEFAULT_REGISTRY_MAX_AGENT_COUNT);
 }

http://git-wip-us.apache.org/repos/asf/mesos/blob/9dad0b03/src/master/flags.hpp
--
diff --git a/src/master/flags.hpp b/src/master/flags.hpp
index c6e8530..708a629 100644
--- a/src/master/flags.hpp
+++ b/src/master/flags.hpp
@@ -89,6 +89,9 @@ public:
   size_t max_completed_tasks_per_framework;
   

[18/27] mesos git commit: Improved SlaveTest.HealthCheckUnregisterRace.

2016-09-19 Thread vinodkone
Improved SlaveTest.HealthCheckUnregisterRace.

Now that the MockRegistrar has been introduced, we can assert
that the master doesn't do a registry operation in certain
situations.

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


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

Branch: refs/heads/master
Commit: 6172da93d883cf2bafb7cf195ad119d480434329
Parents: fac32e4
Author: Neil Conway 
Authored: Mon Sep 19 15:48:48 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:48:48 2016 -0700

--
 src/tests/slave_tests.cpp | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/6172da93/src/tests/slave_tests.cpp
--
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index 8ad3547..552f3f8 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -2875,7 +2875,12 @@ TEST_F(SlaveTest, HealthCheckUnregisterRace)
   // We now want to arrange for the agent to fail health checks. We
   // can't do that directly, because the `SlaveObserver` for this
   // agent has already been removed. Instead, we dispatch to the
-  // master's `markUnreachable` method directly.
+  // master's `markUnreachable` method directly. We expect the master
+  // to ignore this message; in particular, the master should not
+  // attempt to update the registry to mark the slave unreachable.
+  EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+.Times(0);
+
   process::dispatch(master.get()->pid, ::markUnreachable, slaveId);
 
   Clock::settle();



[27/27] mesos git commit: Removed use of "--registry_strict" master flag.

2016-09-19 Thread vinodkone
Removed use of "--registry_strict" master flag.

The flag will remain for a few more months per the deprecation policy,
but we no longer need to set it in the unit tests. Providing an
extensive usage summary in "--help" output also doesn't seem useful.

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


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

Branch: refs/heads/master
Commit: 29236068f23b6cfbd19d7a4b5b96be852818a356
Parents: 6280299
Author: Neil Conway 
Authored: Mon Sep 19 15:49:38 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:49:38 2016 -0700

--
 src/master/flags.cpp  | 5 +
 src/tests/cluster.cpp | 6 ++
 src/tests/mesos.cpp   | 1 -
 3 files changed, 3 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/29236068/src/master/flags.cpp
--
diff --git a/src/master/flags.cpp b/src/master/flags.cpp
index aea8bd4..9bfb40e 100644
--- a/src/master/flags.cpp
+++ b/src/master/flags.cpp
@@ -89,10 +89,7 @@ mesos::internal::master::Flags::Flags()
   add(::registry_strict,
   "registry_strict",
   "Whether the master will take actions based on the persistent\n"
-  "information stored in the Registry. Setting this to false means\n"
-  "that the Registrar will never reject the admission, readmission,\n"
-  "or removal of an agent. Consequently, `false` can be used to\n"
-  "bootstrap the persistent state on a running cluster.\n"
+  "information stored in the Registry.\n"
   "NOTE: This flag is *disabled* and will be removed in a future\n"
   "version of Mesos.",
   false,

http://git-wip-us.apache.org/repos/asf/mesos/blob/29236068/src/tests/cluster.cpp
--
diff --git a/src/tests/cluster.cpp b/src/tests/cluster.cpp
index 7152ac3..f201b49 100644
--- a/src/tests/cluster.cpp
+++ b/src/tests/cluster.cpp
@@ -192,10 +192,8 @@ Try Master::start(
   }
 
   // Check for some invalid flag combinations.
-  if (flags.registry == "in_memory" && flags.registry_strict) {
-return Error(
-"Cannot use '--registry_strict' when using in-memory storage based"
-" registry");
+  if (flags.registry_strict) {
+return Error("Support for '--registry_strict' has been removed");
   }
 
   if (flags.registry == "replicated_log" && flags.work_dir.isNone()) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/29236068/src/tests/mesos.cpp
--
diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp
index 07a64f0..2aae160 100644
--- a/src/tests/mesos.cpp
+++ b/src/tests/mesos.cpp
@@ -145,7 +145,6 @@ master::Flags MesosTest::CreateMasterFlags()
 
   // Use the replicated log (without ZooKeeper) by default.
   flags.registry = "replicated_log";
-  flags.registry_strict = true;
 
   // On many test VMs, this default is too small.
   flags.registry_store_timeout = flags.registry_store_timeout * 5;



[24/27] mesos git commit: Removed dependency on "registry_strict" in master failover.

2016-09-19 Thread vinodkone
Removed dependency on "registry_strict" in master failover.

When the master fails over, agents have `agent_reregister_timeout` to
reregister with the new master. Any agents that fail to reregister
within the timeout will be marked unreachable in the registry.
Previously, frameworks would only receive a `slaveLost` callback for
such agents if the master was running in "registry_strict" mode. This
commit changes the master to always inform frameworks about lost agents,
regardless of the "registry_strict" flag.

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


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

Branch: refs/heads/master
Commit: 905204e54748c5842f96997db41f9ff14d9246ab
Parents: ef9211f
Author: Neil Conway 
Authored: Mon Sep 19 15:49:23 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:49:23 2016 -0700

--
 src/master/master.cpp  | 27 --
 src/tests/master_tests.cpp | 81 -
 2 files changed, 7 insertions(+), 101 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/905204e5/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 763c5e7..66a672f 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -1880,27 +1880,14 @@ Nothing Master::markUnreachableAfterFailover(const 
Registry::Slave& slave)
 
   TimeInfo unreachableTime = protobuf::getCurrentTime();
 
-  if (flags.registry_strict) {
-slaves.markingUnreachable.insert(slave.info().id());
+  slaves.markingUnreachable.insert(slave.info().id());
 
-registrar->apply(Owned(
-new MarkSlaveUnreachable(slave.info(), unreachableTime)))
-  .onAny(defer(self(),
-   ::_markUnreachableAfterFailover,
-   slave.info(),
-   lambda::_1));
-  } else {
-// When a non-strict registry is in use, we want to ensure the
-// registry is used in a write-only manner. Therefore we remove
-// the slave from the registry but we do not inform the
-// framework.
-const string& message =
-  "Failed to mark agent " + stringify(slave.info().id()) + " unreachable";
-
-registrar->apply(Owned(
-new MarkSlaveUnreachable(slave.info(), unreachableTime)))
-  .onFailed(lambda::bind(fail, message, lambda::_1));
-  }
+  registrar->apply(Owned(
+  new MarkSlaveUnreachable(slave.info(), unreachableTime)))
+.onAny(defer(self(),
+ ::_markUnreachableAfterFailover,
+ slave.info(),
+ lambda::_1));
 
   return Nothing();
 }

http://git-wip-us.apache.org/repos/asf/mesos/blob/905204e5/src/tests/master_tests.cpp
--
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 6c49ab3..a32ac12 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -1967,87 +1967,6 @@ TEST_F(MasterTest, RecoveredSlaveCanReregister)
 }
 
 
-// This test ensures that a non-strict registry is write-only by
-// inducing a slave removal during recovery. After which, we expect
-// that the framework is *not* informed, and we expect that the
-// slave can re-register successfully.
-TEST_F(MasterTest, NonStrictRegistryWriteOnly)
-{
-  // Step 1: Start a master.
-  master::Flags masterFlags = CreateMasterFlags();
-  masterFlags.registry_strict = false;
-
-  Try master = StartMaster(masterFlags);
-  ASSERT_SOME(master);
-
-  // Step 2: Start a slave.
-  Future slaveRegisteredMessage =
-FUTURE_PROTOBUF(SlaveRegisteredMessage(), master.get()->pid, _);
-
-  // Reuse slaveFlags so both StartSlave() use the same work_dir.
-  slave::Flags slaveFlags = this->CreateSlaveFlags();
-
-  Owned detector = master.get()->createDetector();
-  Try slave = StartSlave(detector.get(), slaveFlags);
-  ASSERT_SOME(slave);
-
-  AWAIT_READY(slaveRegisteredMessage);
-
-  // Step 3: Stop the slave while the master is down.
-  master->reset();
-  slave.get()->terminate();
-  slave->reset();
-
-  // Step 4: Restart the master.
-  master = StartMaster(masterFlags);
-  ASSERT_SOME(master);
-
-  // Step 5: Start a scheduler.
-  MockScheduler sched;
-  MesosSchedulerDriver driver(
-  , DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
-
-  Future registered;
-  EXPECT_CALL(sched, registered(, _, _))
-.WillOnce(FutureSatisfy());
-
-  EXPECT_CALL(sched, resourceOffers(, _))
-.WillRepeatedly(Return()); // Ignore offers.
-
-  driver.start();
-
-  AWAIT_READY(registered);
-
-  // Step 6: 

[25/27] mesos git commit: Squelched GMock warning in MasterTest.RecoveredSlaveCanReregister.

2016-09-19 Thread vinodkone
Squelched GMock warning in MasterTest.RecoveredSlaveCanReregister.

After the slave reregisters, the framework might receive an offer for
the resources on that slave.

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


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

Branch: refs/heads/master
Commit: 89a78b873f5751714fefc7e97e1249e094d1e68a
Parents: 905204e
Author: Neil Conway 
Authored: Mon Sep 19 15:49:29 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:49:29 2016 -0700

--
 src/tests/master_tests.cpp | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/89a78b87/src/tests/master_tests.cpp
--
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index a32ac12..e6c8362 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -1956,11 +1956,17 @@ TEST_F(MasterTest, RecoveredSlaveCanReregister)
   Future slaveReregisteredMessage =
 FUTURE_PROTOBUF(SlaveReregisteredMessage(), master.get()->pid, _);
 
+  // Expect a resource offer from the re-registered slave.
+  Future offers;
+  EXPECT_CALL(sched, resourceOffers(, _))
+.WillOnce(FutureSatisfy());
+
   detector = master.get()->createDetector();
   slave = StartSlave(detector.get(), slaveFlags);
   ASSERT_SOME(slave);
 
   AWAIT_READY(slaveReregisteredMessage);
+  AWAIT_READY(offers);
 
   driver.stop();
   driver.join();



[11/27] mesos git commit: Adjusted existing tests to use MockRegistrar.

2016-09-19 Thread vinodkone
Adjusted existing tests to use MockRegistrar.

This means that `Master::_reregisterSlave` can be made private.

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


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

Branch: refs/heads/master
Commit: 87b94314b1490ef7035e9ec5e8e071dfc1f12309
Parents: 80993da
Author: Neil Conway 
Authored: Mon Sep 19 15:48:06 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:48:06 2016 -0700

--
 src/master/master.hpp  | 27 +++
 src/tests/master_tests.cpp | 16 
 src/tests/reconciliation_tests.cpp | 21 ++---
 3 files changed, 37 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/87b94314/src/master/master.hpp
--
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 714aa79..370e0f0 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -555,22 +555,6 @@ public:
   // Made public for testing purposes.
   process::Future _recover(const Registry& registry);
 
-  // Continuation of reregisterSlave().
-  // Made public for testing purposes.
-  // TODO(vinod): Instead of doing this create and use a
-  // MockRegistrar.
-  // TODO(dhamon): Consider FRIEND_TEST macro from gtest.
-  void _reregisterSlave(
-  const SlaveInfo& slaveInfo,
-  const process::UPID& pid,
-  const std::vector& checkpointedResources,
-  const std::vector& executorInfos,
-  const std::vector& tasks,
-  const std::vector& frameworks,
-  const std::vector& completedFrameworks,
-  const std::string& version,
-  const process::Future& readmit);
-
   MasterInfo info() const
   {
 return info_;
@@ -620,6 +604,17 @@ protected:
   const std::string& version,
   const process::Future& admit);
 
+  void _reregisterSlave(
+  const SlaveInfo& slaveInfo,
+  const process::UPID& pid,
+  const std::vector& checkpointedResources,
+  const std::vector& executorInfos,
+  const std::vector& tasks,
+  const std::vector& frameworks,
+  const std::vector& completedFrameworks,
+  const std::string& version,
+  const process::Future& readmit);
+
   void __reregisterSlave(
   Slave* slave,
   const std::vector& tasks,

http://git-wip-us.apache.org/repos/asf/mesos/blob/87b94314/src/tests/master_tests.cpp
--
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 85ebd57..737f589 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -535,9 +535,6 @@ TEST_F(MasterTest, KillUnknownTaskSlaveInTransition)
   EXPECT_CALL(exec, shutdown(_))
 .Times(AtMost(1));
 
-  Future _reregisterSlave =
-DROP_DISPATCH(_, ::_reregisterSlave);
-
   // Stop master and slave.
   master->reset();
   slave.get()->terminate();
@@ -551,6 +548,14 @@ TEST_F(MasterTest, KillUnknownTaskSlaveInTransition)
   master = StartMaster();
   ASSERT_SOME(master);
 
+  // Intercept the first registrar operation that is attempted; this
+  // should be the registry operation that reregisters the slave.
+  Future reregister;
+  Promise promise; // Never satisfied.
+  EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+.WillOnce(DoAll(FutureArg<0>(),
+Return(promise.future(;
+
   frameworkId = Future();
   EXPECT_CALL(sched, registered(, _, _))
 .WillOnce(FutureArg<1>());
@@ -567,7 +572,10 @@ TEST_F(MasterTest, KillUnknownTaskSlaveInTransition)
   ASSERT_SOME(slave);
 
   // Wait for the slave to start reregistration.
-  AWAIT_READY(_reregisterSlave);
+  AWAIT_READY(reregister);
+  EXPECT_NE(
+  nullptr,
+  dynamic_cast(reregister.get().get()));
 
   // As Master::killTask isn't doing anything, we shouldn't get a status 
update.
   EXPECT_CALL(sched, statusUpdate(, _))

http://git-wip-us.apache.org/repos/asf/mesos/blob/87b94314/src/tests/reconciliation_tests.cpp
--
diff --git a/src/tests/reconciliation_tests.cpp 
b/src/tests/reconciliation_tests.cpp
index a043356..9828ab9 100644
--- a/src/tests/reconciliation_tests.cpp
+++ b/src/tests/reconciliation_tests.cpp
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -412,15 +413,18 @@ TEST_F(ReconciliationTest, SlaveInTransition)
   EXPECT_CALL(sched, statusUpdate(, _))
 .Times(0);
 
-  // Drop '::_reregisterSlave' dispatch so that the slave is
-  // in 'reregistering' 

[06/27] mesos git commit: Added more assertions to the master.

2016-09-19 Thread vinodkone
Added more assertions to the master.

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


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

Branch: refs/heads/master
Commit: 3cecdbdd4b727567c621f999fb8df45116f0a979
Parents: ac26919
Author: Neil Conway 
Authored: Mon Sep 19 15:47:33 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:47:33 2016 -0700

--
 src/master/master.cpp | 11 +--
 src/master/master.hpp |  3 ---
 2 files changed, 9 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/3cecdbdd/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index d5a194b..34de462 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5183,6 +5183,9 @@ void Master::_reregisterSlave(
   // example.
   bool slaveWasRemoved = slaves.removed.get(slave->id).isSome();
 
+  slaves.removed.erase(slave->id);
+  slaves.unreachable.erase(slave->id);
+
   addSlave(slave, completedFrameworks);
 
   Duration pingTimeout =
@@ -5673,6 +5676,9 @@ void Master::markUnreachable(const SlaveID& slaveId)
   LOG(INFO) << "Marking agent " << *slave
 << " unreachable: health check timed out";
 
+  CHECK(!slaves.unreachable.contains(slaveId));
+  CHECK(slaves.removed.get(slaveId).isNone());
+
   // We want to remove the slave first, to avoid the allocator
   // re-allocating the recovered resources.
   //
@@ -7036,9 +7042,10 @@ void Master::addSlave(
 const vector& completedFrameworks)
 {
   CHECK_NOTNULL(slave);
+  CHECK(!slaves.registered.contains(slave->id));
+  CHECK(!slaves.unreachable.contains(slave->id));
+  CHECK(slaves.removed.get(slave->id).isNone());
 
-  slaves.removed.erase(slave->id);
-  slaves.unreachable.erase(slave->id);
   slaves.registered.put(slave);
 
   link(slave->pid);

http://git-wip-us.apache.org/repos/asf/mesos/blob/3cecdbdd/src/master/master.hpp
--
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 6aeb1b9..7e50359 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -1928,9 +1928,6 @@ protected:
   }
 }
 
-// TODO(neilc): Check if the slave appears in the list of
-// `unreachable` slaves in the registry?
-
 Registry::Slave* slave = registry->mutable_slaves()->add_slaves();
 slave->mutable_info()->CopyFrom(info);
 slaveIDs->insert(info.id());



[12/27] mesos git commit: Added test for HTTP endpoints during slave removal.

2016-09-19 Thread vinodkone
Added test for HTTP endpoints during slave removal.

When a slave is being removed but before the registry operation to
remove it has completed, querying the HTTP endpoints at the master
should not indicate that the slave has been removed yet. This is
important because the registry update might fail; if the master
fails over, the new master will not have removed the slave.

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


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

Branch: refs/heads/master
Commit: 592da1edc2a5279f8851a8f30a1425229e8fbaca
Parents: 87b9431
Author: Neil Conway 
Authored: Mon Sep 19 15:48:11 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:48:11 2016 -0700

--
 src/tests/master_tests.cpp | 117 
 1 file changed, 117 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/592da1ed/src/tests/master_tests.cpp
--
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 737f589..6c49ab3 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -607,6 +607,123 @@ TEST_F(MasterTest, KillUnknownTaskSlaveInTransition)
 }
 
 
+// This test checks that the HTTP endpoints return the expected
+// information for agents that the master is in the process of marking
+// unreachable, but that have not yet been so marked (because the
+// registry update hasn't completed yet).
+TEST_F(MasterTest, EndpointsForHalfRemovedSlave)
+{
+  master::Flags masterFlags = CreateMasterFlags();
+  Try master = StartMaster(masterFlags);
+  ASSERT_SOME(master);
+
+  // Set these expectations up before we spawn the slave so that we
+  // don't miss the first PING.
+  Future ping = FUTURE_MESSAGE(
+  Eq(PingSlaveMessage().GetTypeName()), _, _);
+
+  // Drop all the PONGs to simulate slave partition.
+  DROP_PROTOBUFS(PongSlaveMessage(), _, _);
+
+  Owned detector = master.get()->createDetector();
+  Try slave = StartSlave(detector.get());
+  ASSERT_SOME(slave);
+
+  Clock::pause();
+
+  // Now advance through the PINGs.
+  size_t pings = 0;
+  while (true) {
+AWAIT_READY(ping);
+pings++;
+if (pings == masterFlags.max_agent_ping_timeouts) {
+  break;
+}
+ping = FUTURE_MESSAGE(Eq(PingSlaveMessage().GetTypeName()), _, _);
+Clock::advance(masterFlags.agent_ping_timeout);
+  }
+
+  // Intercept the first registrar operation that is attempted; this
+  // should be the operation that marks the slave as unreachable.
+  Future unreachable;
+  Promise promise;
+  EXPECT_CALL(*master.get()->registrar.get(), apply(_))
+.WillOnce(DoAll(FutureArg<0>(),
+Return(promise.future(;
+
+  Clock::advance(masterFlags.agent_ping_timeout);
+
+  slave.get()->terminate();
+  slave->reset();
+
+  // Wait for the master to attempt to update the registry, but don't
+  // allow the registry update to succeed yet.
+  AWAIT_READY(unreachable);
+  EXPECT_NE(
+  nullptr,
+  dynamic_cast(unreachable.get().get()));
+
+  // Settle the clock for the sake of paranoia.
+  Clock::settle();
+
+  // Metrics should not be updated yet.
+  JSON::Object stats1 = Metrics();
+  EXPECT_EQ(1, stats1.values["master/slave_unreachable_scheduled"]);
+  EXPECT_EQ(1, stats1.values["master/slave_unreachable_completed"]);
+  EXPECT_EQ(0, stats1.values["master/slave_removals"]);
+  EXPECT_EQ(0, stats1.values["master/slave_removals/reason_unhealthy"]);
+  EXPECT_EQ(0, stats1.values["master/slave_removals/reason_unregistered"]);
+
+  // HTTP endpoints (e.g., /state) should not reflect the removal of
+  // the slave yet.
+  Future response1 = process::http::get(
+  master.get()->pid,
+  "state",
+  None(),
+  createBasicAuthHeaders(DEFAULT_CREDENTIAL));
+
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response1);
+  AWAIT_EXPECT_RESPONSE_HEADER_EQ(APPLICATION_JSON, "Content-Type", response1);
+
+  Try parse1 = JSON::parse(response1.get().body);
+  Result array1 = parse1.get().find("slaves");
+  ASSERT_SOME(array1);
+  EXPECT_EQ(1u, array1.get().values.size());
+
+  // Allow the registry operation to return success. Note that we
+  // don't actually update the registry here, since the test doesn't
+  // require it.
+  promise.set(true);
+
+  Clock::settle();
+
+  // Metrics should be updated.
+  JSON::Object stats2 = Metrics();
+  EXPECT_EQ(1, stats2.values["master/slave_unreachable_scheduled"]);
+  EXPECT_EQ(1, stats2.values["master/slave_unreachable_completed"]);
+  EXPECT_EQ(1, 

[23/27] mesos git commit: Removed the "strict" flag from the registry operation interface.

2016-09-19 Thread vinodkone
Removed the "strict" flag from the registry operation interface.

This flag is now ignored by all registry operations, so this should
not result in a functional change.

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


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

Branch: refs/heads/master
Commit: ef9211f0e1a77896f0c5cee032dc032e9d3a0c5c
Parents: 9fa9961
Author: Neil Conway 
Authored: Mon Sep 19 15:49:19 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:49:19 2016 -0700

--
 src/master/maintenance.cpp |  9 +++--
 src/master/maintenance.hpp | 15 +++
 src/master/master.hpp  | 22 +-
 src/master/quota.cpp   |  6 ++
 src/master/quota.hpp   | 13 ++---
 src/master/registrar.cpp   |  7 ++-
 src/master/registrar.hpp   | 18 +++---
 src/master/weights.cpp |  4 +++-
 src/master/weights.hpp |  5 +
 9 files changed, 24 insertions(+), 75 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/ef9211f0/src/master/maintenance.cpp
--
diff --git a/src/master/maintenance.cpp b/src/master/maintenance.cpp
index 7da61c7..c07b815 100644
--- a/src/master/maintenance.cpp
+++ b/src/master/maintenance.cpp
@@ -44,8 +44,7 @@ UpdateSchedule::UpdateSchedule(
 
 Try UpdateSchedule::perform(
 Registry* registry,
-hashset* slaveIDs,
-bool strict)
+hashset* /*slaveIDs*/)
 {
   // Put the machines in the existing schedule into a set.
   hashset existing;
@@ -123,8 +122,7 @@ StartMaintenance::StartMaintenance(
 
 Try StartMaintenance::perform(
 Registry* registry,
-hashset* slaveIDs,
-bool strict)
+hashset* /*perform*/)
 {
   // Flip the mode of all targeted machines.
   bool changed = false;
@@ -153,8 +151,7 @@ StopMaintenance::StopMaintenance(
 
 Try StopMaintenance::perform(
 Registry* registry,
-hashset* slaveIDs,
-bool strict)
+hashset* /*slaveIDs*/)
 {
   // Delete the machine info entry of all targeted machines.
   // i.e. Transition them into `UP` mode.

http://git-wip-us.apache.org/repos/asf/mesos/blob/ef9211f0/src/master/maintenance.hpp
--
diff --git a/src/master/maintenance.hpp b/src/master/maintenance.hpp
index 87fbb2a..b1e176c 100644
--- a/src/master/maintenance.hpp
+++ b/src/master/maintenance.hpp
@@ -54,10 +54,7 @@ public:
   const mesos::maintenance::Schedule& _schedule);
 
 protected:
-  Try perform(
-  Registry* registry,
-  hashset* slaveIDs,
-  bool strict);
+  Try perform(Registry* registry, hashset* slaveIDs);
 
 private:
   const mesos::maintenance::Schedule schedule;
@@ -78,10 +75,7 @@ public:
   const google::protobuf::RepeatedPtrField& _ids);
 
 protected:
-  Try perform(
-  Registry* registry,
-  hashset* slaveIDs,
-  bool strict);
+  Try perform(Registry* registry, hashset* slaveIDs);
 
 private:
   hashset ids;
@@ -101,10 +95,7 @@ public:
   const google::protobuf::RepeatedPtrField& _ids);
 
 protected:
-  Try perform(
-  Registry* registry,
-  hashset* slaveIDs,
-  bool strict);
+  Try perform(Registry* registry, hashset* slaveIDs);
 
 private:
   hashset ids;

http://git-wip-us.apache.org/repos/asf/mesos/blob/ef9211f0/src/master/master.hpp
--
diff --git a/src/master/master.hpp b/src/master/master.hpp
index a051742..35db198 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -1929,10 +1929,7 @@ public:
   }
 
 protected:
-  virtual Try perform(
-  Registry* registry,
-  hashset* slaveIDs,
-  bool)
+  virtual Try perform(Registry* registry, hashset* slaveIDs)
   {
 // Check if this slave is currently admitted. This should only
 // happen if there is a slaveID collision, but that is extremely
@@ -1964,10 +1961,7 @@ public:
   }
 
 protected:
-  virtual Try perform(
-  Registry* registry,
-  hashset* slaveIDs,
-  bool)
+  virtual Try perform(Registry* registry, hashset* slaveIDs)
   {
 // As currently implemented, this should not be possible: the
 // master will only mark slaves unreachable that are currently
@@ -2017,10 +2011,7 @@ public:
   }
 
 protected:
-  virtual Try perform(
-  Registry* registry,
-  hashset* slaveIDs,
-  bool)
+  virtual Try perform(Registry* registry, hashset* slaveIDs)
   {
 // A slave might try to reregister that appears in the list of
 // admitted slaves. This can occur when the master fails over:
@@ -2073,7 +2064,7 @@ public:
 

[05/27] mesos git commit: Added `unreachable_time` to TaskStatus.

2016-09-19 Thread vinodkone
Added `unreachable_time` to TaskStatus.

This field contains the time at which the master marked an agent as
unreachable. It will only be set for status updates (including
reconciliation updates) that describe tasks running on unreachable
(e.g., partitioned) agents.

The intent is to help frameworks decide how to handle tasks running on
partitioned agents: since the framework might have missed the initial
TASK_LOST/TASK_UNREACHABLE status update (e.g., due to framework
downtime/failover), it might otherwise be difficult for frameworks to
determine how long an agent has been partitioned.

This unreachable timestamp is stored in the registry and loaded as part
of master recovery.

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


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

Branch: refs/heads/master
Commit: ac26919329cb137e09b1a6c8ef500dea2aa908eb
Parents: 06506fa
Author: Neil Conway 
Authored: Mon Sep 19 15:47:26 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:47:26 2016 -0700

--
 include/mesos/mesos.proto  |   6 ++
 include/mesos/v1/mesos.proto   |   6 ++
 src/common/protobuf_utils.cpp  |   7 +-
 src/common/protobuf_utils.hpp  |   3 +-
 src/master/master.cpp  |  53 --
 src/master/master.hpp  |  11 ++-
 src/tests/partition_tests.cpp  |  32 ++
 src/tests/reconciliation_tests.cpp | 168 
 src/tests/registrar_tests.cpp  |  19 +++-
 9 files changed, 289 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/ac269193/include/mesos/mesos.proto
--
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 7241c11..2209ea2 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -1636,6 +1636,12 @@ message TaskStatus {
   // Container related information that is resolved dynamically such as
   // network address.
   optional ContainerStatus container_status = 13;
+
+  // The time (according to the master's clock) when the agent where
+  // this task was running became unreachable. This is only set on
+  // status updates for tasks running on agents that are unreachable
+  // (e.g., partitioned away from the master).
+  optional TimeInfo unreachable_time = 14;
 }
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/ac269193/include/mesos/v1/mesos.proto
--
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index 04eaeb3..00c6234 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -1635,6 +1635,12 @@ message TaskStatus {
   // Container related information that is resolved dynamically such as
   // network address.
   optional ContainerStatus container_status = 13;
+
+  // The time (according to the master's clock) when the agent where
+  // this task was running became unreachable. This is only set on
+  // status updates for tasks running on agents that are unreachable
+  // (e.g., partitioned away from the master).
+  optional TimeInfo unreachable_time = 14;
 }
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/ac269193/src/common/protobuf_utils.cpp
--
diff --git a/src/common/protobuf_utils.cpp b/src/common/protobuf_utils.cpp
index ed3ac7f..5db4be4 100644
--- a/src/common/protobuf_utils.cpp
+++ b/src/common/protobuf_utils.cpp
@@ -102,7 +102,8 @@ StatusUpdate createStatusUpdate(
 const Option& executorId,
 const Option& healthy,
 const Option& labels,
-const Option& containerStatus)
+const Option& containerStatus,
+const Option unreachableTime)
 {
   StatusUpdate update;
 
@@ -150,6 +151,10 @@ StatusUpdate createStatusUpdate(
 status->mutable_container_status()->CopyFrom(containerStatus.get());
   }
 
+  if (unreachableTime.isSome()) {
+status->mutable_unreachable_time()->CopyFrom(unreachableTime.get());
+  }
+
   return update;
 }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/ac269193/src/common/protobuf_utils.hpp
--
diff --git a/src/common/protobuf_utils.hpp b/src/common/protobuf_utils.hpp
index 3324838..c5e5a9a 100644
--- a/src/common/protobuf_utils.hpp
+++ b/src/common/protobuf_utils.hpp
@@ -74,7 +74,8 @@ StatusUpdate createStatusUpdate(
 const Option& executorId = None(),
 const Option& healthy = None(),
 const Option& labels = None(),
-const Option& containerStatus = None());
+

[02/27] mesos git commit: Added test cases for PARTITION_AWARE behavior.

2016-09-19 Thread vinodkone
Added test cases for PARTITION_AWARE behavior.

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


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

Branch: refs/heads/master
Commit: 9ba79daead85cb84759582e1aacf41eea0d43054
Parents: 937c85f
Author: Neil Conway 
Authored: Mon Sep 19 15:47:09 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:47:09 2016 -0700

--
 src/tests/partition_tests.cpp | 514 -
 1 file changed, 510 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/9ba79dae/src/tests/partition_tests.cpp
--
diff --git a/src/tests/partition_tests.cpp b/src/tests/partition_tests.cpp
index 34622b3..efdb49e 100644
--- a/src/tests/partition_tests.cpp
+++ b/src/tests/partition_tests.cpp
@@ -179,7 +179,7 @@ TEST_P(PartitionTest, ReregisterSlavePartitionAware)
 
   // Allow the master to PING the slave, but drop all PONG messages
   // from the slave. Note that we don't match on the master / slave
-  // PIDs because it's actually the SlaveObserver Process that sends
+  // PIDs because it's actually the `SlaveObserver` process that sends
   // the pings.
   Future ping = FUTURE_MESSAGE(
   Eq(PingSlaveMessage().GetTypeName()), _, _);
@@ -326,7 +326,7 @@ TEST_P(PartitionTest, ReregisterSlaveNotPartitionAware)
 
   // Allow the master to PING the slave, but drop all PONG messages
   // from the slave. Note that we don't match on the master / slave
-  // PIDs because it's actually the SlaveObserver Process that sends
+  // PIDs because it's actually the `SlaveObserver` process that sends
   // the pings.
   Future ping = FUTURE_MESSAGE(
   Eq(PingSlaveMessage().GetTypeName()), _, _);
@@ -458,6 +458,512 @@ TEST_P(PartitionTest, ReregisterSlaveNotPartitionAware)
 }
 
 
+// This tests that an agent can reregister with the master after a
+// partition in which the master has failed over while the agent was
+// partitioned. We use one agent and two schedulers; one scheduler
+// enables the PARTITION_AWARE capability, while the other does
+// not. Both tasks should survive the reregistration of the partitioned
+// agent: we allow the non-partition-aware task to continue running for
+// backward compatibility with the "non-strict" Mesos 1.0 behavior.
+TEST_P(PartitionTest, PartitionedSlaveReregistrationMasterFailover)
+{
+  Clock::pause();
+
+  master::Flags masterFlags = CreateMasterFlags();
+  masterFlags.registry_strict = GetParam();
+
+  Try master = StartMaster(masterFlags);
+  ASSERT_SOME(master);
+
+  // Allow the master to PING the slave, but drop all PONG messages
+  // from the slave. Note that we don't match on the master / slave
+  // PIDs because it's actually the `SlaveObserver` process that sends
+  // the pings.
+  Future ping = FUTURE_MESSAGE(
+  Eq(PingSlaveMessage().GetTypeName()), _, _);
+
+  DROP_PROTOBUFS(PongSlaveMessage(), _, _);
+
+  slave::Flags slaveFlags = CreateSlaveFlags();
+  slaveFlags.resources = "cpus:2;mem:1024";
+
+  StandaloneMasterDetector detector(master.get()->pid);
+
+  Try slave = StartSlave(, slaveFlags);
+  ASSERT_SOME(slave);
+
+  // Connect the first scheduler (not PARTITION_AWARE).
+  MockScheduler sched1;
+  TestingMesosSchedulerDriver driver1(, );
+
+  EXPECT_CALL(sched1, registered(, _, _));
+
+  Future offers;
+  EXPECT_CALL(sched1, resourceOffers(, _))
+.WillOnce(FutureArg<1>())
+.WillRepeatedly(Return()); // Ignore subsequent offers.
+
+  driver1.start();
+
+  AWAIT_READY(offers);
+  ASSERT_FALSE(offers.get().empty());
+
+  Offer offer = offers.get()[0];
+
+  Resources taskResources = Resources::parse("cpus:1;mem:512").get();
+
+  EXPECT_TRUE(Resources(offer.resources()).contains(taskResources));
+
+  // Launch `task1` using `sched1`.
+  TaskInfo task1 = createTask(offer.slave_id(), taskResources, "sleep 60");
+
+  Future runningStatus1;
+  EXPECT_CALL(sched1, statusUpdate(, _))
+.WillOnce(FutureArg<1>());
+
+  Future statusUpdateAck1 = FUTURE_DISPATCH(
+  slave.get()->pid, ::_statusUpdateAcknowledgement);
+
+  driver1.launchTasks(offer.id(), {task1});
+
+  AWAIT_READY(runningStatus1);
+  EXPECT_EQ(TASK_RUNNING, runningStatus1.get().state());
+  EXPECT_EQ(task1.task_id(), runningStatus1.get().task_id());
+
+  const SlaveID slaveId = runningStatus1.get().slave_id();
+
+  AWAIT_READY(statusUpdateAck1);
+
+  // Connect the second scheduler (PARTITION_AWARE).
+  FrameworkInfo frameworkInfo2 = DEFAULT_FRAMEWORK_INFO;
+  frameworkInfo2.add_capabilities()->set_type(
+  

[19/27] mesos git commit: Added test case for registry GC race condition.

2016-09-19 Thread vinodkone
Added test case for registry GC race condition.

If GC occurs concurrently with another operation that changes the
registry (e.g., reregistration of an agent that is also going to be
removed by the GC operation), the GC might not be able to prune as
many entries as expected from the registry.

Along the way, this commit updates the master's logging to emit
a warning in this situation. It also corrects an inaccuracy: we
should report the number of agents we actually pruned from the
registry, not the number we _attempted_ to reclaim.

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


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

Branch: refs/heads/master
Commit: 47bd3e458b8cfcfd1ca0114419e56069da15453f
Parents: 6172da9
Author: Neil Conway 
Authored: Mon Sep 19 15:48:54 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 15:48:54 2016 -0700

--
 src/master/master.cpp |  28 +++-
 src/tests/partition_tests.cpp | 280 +
 2 files changed, 301 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/47bd3e45/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index beea5ff..e4499b5 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -1766,16 +1766,30 @@ void Master::_doRegistryGc(
   // `PruneUnreachable` registry operation should never fail.
   CHECK(registrarResult.get());
 
-  // TODO(neilc): Add a metric for # of agents discarded from the registry?
-  LOG(INFO) << "Garbage collected " << toRemove.size()
-<< " unreachable agents from the registry";
-
-  // Update in-memory state to be consistent with registry changes.
+  // Update in-memory state to be consistent with registry changes. If
+  // there was a concurrent registry operation that also modified the
+  // unreachable list (e.g., an agent in `toRemove` concurrently
+  // reregistered), entries in `toRemove` might not appear in
+  // `slaves.unreachable`.
+  //
+  // TODO(neilc): It would be nice to verify that the effect of these
+  // in-memory updates is equivalent to the changes made by the registry
+  // operation, but there isn't an easy way to do that.
+  size_t numRemoved = 0;
   foreach (const SlaveID& slave, toRemove) {
-// NOTE: `slave` might not appear in `slaves.unreachable` if there
-// have been concurrent changes.
+if (!slaves.unreachable.contains(slave)) {
+  LOG(WARNING) << "Failed to garbage collect " << slave
+   << " from the unreachable list";
+  continue;
+}
+
 slaves.unreachable.erase(slave);
+numRemoved++;
   }
+
+  // TODO(neilc): Add a metric for # of agents discarded from the registry?
+  LOG(INFO) << "Garbage collected " << numRemoved
+<< " unreachable agents from the registry";
 }
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/47bd3e45/src/tests/partition_tests.cpp
--
diff --git a/src/tests/partition_tests.cpp b/src/tests/partition_tests.cpp
index c860d2a..895a073 100644
--- a/src/tests/partition_tests.cpp
+++ b/src/tests/partition_tests.cpp
@@ -1881,6 +1881,286 @@ TEST_P(PartitionTest, RegistryGcByAge)
 }
 
 
+// This test checks what happens when these two operations race:
+// garbage collecting some slave IDs from the "unreachable" list in
+// the registry and moving a slave from the unreachable list back to
+// the admitted list. We add three agents to the unreachable list and
+// configure GC to only keep a single agent. Concurrently with GC
+// running, we arrange for one of those agents to reregister with the
+// master.
+TEST_P(PartitionTest, RegistryGcRace2)
+{
+  master::Flags masterFlags = CreateMasterFlags();
+  masterFlags.registry_strict = GetParam();
+  masterFlags.registry_max_agent_count = 1;
+
+  Clock::pause();
+
+  Try master = StartMaster(masterFlags);
+  ASSERT_SOME(master);
+
+  // Allow the master to PING the slave, but drop all PONG messages
+  // from the slave. Note that we don't match on the master / slave
+  // PIDs because it's actually the `SlaveObserver` process that sends
+  // the pings.
+  Future ping = FUTURE_MESSAGE(
+  Eq(PingSlaveMessage().GetTypeName()), _, _);
+
+  DROP_PROTOBUFS(PongSlaveMessage(), _, _);
+
+  Future slaveRegisteredMessage1 =
+FUTURE_PROTOBUF(SlaveRegisteredMessage(), _, _);
+
+  Owned detector1 = master.get()->createDetector();
+
+  Try slave1 = StartSlave(detector1.get());
+  ASSERT_SOME(slave1);
+
+  // Wait for the slave to 

[4/4] mesos git commit: Updated mesos-execute to support task groups.

2016-09-19 Thread vinodkone
Updated mesos-execute to support task groups.

Through this patch, mesos-execute supports running
task groups. Single task provided through command
line option is supported as well for backward
compatibility.

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


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

Branch: refs/heads/master
Commit: f162ade0f9d4c93129f935c54d100cc173579361
Parents: e84c2c4
Author: Abhishek Dasgupta 
Authored: Mon Sep 19 13:31:43 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 13:31:43 2016 -0700

--
 src/cli/execute.cpp | 299 ++-
 1 file changed, 221 insertions(+), 78 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/f162ade0/src/cli/execute.cpp
--
diff --git a/src/cli/execute.cpp b/src/cli/execute.cpp
index f2e28e4..f180672 100644
--- a/src/cli/execute.cpp
+++ b/src/cli/execute.cpp
@@ -62,6 +62,7 @@ using mesos::v1::CommandInfo;
 using mesos::v1::ContainerInfo;
 using mesos::v1::Credential;
 using mesos::v1::Environment;
+using mesos::v1::ExecutorInfo;
 using mesos::v1::FrameworkID;
 using mesos::v1::FrameworkInfo;
 using mesos::v1::Image;
@@ -69,6 +70,7 @@ using mesos::v1::Label;
 using mesos::v1::Labels;
 using mesos::v1::Offer;
 using mesos::v1::Resources;
+using mesos::v1::TaskGroupInfo;
 using mesos::v1::TaskID;
 using mesos::v1::TaskInfo;
 using mesos::v1::TaskState;
@@ -93,6 +95,46 @@ public:
 "master",
 "Mesos master (e.g., IP:PORT).");
 
+add(_group,
+"task_group",
+"The value could be a JSON-formatted string of `TaskGroupInfo` or a\n"
+"file path containing the JSON-formatted `TaskGroupInfo`. Path must\n"
+"be of the form `file:///path/to/file` or `/path/to/file`."
+"\n"
+"See the `TaskGroupInfo` message in `mesos.proto` for the expected\n"
+"format. NOTE: `agent_id` need not to be set.\n"
+"\n"
+"Example:\n"
+"{\n"
+"  \"tasks\":\n"
+" [\n"
+"{\n"
+" \"name\": \"Name of the task\",\n"
+" \"task_id\": {\"value\" : \"Id of the task\"},\n"
+" \"agent_id\": {\"value\" : \"\"},\n"
+" \"resources\": [{\n"
+"\"name\": \"cpus\",\n"
+"\"type\": \"SCALAR\",\n"
+"\"scalar\": {\n"
+"\"value\": 0.1\n"
+" },\n"
+"\"role\": \"*\"\n"
+"   },\n"
+"   {\n"
+"\"name\": \"mem\",\n"
+"\"type\": \"SCALAR\",\n"
+"\"scalar\": {\n"
+"\"value\": 32\n"
+" },\n"
+"\"role\": \"*\"\n"
+"  }],\n"
+" \"command\": {\n"
+"\"value\": \"sleep 1000\"\n"
+"   }\n"
+"   }\n"
+" ]\n"
+"}");
+
 add(,
 "name",
 "Name for the command.");
@@ -225,6 +267,7 @@ public:
 
   Option master;
   Option name;
+  Option task_group;
   bool shell;
   Option command;
   Option> environment;
@@ -255,14 +298,17 @@ public:
   const string& _master,
   const Option& _killAfter,
   const Option& _credential,
-  const TaskInfo& _task)
+  const Option& _task,
+  const Option _taskGroup)
 : state(DISCONNECTED),
   frameworkInfo(_frameworkInfo),
   master(_master),
   killAfter(_killAfter),
   credential(_credential),
   task(_task),
-  launched(false) {}
+  taskGroup(_taskGroup),
+  launched(false),
+  terminatedTaskCount(0) {}
 
   virtual ~CommandScheduler() {}
 
@@ -338,43 +384,106 @@ protected:
 foreach (const Offer& offer, offers) {
   Resources offered = offer.resources();
 
-  TaskInfo _task = task;
+  Resources requiredResources;
 
-  if (!launched && offered.flatten().contains(_task.resources())) {
-_task.mutable_agent_id()->MergeFrom(offer.agent_id());
+  CHECK_NE(task.isSome(), taskGroup.isSome())
+<< "Either task or task group should be set but not both";
 
-// Takes resources first from the specified role, then from '*'.
-Try flattened =
-  Resources(_task.resources()).flatten(frameworkInfo.role());
+  if (task.isSome()) {
+requiredResources = Resources(task.get().resources());
+  } else {
+foreach (const TaskInfo& _task, 

[2/4] mesos git commit: Added parse function in flags namespace for v1::TaskGroupInfo protobuf.

2016-09-19 Thread vinodkone
Added parse function in flags namespace for v1::TaskGroupInfo protobuf.

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


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

Branch: refs/heads/master
Commit: 9a9610d0444d97b7226012ec82f9a0eb59a48959
Parents: 4e8ac99
Author: Abhishek Dasgupta 
Authored: Mon Sep 19 13:31:34 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 13:31:34 2016 -0700

--
 src/common/parse.hpp | 16 
 1 file changed, 16 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/9a9610d0/src/common/parse.hpp
--
diff --git a/src/common/parse.hpp b/src/common/parse.hpp
index 51582a4..62a333c 100644
--- a/src/common/parse.hpp
+++ b/src/common/parse.hpp
@@ -15,6 +15,8 @@
 
 #include 
 
+#include 
+
 #include 
 
 #include 
@@ -88,6 +90,20 @@ inline Try parse(const std::string& 
value)
 }
 
 
+template <>
+inline Try parse(const std::string& value)
+{
+  // Convert from string or file to JSON.
+  Try json = parse(value);
+  if (json.isError()) {
+return Error(json.error());
+  }
+
+  // Convert from JSON to Protobuf.
+  return protobuf::parse(json.get());
+}
+
+
 // When the same variable is listed multiple times,
 // uses only the last value.
 template <>



[3/4] mesos git commit: Added << operator to stringify v1::TaskGroupInfo protobuf.

2016-09-19 Thread vinodkone
Added << operator to stringify v1::TaskGroupInfo protobuf.

This patch is needed as Flags add() function needs to stringify
v1::TaskGroupInfo before it is parsed to a variable of that
type.

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


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

Branch: refs/heads/master
Commit: e84c2c451dbb971ec91a70ef6c077b4a666ae311
Parents: 9a9610d
Author: Abhishek Dasgupta 
Authored: Mon Sep 19 13:31:38 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 19 13:31:38 2016 -0700

--
 include/mesos/v1/mesos.hpp | 5 +
 src/v1/mesos.cpp   | 6 ++
 2 files changed, 11 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/e84c2c45/include/mesos/v1/mesos.hpp
--
diff --git a/include/mesos/v1/mesos.hpp b/include/mesos/v1/mesos.hpp
index 936af77..f171458 100644
--- a/include/mesos/v1/mesos.hpp
+++ b/include/mesos/v1/mesos.hpp
@@ -285,6 +285,11 @@ std::ostream& operator<<(std::ostream& stream, const 
MachineID& machineId);
 std::ostream& operator<<(std::ostream& stream, const TaskInfo& task);
 
 
+std::ostream& operator<<(
+std::ostream& stream,
+const TaskGroupInfo& taskGroupInfo);
+
+
 std::ostream& operator<<(std::ostream& stream, const TaskState& state);
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/e84c2c45/src/v1/mesos.cpp
--
diff --git a/src/v1/mesos.cpp b/src/v1/mesos.cpp
index c6a8799..0f88aba 100644
--- a/src/v1/mesos.cpp
+++ b/src/v1/mesos.cpp
@@ -468,6 +468,12 @@ ostream& operator<<(ostream& stream, const TaskInfo& task)
 }
 
 
+ostream& operator<<(ostream& stream, const TaskGroupInfo& taskGroupInfo)
+{
+  return stream << taskGroupInfo.DebugString();
+}
+
+
 ostream& operator<<(ostream& stream, const TaskState& state)
 {
   return stream << TaskState_Name(state);



mesos git commit: Updated master validation for DOCKER ContainerInfo in TaskGroup.

2016-09-13 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master aeaec8940 -> 9f73082aa


Updated master validation for DOCKER ContainerInfo in TaskGroup.

DOCKER as ContainerInfo Type for both task group executor as well as
taskgroup task is currently not supported. Only MESOS as
ContainerInfo Type is supported. This patch is to validate that
TaskGroup executor and tasks do not use DOCKER ContainerInfo.

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


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

Branch: refs/heads/master
Commit: 9f73082aac613f7430b0d713a672bcae90198c47
Parents: aeaec89
Author: Abhishek Dasgupta 
Authored: Tue Sep 13 17:00:37 2016 -0700
Committer: Vinod Kone 
Committed: Tue Sep 13 17:00:37 2016 -0700

--
 src/master/validation.cpp |  15 ++-
 src/tests/master_validation_tests.cpp | 183 +
 2 files changed, 196 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/9f73082a/src/master/validation.cpp
--
diff --git a/src/master/validation.cpp b/src/master/validation.cpp
index 137b9f9..aa743d7 100644
--- a/src/master/validation.cpp
+++ b/src/master/validation.cpp
@@ -1011,8 +1011,14 @@ Option validateTask(
 return Error("'TaskInfo.executor' must not be set");
   }
 
-  if (task.has_container() && task.container().network_infos().size() > 0) {
-return Error("NetworkInfos must not be set on the task");
+  if (task.has_container()) {
+if (task.container().network_infos().size() > 0) {
+  return Error("NetworkInfos must not be set on the task");
+}
+
+if (task.container().type() == ContainerInfo::DOCKER) {
+  return Error("Docker ContainerInfo is not supported on the task");
+}
   }
 
   return None();
@@ -1072,6 +1078,11 @@ Option validateExecutor(
 return Error("Unknown executor type");
   }
 
+  if (executor.has_container() &&
+  executor.container().type() == ContainerInfo::DOCKER) {
+return Error("Docker ContainerInfo is not supported on the executor");
+  }
+
   const Resources& executorResources = executor.resources();
 
   // Validate minimal cpus and memory resources of executor.

http://git-wip-us.apache.org/repos/asf/mesos/blob/9f73082a/src/tests/master_validation_tests.cpp
--
diff --git a/src/tests/master_validation_tests.cpp 
b/src/tests/master_validation_tests.cpp
index 3a5cfa2..16c5773 100644
--- a/src/tests/master_validation_tests.cpp
+++ b/src/tests/master_validation_tests.cpp
@@ -1719,6 +1719,98 @@ TEST_F(TaskGroupValidationTest, 
TaskGroupAndExecutorUsesRevocableResources)
 }
 
 
+// Verifies that an executor with `ContainerInfo` set as DOCKER
+// is rejected during `TaskGroupInfo` validation.
+TEST_F(TaskGroupValidationTest, ExecutorUsesDockerContainerInfo)
+{
+  Try master = StartMaster();
+  ASSERT_SOME(master);
+
+  Owned detector = master.get()->createDetector();
+  Try slave = StartSlave(detector.get());
+  ASSERT_SOME(slave);
+
+  FrameworkInfo frameworkInfo = DEFAULT_FRAMEWORK_INFO;
+  frameworkInfo.mutable_id()->set_value("Test_Framework");
+
+  MockScheduler sched;
+  MesosSchedulerDriver driver(
+  , frameworkInfo, master.get()->pid, DEFAULT_CREDENTIAL);
+
+  EXPECT_CALL(sched, registered(, _, _))
+.Times(1);
+
+  Future offers;
+  EXPECT_CALL(sched, resourceOffers(, _))
+.WillOnce(FutureArg<1>())
+.WillRepeatedly(Return()); // Ignore subsequent offers.
+
+  driver.start();
+
+  AWAIT_READY(offers);
+  EXPECT_NE(0u, offers->size());
+
+  Offer offer = offers.get()[0];
+
+  // Create an invalid executor with `ContainerInfo` set as DOCKER.
+  ExecutorInfo executor;
+  executor.set_type(ExecutorInfo::DEFAULT);
+  executor.mutable_executor_id()->set_value("E");
+  executor.mutable_framework_id()->CopyFrom(frameworkInfo.id());
+  executor.mutable_container()->set_type(ContainerInfo::DOCKER);
+
+  TaskInfo task1;
+  task1.set_name("1");
+  task1.mutable_task_id()->set_value("1");
+  task1.mutable_slave_id()->MergeFrom(offer.slave_id());
+  task1.mutable_resources()->MergeFrom(offer.resources());
+
+  TaskInfo task2;
+  task2.set_name("2");
+  task2.mutable_task_id()->set_value("2");
+  task2.mutable_slave_id()->MergeFrom(offer.slave_id());
+  task2.mutable_resources()->MergeFrom(offer.resources());
+
+  TaskGroupInfo taskGroup;
+  taskGroup.add_tasks()->CopyFrom(task1);
+  taskGroup.add_tasks()->CopyFrom(task2);
+
+  Future task1Status;
+  Future task2Status;
+  EXPECT_CALL(sched, statusUpdate(, _))
+

mesos git commit: Fixed line wrap in executor.proto.

2016-09-13 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 2d18088c2 -> cde295a14


Fixed line wrap in executor.proto.


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

Branch: refs/heads/master
Commit: cde295a14df19854dda352ab90bad84631b78e16
Parents: 2d18088
Author: Vinod Kone 
Authored: Tue Sep 13 15:20:48 2016 -0700
Committer: Vinod Kone 
Committed: Tue Sep 13 15:20:48 2016 -0700

--
 include/mesos/v1/executor/executor.proto | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/cde295a1/include/mesos/v1/executor/executor.proto
--
diff --git a/include/mesos/v1/executor/executor.proto 
b/include/mesos/v1/executor/executor.proto
index 0783596..f661b71 100644
--- a/include/mesos/v1/executor/executor.proto
+++ b/include/mesos/v1/executor/executor.proto
@@ -199,7 +199,8 @@ message Event {
   // 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.
-  // See comments on `Event::Type` above on the reasoning behind this field 
being optional.
+  // See comments on `Event::Type` above on the reasoning behind this
+  // field being optional.
   optional Type type = 3;
 
   optional Subscribe subscribe = 4;



mesos git commit: Added meta tags in project website to support Twitter Cards.

2016-09-12 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 3562f95d0 -> 0b623f9d2


Added meta tags in project website to support Twitter Cards.

Slack depends on Twitter Summary Card to show small preview logo.
This patch followed https://dev.twitter.com/cards/types/summary to
add meta tags in project website template to support Twitter Cards.
For consistency, we completed the similar Open Graph meta tags which
supported by Facebook in this patch as well.

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


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

Branch: refs/heads/master
Commit: 0b623f9d2177f2456f3ade43a33920f3d2b70352
Parents: 3562f95
Author: haosdent huang 
Authored: Mon Sep 12 11:13:04 2016 -0700
Committer: Vinod Kone 
Committed: Mon Sep 12 11:13:04 2016 -0700

--
 site/source/layouts/basic.erb | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/0b623f9d/site/source/layouts/basic.erb
--
diff --git a/site/source/layouts/basic.erb b/site/source/layouts/basic.erb
index 253de38..7464e40 100755
--- a/site/source/layouts/basic.erb
+++ b/site/source/layouts/basic.erb
@@ -4,7 +4,26 @@
 
 <%= current_page.data.title %>
 
-
+
+
+
+
+
+http://mesos.apache.org/"/>
+http://mesos.apache.org/assets/img/mesos_logo_fb_preview.png"/>
+
+
+
+
+
+http://mesos.apache.org/assets/img/mesos_logo_fb_preview.png"/>
+
 
 
 



mesos git commit: Exposed metrics in scheduler library.

2016-09-09 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 89b43e003 -> 02f13c9aa


Exposed metrics in scheduler library.

Exposed metrics scheduler/event_queue_messages(size of
message queue) and scheduler/event_queue_dispatches
(size of dispatch queue) in scheduler library.

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


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

Branch: refs/heads/master
Commit: 02f13c9aaa87cf7d0f3f6596edc98d8726ba0d35
Parents: 89b43e0
Author: Abhishek Dasgupta 
Authored: Fri Sep 9 09:52:49 2016 +0200
Committer: Vinod Kone 
Committed: Fri Sep 9 09:52:49 2016 +0200

--
 src/scheduler/scheduler.cpp   | 44 +
 src/tests/scheduler_tests.cpp | 67 ++
 2 files changed, 111 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/02f13c9a/src/scheduler/scheduler.cpp
--
diff --git a/src/scheduler/scheduler.cpp b/src/scheduler/scheduler.cpp
index 276ed10..2ed6ce2 100644
--- a/src/scheduler/scheduler.cpp
+++ b/src/scheduler/scheduler.cpp
@@ -48,6 +48,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -141,6 +144,7 @@ public:
   const Flags& _flags)
 : ProcessBase(ID::generate("scheduler")),
   state(DISCONNECTED),
+  metrics(*this),
   contentType(_contentType),
   callbacks {connected, disconnected, received},
   credential(_credential),
@@ -711,6 +715,46 @@ private:
 UNREACHABLE();
   }
 
+  struct Metrics
+  {
+Metrics(const MesosProcess& mesosProcess)
+  : event_queue_messages(
+  "scheduler/event_queue_messages",
+  defer(mesosProcess, ::_event_queue_messages)),
+event_queue_dispatches(
+  "scheduler/event_queue_dispatches",
+  defer(mesosProcess,
+::_event_queue_dispatches))
+{
+  // TODO(dhamon): When we start checking the return value of 'add' we may
+  // get failures in situations where multiple SchedulerProcesses are 
active
+  // (ie, the fault tolerance tests). At that point we'll need MESOS-1285 
to
+  // be fixed and to use self().id in the metric name.
+  process::metrics::add(event_queue_messages);
+  process::metrics::add(event_queue_dispatches);
+}
+
+~Metrics()
+{
+  process::metrics::remove(event_queue_messages);
+  process::metrics::remove(event_queue_dispatches);
+}
+
+// Process metrics.
+process::metrics::Gauge event_queue_messages;
+process::metrics::Gauge event_queue_dispatches;
+  } metrics;
+
+  double _event_queue_messages()
+  {
+return static_cast(eventCount());
+  }
+
+  double _event_queue_dispatches()
+  {
+return static_cast(eventCount());
+  }
+
   // There can be multiple simulataneous ongoing (re-)connection attempts with
   // the master (e.g., the master failed over while an attempt was in 
progress).
   // This helps us in uniquely identifying the current connection instance and

http://git-wip-us.apache.org/repos/asf/mesos/blob/02f13c9a/src/tests/scheduler_tests.cpp
--
diff --git a/src/tests/scheduler_tests.cpp b/src/tests/scheduler_tests.cpp
index 931c185..b0ea0bb 100644
--- a/src/tests/scheduler_tests.cpp
+++ b/src/tests/scheduler_tests.cpp
@@ -36,6 +36,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 
@@ -71,6 +73,10 @@ using process::Owned;
 using process::PID;
 using process::Queue;
 
+using process::http::OK;
+
+using process::metrics::internal::MetricsProcess;
+
 using std::cout;
 using std::endl;
 using std::string;
@@ -312,6 +318,67 @@ TEST_P(SchedulerTest, MasterFailover)
 }
 
 
+// This test verifies that scheduler library also exposes metrics like
+// scheduler driver.
+TEST_P(SchedulerTest, MetricsEndpoint)
+{
+  Try master = StartMaster();
+  ASSERT_SOME(master);
+
+  auto scheduler = std::make_shared();
+
+  Future connected;
+  EXPECT_CALL(*scheduler, connected(_))
+.WillOnce(FutureSatisfy());
+
+  ContentType contentType = GetParam();
+
+  scheduler::TestV1Mesos mesos(master.get()->pid, contentType, scheduler);
+
+  AWAIT_READY(connected);
+
+  Future subscribed;
+  EXPECT_CALL(*scheduler, subscribed(_, _))
+.WillOnce(FutureArg<1>());
+
+  EXPECT_CALL(*scheduler, heartbeat(_))
+.WillRepeatedly(Return()); // Ignore heartbeats.
+
+  {
+Call call;
+call.set_type(Call::SUBSCRIBE);
+Call::Subscribe* subscribe = call.mutable_subscribe();
+

mesos git commit: Added documentation for Nvidia GPU support.

2016-09-08 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 207b3c0fa -> f6089bdf8


Added documentation for Nvidia GPU support.

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


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

Branch: refs/heads/master
Commit: f6089bdf848c5cbbacdd10228bc1d3b28a59a594
Parents: 207b3c0
Author: Kevin Klues 
Authored: Thu Sep 8 10:06:29 2016 +0200
Committer: Vinod Kone 
Committed: Thu Sep 8 10:07:20 2016 +0200

--
 docs/gpu-support.md | 365 +++
 docs/home.md|   1 +
 2 files changed, 366 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/f6089bdf/docs/gpu-support.md
--
diff --git a/docs/gpu-support.md b/docs/gpu-support.md
new file mode 100644
index 000..3c20f66
--- /dev/null
+++ b/docs/gpu-support.md
@@ -0,0 +1,365 @@
+---
+title: Apache Mesos - Nvidia GPU Support
+layout: documentation
+---
+
+# Nvidia GPU Support
+
+Mesos 1.0.0 added first-class support for Nvidia GPUs.
+
+## Overview
+Getting up and running with GPU support in Mesos is fairly
+straightforward once you know the steps necessary to make it work as
+expected. On one side, this includes setting the necessary agent flags
+to enumerate GPUs and advertise them to the Mesos master. On the other
+side, this includes setting the proper framework capabilities so that
+the Mesos master will actually include GPUs in the resource offers it
+sends to a framework. So long as all of these constraints are met,
+accepting offers that contain GPUs and launching tasks that consume
+them should be just as straightforward as launching a traditional task
+that only consumes CPUs, memory, and disk.
+
+As such, Mesos exposes GPUs as a simple `SCALAR` resource in the same
+way it always has for CPUs, memory, and disk. That is, a resource
+offer such as the following is now possible:
+
+cpus:8; mem:1024; disk:65536; gpus:4;
+
+However, unlike CPUs, memory, and disk, *only* whole numbers of GPUs
+can be selected. If a fractional amount is selected, launching the
+task will result in a `TASK_ERROR`.
+
+At the time of this writing, Nvidia GPU support is only available for
+tasks launched through the Mesos containerizer (i.e. no support exists
+for launching GPU capable tasks through the Docker containerizer).
+That said, the Mesos containerizer now supports running docker
+containers natively, so this limitation should not affect the vast
+majority of users.
+
+Moreover, we mimic the support provided by [nvidia-docker](
+https://github.com/NVIDIA/nvidia-docker/wiki/NVIDIA-driver) to
+automatically mount the proper Nvidia drivers and tools directly into
+your docker container. This means you can easily test your GPU enabled
+docker containers locally and deploy them to Mesos with the assurance
+that they will work without modification.
+
+In the following sections we walk through all of the flags and
+framework capabilities necessary to enable Nvidia GPU support in
+Mesos. We then show an example of setting up and running an example
+test cluster that launches tasks both with and without docker
+containers. Finally, we conclude with a step-by-step guide of how to
+install any necessary nvidia GPU drivers on your machine.
+
+## Agent Flags
+The following isolation flags are required to enable Nvidia GPU
+support on an agent.
+
+--isolation="cgroups/devices,gpu/nvidia"
+
+The `cgroups/devices` flag tells the agent to restrict access to a
+specific set of devices for each task that it launches (i.e. a subset
+of all devices listed in `/dev`). When used in conjunction with the
+`gpu/nvidia` flag, the `cgroups/devices` flag allows us to grant /
+revoke access to specific GPUs on a per-task basis.
+
+By default, all GPUs on an agent are automatically discovered and sent
+to the Mesos master as part of its resource offer. However, it may
+sometimes be necessary to restrict access to only a subset of the GPUs
+available an agent. This is useful, for example, if you want to
+exclude a specific GPU device because an unwanted Nvidia graphics card
+is listed alongside a more powerful set of GPUs. When this is
+required, the following additional agent flags can be used to
+accomplish this:
+
+--nvidia_gpu_devices=""
+
+--resources="gpus:"
+
+For the `--nvidia_gpu_devices` flag, you need to provide a comma
+separated list of GPUs, as determined by running `nvidia-smi` on the
+host where the agent is to be launched ([see
+below](#external-dependencies) for instructions on what external
+dependencies must be installed on these 

mesos git commit: Updated TaskGroupValidationTest.TaskUsesNetworkInfo use two tasks.

2016-09-06 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 24f85fa8a -> 19c9f09ea


Updated TaskGroupValidationTest.TaskUsesNetworkInfo use two tasks.

This patch updated TaskGroupValidationTest.TaskUsesNetworkInfo
to have two tasks in the task group.

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


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

Branch: refs/heads/master
Commit: 19c9f09ea45ed030a7f66ea4f8edac05be1fcca7
Parents: 24f85fa
Author: Guangya Liu 
Authored: Tue Sep 6 11:02:17 2016 +0200
Committer: Vinod Kone 
Committed: Tue Sep 6 11:02:17 2016 +0200

--
 src/tests/master_validation_tests.cpp | 54 +++---
 1 file changed, 34 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/19c9f09e/src/tests/master_validation_tests.cpp
--
diff --git a/src/tests/master_validation_tests.cpp 
b/src/tests/master_validation_tests.cpp
index d40b392..8bb4c37 100644
--- a/src/tests/master_validation_tests.cpp
+++ b/src/tests/master_validation_tests.cpp
@@ -1759,9 +1759,8 @@ TEST_F(TaskGroupValidationTest, 
ExecutorWithoutFrameworkId)
   driver.join();
 }
 
-
-// This test verifies that a task group task
-// that has `NetworkInfo` set is invalid.
+// Ensures that a task in a task group that has `NetworkInfo`
+// set is rejected during `TaskGroupInfo` validation.
 TEST_F(TaskGroupValidationTest, TaskUsesNetworkInfo)
 {
   Try master = StartMaster();
@@ -1795,21 +1794,31 @@ TEST_F(TaskGroupValidationTest, TaskUsesNetworkInfo)
   executor.set_type(ExecutorInfo::CUSTOM);
   executor.mutable_resources()->CopyFrom(resources);
 
-  // Create a task that has NetworkInfos set.
-  TaskInfo task;
-  task.set_name("test");
-  task.mutable_task_id()->set_value("1");
-  task.mutable_slave_id()->MergeFrom(offer.slave_id());
-  task.mutable_resources()->MergeFrom(resources);
-  task.mutable_container()->set_type(ContainerInfo::MESOS);
-  task.mutable_container()->add_network_infos();
+  // Create an invalid task that has NetworkInfos set.
+  TaskInfo task1;
+  task1.set_name("1");
+  task1.mutable_task_id()->set_value("1");
+  task1.mutable_slave_id()->MergeFrom(offer.slave_id());
+  task1.mutable_resources()->MergeFrom(resources);
+  task1.mutable_container()->set_type(ContainerInfo::MESOS);
+  task1.mutable_container()->add_network_infos();
+
+  // Create a valid task.
+  TaskInfo task2;
+  task2.set_name("2");
+  task2.mutable_task_id()->set_value("2");
+  task2.mutable_slave_id()->MergeFrom(offer.slave_id());
+  task2.mutable_resources()->MergeFrom(resources);
 
   TaskGroupInfo taskGroup;
-  taskGroup.add_tasks()->CopyFrom(task);
+  taskGroup.add_tasks()->CopyFrom(task1);
+  taskGroup.add_tasks()->CopyFrom(task2);
 
-  Future status;
+  Future task1Status;
+  Future task2Status;
   EXPECT_CALL(sched, statusUpdate(, _))
-.WillOnce(FutureArg<1>());
+.WillOnce(FutureArg<1>())
+.WillOnce(FutureArg<1>());
 
   Offer::Operation operation;
   operation.set_type(Offer::Operation::LAUNCH_GROUP);
@@ -1820,14 +1829,19 @@ TEST_F(TaskGroupValidationTest, TaskUsesNetworkInfo)
   launchGroup->mutable_executor()->CopyFrom(executor);
   launchGroup->mutable_task_group()->CopyFrom(taskGroup);
 
-  driver.acceptOffers({offers.get()[0].id()}, {operation});
+  driver.acceptOffers({offer.id()}, {operation});
 
-  AWAIT_READY(status);
-  EXPECT_EQ(task.task_id(), status->task_id());
-  EXPECT_EQ(TASK_ERROR, status->state());
-  EXPECT_EQ(TaskStatus::REASON_TASK_GROUP_INVALID, status->reason());
+  AWAIT_READY(task1Status);
+  EXPECT_EQ(task1.task_id(), task1Status->task_id());
+  EXPECT_EQ(TASK_ERROR, task1Status->state());
+  EXPECT_EQ(TaskStatus::REASON_TASK_GROUP_INVALID, task1Status->reason());
   EXPECT_EQ("Task '1' is invalid: NetworkInfos must not be set on the task",
-status->message());
+task1Status->message());
+
+  AWAIT_READY(task2Status);
+  EXPECT_EQ(task2.task_id(), task2Status->task_id());
+  EXPECT_EQ(TASK_ERROR, task2Status->state());
+  EXPECT_EQ(TaskStatus::REASON_TASK_GROUP_INVALID, task2Status->reason());
 
   driver.stop();
   driver.join();



mesos git commit: Merged function "socket_send_data" logical judgment.

2016-09-06 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 559a7c9e6 -> 24f85fa8a


Merged function "socket_send_data" logical judgment.

Not a functional change. Refactored the code to read better.

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


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

Branch: refs/heads/master
Commit: 24f85fa8a96fd174cd92ba3bce68f42fcc611d9f
Parents: 559a7c9
Author: Andy Pang 
Authored: Tue Sep 6 10:32:24 2016 +0200
Committer: Vinod Kone 
Committed: Tue Sep 6 10:32:24 2016 +0200

--
 3rdparty/libprocess/src/poll_socket.cpp | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/24f85fa8/3rdparty/libprocess/src/poll_socket.cpp
--
diff --git a/3rdparty/libprocess/src/poll_socket.cpp 
b/3rdparty/libprocess/src/poll_socket.cpp
index a45cc20..1cc5e88 100644
--- a/3rdparty/libprocess/src/poll_socket.cpp
+++ b/3rdparty/libprocess/src/poll_socket.cpp
@@ -187,13 +187,10 @@ Future socket_send_data(Socket socket, const 
char* data, size_t size)
   if (length < 0) {
 const string error = os::strerror(errno);
 VLOG(1) << "Socket error while sending: " << error;
+return Failure(ErrnoError("Socket send failed"));
   } else {
 VLOG(1) << "Socket closed while sending";
-  }
-  if (length == 0) {
 return length;
-  } else {
-return Failure(ErrnoError("Socket send failed"));
   }
 } else {
   CHECK(length > 0);



mesos git commit: Documentation: fix broken links.

2016-09-06 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master b4441a4cb -> 8075cd59c


Documentation: fix broken links.

\* Remove references to github.com (contains /blob/master..)
\* site Rakefile now handle links contained in HTML table

The link to github.com in \`submitting-a-patch.md\` was let on purpose
as it seems that some users submit PRs by directly editting the file.

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


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

Branch: refs/heads/master
Commit: 8075cd59c8577bb34a200a3ffddb8dc384fc2629
Parents: b4441a4
Author: Pierre Cheynier 
Authored: Tue Sep 6 10:21:28 2016 +0200
Committer: Vinod Kone 
Committed: Tue Sep 6 10:21:28 2016 +0200

--
 docs/authorization.md  | 29 ++---
 docs/docker-volume.md  |  3 +--
 docs/working-groups.md |  2 +-
 site/Rakefile  |  1 +
 4 files changed, 13 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/8075cd59/docs/authorization.md
--
diff --git a/docs/authorization.md b/docs/authorization.md
index 5456f1b..0abb05c 100644
--- a/docs/authorization.md
+++ b/docs/authorization.md
@@ -143,7 +143,7 @@ entries, each representing an authorizable action:
 
   register_frameworks
   Framework principal.
-  Resource roles of
+  Resource roles of
   the framework.
   
   (Re-)registering of frameworks.
@@ -164,24 +164,20 @@ entries, each representing an authorizable action:
   reserve_resources
   Framework principal or Operator username.
   Resource role of the reservation.
-  Reserving
-  resources.
-  
+  Reserving resources.
 
 
   unreserve_resources
   Framework principal or Operator username.
   Principals whose resources can be unreserved by the operator.
-  Unreserving
-  resources.
-  
+  Unreserving resources.
 
 
   create_volumes
   Framework principal or Operator username.
   Resource role of the volume.
   Creating
-  volumes.
+  volumes.
   
 
 
@@ -189,30 +185,27 @@ entries, each representing an authorizable action:
   Framework principal or Operator username.
   Principals whose volumes can be destroyed by the operator.
   Destroying
-  volumes.
+  volumes.
   
 
 
   get_quotas
   Operator username.
   Resource role whose quota status will be queried.
-  Querying quota
-  status.
-  
+  Querying quota status.
 
 
   update_quotas
   Operator username.
   Resource role whose quota will be updated.
-  Modifying quotas.
-  
+  Modifying quotas.
 
 
   view_roles
   Operator username.
   Resource roles whose information can be viewed by the operator.
-  Querying roles
-  and weights.
+  Querying roles
+  and weights.
   
 
 
@@ -226,9 +219,7 @@ entries, each representing an authorizable action:
   update_weights
   Operator username.
   Resource roles whose weights can be updated by the operator.
-  Updating
-  weights.
-  
+  Updating weights.
 
 
   view_frameworks

http://git-wip-us.apache.org/repos/asf/mesos/blob/8075cd59/docs/docker-volume.md
--
diff --git a/docs/docker-volume.md b/docs/docker-volume.md
index 2dbd044..d4bea06 100644
--- a/docs/docker-volume.md
+++ b/docs/docker-volume.md
@@ -365,8 +365,7 @@ Create another task to verify the file `myfile` was created 
successfully.
 --volumes=/myvolume.json
 ```
 
-Check the [sandbox
-](https://github.com/apache/mesos/blob/master/docs/sandbox.md#where-is-the-sandbox)
+Check the [sandbox](sandbox.md#where-is-it)
 for the second task to check the file `myfile` was created successfully.
 
 ```{.console}

http://git-wip-us.apache.org/repos/asf/mesos/blob/8075cd59/docs/working-groups.md
--
diff --git a/docs/working-groups.md b/docs/working-groups.md
index e9e1076..a03a9aa 100644
--- a/docs/working-groups.md
+++ b/docs/working-groups.md
@@ -46,7 +46,7 @@ layout: documentation
* [MESOS-2288](https://issues.apache.org/jira/browse/MESOS-2288)
* [MESOS-3302](https://issues.apache.org/jira/browse/MESOS-3302)
* [Scheduler HTTP API Design 
doc](https://docs.google.com/document/d/1pnIY_HckimKNvpqhKRhbc9eSItWNFT-priXh_urR-T0/edit?usp=sharing)
-   * [Scheduler HTTP API User 
doc](https://github.com/apache/mesos/blob/master/docs/scheduler_http_api.md)
+   * [Scheduler HTTP API User doc](scheduler-http-api.md)
* [Versioning HTTP 

mesos git commit: Updated Mesos version in getting started guide.

2016-09-05 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 3a5b5ade2 -> 3bb51c3f7


Updated Mesos version in getting started guide.

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


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

Branch: refs/heads/master
Commit: 3bb51c3f74aee302db7e5868ba338689a4c5fc8c
Parents: 3a5b5ad
Author: Joerg Schad 
Authored: Mon Sep 5 11:15:47 2016 +0200
Committer: Vinod Kone 
Committed: Mon Sep 5 11:15:47 2016 +0200

--
 docs/getting-started.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/3bb51c3f/docs/getting-started.md
--
diff --git a/docs/getting-started.md b/docs/getting-started.md
index ebe5270..de3fba4 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -11,8 +11,8 @@ There are different ways you can get Mesos:
 
 1\. Download the latest stable release from 
[Apache](http://mesos.apache.org/downloads/) (***Recommended***)
 
-$ wget http://www.apache.org/dist/mesos/0.28.2/mesos-0.28.2.tar.gz
-$ tar -zxf mesos-0.28.2.tar.gz
+$ wget http://www.apache.org/dist/mesos/1.0.1/mesos-1.0.1.tar.gz
+$ tar -zxf mesos-1.0.1.tar.gz
 
 2\. Clone the Mesos git 
[repository](https://git-wip-us.apache.org/repos/asf/mesos.git) (***Advanced 
Users Only***)
 



mesos git commit: Added test case TaskGroupValidationTest.TaskUsesExecutor.

2016-08-26 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 47c2607f1 -> bda9a5087


Added test case TaskGroupValidationTest.TaskUsesExecutor.

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


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

Branch: refs/heads/master
Commit: bda9a5087a2bc89d100f8fbc45cdc52cb52b6b6e
Parents: 47c2607
Author: Guangya Liu 
Authored: Fri Aug 26 18:04:17 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 26 18:04:17 2016 -0700

--
 src/tests/master_validation_tests.cpp | 88 ++
 1 file changed, 88 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/bda9a508/src/tests/master_validation_tests.cpp
--
diff --git a/src/tests/master_validation_tests.cpp 
b/src/tests/master_validation_tests.cpp
index 1df76f5..e440ff3 100644
--- a/src/tests/master_validation_tests.cpp
+++ b/src/tests/master_validation_tests.cpp
@@ -1814,6 +1814,94 @@ TEST_F(TaskGroupValidationTest, TaskUsesNetworkInfo)
   driver.join();
 }
 
+
+// Ensures that a task in a task group with an executor
+// is rejected during `TaskGroupInfo` validation.
+TEST_F(TaskGroupValidationTest, TaskUsesExecutor)
+{
+  Try master = StartMaster();
+  ASSERT_SOME(master);
+
+  Owned detector = master.get()->createDetector();
+  Try slave = StartSlave(detector.get());
+  ASSERT_SOME(slave);
+
+  MockScheduler sched;
+  MesosSchedulerDriver driver(
+  , DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
+
+  EXPECT_CALL(sched, registered(, _, _))
+.Times(1);
+
+  Future offers;
+  EXPECT_CALL(sched, resourceOffers(, _))
+.WillOnce(FutureArg<1>())
+.WillRepeatedly(Return()); // Ignore subsequent offers.
+
+  driver.start();
+
+  AWAIT_READY(offers);
+  EXPECT_NE(0u, offers->size());
+  Offer offer = offers.get()[0];
+
+  Resources resources = Resources::parse("cpus:1;mem:512;disk:32").get();
+
+  ExecutorInfo executor(DEFAULT_EXECUTOR_INFO);
+  executor.set_type(ExecutorInfo::CUSTOM);
+  executor.mutable_resources()->CopyFrom(resources);
+
+  // Create an invalid task that has executor.
+  TaskInfo task1;
+  task1.set_name("1");
+  task1.mutable_task_id()->set_value("1");
+  task1.mutable_slave_id()->MergeFrom(offer.slave_id());
+  task1.mutable_resources()->MergeFrom(resources);
+  task1.mutable_executor()->MergeFrom(executor);
+
+  // Create a valid task.
+  TaskInfo task2;
+  task2.set_name("2");
+  task2.mutable_task_id()->set_value("2");
+  task2.mutable_slave_id()->MergeFrom(offer.slave_id());
+  task1.mutable_resources()->MergeFrom(resources);
+
+  TaskGroupInfo taskGroup;
+  taskGroup.add_tasks()->CopyFrom(task1);
+  taskGroup.add_tasks()->CopyFrom(task2);
+
+  Future task1Status;
+  Future task2Status;
+  EXPECT_CALL(sched, statusUpdate(, _))
+.WillOnce(FutureArg<1>())
+.WillOnce(FutureArg<1>());
+
+  Offer::Operation operation;
+  operation.set_type(Offer::Operation::LAUNCH_GROUP);
+
+  Offer::Operation::LaunchGroup* launchGroup =
+operation.mutable_launch_group();
+
+  launchGroup->mutable_executor()->CopyFrom(executor);
+  launchGroup->mutable_task_group()->CopyFrom(taskGroup);
+
+  driver.acceptOffers({offer.id()}, {operation});
+
+  AWAIT_READY(task1Status);
+  EXPECT_EQ(task1.task_id(), task1Status->task_id());
+  EXPECT_EQ(TASK_ERROR, task1Status->state());
+  EXPECT_EQ(TaskStatus::REASON_TASK_GROUP_INVALID, task1Status->reason());
+  EXPECT_EQ("Task '1' is invalid: 'TaskInfo.executor' must not be set",
+task1Status->message());
+
+  AWAIT_READY(task2Status);
+  EXPECT_EQ(task2.task_id(), task2Status->task_id());
+  EXPECT_EQ(TASK_ERROR, task2Status->state());
+  EXPECT_EQ(TaskStatus::REASON_TASK_GROUP_INVALID, task2Status->reason());
+
+  driver.stop();
+  driver.join();
+}
+
 } // namespace tests {
 } // namespace internal {
 } // namespace mesos {



[5/6] mesos git commit: Removed a no-longer-relevant test.

2016-08-26 Thread vinodkone
Removed a no-longer-relevant test.

The behavior this test is trying to validate (slaves receive a
`ShutdownMessage` if they attempt to reregister after failing health
checks) will be changed shortly. Moreover, the new behavior is already
covered by other test cases.

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


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

Branch: refs/heads/master
Commit: 0b90cccaca0069a2e2fff54d1424d205659346a3
Parents: 93016d3
Author: Neil Conway 
Authored: Fri Aug 26 14:48:39 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 26 14:49:49 2016 -0700

--
 src/tests/slave_recovery_tests.cpp | 142 
 1 file changed, 142 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/0b90ccca/src/tests/slave_recovery_tests.cpp
--
diff --git a/src/tests/slave_recovery_tests.cpp 
b/src/tests/slave_recovery_tests.cpp
index 9ff19f4..3c69e56 100644
--- a/src/tests/slave_recovery_tests.cpp
+++ b/src/tests/slave_recovery_tests.cpp
@@ -3186,148 +3186,6 @@ TYPED_TEST(SlaveRecoveryTest, SchedulerFailover)
 }
 
 
-// The purpose of this test is to ensure that during a network
-// partition, the master will remove a partitioned slave. When the
-// partition is removed, the slave will receive a ShutdownMessage.
-// When the slave starts again on the same host, we verify that the
-// slave will not try to reregister itself with the master. It will
-// register itself with the master and get a new slave id.
-TYPED_TEST(SlaveRecoveryTest, PartitionedSlave)
-{
-  master::Flags masterFlags = this->CreateMasterFlags();
-  Try master = this->StartMaster(masterFlags);
-  ASSERT_SOME(master);
-
-  // Set these expectations up before we spawn the slave so that we
-  // don't miss the first PING.
-  Future ping = FUTURE_MESSAGE(
-  Eq(PingSlaveMessage().GetTypeName()), _, _);
-
-  // Drop all the PONGs to simulate slave partition.
-  DROP_PROTOBUFS(PongSlaveMessage(), _, _);
-
-  slave::Flags flags = this->CreateSlaveFlags();
-
-  Fetcher fetcher;
-
-  Try _containerizer = TypeParam::create(flags, true, );
-  ASSERT_SOME(_containerizer);
-  Owned containerizer(_containerizer.get());
-
-  Owned detector = master.get()->createDetector();
-
-  Try slave =
-this->StartSlave(detector.get(), containerizer.get(), flags);
-  ASSERT_SOME(slave);
-
-  // Enable checkpointing for the framework.
-  FrameworkInfo frameworkInfo = DEFAULT_FRAMEWORK_INFO;
-  frameworkInfo.set_checkpoint(true);
-
-  MockScheduler sched;
-  MesosSchedulerDriver driver(
-  , frameworkInfo, master.get()->pid, DEFAULT_CREDENTIAL);
-
-  EXPECT_CALL(sched, registered(_, _, _));
-
-  Future offers;
-  EXPECT_CALL(sched, resourceOffers(, _))
-.WillOnce(FutureArg<1>())
-.WillRepeatedly(Return());
-
-  driver.start();
-
-  AWAIT_READY(offers);
-  EXPECT_NE(0u, offers.get().size());
-
-  // Long running task.
-  TaskInfo task = createTask(offers.get()[0], "sleep 1000");
-
-  EXPECT_CALL(sched, statusUpdate(_, _));
-
-  Future _statusUpdateAcknowledgement =
-FUTURE_DISPATCH(_, ::_statusUpdateAcknowledgement);
-
-  driver.launchTasks(offers.get()[0].id(), {task});
-
-  // Wait for the ACK to be checkpointed.
-  AWAIT_READY(_statusUpdateAcknowledgement);
-
-  Future shutdownMessage =
-FUTURE_PROTOBUF(ShutdownMessage(), _, slave.get()->pid);
-
-  Future slaveLost;
-  EXPECT_CALL(sched, slaveLost(, _))
-.WillOnce(FutureSatisfy());
-
-  Future status;
-  EXPECT_CALL(sched, statusUpdate(, _))
-.WillOnce(FutureArg<1>());
-
-  Future executorTerminated =
-FUTURE_DISPATCH(_, ::executorTerminated);
-
-  Clock::pause();
-
-  // Now, induce a partition of the slave by having the master
-  // timeout the slave.
-  size_t pings = 0;
-  while (true) {
-AWAIT_READY(ping);
-pings++;
-if (pings == masterFlags.max_agent_ping_timeouts) {
-  break;
-}
-ping = FUTURE_MESSAGE(Eq(PingSlaveMessage().GetTypeName()), _, _);
-Clock::advance(masterFlags.agent_ping_timeout);
-  }
-
-  Clock::advance(masterFlags.agent_ping_timeout);
-
-  // The master will notify the framework that the slave was lost.
-  AWAIT_READY(slaveLost);
-
-  // The master will have notified the framework of the lost task.
-  AWAIT_READY(status);
-
-  EXPECT_EQ(TASK_LOST, status.get().state());
-  EXPECT_EQ(TaskStatus::SOURCE_MASTER, status.get().source());
-  EXPECT_EQ(TaskStatus::REASON_SLAVE_REMOVED, status.get().reason());
-
-  // Wait for the master to attempt to shut down the slave.
-  AWAIT_READY(shutdownMessage);
-
- 

[1/6] mesos git commit: Added new TaskState values and PARTITION_AWARE capability.

2016-08-26 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 8ab7a6f4d -> 8330e99f6


Added new TaskState values and PARTITION_AWARE capability.

TASK_DROPPED, TASK_UNREACHABLE, TASK_GONE, TASK_GONE_BY_OPERATOR, and
TASK_UNKNOWN. These values are intended to replace the existing
TASK_LOST state by offering more fine-grained information on the
current state of a task. These states will only be sent to frameworks
that opt into this new behavior via the PARTITION_AWARE capability.

Note that this commit doesn't add a master metric for the TASK_UNKNOWN
status, because this is a "default" status reported when the master has
no knowledge of a particular task/agent ID. Hence the number of
"unknown" tasks at any given time is not a well-defined metric.

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


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

Branch: refs/heads/master
Commit: c3268cad3621a6373ff331d882393b2ada064f4b
Parents: 8ab7a6f
Author: Neil Conway 
Authored: Fri Aug 26 14:47:53 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 26 14:47:53 2016 -0700

--
 include/mesos/mesos.proto| 59 ++-
 include/mesos/v1/mesos.proto | 59 ++-
 src/common/protobuf_utils.cpp|  8 -
 src/examples/disk_full_framework.cpp |  5 +++
 src/master/http.cpp  | 19 +-
 src/master/master.cpp| 42 ++
 src/master/metrics.cpp   | 16 +
 src/master/metrics.hpp   |  4 +++
 src/tests/master_tests.cpp   |  4 ++-
 9 files changed, 205 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/c3268cad/include/mesos/mesos.proto
--
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index a93db55..7fbcdf0 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -297,6 +297,24 @@ message FrameworkInfo {
   // Receive offers with resources that are shared.
   // TODO(anindya_sinha): This is currently a no-op.
   SHARED_RESOURCES = 4;
+
+  // Indicates that the framework is prepared to handle the
+  // following TaskStates: TASK_UNREACHABLE, TASK_DROPPED,
+  // TASK_GONE, TASK_GONE_BY_OPERATOR, and TASK_UNKNOWN.
+  //
+  // With this capability, frameworks can define how they would
+  // like to handle partitioned tasks. Frameworks will receive
+  // TASK_UNREACHABLE for tasks on partitioned agents; if/when the
+  // partitioned agent reregisters, the task will not be killed.
+  // Frameworks that enable this capability will never receive
+  // TASK_LOST; they will receive one of the most specific task
+  // statuses listed above instead.
+  //
+  // Without this capability, frameworks will receive TASK_LOST
+  // for tasks on partitioned agents; such tasks will be killed by
+  // Mesos when the agent reregisters (unless the master has
+  // failed over).
+  PARTITION_AWARE = 5;
 }
 
 // Enum fields should be optional, see: MESOS-4997.
@@ -1489,8 +1507,47 @@ enum TaskState {
   TASK_FINISHED = 2; // TERMINAL: The task finished successfully.
   TASK_FAILED = 3;   // TERMINAL: The task failed to finish successfully.
   TASK_KILLED = 4;   // TERMINAL: The task was killed by the executor.
-  TASK_LOST = 5; // TERMINAL: The task failed but can be rescheduled.
   TASK_ERROR = 7;// TERMINAL: The task description contains an error.
+
+  // This is only sent when the framework does NOT opt-in to the
+  // PARTITION_AWARE capability.
+  TASK_LOST = 5; // TERMINAL: The task failed but can be rescheduled.
+
+  // The following task statuses are only sent when the framework
+  // opts-in to the PARTITION_AWARE capability.
+
+  // The task failed to launch because of a transient error. The
+  // task's executor never started running. Unlike TASK_ERROR, the
+  // task description is valid -- attempting to launch the task again
+  // may be successful. This is a terminal state.
+  TASK_DROPPED = 9;
+
+  // The task was running on an agent that has lost contact with the
+  // master, typically due to a network failure or partition. The task
+  // may or may not still be running.
+  TASK_UNREACHABLE = 10;
+
+  // The task was running on an agent that has been shutdown (e.g.,
+  // the agent become partitioned, rebooted, and then reconnected to
+  // the master; any tasks running before the reboot will transition
+  // from UNREACHABLE to GONE). The task is no longer running. This 

[3/6] mesos git commit: Added registrar operations for marking agents (un-)reachable.

2016-08-26 Thread vinodkone
Added registrar operations for marking agents (un-)reachable.

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


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

Branch: refs/heads/master
Commit: af496f3a80da9a8e7961fb62f839aacf1658222e
Parents: 5405914
Author: Neil Conway 
Authored: Fri Aug 26 14:48:07 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 26 14:48:07 2016 -0700

--
 src/master/master.hpp | 118 -
 src/tests/registrar_tests.cpp |  95 -
 2 files changed, 183 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/af496f3a/src/master/master.hpp
--
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 6decff6..b118293 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -1891,7 +1891,7 @@ private:
 };
 
 
-// Implementation of slave admission Registrar operation.
+// Add a new slave to the list of admitted slaves.
 class AdmitSlave : public Operation
 {
 public:
@@ -1906,7 +1906,7 @@ protected:
   hashset* slaveIDs,
   bool strict)
   {
-// Check and see if this slave already exists.
+// Check and see if this slave is currently admitted.
 if (slaveIDs->contains(info.id())) {
   if (strict) {
 return Error("Agent already admitted");
@@ -1915,6 +1915,9 @@ protected:
   }
 }
 
+// TODO(neilc): Check if the slave appears in the list of
+// `unreachable` slaves in the registry?
+
 Registry::Slave* slave = registry->mutable_slaves()->add_slaves();
 slave->mutable_info()->CopyFrom(info);
 slaveIDs->insert(info.id());
@@ -1926,6 +1929,117 @@ private:
 };
 
 
+// Move a slave from the list of admitted slaves to the list of
+// unreachable slaves.
+class MarkSlaveUnreachable : public Operation
+{
+public:
+  explicit MarkSlaveUnreachable(const SlaveInfo& _info) : info(_info) {
+CHECK(info.has_id()) << "SlaveInfo is missing the 'id' field";
+  }
+
+protected:
+  virtual Try perform(
+  Registry* registry,
+  hashset* slaveIDs,
+  bool strict)
+  {
+// As currently implemented, this should not be possible: the
+// master will only mark slaves unreachable that are currently
+// admitted.
+if (!slaveIDs->contains(info.id())) {
+  return Error("Agent not yet admitted");
+}
+
+for (int i = 0; i < registry->slaves().slaves().size(); i++) {
+  const Registry::Slave& slave = registry->slaves().slaves(i);
+
+  if (slave.info().id() == info.id()) {
+registry->mutable_slaves()->mutable_slaves()->DeleteSubrange(i, 1);
+slaveIDs->erase(info.id());
+
+Registry::UnreachableSlave* unreachable =
+  registry->mutable_unreachable()->add_slaves();
+
+unreachable->mutable_id()->CopyFrom(info.id());
+unreachable->mutable_timestamp()->CopyFrom(protobuf::getCurrentTime());
+
+return true; // Mutation.
+  }
+}
+
+// Should not happen.
+return Error("Failed to find agent " + stringify(info.id()));
+  }
+
+private:
+  const SlaveInfo info;
+};
+
+
+// Add a slave back to the list of admitted slaves. The slave will
+// typically be in the "unreachable" list; if so, it is removed from
+// that list. The slave might also be in the "admitted" list already.
+// Finally, the slave might be in neither the "unreachable" or
+// "admitted" lists, if its metadata has been garbage collected from
+// the registry.
+class MarkSlaveReachable : public Operation
+{
+public:
+  explicit MarkSlaveReachable(const SlaveInfo& _info) : info(_info) {
+CHECK(info.has_id()) << "SlaveInfo is missing the 'id' field";
+  }
+
+protected:
+  virtual Try perform(
+  Registry* registry,
+  hashset* slaveIDs,
+  bool strict)
+  {
+// A slave might try to reregister that appears in the list of
+// admitted slaves. This can occur when the master fails over:
+// agents will usually attempt to reregister with the new master
+// before they are marked unreachable. In this situation, the
+// registry is already in the correct state, so no changes are
+// needed.
+if (slaveIDs->contains(info.id())) {
+  return false; // No mutation.
+}
+
+// Check whether the slave is in the unreachable list.
+// TODO(neilc): Optimize this to avoid linear scan.
+bool found = false;
+for (int i = 0; i < registry->unreachable().slaves().size(); i++) {
+  const Registry::UnreachableSlave& slave =
+registry->unreachable().slaves(i);
+
+  if (slave.id() == 

[4/6] mesos git commit: Renamed metrics from "slave_shutdowns" to "slave_unreachable".

2016-08-26 Thread vinodkone
Renamed metrics from "slave_shutdowns" to "slave_unreachable".

The master will shortly be changed to no longer shutdown unhealthy
agents, so the previous metric name is no longer accurate. The old
metric names have been kept for backwards compatibility, but they
are no longer updated (i.e., they will always be set to zero).

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


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

Branch: refs/heads/master
Commit: 93016d37bf8833d7a78ada9c4ec59a374419ba35
Parents: af496f3
Author: Neil Conway 
Authored: Fri Aug 26 14:48:16 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 26 14:49:43 2016 -0700

--
 CHANGELOG | 14 ++
 docs/monitoring.md| 24 +---
 src/master/master.cpp | 13 ++---
 src/master/metrics.cpp| 16 +++-
 src/master/metrics.hpp|  7 +++
 src/tests/master_tests.cpp|  4 ++--
 src/tests/partition_tests.cpp |  2 ++
 7 files changed, 59 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/93016d37/CHANGELOG
--
diff --git a/CHANGELOG b/CHANGELOG
index ffeaf10..587d843 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,17 @@
+Release Notes - Mesos - Version 1.1.0 (WIP)
+
+This release contains the following new features:
+
+Deprecations:
+
+  * The following metrics are deprecated and will be removed in Mesos 1.4:
+master/slave_shutdowns_scheduled, master/slave_shutdowns_canceled, and
+slave_shutdowns_completed. As of Mesos 1.1.0, these metrics will always be
+zero. The following new metrics have been introduced as replacements:
+master/slave_unreachable_scheduled, master/slave_unreachable_canceled,
+and master/slave_unreachable_completed.
+
+
 Release Notes - Mesos - Version 1.0.1
 
 * This is a bug fix release.

http://git-wip-us.apache.org/repos/asf/mesos/blob/93016d37/docs/monitoring.md
--
diff --git a/docs/monitoring.md b/docs/monitoring.md
index e19ecd0..f32ee40 100644
--- a/docs/monitoring.md
+++ b/docs/monitoring.md
@@ -347,30 +347,32 @@ unhealthy or that they are not able to connect to the 
elected master.
 
 
   
-  master/slave_shutdowns_scheduled
+  master/slave_unreachable_scheduled
   
   Number of agents which have failed their health check and are scheduled
-  to be removed. They will not be immediately removed due to the Agent
-  Removal Rate-Limit, but master/slave_shutdowns_completed
+  to be marked unreachable. They will not be marked unreachable 
immediately due to the Agent
+  Removal Rate-Limit, but master/slave_unreachable_completed
   will start increasing as they do get removed.
   Counter
 
 
   
-  master/slave_shutdowns_canceled
+  master/slave_unreachable_canceled
   
-  Number of cancelled agent shutdowns. This happens when the agent removal
-  rate limit allows for an agent to reconnect and send a PONG
-  to the master before being removed.
+  Number of times that an agent was due to be marked unreachable but this
+  transition was cancelled. This happens when the agent removal rate limit
+  is enabled and the agent sends a PONG response message to 
the
+  master before the rate limit allows the agent to be marked 
unreachable.
   Counter
 
 
   
-  master/slave_shutdowns_completed
+  master/slave_unreachable_completed
   
-  Number of agents that failed their health check. These are agents which
-  were not heard from despite the agent-removal rate limit, and have been
-  removed from the master's agent registry.
+  Number of agents that were marked as unreachable because they failed
+  health checks. These are agents which were not heard from despite the
+  agent-removal rate limit, and have been marked as unreachable in the
+  master's agent registry.
   Counter
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/93016d37/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index ae38c1a..2b4aff8 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -233,7 +233,7 @@ protected:
 }
 
 shuttingDown = acquire.onAny(defer(self(), ::_shutdown));
-++metrics->slave_shutdowns_scheduled;
+++metrics->slave_unreachable_scheduled;
   }
 
   void _shutdown()
@@ -248,7 +248,7 @@ protected:
 

[2/6] mesos git commit: Added a list of "unreachable" agents to the registry.

2016-08-26 Thread vinodkone
Added a list of "unreachable" agents to the registry.

These are agents that have failed health checks.

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


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

Branch: refs/heads/master
Commit: 540591407729ae9eaf81f68cb025b181782c5b99
Parents: c3268ca
Author: Neil Conway 
Authored: Fri Aug 26 14:48:03 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 26 14:48:03 2016 -0700

--
 src/master/registry.proto | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/54059140/src/master/registry.proto
--
diff --git a/src/master/registry.proto b/src/master/registry.proto
index 9bf9998..03c896c 100644
--- a/src/master/registry.proto
+++ b/src/master/registry.proto
@@ -41,6 +41,17 @@ message Registry {
 repeated Slave slaves = 1;
   }
 
+  message UnreachableSlave {
+required SlaveID id = 1;
+
+// The time when the slave was marked unreachable by the master.
+required TimeInfo timestamp = 2;
+  }
+
+  message UnreachableSlaves {
+repeated UnreachableSlave slaves = 1;
+  }
+
   message Machine {
 required MachineInfo info = 1;
   }
@@ -60,9 +71,13 @@ message Registry {
   // Most recent leading master.
   optional Master master = 1;
 
-  // All admitted slaves.
+  // All admitted (healthy) slaves.
   optional Slaves slaves = 2;
 
+  // Slaves that have failed health checks. They may or may not still
+  // be running.
+  optional UnreachableSlaves unreachable = 7;
+
   // Holds a list of machines and some status information about each.
   // See comments in `MachineInfo` for more information.
   optional Machines machines = 3;



[6/6] mesos git commit: Made a few minor tweaks to comments.

2016-08-26 Thread vinodkone
Made a few minor tweaks to comments.

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


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

Branch: refs/heads/master
Commit: 8330e99f6e9842ec665414fc5f497e81ef7ed7b4
Parents: 0b90ccc
Author: Neil Conway 
Authored: Fri Aug 26 14:48:47 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 26 14:49:49 2016 -0700

--
 src/messages/messages.proto | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/8330e99f/src/messages/messages.proto
--
diff --git a/src/messages/messages.proto b/src/messages/messages.proto
index 17bb352..7d65be1 100644
--- a/src/messages/messages.proto
+++ b/src/messages/messages.proto
@@ -416,9 +416,12 @@ message RegisterSlaveMessage {
 
 
 /**
- * Registers the agent with the master.
- * This is used when the agent has previously registered and
- * the master changes to a newly elected master.
+ * Reregisters the agent with the master.
+ *
+ * This is used when the agent has previously registered and the agent
+ * has reason to suspect that it should re-establish its connection
+ * (e.g., a new master is elected or the agent hasn't seen a ping from
+ * the master for a long period of time).
  *
  * If registration fails, a `ShutdownMessage` is sent to the agent.
  * Failure conditions are documented inline in Master::reregisterSlave.



svn commit: r1757930 - in /mesos/site/publish: api/latest/c++/ documentation/external-containerizer/ documentation/latest/external-containerizer/

2016-08-26 Thread vinodkone
Author: vinodkone
Date: Fri Aug 26 21:46:06 2016
New Revision: 1757930

URL: http://svn.apache.org/viewvc?rev=1757930=rev
Log:
Removed missing files.

Removed:
mesos/site/publish/api/latest/c++/classSetnsTestHelper-members.html
mesos/site/publish/api/latest/c++/classSetnsTestHelper.html
mesos/site/publish/api/latest/c++/classSetnsTestHelper.png

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1HealthChecker-members.html

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1HealthChecker.html

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1HealthCheckerProcess-members.html

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1HealthCheckerProcess.html

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1HealthCheckerProcess.png

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1slave_1_1ExternalContainerizer-members.html

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1slave_1_1ExternalContainerizer.html

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1slave_1_1ExternalContainerizer.png

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1slave_1_1ExternalContainerizerProcess-members.html

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1slave_1_1ExternalContainerizerProcess.html

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1slave_1_1ExternalContainerizerProcess.png

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1tests_1_1MemoryTestHelperMain-members.html

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1tests_1_1MemoryTestHelperMain.html

mesos/site/publish/api/latest/c++/classmesos_1_1internal_1_1tests_1_1MemoryTestHelperMain.png

mesos/site/publish/api/latest/c++/classprocess_1_1network_1_1openssl_1_1Flags-members.html

mesos/site/publish/api/latest/c++/classprocess_1_1network_1_1openssl_1_1Flags.html

mesos/site/publish/api/latest/c++/classprocess_1_1network_1_1openssl_1_1Flags.png
mesos/site/publish/api/latest/c++/dir_e36f3d2258c529a8e072866d6ad6a3ee.html
mesos/site/publish/api/latest/c++/external__containerizer_8hpp.html
mesos/site/publish/api/latest/c++/external__containerizer_8hpp_source.html

mesos/site/publish/api/latest/c++/include_2mesos_2containerizer_2containerizer_8hpp.html

mesos/site/publish/api/latest/c++/include_2mesos_2containerizer_2containerizer_8hpp_source.html
mesos/site/publish/documentation/external-containerizer/
mesos/site/publish/documentation/latest/external-containerizer/



svn commit: r1757929 - in /mesos/site/publish: ./ api/latest/c++/ api/latest/java/ api/latest/java/org/apache/mesos/ blog/ blog/mesos-1-0-0-released/ blog/mesos-1-0-1-released/ documentation/ document

2016-08-26 Thread vinodkone
Author: vinodkone
Date: Fri Aug 26 21:41:17 2016
New Revision: 1757929

URL: http://svn.apache.org/viewvc?rev=1757929=rev
Log:
Updated website for 1.0.1.


[This commit notification would consist of 133 parts, 
which exceeds the limit of 50 ones, so it was shortened to the summary.]


mesos git commit: Fixed white space in 1.0.1 blog post.

2016-08-26 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 2d7bb9dfd -> 8ab7a6f4d


Fixed white space in 1.0.1 blog post.


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

Branch: refs/heads/master
Commit: 8ab7a6f4d5a6bab6eef8ec49b7a3b9f0a4e420af
Parents: 2d7bb9d
Author: Vinod Kone 
Authored: Fri Aug 26 14:28:07 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 26 14:28:07 2016 -0700

--
 .../source/blog/2016-08-23-mesos-1-0-1-released.md | 17 +
 1 file changed, 17 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/8ab7a6f4/site/source/blog/2016-08-23-mesos-1-0-1-released.md
--
diff --git a/site/source/blog/2016-08-23-mesos-1-0-1-released.md 
b/site/source/blog/2016-08-23-mesos-1-0-1-released.md
index ac6561a..ab7d2b6 100644
--- a/site/source/blog/2016-08-23-mesos-1-0-1-released.md
+++ b/site/source/blog/2016-08-23-mesos-1-0-1-released.md
@@ -12,22 +12,39 @@ tags: Release
 The latest Mesos release, 1.0.1, is now available for 
[download](http://mesos.apache.org/downloads). This release includes some 
important bug fixes and improvements on top of 1.0.0. It is highly recommended 
to use this version if you are considering using Mesos 1.0. More specifically, 
this release includes the following fixes and improvements:
 
 [MESOS-5388]( https://issues.apache.org/jira/browse/MESOS-5388) - 
MesosContainerizerLaunch flags execute arbitrary commands via shell.
+
 [MESOS-5862]( https://issues.apache.org/jira/browse/MESOS-5862) - External 
links to .md files broken.
+
 [MESOS-5911]( https://issues.apache.org/jira/browse/MESOS-5911) - Webui 
redirection to leader in browser does not work
+
 [MESOS-5913]( https://issues.apache.org/jira/browse/MESOS-5913) - Stale socket 
FD usage when using libevent + SSL.
+
 [MESOS-5922]( https://issues.apache.org/jira/browse/MESOS-5922) - mesos-agent 
--help exit status is 1
+
 [MESOS-5923]( https://issues.apache.org/jira/browse/MESOS-5923) - Ubuntu 14.04 
LTS GPU Isolator "/run" directory is noexec
+
 [MESOS-5927]( https://issues.apache.org/jira/browse/MESOS-5927) - Unable to 
run "scratch" Dockerfiles with Unified Containerizer.
+
 [MESOS-5928]( https://issues.apache.org/jira/browse/MESOS-5928) - Agent's 
'--version' flag doesn't work
+
 [MESOS-5930]( https://issues.apache.org/jira/browse/MESOS-5930) - Orphan tasks 
can show up as running after they have finished.
+
 [MESOS-5943]( https://issues.apache.org/jira/browse/MESOS-5943) - Incremental 
http parsing of URLs leads to decoder error
+
 [MESOS-5945]( https://issues.apache.org/jira/browse/MESOS-5945) - 
NvidiaVolume::create() should check for root before creating volume
+
 [MESOS-5959]( https://issues.apache.org/jira/browse/MESOS-5959) - All non-root 
tests fail on GPU machine
+
 [MESOS-5969]( https://issues.apache.org/jira/browse/MESOS-5969) - Linux 
'MountInfoTable' entries not sorted as expected
+
 [MESOS-5982]( https://issues.apache.org/jira/browse/MESOS-5982) - NvidiaVolume 
errors out if any binary is missing
+
 [MESOS-5986]( https://issues.apache.org/jira/browse/MESOS-5986) - SSL Socket 
CHECK can fail after socket receives EOF
+
 [MESOS-5988]( https://issues.apache.org/jira/browse/MESOS-5988) - 
PollSocketImpl can write to a stale fd.
+
 [MESOS-5830]( https://issues.apache.org/jira/browse/MESOS-5830) - Make a sweep 
to trim excess space around angle brackets
+
 [MESOS-5970]( https://issues.apache.org/jira/browse/MESOS-5970) - Remove 
HTTP_PARSER_VERSION_MAJOR < 2 code in decoder.
 
 Full release notes are available in the release 
[CHANGELOG](https://git-wip-us.apache.org/repos/asf?p=mesos.git;a=blob_plain;f=CHANGELOG;hb=1.0.1)



mesos git commit: Added validation test for task group task using NetworkInfos.

2016-08-26 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 7429846df -> 2d7bb9dfd


Added validation test for task group task using NetworkInfos.

NetworkInfos can only be set on the task group executor.

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


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

Branch: refs/heads/master
Commit: 2d7bb9dfd99e370790aa10a4a657c4848a1b533b
Parents: 7429846
Author: Vinod Kone 
Authored: Thu Aug 25 10:39:24 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 26 12:17:40 2016 -0700

--
 src/master/validation.cpp |  5 ++
 src/tests/master_validation_tests.cpp | 74 ++
 2 files changed, 79 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/2d7bb9df/src/master/validation.cpp
--
diff --git a/src/master/validation.cpp b/src/master/validation.cpp
index 36447ff..15e2ecc 100644
--- a/src/master/validation.cpp
+++ b/src/master/validation.cpp
@@ -994,10 +994,15 @@ Option validateTask(
   }
 
   // Now do `TaskGroup` specific validation.
+
   if (task.has_executor()) {
 return Error("'TaskInfo.executor' must not be set");
   }
 
+  if (task.has_container() && task.container().network_infos().size() > 0) {
+return Error("NetworkInfos must not be set on the task");
+  }
+
   return None();
 }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2d7bb9df/src/tests/master_validation_tests.cpp
--
diff --git a/src/tests/master_validation_tests.cpp 
b/src/tests/master_validation_tests.cpp
index 56e931c..1df76f5 100644
--- a/src/tests/master_validation_tests.cpp
+++ b/src/tests/master_validation_tests.cpp
@@ -1740,6 +1740,80 @@ TEST_F(TaskGroupValidationTest, 
ExecutorWithoutFrameworkId)
   driver.join();
 }
 
+
+// This test verifies that a task group task
+// that has `NetworkInfo` set is invalid.
+TEST_F(TaskGroupValidationTest, TaskUsesNetworkInfo)
+{
+  Try master = StartMaster();
+  ASSERT_SOME(master);
+
+  Owned detector = master.get()->createDetector();
+  Try slave = StartSlave(detector.get());
+  ASSERT_SOME(slave);
+
+  MockScheduler sched;
+  MesosSchedulerDriver driver(
+  , DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
+
+  EXPECT_CALL(sched, registered(, _, _))
+.Times(1);
+
+  Future offers;
+  EXPECT_CALL(sched, resourceOffers(, _))
+.WillOnce(FutureArg<1>())
+.WillRepeatedly(Return()); // Ignore subsequent offers.
+
+  driver.start();
+
+  AWAIT_READY(offers);
+  EXPECT_NE(0u, offers->size());
+  Offer offer = offers.get()[0];
+
+  Resources resources = Resources::parse("cpus:1;mem:512;disk:32").get();
+
+  ExecutorInfo executor(DEFAULT_EXECUTOR_INFO);
+  executor.set_type(ExecutorInfo::CUSTOM);
+  executor.mutable_resources()->CopyFrom(resources);
+
+  // Create a task that has NetworkInfos set.
+  TaskInfo task;
+  task.set_name("test");
+  task.mutable_task_id()->set_value("1");
+  task.mutable_slave_id()->MergeFrom(offer.slave_id());
+  task.mutable_resources()->MergeFrom(resources);
+  task.mutable_container()->set_type(ContainerInfo::MESOS);
+  task.mutable_container()->add_network_infos();
+
+  TaskGroupInfo taskGroup;
+  taskGroup.add_tasks()->CopyFrom(task);
+
+  Future status;
+  EXPECT_CALL(sched, statusUpdate(, _))
+.WillOnce(FutureArg<1>());
+
+  Offer::Operation operation;
+  operation.set_type(Offer::Operation::LAUNCH_GROUP);
+
+  Offer::Operation::LaunchGroup* launchGroup =
+operation.mutable_launch_group();
+
+  launchGroup->mutable_executor()->CopyFrom(executor);
+  launchGroup->mutable_task_group()->CopyFrom(taskGroup);
+
+  driver.acceptOffers({offers.get()[0].id()}, {operation});
+
+  AWAIT_READY(status);
+  EXPECT_EQ(task.task_id(), status->task_id());
+  EXPECT_EQ(TASK_ERROR, status->state());
+  EXPECT_EQ(TaskStatus::REASON_TASK_GROUP_INVALID, status->reason());
+  EXPECT_EQ("Task '1' is invalid: NetworkInfos must not be set on the task",
+status->message());
+
+  driver.stop();
+  driver.join();
+}
+
 } // namespace tests {
 } // namespace internal {
 } // namespace mesos {



[2/2] mesos git commit: Fixed typo for the comments of UnauthorizedTaskGroup.

2016-08-26 Thread vinodkone
Fixed typo for the comments of UnauthorizedTaskGroup.

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


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

Branch: refs/heads/master
Commit: 7429846df717b3b84a2d1dd08b17496e6f828818
Parents: 60aedf7
Author: Guangya Liu 
Authored: Fri Aug 26 12:08:34 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 26 12:10:22 2016 -0700

--
 src/tests/master_authorization_tests.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/7429846d/src/tests/master_authorization_tests.cpp
--
diff --git a/src/tests/master_authorization_tests.cpp 
b/src/tests/master_authorization_tests.cpp
index 042f543..a6399f1 100644
--- a/src/tests/master_authorization_tests.cpp
+++ b/src/tests/master_authorization_tests.cpp
@@ -233,7 +233,7 @@ TEST_F(MasterAuthorizationTest, UnauthorizedTask)
 
 
 // This test verifies that even if one of the tasks in a task group is
-/// unauthorized, all the tasks in the task group are rejected.
+// unauthorized, all the tasks in the task group are rejected.
 TEST_F(MasterAuthorizationTest, UnauthorizedTaskGroup)
 {
   // Setup ACLs so that no framework can launch as "foo".



[1/2] mesos git commit: Added test case MasterAuthorizationTest.KillPendingTaskInTaskGroup.

2016-08-26 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master dbfbe6697 -> 7429846df


Added test case MasterAuthorizationTest.KillPendingTaskInTaskGroup.

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


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

Branch: refs/heads/master
Commit: 60aedf79a5a475f164a9943bbf1389621df2dc9f
Parents: dbfbe66
Author: Guangya Liu 
Authored: Fri Aug 26 12:08:29 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 26 12:10:20 2016 -0700

--
 src/tests/master_authorization_tests.cpp | 119 ++
 1 file changed, 119 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/60aedf79/src/tests/master_authorization_tests.cpp
--
diff --git a/src/tests/master_authorization_tests.cpp 
b/src/tests/master_authorization_tests.cpp
index d0fe4be..042f543 100644
--- a/src/tests/master_authorization_tests.cpp
+++ b/src/tests/master_authorization_tests.cpp
@@ -403,6 +403,125 @@ TEST_F(MasterAuthorizationTest, KillTask)
 }
 
 
+// This test verifies that if a pending task in a task group
+// is killed, then the entire group will be killed.
+TEST_F(MasterAuthorizationTest, KillPendingTaskInTaskGroup)
+{
+  MockAuthorizer authorizer;
+  Try master = StartMaster();
+  ASSERT_SOME(master);
+
+  Owned detector = master.get()->createDetector();
+  Try slave = StartSlave(detector.get());
+  ASSERT_SOME(slave);
+
+  MockScheduler sched;
+  MesosSchedulerDriver driver(
+  , DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
+
+  Future frameworkId;
+  EXPECT_CALL(sched, registered(, _, _))
+.WillOnce(FutureArg<1>());
+
+  Future offers;
+  EXPECT_CALL(sched, resourceOffers(, _))
+.WillOnce(FutureArg<1>())
+.WillRepeatedly(Return()); // Ignore subsequent offers.
+
+  driver.start();
+
+  AWAIT_READY(frameworkId);
+
+  AWAIT_READY(offers);
+  EXPECT_NE(0u, offers->size());
+
+  Resources resources =
+Resources::parse("cpus:0.1;mem:32;disk:32").get();
+
+  ExecutorInfo executor;
+  executor.set_type(ExecutorInfo::DEFAULT);
+  executor.mutable_executor_id()->set_value("E");
+  executor.mutable_framework_id()->CopyFrom(frameworkId.get());
+  executor.mutable_resources()->CopyFrom(resources);
+
+  TaskInfo task1;
+  task1.set_name("1");
+  task1.mutable_task_id()->set_value("1");
+  task1.mutable_slave_id()->MergeFrom(offers.get()[0].slave_id());
+  task1.mutable_resources()->MergeFrom(resources);
+
+  TaskInfo task2;
+  task2.set_name("2");
+  task2.mutable_task_id()->set_value("2");
+  task2.mutable_slave_id()->MergeFrom(offers.get()[0].slave_id());
+  task2.mutable_resources()->MergeFrom(resources);
+
+  TaskGroupInfo taskGroup;
+  taskGroup.add_tasks()->CopyFrom(task1);
+  taskGroup.add_tasks()->CopyFrom(task2);
+
+  // Return a pending future from authorizer.
+  Future authorize1;
+  Future authorize2;
+  Promise promise1;
+  Promise promise2;
+  EXPECT_CALL(authorizer, authorized(_))
+.WillOnce(DoAll(FutureSatisfy(),
+Return(promise1.future(
+.WillOnce(DoAll(FutureSatisfy(),
+Return(promise2.future(;
+
+  Future task1Status;
+  Future task2Status;
+  EXPECT_CALL(sched, statusUpdate(, _))
+.WillOnce(FutureArg<1>())
+.WillOnce(FutureArg<1>());
+
+  Offer::Operation operation;
+  operation.set_type(Offer::Operation::LAUNCH_GROUP);
+
+  Offer::Operation::LaunchGroup* launchGroup =
+operation.mutable_launch_group();
+
+  launchGroup->mutable_executor()->CopyFrom(executor);
+  launchGroup->mutable_task_group()->CopyFrom(taskGroup);
+
+  driver.acceptOffers({offers.get()[0].id()}, {operation});
+
+  // Wait until all authorizations are in progress.
+  AWAIT_READY(authorize1);
+  AWAIT_READY(authorize2);
+
+  // Now kill task1.
+  driver.killTask(task1.task_id());
+
+  AWAIT_READY(task1Status);
+  EXPECT_EQ(TASK_KILLED, task1Status->state());
+  EXPECT_TRUE(strings::contains(
+  task1Status->message(), "Killed pending task"));
+
+  Future recoverResources =
+FUTURE_DISPATCH(_, ::recoverResources);
+
+  // Now complete authorizations for task1 and task2.
+  promise1.set(true);
+  promise2.set(true);
+
+  AWAIT_READY(task2Status);
+  EXPECT_EQ(TASK_KILLED, task2Status->state());
+  EXPECT_TRUE(strings::contains(
+  task2Status->message(),
+  "A task within the task group was killed before delivery to the agent"));
+
+  // No task launch should happen resulting in all resources being
+  // returned to the allocator.
+  AWAIT_READY(recoverResources);
+
+  driver.stop();
+  driver.join();
+}
+
+
 // This 

mesos git commit: Killed a line in master/validation.cpp.

2016-08-25 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master f3181999f -> 79b6a9e38


Killed a line in master/validation.cpp.

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


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

Branch: refs/heads/master
Commit: 79b6a9e38bdeb711bd25c890e7ad88a01d7dbfea
Parents: f318199
Author: Guangya Liu 
Authored: Thu Aug 25 19:08:26 2016 -0700
Committer: Vinod Kone 
Committed: Thu Aug 25 19:08:26 2016 -0700

--
 src/master/validation.cpp | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/79b6a9e3/src/master/validation.cpp
--
diff --git a/src/master/validation.cpp b/src/master/validation.cpp
index 3d2965e..36447ff 100644
--- a/src/master/validation.cpp
+++ b/src/master/validation.cpp
@@ -1051,7 +1051,6 @@ Option validateExecutor(
 return Error("'ExecutorInfo.type' must be set");
   }
 
-
   if (executor.type() == ExecutorInfo::UNKNOWN) {
 return Error("Unknown executor type");
   }



mesos git commit: Added test case MasterAuthorizationTest, UnauthorizedTaskGroup.

2016-08-25 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 4e8a23411 -> 3ec608018


Added test case MasterAuthorizationTest, UnauthorizedTaskGroup.

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


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

Branch: refs/heads/master
Commit: 3ec608018dfbf54fb7a75b8eed9c5a113f95d978
Parents: 4e8a234
Author: Guangya Liu 
Authored: Thu Aug 25 13:32:43 2016 -0700
Committer: Vinod Kone 
Committed: Thu Aug 25 13:34:43 2016 -0700

--
 src/tests/master_authorization_tests.cpp | 99 +++
 1 file changed, 99 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/3ec60801/src/tests/master_authorization_tests.cpp
--
diff --git a/src/tests/master_authorization_tests.cpp 
b/src/tests/master_authorization_tests.cpp
index 92bd2a9..d0fe4be 100644
--- a/src/tests/master_authorization_tests.cpp
+++ b/src/tests/master_authorization_tests.cpp
@@ -232,6 +232,105 @@ TEST_F(MasterAuthorizationTest, UnauthorizedTask)
 }
 
 
+// This test verifies that even if one of the tasks in a task group is
+/// unauthorized, all the tasks in the task group are rejected.
+TEST_F(MasterAuthorizationTest, UnauthorizedTaskGroup)
+{
+  // Setup ACLs so that no framework can launch as "foo".
+  ACLs acls;
+  mesos::ACL::RunTask* acl = acls.add_run_tasks();
+  acl->mutable_principals()->set_type(mesos::ACL::Entity::NONE);
+  acl->mutable_users()->add_values("foo");
+
+  master::Flags flags = CreateMasterFlags();
+  flags.acls = acls;
+
+  Try master = StartMaster(flags);
+  ASSERT_SOME(master);
+
+  Owned detector = master.get()->createDetector();
+  Try slave = StartSlave(detector.get());
+  ASSERT_SOME(slave);
+
+  MockScheduler sched;
+  MesosSchedulerDriver driver(
+  , DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
+
+  Future frameworkId;
+  EXPECT_CALL(sched, registered(, _, _))
+.WillOnce(FutureArg<1>());
+
+  Future offers;
+  EXPECT_CALL(sched, resourceOffers(, _))
+.WillOnce(FutureArg<1>())
+.WillRepeatedly(Return()); // Ignore subsequent offers.
+
+  driver.start();
+
+  AWAIT_READY(frameworkId);
+
+  AWAIT_READY(offers);
+  EXPECT_NE(0u, offers.get().size());
+
+  Resources resources =
+Resources::parse("cpus:0.1;mem:32;disk:32").get();
+
+  ExecutorInfo executor;
+  executor.set_type(ExecutorInfo::DEFAULT);
+  executor.mutable_executor_id()->set_value("E");
+  executor.mutable_framework_id()->CopyFrom(frameworkId.get());
+  executor.mutable_resources()->CopyFrom(resources);
+
+  // Create an unauthorized task.
+  TaskInfo task1;
+  task1.set_name("1");
+  task1.mutable_task_id()->set_value("1");
+  task1.mutable_slave_id()->MergeFrom(offers.get()[0].slave_id());
+  task1.mutable_resources()->MergeFrom(resources);
+  task1.mutable_command()->set_value("echo hello");
+  task1.mutable_command()->set_user("foo");
+
+  // Create an authorized task.
+  TaskInfo task2;
+  task2.set_name("2");
+  task2.mutable_task_id()->set_value("2");
+  task2.mutable_slave_id()->MergeFrom(offers.get()[0].slave_id());
+  task2.mutable_resources()->MergeFrom(resources);
+
+  TaskGroupInfo taskGroup;
+  taskGroup.add_tasks()->CopyFrom(task1);
+  taskGroup.add_tasks()->CopyFrom(task2);
+
+  Future task1Status;
+  Future task2Status;
+  EXPECT_CALL(sched, statusUpdate(, _))
+.WillOnce(FutureArg<1>())
+.WillOnce(FutureArg<1>());
+
+  Offer::Operation operation;
+  operation.set_type(Offer::Operation::LAUNCH_GROUP);
+
+  Offer::Operation::LaunchGroup* launchGroup =
+operation.mutable_launch_group();
+
+  launchGroup->mutable_executor()->CopyFrom(executor);
+  launchGroup->mutable_task_group()->CopyFrom(taskGroup);
+
+  driver.acceptOffers({offers.get()[0].id()}, {operation});
+
+  AWAIT_READY(task1Status);
+  EXPECT_EQ(TASK_ERROR, task1Status->state());
+  EXPECT_EQ(TaskStatus::REASON_TASK_GROUP_UNAUTHORIZED, task1Status->reason());
+
+  AWAIT_READY(task2Status);
+  EXPECT_EQ(TASK_ERROR, task2Status->state());
+  EXPECT_EQ(TaskStatus::REASON_TASK_GROUP_UNAUTHORIZED, task2Status->reason());
+
+  driver.stop();
+  driver.join();
+}
+
+
 // This test verifies that a 'killTask()' that comes before
 // '_launchTasks()' is called results in TASK_KILLED.
 TEST_F(MasterAuthorizationTest, KillTask)



mesos git commit: Added test case for TaskGroupValidationTest.ExecutorWithoutFrameworkId.

2016-08-25 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master ae513df1e -> 711797086


Added test case for TaskGroupValidationTest.ExecutorWithoutFrameworkId.

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


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

Branch: refs/heads/master
Commit: 71179708650642e145f75e250bf6d6b3eaabb6c5
Parents: ae513df
Author: Guangya Liu 
Authored: Thu Aug 25 10:39:34 2016 -0700
Committer: Vinod Kone 
Committed: Thu Aug 25 10:40:05 2016 -0700

--
 src/tests/master_validation_tests.cpp | 79 ++
 1 file changed, 79 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/71179708/src/tests/master_validation_tests.cpp
--
diff --git a/src/tests/master_validation_tests.cpp 
b/src/tests/master_validation_tests.cpp
index 86b4b22..56e931c 100644
--- a/src/tests/master_validation_tests.cpp
+++ b/src/tests/master_validation_tests.cpp
@@ -1661,6 +1661,85 @@ TEST_F(TaskGroupValidationTest, 
TaskGroupAndExecutorUsesRevocableResources)
   "Task group and executor mix revocable and non-revocable resources"));
 }
 
+
+// Ensures that an executor without a framework id is
+// rejected during `TaskGroupInfo` validation.
+TEST_F(TaskGroupValidationTest, ExecutorWithoutFrameworkId)
+{
+  Try master = StartMaster();
+  ASSERT_SOME(master);
+
+  Owned detector = master.get()->createDetector();
+  Try slave = StartSlave(detector.get());
+  ASSERT_SOME(slave);
+
+  MockScheduler sched;
+  MesosSchedulerDriver driver(
+  , DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
+
+  EXPECT_CALL(sched, registered(, _, _))
+.Times(1);
+
+  Future offers;
+  EXPECT_CALL(sched, resourceOffers(, _))
+.WillOnce(FutureArg<1>())
+.WillRepeatedly(Return()); // Ignore subsequent offers.
+
+  driver.start();
+
+  AWAIT_READY(offers);
+  EXPECT_NE(0u, offers.get().size());
+
+  // Create an invalid executor without framework id.
+  ExecutorInfo executor;
+  executor.set_type(ExecutorInfo::DEFAULT);
+  executor.mutable_executor_id()->set_value("E");
+
+  TaskInfo task1;
+  task1.set_name("1");
+  task1.mutable_task_id()->set_value("1");
+  task1.mutable_slave_id()->MergeFrom(offers.get()[0].slave_id());
+  task1.mutable_resources()->MergeFrom(offers.get()[0].resources());
+
+  TaskInfo task2;
+  task2.set_name("2");
+  task2.mutable_task_id()->set_value("2");
+  task2.mutable_slave_id()->MergeFrom(offers.get()[0].slave_id());
+  task2.mutable_resources()->MergeFrom(offers.get()[0].resources());
+
+  TaskGroupInfo taskGroup;
+  taskGroup.add_tasks()->CopyFrom(task1);
+  taskGroup.add_tasks()->CopyFrom(task2);
+
+  Future task1Status;
+  Future task2Status;
+  EXPECT_CALL(sched, statusUpdate(, _))
+.WillOnce(FutureArg<1>())
+.WillOnce(FutureArg<1>());
+
+  Offer::Operation operation;
+  operation.set_type(Offer::Operation::LAUNCH_GROUP);
+
+  Offer::Operation::LaunchGroup* launchGroup =
+operation.mutable_launch_group();
+
+  launchGroup->mutable_executor()->CopyFrom(executor);
+  launchGroup->mutable_task_group()->CopyFrom(taskGroup);
+
+  driver.acceptOffers({offers.get()[0].id()}, {operation});
+
+  AWAIT_READY(task1Status);
+  EXPECT_EQ(TASK_ERROR, task1Status->state());
+  EXPECT_EQ(TaskStatus::REASON_TASK_GROUP_INVALID, task1Status->reason());
+
+  AWAIT_READY(task2Status);
+  EXPECT_EQ(TASK_ERROR, task2Status->state());
+  EXPECT_EQ(TaskStatus::REASON_TASK_GROUP_INVALID, task2Status->reason());
+
+  driver.stop();
+  driver.join();
+}
+
 } // namespace tests {
 } // namespace internal {
 } // namespace mesos {



mesos git commit: Added Aaron Wood to contributors.

2016-08-24 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master db4c8a0e9 -> 3674c58ad


Added Aaron Wood to contributors.

This closes #161


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

Branch: refs/heads/master
Commit: 3674c58ad5268c96c3868dda3d43375f0f7b02a7
Parents: db4c8a0
Author: Aaron Wood 
Authored: Wed Aug 24 12:40:51 2016 -0700
Committer: Vinod Kone 
Committed: Wed Aug 24 12:40:51 2016 -0700

--
 docs/contributors.yaml | 10 ++
 1 file changed, 10 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/3674c58a/docs/contributors.yaml
--
diff --git a/docs/contributors.yaml b/docs/contributors.yaml
index d3f4afc..0f2a81f 100644
--- a/docs/contributors.yaml
+++ b/docs/contributors.yaml
@@ -1,3 +1,13 @@
+- name: Aaron Wood
+  affiliations:
+- {organization: Verizon Labs}
+  emails:
+- aaronjw...@gmail.com
+- m...@aaronjwood.com
+- aaron.w...@verizon.com
+  jira_user: aaron.wood
+  reviewboard_user: aaron.wood
+
 - name: Adam B
   affiliations:
 - {organization: Mesosphere}



mesos git commit: Printed out the received stream ID in scheduler API.

2016-08-23 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master cb0f4a659 -> ba0e582b2


Printed out the received stream ID in scheduler API.

This patch prints out the received stream ID in error output
caused by Mesos-Stream-Id mismatch in calls to scheduler HTTP API.
Expected stream ID is not printed in error output as it may cause
security leak.

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


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

Branch: refs/heads/master
Commit: ba0e582b2bd1a5149b7178e15f652ea33fae90bb
Parents: cb0f4a6
Author: Abhishek Dasgupta 
Authored: Tue Aug 23 21:35:47 2016 -0700
Committer: Vinod Kone 
Committed: Tue Aug 23 21:35:47 2016 -0700

--
 src/master/http.cpp | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/ba0e582b/src/master/http.cpp
--
diff --git a/src/master/http.cpp b/src/master/http.cpp
index 52dd80b..c6bdad6 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -839,11 +839,11 @@ Future Master::Http::scheduler(
 "All non-subscribe calls should include the 'Mesos-Stream-Id' header");
   }
 
-  if (request.headers.at("Mesos-Stream-Id") !=
-  framework->http.get().streamId.toString()) {
+  const string& streamId = request.headers.at("Mesos-Stream-Id");
+  if (streamId != framework->http.get().streamId.toString()) {
 return BadRequest(
-"The stream ID included in this request didn't match the stream ID "
-"currently associated with framework ID "
+"The stream ID '" + streamId + "' included in this request "
+"didn't match the stream ID currently associated with framework ID "
 + framework->id().value());
   }
 



mesos git commit: Updated website for 1.0.1 release.

2016-08-23 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 9460d097b -> cb0f4a659


Updated website for 1.0.1 release.


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

Branch: refs/heads/master
Commit: cb0f4a659412888f07c1567c26a433697c3a9a92
Parents: 9460d09
Author: Vinod Kone <vinodk...@gmail.com>
Authored: Tue Aug 23 19:08:17 2016 -0700
Committer: Vinod Kone <vinodk...@gmail.com>
Committed: Tue Aug 23 19:10:10 2016 -0700

--
 site/data/releases.yml  | 10 -
 .../blog/2016-08-23-mesos-1-0-1-released.md | 47 
 2 files changed, 55 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/cb0f4a65/site/data/releases.yml
--
diff --git a/site/data/releases.yml b/site/data/releases.yml
index 3a23aa2..1e9bb85 100644
--- a/site/data/releases.yml
+++ b/site/data/releases.yml
@@ -3,8 +3,8 @@
 #   `versions` below.
 # * When publishing a new blog post, we need to append an item to `news` below.
 latest_stable:
-  version: 1.0.0
-  jira_version: 12324944
+  version: 1.0.1
+  jira_version: 12335956
 news:
 ## * If the news is used to announce a release version, the item structure is
 ##   - title: (required)
@@ -15,6 +15,10 @@ news:
 ##   - title: (required)
 ## date: (required)
 ## blog: (required)
+  - title: Mesos 1.0.1 is released!
+date: August 23, 2016
+blog: mesos-1-0-1-released
+target_version: 1.0.1
   - title: Mesos 1.0.0 is released!
 date: July 27, 2016
 blog: mesos-1-0-0-released
@@ -92,6 +96,8 @@ versions:
 ## after we create the ReleaseNote for 0.28.1, we get the link:
 ## 
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311242=12335359.
 ## At here, 12335359 is the jira_version of 0.28.1.
+  - version: 1.0.1
+jira_version: 12335956
   - version: 1.0.0
 jira_version: 12324944
   - version: 0.28.2

http://git-wip-us.apache.org/repos/asf/mesos/blob/cb0f4a65/site/source/blog/2016-08-23-mesos-1-0-1-released.md
--
diff --git a/site/source/blog/2016-08-23-mesos-1-0-1-released.md 
b/site/source/blog/2016-08-23-mesos-1-0-1-released.md
new file mode 100644
index 000..ac6561a
--- /dev/null
+++ b/site/source/blog/2016-08-23-mesos-1-0-1-released.md
@@ -0,0 +1,47 @@
+---
+layout: post
+title: Apache Mesos 1.0.1 Released
+permalink: /blog/mesos-1-0-1-released/
+published: true
+post_author:
+  display_name: Vinod Kone
+  twitter: vinodkone
+tags: Release
+---
+
+The latest Mesos release, 1.0.1, is now available for 
[download](http://mesos.apache.org/downloads). This release includes some 
important bug fixes and improvements on top of 1.0.0. It is highly recommended 
to use this version if you are considering using Mesos 1.0. More specifically, 
this release includes the following fixes and improvements:
+
+[MESOS-5388]( https://issues.apache.org/jira/browse/MESOS-5388) - 
MesosContainerizerLaunch flags execute arbitrary commands via shell.
+[MESOS-5862]( https://issues.apache.org/jira/browse/MESOS-5862) - External 
links to .md files broken.
+[MESOS-5911]( https://issues.apache.org/jira/browse/MESOS-5911) - Webui 
redirection to leader in browser does not work
+[MESOS-5913]( https://issues.apache.org/jira/browse/MESOS-5913) - Stale socket 
FD usage when using libevent + SSL.
+[MESOS-5922]( https://issues.apache.org/jira/browse/MESOS-5922) - mesos-agent 
--help exit status is 1
+[MESOS-5923]( https://issues.apache.org/jira/browse/MESOS-5923) - Ubuntu 14.04 
LTS GPU Isolator "/run" directory is noexec
+[MESOS-5927]( https://issues.apache.org/jira/browse/MESOS-5927) - Unable to 
run "scratch" Dockerfiles with Unified Containerizer.
+[MESOS-5928]( https://issues.apache.org/jira/browse/MESOS-5928) - Agent's 
'--version' flag doesn't work
+[MESOS-5930]( https://issues.apache.org/jira/browse/MESOS-5930) - Orphan tasks 
can show up as running after they have finished.
+[MESOS-5943]( https://issues.apache.org/jira/browse/MESOS-5943) - Incremental 
http parsing of URLs leads to decoder error
+[MESOS-5945]( https://issues.apache.org/jira/browse/MESOS-5945) - 
NvidiaVolume::create() should check for root before creating volume
+[MESOS-5959]( https://issues.apache.org/jira/browse/MESOS-5959) - All non-root 
tests fail on GPU machine
+[MESOS-5969]( https://issues.apache.org/jira/browse/MESOS-5969) - Linux 
'MountInfoTable' entries not sorted as expected
+[MESOS-5982]( https://issues.apache.org/jira/browse/MESOS-5982) - NvidiaVolume 

[mesos] Git Push Summary

2016-08-23 Thread vinodkone
Repository: mesos
Updated Tags:  refs/tags/1.0.1 [created] 3611eb0b7


svn commit: r14925 - in /release/mesos/1.0.1: ./ mesos-1.0.1.tar.gz mesos-1.0.1.tar.gz.asc mesos-1.0.1.tar.gz.md5

2016-08-23 Thread vinodkone
Author: vinodkone
Date: Wed Aug 24 01:06:47 2016
New Revision: 14925

Log:
Adding mesos-1.0.1.

Added:
release/mesos/1.0.1/
release/mesos/1.0.1/mesos-1.0.1.tar.gz   (with props)
release/mesos/1.0.1/mesos-1.0.1.tar.gz.asc
release/mesos/1.0.1/mesos-1.0.1.tar.gz.md5

Added: release/mesos/1.0.1/mesos-1.0.1.tar.gz
==
Binary file - no diff available.

Propchange: release/mesos/1.0.1/mesos-1.0.1.tar.gz
--
svn:mime-type = application/octet-stream

Added: release/mesos/1.0.1/mesos-1.0.1.tar.gz.asc
==
--- release/mesos/1.0.1/mesos-1.0.1.tar.gz.asc (added)
+++ release/mesos/1.0.1/mesos-1.0.1.tar.gz.asc Wed Aug 24 01:06:47 2016
@@ -0,0 +1,11 @@
+-BEGIN PGP SIGNATURE-
+Version: GnuPG v1
+
+iQEcBAABAgAGBQJXq8bgAAoJEBf21SiiwsdKOtsH/2lndEMRgufihdNu08FtfW5v
+8eTLImBWLOkz4rJFjX7ZUr8OB3FgH9LVxwXZVo9qHNx49eY6LwjlF7ObBx7EOv8S
+8HYATcoVsRez8f7GpOvGsrYoN92wjS3jLtaDRXc/Ad8EBhGijGMMkB53qoA9aoSj
+PF+BP+e3p+5jNoyCD7Q8P2dqSS3FS36F27gfWmwlblqGv91iCDnzot6lGfqy/Jnv
+aj+QZWhaNCItIdxrvaQIiC9aDssClmX5jwXO00h8RXvUpCOtSDMltKlPihysoqXY
+hTzWBGBsdKpzb4YeWx+gVjuGdGuduk60SHV13YGBnq37mbTpi+1zpqt5m/8jAw8=
+=ieI4
+-END PGP SIGNATURE-

Added: release/mesos/1.0.1/mesos-1.0.1.tar.gz.md5
==
--- release/mesos/1.0.1/mesos-1.0.1.tar.gz.md5 (added)
+++ release/mesos/1.0.1/mesos-1.0.1.tar.gz.md5 Wed Aug 24 01:06:47 2016
@@ -0,0 +1 @@
+mesos-1.0.1.tar.gz: 1A AC A0 0A 0F FB 20 F4  B3 1C 2D CC 24 47 C2 C5




mesos git commit: Added Krzysztof Paprocki to contributors.

2016-08-23 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 963c1ff9c -> 3ed895e1e


Added Krzysztof Paprocki to contributors.

Added myself in order to be able to self-assign Jira.

This closes #160


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

Branch: refs/heads/master
Commit: 3ed895e1e7aade644e0922ab7017f4f6050a7d5c
Parents: 963c1ff
Author: ChrisPaprocki 
Authored: Tue Aug 23 14:55:36 2016 -0700
Committer: Vinod Kone 
Committed: Tue Aug 23 14:55:36 2016 -0700

--
 docs/contributors.yaml | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/3ed895e1/docs/contributors.yaml
--
diff --git a/docs/contributors.yaml b/docs/contributors.yaml
index 3f06000..d3f4afc 100644
--- a/docs/contributors.yaml
+++ b/docs/contributors.yaml
@@ -289,6 +289,12 @@
   jira_user: klaus1982
   reviewboard_user: klaus1982
 
+- name: Krzysztof Paprocki
+  emails:
+- paprocki.krzysz...@gmail.com
+  jira_user: Kris-Paprocki
+  reviewboard_user: Kris-Paprocki
+
 - name: Lily Chen
   affiliations:
 - {organization: Mesosphere}



[3/3] mesos git commit: Fixed indentation in master/validation.cpp.

2016-08-22 Thread vinodkone
Fixed indentation in master/validation.cpp.

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


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

Branch: refs/heads/master
Commit: 47f2c2187bffe79d9d05085f403b9087154d6618
Parents: 4000fd3
Author: Vinod Kone 
Authored: Mon Aug 15 16:12:26 2016 -0700
Committer: Vinod Kone 
Committed: Mon Aug 22 20:04:04 2016 -0700

--
 src/master/validation.cpp | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/47f2c218/src/master/validation.cpp
--
diff --git a/src/master/validation.cpp b/src/master/validation.cpp
index ddc7ac3..19a63ea 100644
--- a/src/master/validation.cpp
+++ b/src/master/validation.cpp
@@ -534,8 +534,7 @@ Option validateTaskID(const TaskInfo& task)
 
 // Validates that the TaskID does not collide with any existing tasks
 // for the framework.
-Option validateUniqueTaskID(const TaskInfo& task, Framework*
-framework)
+Option validateUniqueTaskID(const TaskInfo& task, Framework* framework)
 {
   const TaskID& taskId = task.task_id();
 
@@ -563,7 +562,9 @@ Option validateSlaveID(const TaskInfo& task, Slave* 
slave)
 // Validates that tasks that use the "same" executor (i.e., same
 // ExecutorID) have an identical ExecutorInfo.
 Option validateExecutorInfo(
-const TaskInfo& task, Framework* framework, Slave* slave)
+const TaskInfo& task,
+Framework* framework,
+Slave* slave)
 {
   if (task.has_executor() == task.has_command()) {
 return Error(
@@ -940,7 +941,8 @@ Option validateFramework(
 
 // Validates that all offers belong to the same valid slave.
 Option validateSlave(
-const RepeatedPtrField& offerIds, Master* master)
+const RepeatedPtrField& offerIds,
+Master* master)
 {
   Option slaveId;
 



[1/3] mesos git commit: Added master validations for TaskGroup.

2016-08-22 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 4000fd31b -> 06c0e3e6e


Added master validations for TaskGroup.

The TaskGroup is considered invalid if any of the tasks or the executor
is invalid.

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


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

Branch: refs/heads/master
Commit: 06c0e3e6ecd7fa526ba69886340d41882dbdf0a9
Parents: fb58d38
Author: Vinod Kone 
Authored: Mon Aug 15 16:10:04 2016 -0700
Committer: Vinod Kone 
Committed: Mon Aug 22 20:04:04 2016 -0700

--
 src/master/validation.cpp | 168 +
 src/master/validation.hpp |  35 +-
 src/tests/master_validation_tests.cpp | 155 ++
 3 files changed, 357 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/06c0e3e6/src/master/validation.cpp
--
diff --git a/src/master/validation.cpp b/src/master/validation.cpp
index 803aa48..30319e7 100644
--- a/src/master/validation.cpp
+++ b/src/master/validation.cpp
@@ -972,6 +972,174 @@ Option validate(
   return None();
 }
 
+namespace group {
+
+namespace internal {
+
+Option validateTask(
+const TaskInfo& task,
+Framework* framework,
+Slave* slave)
+{
+  CHECK_NOTNULL(framework);
+  CHECK_NOTNULL(slave);
+
+  // Do the general validation first.
+  Option error = task::internal::validateTask(task, framework, slave);
+  if (error.isSome()) {
+return error;
+  }
+
+  // Now do `TaskGroup` specific validation.
+  if (task.has_executor()) {
+return Error("'TaskInfo.executor' must not be set");
+  }
+
+  return None();
+}
+
+
+Option validateTaskGroupAndExecutorResources(
+const TaskGroupInfo& taskGroup,
+const ExecutorInfo& executor)
+{
+  Resources total = executor.resources();
+  foreach (const TaskInfo& task, taskGroup.tasks()) {
+total += task.resources();
+  }
+
+  Option error = resource::validateUniquePersistenceID(total);
+  if (error.isSome()) {
+return Error("Task group and executor use duplicate persistence ID: " +
+ error->message);
+  }
+
+  error = resource::validateRevocableAndNonRevocableResources(total);
+  if (error.isSome()) {
+return Error("Task group and executor mix revocable and non-revocable"
+ " resources: " + error->message);
+  }
+
+  return None();
+}
+
+
+Option validateExecutor(
+const TaskGroupInfo& taskGroup,
+const ExecutorInfo& executor,
+Framework* framework,
+Slave* slave,
+const Resources& offered)
+{
+  CHECK_NOTNULL(framework);
+  CHECK_NOTNULL(slave);
+
+  // Do the general validation first.
+  Option error =
+executor::internal::validate(executor, framework, slave);
+
+  if (error.isSome()) {
+return error;
+  }
+
+  // Now do `TaskGroup` specific validation.
+
+  if (!executor.has_type()) {
+return Error("'ExecutorInfo.type' must be set");
+  }
+
+
+  if (executor.type() == ExecutorInfo::UNKNOWN) {
+return Error("Unknown executor type");
+  }
+
+  const Resources& executorResources = executor.resources();
+
+  // Validate minimal cpus and memory resources of executor.
+  Option cpus =  executorResources.cpus();
+  if (cpus.isNone() || cpus.get() < MIN_CPUS) {
+return Error(
+  "Executor '" + stringify(executor.executor_id()) +
+  "' uses less CPUs (" +
+  (cpus.isSome() ? stringify(cpus.get()) : "None") +
+  ") than the minimum required (" + stringify(MIN_CPUS) + ")");
+  }
+
+  Option mem = executorResources.mem();
+  if (mem.isNone() || mem.get() < MIN_MEM) {
+return Error(
+  "Executor '" + stringify(executor.executor_id()) +
+  "' uses less memory (" +
+  (mem.isSome() ? stringify(mem.get().megabytes()) : "None") +
+  ") than the minimum required (" + stringify(MIN_MEM) + ")");
+  }
+
+  Option disk = executorResources.disk();
+  if (disk.isNone()) {
+return Error(
+  "Executor '" + stringify(executor.executor_id()) + "' uses no disk");
+  }
+
+  // Validate combined resources of task group and executor.
+
+  // NOTE: This is refactored into a separate function so that it can
+  // be easily unit tested.
+  error = internal::validateTaskGroupAndExecutorResources(taskGroup, executor);
+  if (error.isSome()) {
+return error;
+  }
+
+  Resources total;
+  foreach (const TaskInfo& task, taskGroup.tasks()) {
+total += task.resources();
+  }
+
+  if (!slave->hasExecutor(framework->id(), executor.executor_id())) {
+total += executorResources;
+  }
+
+  if (!offered.contains(total)) {
+return Error(
+

[2/3] mesos git commit: Refactored task validations in master.

2016-08-22 Thread vinodkone
Refactored task validations in master.

Refactored in such a way that most of the helper functions can be
reused for doing task group validation.

Note that there are no functional changes here only code movement.

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


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

Branch: refs/heads/master
Commit: fb58d38d86b63804448455bcf2e356d75554e5e1
Parents: 47f2c21
Author: Vinod Kone 
Authored: Tue Aug 16 19:22:34 2016 -0700
Committer: Vinod Kone 
Committed: Mon Aug 22 20:04:04 2016 -0700

--
 src/master/validation.cpp | 475 +++--
 src/master/validation.hpp |  17 +-
 src/tests/master_validation_tests.cpp | 109 ++-
 3 files changed, 438 insertions(+), 163 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/fb58d38d/src/master/validation.cpp
--
diff --git a/src/master/validation.cpp b/src/master/validation.cpp
index 19a63ea..803aa48 100644
--- a/src/master/validation.cpp
+++ b/src/master/validation.cpp
@@ -470,6 +470,25 @@ Option validateUniquePersistenceID(
 }
 
 
+// Validates that revocable and non-revocable
+// resources of the same name do not exist.
+//
+// TODO(vinod): Is this the right place to do this?
+Option validateRevocableAndNonRevocableResources(
+const Resources& _resources)
+{
+  foreach (const string& name, _resources.names()) {
+Resources resources = _resources.get(name);
+if (!resources.revocable().empty() && resources != resources.revocable()) {
+  return Error("Cannot use both revocable and non-revocable '" + name +
+   "' at the same time");
+}
+  }
+
+  return None();
+}
+
+
 // Validates that all the given resources are persistent volumes.
 Option validatePersistentVolume(
 const RepeatedPtrField& volumes)
@@ -514,6 +533,161 @@ Option validate(const RepeatedPtrField& 
resources)
 } // namespace resource {
 
 
+namespace executor {
+namespace internal {
+
+Option validateType(const ExecutorInfo& executor)
+{
+  switch (executor.type()) {
+case ExecutorInfo::DEFAULT:
+  if (executor.has_command()) {
+return Error(
+"'ExecutorInfo.command' must not be set for 'DEFAULT' executor");
+  }
+  break;
+
+case ExecutorInfo::CUSTOM:
+  if (!executor.has_command()) {
+return Error(
+"'ExecutorInfo.command' must be set for 'CUSTOM' executor");
+  }
+  break;
+
+case ExecutorInfo::UNKNOWN:
+  // This could happen if a new executor type is introduced in the
+  // protos but the  master doesn't know about it yet (e.g., new
+  // scheduler launches new type of executor on an old master).
+  return None();
+  }
+
+  return None();
+}
+
+
+Option validateCompatibleExecutorInfo(
+const ExecutorInfo& executor,
+Framework* framework,
+Slave* slave)
+{
+  CHECK_NOTNULL(framework);
+  CHECK_NOTNULL(slave);
+
+  const ExecutorID& executorId = executor.executor_id();
+  Option executorInfo = None();
+
+  if (slave->hasExecutor(framework->id(), executorId)) {
+executorInfo =
+  slave->executors.at(framework->id()).at(executorId);
+  }
+
+  if (executorInfo.isSome() && !(executor == executorInfo.get())) {
+return Error(
+"ExecutorInfo is not compatible with existing ExecutorInfo"
+" with same ExecutorID).\n"
+"\n"
+"Existing ExecutorInfo:\n" +
+stringify(executorInfo.get()) + "\n"
+"\n"
+"ExecutorInfo:\n" +
+stringify(executor) + "\n"
+"\n");
+  }
+
+  return None();
+}
+
+
+Option validateFrameworkID(
+const ExecutorInfo& executor,
+Framework* framework)
+{
+  CHECK_NOTNULL(framework);
+
+  // Master ensures `ExecutorInfo.framework_id`
+  // is set before calling this method.
+  CHECK(executor.has_framework_id());
+
+  if (executor.framework_id() != framework->id()) {
+return Error(
+"ExecutorInfo has an invalid FrameworkID"
+" (Actual: " + stringify(executor.framework_id()) +
+" vs Expected: " + stringify(framework->id()) + ")");
+  }
+
+  return None();
+}
+
+
+Option validateShutdownGracePeriod(const ExecutorInfo& executor)
+{
+  // Make sure provided duration is non-negative.
+  if (executor.has_shutdown_grace_period() &&
+  Nanoseconds(executor.shutdown_grace_period().nanoseconds()) <
+Duration::zero()) {
+

[2/4] mesos git commit: Made `Offer::Operation::Type` optional with default `UNKNOWN`.

2016-08-15 Thread vinodkone
Made `Offer::Operation::Type` optional with default `UNKNOWN`.

This is necessary to introduce new offer operations in a backwards
compatible manner. See MESOS-4997 for context.

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


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

Branch: refs/heads/master
Commit: d3adee2d9500a0e1ed5124df7c79f8043ec2bfda
Parents: c7f5d87
Author: Vinod Kone 
Authored: Fri Aug 12 14:02:19 2016 -0700
Committer: Vinod Kone 
Committed: Mon Aug 15 15:25:05 2016 -0700

--
 include/mesos/mesos.proto|  3 ++-
 include/mesos/v1/mesos.proto |  3 ++-
 src/common/resources.cpp |  4 ++--
 src/master/master.cpp| 11 +--
 src/v1/resources.cpp |  4 ++--
 5 files changed, 17 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/d3adee2d/include/mesos/mesos.proto
--
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 90518a2..0326a5c 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -1252,6 +1252,7 @@ message Offer {
   // Defines an operation that can be performed against offers.
   message Operation {
 enum Type {
+  UNKNOWN = 0;
   LAUNCH = 1;
   RESERVE = 2;
   UNRESERVE = 3;
@@ -1279,7 +1280,7 @@ message Offer {
   repeated Resource volumes = 1;
 }
 
-required Type type = 1;
+optional Type type = 1;
 optional Launch launch = 2;
 optional Reserve reserve = 3;
 optional Unreserve unreserve = 4;

http://git-wip-us.apache.org/repos/asf/mesos/blob/d3adee2d/include/mesos/v1/mesos.proto
--
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index 93a4bce..fa29335 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -1251,6 +1251,7 @@ message Offer {
   // Defines an operation that can be performed against offers.
   message Operation {
 enum Type {
+  UNKNOWN = 0;
   LAUNCH = 1;
   RESERVE = 2;
   UNRESERVE = 3;
@@ -1278,7 +1279,7 @@ message Offer {
   repeated Resource volumes = 1;
 }
 
-required Type type = 1;
+optional Type type = 1;
 optional Launch launch = 2;
 optional Reserve reserve = 3;
 optional Unreserve unreserve = 4;

http://git-wip-us.apache.org/repos/asf/mesos/blob/d3adee2d/src/common/resources.cpp
--
diff --git a/src/common/resources.cpp b/src/common/resources.cpp
index 6b7af91..f180a0f 100644
--- a/src/common/resources.cpp
+++ b/src/common/resources.cpp
@@ -1234,8 +1234,8 @@ Try Resources::apply(const Offer::Operation& 
operation) const
   break;
 }
 
-default:
-  return Error("Unknown offer operation " + stringify(operation.type()));
+case Offer::Operation::UNKNOWN:
+  return Error("Unknown offer operation");
   }
 
   // The following are sanity checks to ensure the amount of each type of

http://git-wip-us.apache.org/repos/asf/mesos/blob/d3adee2d/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 0bd1a34..33c2ba1 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -3426,6 +3426,12 @@ void Master::accept(
 
 break;
   }
+
+  case Offer::Operation::UNKNOWN: {
+// TODO(vinod): Send an error event to the scheduler?
+LOG(ERROR) << "Ignoring unknown offer operation";
+break;
+  }
 }
   }
 
@@ -3861,9 +3867,10 @@ void Master::_accept(
 break;
   }
 
-  default:
-LOG(ERROR) << "Unsupported offer operation " << operation.type();
+  case Offer::Operation::UNKNOWN: {
+LOG(ERROR) << "Ignoring unknown offer operation";
 break;
+  }
 }
   }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/d3adee2d/src/v1/resources.cpp
--
diff --git a/src/v1/resources.cpp b/src/v1/resources.cpp
index 03ee0cb..4948b21 100644
--- a/src/v1/resources.cpp
+++ b/src/v1/resources.cpp
@@ -1237,8 +1237,8 @@ Try Resources::apply(const Offer::Operation& 
operation) const
   break;
 }
 
-default:
-  return Error("Unknown offer operation " + stringify(operation.type()));
+case Offer::Operation::UNKNOWN:
+  return Error("Unknown offer operation");
   }
 
   // The following are sanity checks to ensure the amount of each type of



[3/4] mesos git commit: Added LAUNCH_GROUP offer operation.

2016-08-15 Thread vinodkone
Added LAUNCH_GROUP offer operation.

A scheduler can use the LAUNCH_GROUP offer operation to send a
`TaskGroup` to an executor.

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


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

Branch: refs/heads/master
Commit: a43b015dabfb4b91378a8fe14b6a6d8d59c13fe7
Parents: d3adee2
Author: Vinod Kone 
Authored: Fri Aug 12 11:41:52 2016 -0700
Committer: Vinod Kone 
Committed: Mon Aug 15 15:25:05 2016 -0700

--
 include/mesos/mesos.proto| 36 ++--
 include/mesos/v1/mesos.proto | 36 ++--
 src/common/resources.cpp |  4 
 src/master/master.cpp| 12 
 src/v1/resources.cpp |  4 
 5 files changed, 88 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/a43b015d/include/mesos/mesos.proto
--
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 0326a5c..53b6547 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -518,7 +518,8 @@ message ExecutorInfo {
 //and 32 MB memory will be used; schedulers should account for these
 //resources when accepting offers.
 //
-// 3) Default executor only accepts a *single* launch operation.
+// 3) Default executor only accepts a *single* `LAUNCH` or `LAUNCH_GROUP`
+//offer operation.
 DEFAULT = 1;
 
 // For frameworks that need custom functionality to run tasks, a `CUSTOM`
@@ -529,7 +530,8 @@ message ExecutorInfo {
 
   // For backwards compatibility, if this field is not set when using `LAUNCH`
   // offer operation, Mesos will infer the type by checking if `command` is
-  // set (`CUSTOM`) or unset (`DEFAULT`).
+  // set (`CUSTOM`) or unset (`DEFAULT`). `type` must be set when using
+  // `LAUNCH_GROUP` offer operation.
   //
   // TODO(vinod): Add support for explicitly setting `type` to `DEFAULT `
   // in `LAUNCH` offer operation.
@@ -1254,16 +1256,31 @@ message Offer {
 enum Type {
   UNKNOWN = 0;
   LAUNCH = 1;
+  LAUNCH_GROUP = 6;
   RESERVE = 2;
   UNRESERVE = 3;
   CREATE = 4;
   DESTROY = 5;
 }
 
+// TODO(vinod): Deprecate this in favor of `LaunchGroup` below.
 message Launch {
   repeated TaskInfo task_infos = 1;
 }
 
+// Unlike `Launch` above, all the tasks in a `task_group` are
+// atomically delivered to an executor.
+//
+// `NetworkInfo` set on executor will be shared by all tasks in
+// the task group.
+//
+// TODO(vinod): Any volumes set on executor could be used by a
+// task by explicitly setting `Volume.source` in its resources.
+message LaunchGroup {
+  required ExecutorInfo executor = 1;
+  required TaskGroupInfo task_group = 2;
+}
+
 message Reserve {
   repeated Resource resources = 1;
 }
@@ -1282,6 +1299,7 @@ message Offer {
 
 optional Type type = 1;
 optional Launch launch = 2;
+optional LaunchGroup launch_group = 7;
 optional Reserve reserve = 3;
 optional Unreserve unreserve = 4;
 optional Create create = 5;
@@ -1389,6 +1407,20 @@ message TaskInfo {
 }
 
 
+/**
+ * Describes a group of tasks that belong to an executor. The
+ * executor will receive the task group in a single message to
+ * allow the group to be launched "atomically".
+ *
+ * NOTES:
+ * 1) `TaskInfo.executor` must not be set.
+ * 2) `NetworkInfo` must not be set inside task's `ContainerInfo`.
+ */
+message TaskGroupInfo {
+  repeated TaskInfo tasks = 1;
+}
+
+
 // TODO(bmahler): Add executor_uuid here, and send it to the master. This will
 // allow us to expose executor work directories for tasks in the webui when
 // looking from the master level. Currently only the slave knows which run the

http://git-wip-us.apache.org/repos/asf/mesos/blob/a43b015d/include/mesos/v1/mesos.proto
--
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index fa29335..f6b59e1 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -518,7 +518,8 @@ message ExecutorInfo {
 //and 32 MB memory will be used; schedulers should account for these
 //resources when accepting offers.
 //
-// 3) Default executor only accepts a *single* launch operation.
+// 3) Default executor only accepts a *single* `LAUNCH` or `LAUNCH_GROUP`
+//offer operation.
 DEFAULT = 1;
 
 // For frameworks that need custom functionality to run tasks, a 

[1/4] mesos git commit: Added LAUNCH_GROUP event to executor API.

2016-08-15 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master fc5f86ab0 -> 40115df30


Added LAUNCH_GROUP event to executor API.

This event is used to deliver a task group atomically to an executor.

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


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

Branch: refs/heads/master
Commit: 40115df3021cf0951cb3c9925cd979819d438e3a
Parents: a43b015
Author: Vinod Kone 
Authored: Fri Aug 12 15:41:01 2016 -0700
Committer: Vinod Kone 
Committed: Mon Aug 15 15:25:05 2016 -0700

--
 include/mesos/executor/executor.proto| 9 +
 include/mesos/v1/executor/executor.proto | 9 +
 src/examples/long_lived_executor.cpp | 5 +
 src/examples/test_http_executor.cpp  | 6 ++
 src/launcher/executor.cpp| 9 +
 src/tests/mesos.hpp  | 3 +++
 6 files changed, 41 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/40115df3/include/mesos/executor/executor.proto
--
diff --git a/include/mesos/executor/executor.proto 
b/include/mesos/executor/executor.proto
index 9aa046e..0d31406 100644
--- a/include/mesos/executor/executor.proto
+++ b/include/mesos/executor/executor.proto
@@ -40,6 +40,7 @@ message Event {
 
 SUBSCRIBED = 1;   // See 'Subscribed' below.
 LAUNCH = 2;   // See 'Launch' below.
+LAUNCH_GROUP = 8; // See 'LaunchGroup' below.
 KILL = 3; // See 'Kill' below.
 ACKNOWLEDGED = 4; // See 'Acknowledged' below.
 MESSAGE = 5;  // See 'Message' below.
@@ -80,6 +81,13 @@ message Event {
 required TaskInfo task = 1;
   }
 
+  // Received when the framework attempts to launch a group of tasks 
atomically.
+  // Similar to `Launch` above the executor must send TASK_RUNNING updates for
+  // tasks that are successfully launched.
+  message LaunchGroup {
+required TaskGroupInfo task_group = 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
@@ -129,6 +137,7 @@ message Event {
   optional Subscribed subscribed = 2;
   optional Acknowledged acknowledged = 3;
   optional Launch launch = 4;
+  optional LaunchGroup launch_group = 8;
   optional Kill kill = 5;
   optional Message message = 6;
   optional Error error = 7;

http://git-wip-us.apache.org/repos/asf/mesos/blob/40115df3/include/mesos/v1/executor/executor.proto
--
diff --git a/include/mesos/v1/executor/executor.proto 
b/include/mesos/v1/executor/executor.proto
index 5e76e4e..0783596 100644
--- a/include/mesos/v1/executor/executor.proto
+++ b/include/mesos/v1/executor/executor.proto
@@ -40,6 +40,7 @@ message Event {
 
 SUBSCRIBED = 1;   // See 'Subscribed' below.
 LAUNCH = 2;   // See 'Launch' below.
+LAUNCH_GROUP = 8; // See 'LaunchGroup' below.
 KILL = 3; // See 'Kill' below.
 ACKNOWLEDGED = 4; // See 'Acknowledged' below.
 MESSAGE = 5;  // See 'Message' below.
@@ -80,6 +81,13 @@ message Event {
 required TaskInfo task = 1;
   }
 
+  // Received when the framework attempts to launch a group of tasks 
atomically.
+  // Similar to `Launch` above the executor must send TASK_RUNNING updates for
+  // tasks that are successfully launched.
+  message LaunchGroup {
+required TaskGroupInfo task_group = 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
@@ -130,6 +138,7 @@ message Event {
   optional Subscribed subscribed = 2;
   optional Acknowledged acknowledged = 3;
   optional Launch launch = 4;
+  optional LaunchGroup launch_group = 8;
   optional Kill kill = 5;
   optional Message message = 6;
   optional Error error = 7;

http://git-wip-us.apache.org/repos/asf/mesos/blob/40115df3/src/examples/long_lived_executor.cpp
--
diff --git a/src/examples/long_lived_executor.cpp 
b/src/examples/long_lived_executor.cpp
index 5c1fde1..65fc9af 100644
--- a/src/examples/long_lived_executor.cpp
+++ b/src/examples/long_lived_executor.cpp
@@ -111,6 +111,11 @@ protected:
   break;
 }
 
+case Event::LAUNCH_GROUP: {
+  // TODO(vinod): Implement this.
+  break;
+}
+
 case Event::ACKNOWLEDGED: {
   // Remove the corresponding 

mesos git commit: Propagated work_dir flag from local runs to agents/masters.

2016-08-10 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 683551c92 -> 1f988a35b


Propagated work_dir flag from local runs to agents/masters.

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


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

Branch: refs/heads/master
Commit: 1f988a35b513b6c21484b34471a5171adf63ddd3
Parents: 683551c
Author: Ammar Askar 
Authored: Wed Aug 10 17:57:09 2016 -0700
Committer: Vinod Kone 
Committed: Wed Aug 10 17:57:09 2016 -0700

--
 src/local/flags.hpp | 22 ++
 src/local/local.cpp | 42 +-
 2 files changed, 35 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/1f988a35/src/local/flags.hpp
--
diff --git a/src/local/flags.hpp b/src/local/flags.hpp
index f0af0d2..c77eff1 100644
--- a/src/local/flags.hpp
+++ b/src/local/flags.hpp
@@ -18,6 +18,8 @@
 #define __LOCAL_FLAGS_HPP__
 
 #include 
+#include 
+#include 
 
 #include "logging/flags.hpp"
 
@@ -30,12 +32,32 @@ class Flags : public logging::Flags
 public:
   Flags()
   {
+// `work_dir` is passed from here to the agents/master.
+// This is necessary because `work_dir` is a required flag
+// in agents/master and without this, the load call for their
+// flags will spit out an error unless they have an env
+// variable for the `work_dir` explicitly set.
+// Since local mode is used strictly for non-production
+// purposes, it is the one case where we deem it acceptable
+// to set a default value for `work_dir`.
+add(::work_dir,
+"work_dir",
+"Path of the master/agent work directory. This is where the\n"
+"persistent information of the cluster will be stored.\n"
+"Note that locations like `/tmp` which are cleaned\n"
+"automatically are not suitable for the work directory\n"
+"when running in production, since long-running masters\n"
+"and agents could lose data when cleanup occurs.\n"
+"(Example: `/var/lib/mesos`)",
+path::join(os::temp(), "mesos", "local"));
+
 add(::num_slaves,
 "num_slaves",
 "Number of agents to launch for local cluster",
 1);
   }
 
+  std::string work_dir;
   int num_slaves;
 };
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/1f988a35/src/local/local.cpp
--
diff --git a/src/local/local.cpp b/src/local/local.cpp
index d6fe4d0..1e1d246 100644
--- a/src/local/local.cpp
+++ b/src/local/local.cpp
@@ -168,9 +168,20 @@ PID launch(const Flags& flags, Allocator* 
_allocator)
 
   files = new Files();
 
+  // Attempt to create the `work_dir` as a convenience.
+  Try mkdir = os::mkdir(flags.work_dir);
+  if (mkdir.isError()) {
+EXIT(EXIT_FAILURE)
+  << "Failed to create the work_dir for agents/master '"
+  << flags.work_dir << "': " << mkdir.error();
+  }
+
+  std::map propagated_flags;
+  propagated_flags["work_dir"] = flags.work_dir;
+
   {
 master::Flags flags;
-Try load = flags.load("MESOS_");
+Try load = flags.load(propagated_flags, false, "MESOS_");
 if (load.isError()) {
   EXIT(EXIT_FAILURE)
 << "Failed to start a local cluster while loading"
@@ -194,15 +205,6 @@ PID launch(const Flags& flags, Allocator* 
_allocator)
 if (flags.registry == "in_memory") {
   storage = new mesos::state::InMemoryStorage();
 } else if (flags.registry == "replicated_log") {
-  // For local runs, we use a temporary work directory.
-  if (flags.work_dir.isNone()) {
-CHECK_SOME(os::mkdir("/tmp/mesos/local"));
-
-Try directory = os::mkdtemp("/tmp/mesos/local/XX");
-CHECK_SOME(directory);
-flags.work_dir = directory.get();
-  }
-
   // TODO(vinod): Add support for replicated log with ZooKeeper.
   log = new Log(
   1,
@@ -339,25 +341,7 @@ PID launch(const Flags& flags, Allocator* 
_allocator)
   for (int i = 0; i < flags.num_slaves; i++) {
 slave::Flags flags;
 
-if (os::getenv("MESOS_WORK_DIR").isNone()) {
-  const string workDir = "/tmp/mesos/local/agents";
-  Try mkdir = os::mkdir(workDir);
-  if (mkdir.isError()) {
-EXIT(EXIT_FAILURE)
-  << "Failed to create the root work directory for local agents '"
-  << workDir << "': " << mkdir.error();
-  }
-
-  flags.work_dir = path::join(workDir, stringify(i));
-  Try directory = os::mkdir(flags.work_dir);
-  if (directory.isError()) {
-

svn commit: r14761 - in /dev/mesos/1.0.1-rc1: ./ mesos-1.0.1.tar.gz mesos-1.0.1.tar.gz.asc mesos-1.0.1.tar.gz.md5

2016-08-10 Thread vinodkone
Author: vinodkone
Date: Thu Aug 11 00:29:32 2016
New Revision: 14761

Log:
Adding mesos-1.0.1-rc1.

Added:
dev/mesos/1.0.1-rc1/
dev/mesos/1.0.1-rc1/mesos-1.0.1.tar.gz   (with props)
dev/mesos/1.0.1-rc1/mesos-1.0.1.tar.gz.asc
dev/mesos/1.0.1-rc1/mesos-1.0.1.tar.gz.md5

Added: dev/mesos/1.0.1-rc1/mesos-1.0.1.tar.gz
==
Binary file - no diff available.

Propchange: dev/mesos/1.0.1-rc1/mesos-1.0.1.tar.gz
--
svn:mime-type = application/octet-stream

Added: dev/mesos/1.0.1-rc1/mesos-1.0.1.tar.gz.asc
==
--- dev/mesos/1.0.1-rc1/mesos-1.0.1.tar.gz.asc (added)
+++ dev/mesos/1.0.1-rc1/mesos-1.0.1.tar.gz.asc Thu Aug 11 00:29:32 2016
@@ -0,0 +1,11 @@
+-BEGIN PGP SIGNATURE-
+Version: GnuPG v1
+
+iQEcBAABAgAGBQJXq8bgAAoJEBf21SiiwsdKOtsH/2lndEMRgufihdNu08FtfW5v
+8eTLImBWLOkz4rJFjX7ZUr8OB3FgH9LVxwXZVo9qHNx49eY6LwjlF7ObBx7EOv8S
+8HYATcoVsRez8f7GpOvGsrYoN92wjS3jLtaDRXc/Ad8EBhGijGMMkB53qoA9aoSj
+PF+BP+e3p+5jNoyCD7Q8P2dqSS3FS36F27gfWmwlblqGv91iCDnzot6lGfqy/Jnv
+aj+QZWhaNCItIdxrvaQIiC9aDssClmX5jwXO00h8RXvUpCOtSDMltKlPihysoqXY
+hTzWBGBsdKpzb4YeWx+gVjuGdGuduk60SHV13YGBnq37mbTpi+1zpqt5m/8jAw8=
+=ieI4
+-END PGP SIGNATURE-

Added: dev/mesos/1.0.1-rc1/mesos-1.0.1.tar.gz.md5
==
--- dev/mesos/1.0.1-rc1/mesos-1.0.1.tar.gz.md5 (added)
+++ dev/mesos/1.0.1-rc1/mesos-1.0.1.tar.gz.md5 Thu Aug 11 00:29:32 2016
@@ -0,0 +1 @@
+mesos-1.0.1.tar.gz: 1A AC A0 0A 0F FB 20 F4  B3 1C 2D CC 24 47 C2 C5




[mesos] Git Push Summary

2016-08-10 Thread vinodkone
Repository: mesos
Updated Tags:  refs/tags/1.0.1-rc1 [created] 3611eb0b7


mesos git commit: Used MESOS_VERSION instead of fixed mesos version string.

2016-08-10 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/1.0.x 8c6e36600 -> 3611eb0b7


Used MESOS_VERSION instead of fixed mesos version string.

Fixed the hard coded version string in GetAgents test in
api_tests.

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


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

Branch: refs/heads/1.0.x
Commit: 3611eb0b7eea8d144e9b2e840e0ba16f2f659ee3
Parents: 8c6e366
Author: zhou xing 
Authored: Fri Jul 8 09:54:50 2016 -0500
Committer: Vinod Kone 
Committed: Wed Aug 10 16:57:40 2016 -0700

--
 src/tests/api_tests.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/3611eb0b/src/tests/api_tests.cpp
--
diff --git a/src/tests/api_tests.cpp b/src/tests/api_tests.cpp
index 5809e99..4db049a 100644
--- a/src/tests/api_tests.cpp
+++ b/src/tests/api_tests.cpp
@@ -190,7 +190,7 @@ TEST_P(MasterAPITest, GetAgents)
   ASSERT_EQ("host", v1Agent.agent_info().hostname());
   ASSERT_EQ(agent.get()->pid, v1Agent.pid());
   ASSERT_TRUE(v1Agent.active());
-  ASSERT_EQ("1.0.0", v1Agent.version());
+  ASSERT_EQ(MESOS_VERSION, v1Agent.version());
   ASSERT_EQ(4, v1Agent.total_resources_size());
 }
 



mesos git commit: Updated version in configure.ac and CMakeLists.txt.

2016-08-10 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/1.0.x 69fe49dc1 -> 8c6e36600


Updated version in configure.ac and CMakeLists.txt.


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

Branch: refs/heads/1.0.x
Commit: 8c6e36600e62e1a4c282356ba91bbb1cf2375e08
Parents: 69fe49d
Author: Vinod Kone 
Authored: Wed Aug 10 16:35:20 2016 -0700
Committer: Vinod Kone 
Committed: Wed Aug 10 16:35:20 2016 -0700

--
 CMakeLists.txt | 2 +-
 configure.ac   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/8c6e3660/CMakeLists.txt
--
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 31601a2..92cb6c4 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,7 +21,7 @@ cmake_minimum_required(VERSION 2.8)
 project(Mesos)
 set(MESOS_MAJOR_VERSION 1)
 set(MESOS_MINOR_VERSION 0)
-set(MESOS_PATCH_VERSION 0)
+set(MESOS_PATCH_VERSION 1)
 set(PACKAGE_VERSION
   ${MESOS_MAJOR_VERSION}.${MESOS_MINOR_VERSION}.${MESOS_PATCH_VERSION})
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/8c6e3660/configure.ac
--
diff --git a/configure.ac b/configure.ac
index b02a62a..c67733f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.61])
-AC_INIT([mesos], [1.0.0])
+AC_INIT([mesos], [1.0.1])
 
 # Have autoconf setup some variables related to the system.
 AC_CANONICAL_HOST



mesos git commit: Updated CHANGELOG for 1.0.1.

2016-08-10 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/1.0.x 4d76bb145 -> 69fe49dc1


Updated CHANGELOG for 1.0.1.


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

Branch: refs/heads/1.0.x
Commit: 69fe49dc1f5f56f1f99a2434f94b3ca91010ce28
Parents: 4d76bb1
Author: Vinod Kone 
Authored: Wed Aug 10 16:32:10 2016 -0700
Committer: Vinod Kone 
Committed: Wed Aug 10 16:32:59 2016 -0700

--
 CHANGELOG | 37 ++---
 1 file changed, 22 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/69fe49dc/CHANGELOG
--
diff --git a/CHANGELOG b/CHANGELOG
index e612c4e..6ab89f6 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,21 +4,28 @@ Release Notes - Mesos - Version 1.0.1
 
 All Issues:
 ** Bug
-  * [MESOS-5388] - MesosContainerizerLaunch flags execute arbitrary commands 
via shell.
-  * [MESOS-5911] - Webui redirection to leader in browser does not work.
-  * [MESOS-5913] - Stale socket FD usage when using libevent + SSL.
-  * [MESOS-5922] - mesos-agent --help exit status is 1
-  * [MESOS-5923] - Ubuntu 14.04 LTS GPU Isolator "/run" directory is noexec.
-  * [MESOS-5927] - Unable to run "scratch" Dockerfiles with Unified 
Containerizer.
-  * [MESOS-5928] - Agent's '--version' flag doesn't work
-  * [MESOS-5930] - Orphan tasks can shown up as running after they have 
finished.
-  * [MESOS-5943] - Incremental http parsing of URLs leads to decoder error.
-  * [MESOS-5945] - NvidiaVolume::create() should check for root before 
creating volume.
-  * [MESOS-5959] - All non-root tests fail on GPU machine.
-  * [MESOS-5969] - Linux 'MountInfoTable' entries not sorted as expected
-  * [MESOS-5982] - NvidiaVolume errors out if any Nvidia binary is missing.
-  * [MESOS-5986] - SSL Socket CHECK can fail after socket receives EOF.
-  * [MESOS-5988] - PollSocketImpl can write to a stale file descriptor.
+* [MESOS-5388] - MesosContainerizerLaunch flags execute arbitrary commands 
via shell.
+* [MESOS-5862] - External links to .md files broken.
+* [MESOS-5911] - Webui redirection to leader in browser does not work
+* [MESOS-5913] - Stale socket FD usage when using libevent + SSL.
+* [MESOS-5922] - mesos-agent --help exit status is 1
+* [MESOS-5923] - Ubuntu 14.04 LTS GPU Isolator "/run" directory is noexec
+* [MESOS-5927] - Unable to run "scratch" Dockerfiles with Unified 
Containerizer.
+* [MESOS-5928] - Agent's '--version' flag doesn't work
+* [MESOS-5930] - Orphan tasks can show up as running after they have 
finished.
+* [MESOS-5943] - Incremental http parsing of URLs leads to decoder error
+* [MESOS-5945] - NvidiaVolume::create() should check for root before 
creating volume
+* [MESOS-5959] - All non-root tests fail on GPU machine
+* [MESOS-5969] - Linux 'MountInfoTable' entries not sorted as expected
+* [MESOS-5982] - NvidiaVolume errors out if any binary is missing
+* [MESOS-5986] - SSL Socket CHECK can fail after socket receives EOF
+* [MESOS-5988] - PollSocketImpl can write to a stale fd.
+
+** Improvement
+* [MESOS-5830] - Make a sweep to trim excess space around angle brackets
+
+** Task
+* [MESOS-5970] - Remove HTTP_PARSER_VERSION_MAJOR < 2 code in decoder.
 
 
 Release Notes - Mesos - Version 1.0.0



[2/2] mesos git commit: Updated CHANGELOG for 1.0.1.

2016-08-10 Thread vinodkone
Updated CHANGELOG for 1.0.1.


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

Branch: refs/heads/master
Commit: 853869eb39c62c3a405b4588c82bfc2902575bdc
Parents: 0f79782
Author: Vinod Kone 
Authored: Wed Aug 10 16:32:10 2016 -0700
Committer: Vinod Kone 
Committed: Wed Aug 10 16:32:10 2016 -0700

--
 CHANGELOG | 37 ++---
 1 file changed, 22 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/853869eb/CHANGELOG
--
diff --git a/CHANGELOG b/CHANGELOG
index 3008e8b..4fd9364 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,21 +4,28 @@ Release Notes - Mesos - Version 1.0.1
 
 All Issues:
 ** Bug
-  * [MESOS-5388] - MesosContainerizerLaunch flags execute arbitrary commands 
via shell.
-  * [MESOS-5911] - Webui redirection to leader in browser does not work.
-  * [MESOS-5913] - Stale socket FD usage when using libevent + SSL.
-  * [MESOS-5922] - mesos-agent --help exit status is 1
-  * [MESOS-5923] - Ubuntu 14.04 LTS GPU Isolator "/run" directory is noexec.
-  * [MESOS-5927] - Unable to run "scratch" Dockerfiles with Unified 
Containerizer.
-  * [MESOS-5928] - Agent's '--version' flag doesn't work
-  * [MESOS-5930] - Orphan tasks can shown up as running after they have 
finished.
-  * [MESOS-5943] - Incremental http parsing of URLs leads to decoder error.
-  * [MESOS-5945] - NvidiaVolume::create() should check for root before 
creating volume.
-  * [MESOS-5959] - All non-root tests fail on GPU machine.
-  * [MESOS-5969] - Linux 'MountInfoTable' entries not sorted as expected
-  * [MESOS-5982] - NvidiaVolume errors out if any Nvidia binary is missing.
-  * [MESOS-5986] - SSL Socket CHECK can fail after socket receives EOF.
-  * [MESOS-5988] - PollSocketImpl can write to a stale file descriptor.
+* [MESOS-5388] - MesosContainerizerLaunch flags execute arbitrary commands 
via shell.
+* [MESOS-5862] - External links to .md files broken.
+* [MESOS-5911] - Webui redirection to leader in browser does not work
+* [MESOS-5913] - Stale socket FD usage when using libevent + SSL.
+* [MESOS-5922] - mesos-agent --help exit status is 1
+* [MESOS-5923] - Ubuntu 14.04 LTS GPU Isolator "/run" directory is noexec
+* [MESOS-5927] - Unable to run "scratch" Dockerfiles with Unified 
Containerizer.
+* [MESOS-5928] - Agent's '--version' flag doesn't work
+* [MESOS-5930] - Orphan tasks can show up as running after they have 
finished.
+* [MESOS-5943] - Incremental http parsing of URLs leads to decoder error
+* [MESOS-5945] - NvidiaVolume::create() should check for root before 
creating volume
+* [MESOS-5959] - All non-root tests fail on GPU machine
+* [MESOS-5969] - Linux 'MountInfoTable' entries not sorted as expected
+* [MESOS-5982] - NvidiaVolume errors out if any binary is missing
+* [MESOS-5986] - SSL Socket CHECK can fail after socket receives EOF
+* [MESOS-5988] - PollSocketImpl can write to a stale fd.
+
+** Improvement
+* [MESOS-5830] - Make a sweep to trim excess space around angle brackets
+
+** Task
+* [MESOS-5970] - Remove HTTP_PARSER_VERSION_MAJOR < 2 code in decoder.
 
 
 Release Notes - Mesos - Version 1.0.0



mesos git commit: Fixed typo for REX-Ray in 1.0 blog post.

2016-08-10 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 044450208 -> f7bc7e470


Fixed typo for REX-Ray in 1.0 blog post.


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

Branch: refs/heads/master
Commit: f7bc7e470a64fde5b539adac810ccd1f77ebf119
Parents: 0444502
Author: Vinod Kone 
Authored: Wed Aug 10 12:31:13 2016 -0700
Committer: Vinod Kone 
Committed: Wed Aug 10 12:31:13 2016 -0700

--
 site/source/blog/2016-07-27-mesos-1-0-0-released.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/f7bc7e47/site/source/blog/2016-07-27-mesos-1-0-0-released.md
--
diff --git a/site/source/blog/2016-07-27-mesos-1-0-0-released.md 
b/site/source/blog/2016-07-27-mesos-1-0-0-released.md
index 6252c4d..62a1dd3 100644
--- a/site/source/blog/2016-07-27-mesos-1-0-0-released.md
+++ b/site/source/blog/2016-07-27-mesos-1-0-0-released.md
@@ -36,7 +36,7 @@ With the addition of support for the Container Networking 
Interface ([CNI](https
 One of the highlights of the new CNI support is the ability to now provide a 
single IP per container in Mesos.  This is one of the most requested features 
that Mesos has ever had!! Since the CNI interface is widely supported by 
networking vendors, this gives Mesos tremendous flexibility in orchestrating 
containers on a wide variety of networking technologies (e.g, VxLAN, [DC/OS 
overlay](https://dcos.io/docs/1.8/administration/overlay-networks/), 
[Calico](https://www.projectcalico.org/), 
[Weave](https://github.com/weaveworks/weave-cni), 
[Flannel](https://github.com/containernetworking/cni/blob/master/Documentation/flannel.md)).
 
 ### Storage
-Starting from Mesos 1.0, we added **experimnental support** for external 
storage to Mesos. Before this feature, while users could use persistent volumes 
for running stateful services, there were some limitations. First, the users 
were not able to easily use non-local storage volumes. Second, data migrations 
for local persistent volumes had to be manually handled by operators. The newly 
added `docker/volume` isolator addresses these limitations. Currently, the 
isolator interacts with the Docker volume plugins (e.g., 
[Rexray](https://github.com/emccode/rexray), 
[Flocker](https://github.com/ClusterHQ/flocker), 
[Convoy](https://github.com/rancher/convoy)) using a tool called `dvdcli`. By 
speaking the Docker volume plugin API, Mesos containers can connect with 
external volumes from numerous storage providers (e.g., Amazon EBS, Ceph, EMC 
ScaleIO).
+Starting from Mesos 1.0, we added **experimnental support** for external 
storage to Mesos. Before this feature, while users could use persistent volumes 
for running stateful services, there were some limitations. First, the users 
were not able to easily use non-local storage volumes. Second, data migrations 
for local persistent volumes had to be manually handled by operators. The newly 
added `docker/volume` isolator addresses these limitations. Currently, the 
isolator interacts with the Docker volume plugins (e.g., 
[REX-Ray](https://github.com/emccode/rexray), 
[Flocker](https://github.com/ClusterHQ/flocker), 
[Convoy](https://github.com/rancher/convoy)) using a tool called `dvdcli`. By 
speaking the Docker volume plugin API, Mesos containers can connect with 
external volumes from numerous storage providers (e.g., Amazon EBS, Ceph, EMC 
ScaleIO).
 
 ### Security
 



mesos git commit: Removed `test_containerizer.py` from src/Makefile.am.

2016-08-10 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master b2d83a3b8 -> 044450208


Removed `test_containerizer.py` from src/Makefile.am.

This file was deleted when we removed the external containerizer.


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

Branch: refs/heads/master
Commit: 0444502085b3bb5f606b5ccba4ec772a956faa98
Parents: b2d83a3
Author: Vinod Kone 
Authored: Wed Aug 10 12:25:20 2016 -0700
Committer: Vinod Kone 
Committed: Wed Aug 10 12:25:20 2016 -0700

--
 src/Makefile.am | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/04445020/src/Makefile.am
--
diff --git a/src/Makefile.am b/src/Makefile.am
index cf76a69..33706e5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2255,7 +2255,6 @@ mesos_tests_DEPENDENCIES += $(EXAMPLESCRIPTSPYTHON)
 endif
 
 EXTRA_DIST +=  \
-  examples/python/test_containerizer.py\
   examples/python/test_executor.py \
   examples/python/test_framework.py
 



mesos git commit: Added coverity build to build_docker.sh.

2016-08-09 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master b0c86496e -> 705896003


Added coverity build to build_docker.sh.

This review adds an coverity build option
to build_docker.sh in order to enable
regular coverity builds on the ASF infrastructure.

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


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

Branch: refs/heads/master
Commit: 7058960035c99ce82f45e6dba90375236e5f736d
Parents: b0c8649
Author: Joerg Schad 
Authored: Tue Aug 9 21:33:21 2016 -0700
Committer: Vinod Kone 
Committed: Tue Aug 9 21:33:21 2016 -0700

--
 support/docker_build.sh | 85 +---
 1 file changed, 49 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/70589600/support/docker_build.sh
--
diff --git a/support/docker_build.sh b/support/docker_build.sh
index 8ae1aad..5c38c5c 100755
--- a/support/docker_build.sh
+++ b/support/docker_build.sh
@@ -64,6 +64,7 @@ case $OS in
 append_dockerfile "RUN apt-get update"
 append_dockerfile "RUN apt-get -y install build-essential $CLANG_PKG git 
maven autoconf libtool cmake"
 append_dockerfile "RUN apt-get -y install openjdk-7-jdk python-dev 
libcurl4-nss-dev libsasl2-dev libapr1-dev libsvn-dev libevent-dev libev-dev"
+append_dockerfile "RUN apt-get -y install wget curl sed"
 
 # Add an unpriviliged user.
 append_dockerfile "RUN adduser --disabled-password --gecos '' mesos"
@@ -121,42 +122,54 @@ append_dockerfile "ENV DISTCHECK_CONFIGURE_FLAGS 
$CONFIGURATION"
 # Set the environment for build.
 append_dockerfile "ENV $ENVIRONMENT"
 
-# Build and check Mesos.
-case $BUILDTOOL in
-  autotools)
-append_dockerfile "CMD ./bootstrap && ./configure $CONFIGURATION && make 
-j8 distcheck"
-;;
-  cmake)
-# Transform autotools-like parameters to cmake-like.
-# Remove "'".
-CONFIGURATION=${CONFIGURATION//\'/""}
-# Replace "-" with "_".
-CONFIGURATION=${CONFIGURATION//-/"_"}
-# Replace "__" with "-D".
-CONFIGURATION=${CONFIGURATION//__/"-D"}
-# To Upper Case.
-CONFIGURATION=${CONFIGURATION^^}
-
-# Add "=1" suffix to each variable.
-IFS=' ' read -r  -a array <<< "$CONFIGURATION"
-
-CONFIGURATION=""
-for element in "${array[@]}"
-do
-CONFIGURATION="$CONFIGURATION $element=1"
-done
-
-# MESOS-5433: `distcheck` is not currently supported by our CMake scripts.
-# MESOS-5624: In source build is not yet supported.
-# Also, we run `make` in addition to `make check` because the latter only
-# compiles stout and libprocess sources and tests.
-append_dockerfile "CMD ./bootstrap && mkdir build && cd build && cmake 
$CONFIGURATION .. && make -j8 check && make -j8"
-;;
-  *)
-echo "Unknown build tool $BUILDTOOL"
-exit 1
-;;
-esac
+# Perform coverity build if requested.
+if [ -n "$COVERITY_TOKEN" ]
+ then
+   # Note currently the coverity build is only tested with ubuntu:14:04, 
autotools, and gcc.
+
+# Download coverity tools, build using coverity wrapper and upload results.
+append_dockerfile "ENV MESOS_VERSION $(grep "AC_INIT" configure.ac | sed 
's/AC_INIT[(]\[mesos\], \[\(.*\)\][)]/\1/')"
+append_dockerfile "RUN wget https://scan.coverity.com/download/linux64  
--post-data \"token=$COVERITY_TOKEN=Mesos\" -O coverity_tool.tgz"
+append_dockerfile "RUN tar xvf coverity_tool.tgz; mv cov-analysis-linux* 
cov-analysis"
+append_dockerfile "CMD ./bootstrap && ./configure $CONFIGURATION &&  
cov-analysis/bin/cov-build -dir cov-int make -j8 && tar czcf mesos.tgz cov-int 
&& tail cov-int/build-log.txt && curl --form \"token=$COVERITY_TOKEN\" --form 
\"email=d...@mesos.apache.org\"  --form \"file=@mesos.tgz\" --form 
\"version=$MESOS_VERSION\" --form \"description='Continious Coverity Build'\"   
https://scan.coverity.com/builds?project=Mesos;
+else
+# Build and check Mesos.
+case $BUILDTOOL in
+  autotools)
+   append_dockerfile "CMD ./bootstrap && ./configure $CONFIGURATION && 
make -j8 distcheck"
+   ;;
+  cmake)
+   # Transform autotools-like parameters to cmake-like.
+   # Remove "'".
+   CONFIGURATION=${CONFIGURATION//\'/""}
+   # Replace "-" with "_".
+   CONFIGURATION=${CONFIGURATION//-/"_"}
+   # Replace "__" with "-D".
+   CONFIGURATION=${CONFIGURATION//__/"-D"}
+   # To Upper Case.
+   CONFIGURATION=${CONFIGURATION^^}
+
+   # Add "=1" suffix to each variable.
+   IFS=' ' read -r  -a array <<< "$CONFIGURATION"
+
+   CONFIGURATION=""
+  

mesos git commit: Added new contributor (Gaojin CAO).

2016-08-08 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master c81ddb641 -> ffafe9b23


Added new contributor (Gaojin CAO).

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


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

Branch: refs/heads/master
Commit: ffafe9b232c64e0efe73e62c851914301c542515
Parents: c81ddb6
Author: Gaojin CAO 
Authored: Mon Aug 8 14:57:07 2016 -0700
Committer: Vinod Kone 
Committed: Mon Aug 8 14:57:07 2016 -0700

--
 docs/contributors.yaml | 8 
 1 file changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/ffafe9b2/docs/contributors.yaml
--
diff --git a/docs/contributors.yaml b/docs/contributors.yaml
index 7114bd6..e57ccba 100644
--- a/docs/contributors.yaml
+++ b/docs/contributors.yaml
@@ -125,6 +125,14 @@
   jira_user: darroyo
   reviewboard_user: darroyo
 
+- name: Gaojin CAO
+  affiliations:
+- {organization: chinamobile}
+  emails:
+- caogao...@cmss.chinamobile.com
+  jira_user: cgj
+  reviewboard_user: cgj
+
 - name: Gaston Kleiman
   affiliations:
 - {organization: Mesosphere}



mesos git commit: Renamed the filter for tests that depend on "perf".

2016-08-05 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 5220f7758 -> 50f591a78


Renamed the filter for tests that depend on "perf".

Previously, any test case that had "Perf" in its name would only be run
when the perf(1) command was installed. This is inconsistent with other
name-based filters for test cases (e.g., "ROOT_" or "CGROUPS_"). It also
meant that the filter matched "Registrar_BENCHMARK_Test.Performance",
which was a bug (the test does not depend on perf).

Instead, use "PERF_" to indicate tests that can only be run when perf(1)
is installed.

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


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

Branch: refs/heads/master
Commit: 50f591a78f65f8a8d03dd7dde7f7420e5a90c770
Parents: 5220f77
Author: Neil Conway 
Authored: Fri Aug 5 16:43:29 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 5 16:43:29 2016 -0700

--
 src/tests/containerizer/cgroups_tests.cpp  |  2 +-
 src/tests/containerizer/isolator_tests.cpp |  4 ++--
 src/tests/containerizer/perf_tests.cpp |  4 ++--
 src/tests/environment.cpp  | 18 ++
 src/tests/slave_recovery_tests.cpp |  2 +-
 5 files changed, 12 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/50f591a7/src/tests/containerizer/cgroups_tests.cpp
--
diff --git a/src/tests/containerizer/cgroups_tests.cpp 
b/src/tests/containerizer/cgroups_tests.cpp
index d766f0f..821c786 100644
--- a/src/tests/containerizer/cgroups_tests.cpp
+++ b/src/tests/containerizer/cgroups_tests.cpp
@@ -971,7 +971,7 @@ public:
 };
 
 
-TEST_F(CgroupsAnyHierarchyWithPerfEventTest, ROOT_CGROUPS_Perf)
+TEST_F(CgroupsAnyHierarchyWithPerfEventTest, ROOT_CGROUPS_PERF_PerfTest)
 {
   int pipes[2];
   int dummy;

http://git-wip-us.apache.org/repos/asf/mesos/blob/50f591a7/src/tests/containerizer/isolator_tests.cpp
--
diff --git a/src/tests/containerizer/isolator_tests.cpp 
b/src/tests/containerizer/isolator_tests.cpp
index 4887473..827c9f0 100644
--- a/src/tests/containerizer/isolator_tests.cpp
+++ b/src/tests/containerizer/isolator_tests.cpp
@@ -1218,7 +1218,7 @@ TEST_F(NetClsIsolatorTest, ROOT_CGROUPS_ContainerStatus)
 class PerfEventIsolatorTest : public MesosTest {};
 
 
-TEST_F(PerfEventIsolatorTest, ROOT_CGROUPS_Sample)
+TEST_F(PerfEventIsolatorTest, ROOT_CGROUPS_PERF_Sample)
 {
   slave::Flags flags;
 
@@ -1602,7 +1602,7 @@ typedef ::testing::Types<
 TYPED_TEST_CASE(UserCgroupIsolatorTest, CgroupsIsolatorTypes);
 
 
-TYPED_TEST(UserCgroupIsolatorTest, ROOT_CGROUPS_UserCgroup)
+TYPED_TEST(UserCgroupIsolatorTest, ROOT_CGROUPS_PERF_UserCgroup)
 {
   slave::Flags flags = UserCgroupIsolatorTest::CreateSlaveFlags();
   flags.perf_events = "cpu-cycles"; // Needed for CgroupsPerfEventIsolator.

http://git-wip-us.apache.org/repos/asf/mesos/blob/50f591a7/src/tests/containerizer/perf_tests.cpp
--
diff --git a/src/tests/containerizer/perf_tests.cpp 
b/src/tests/containerizer/perf_tests.cpp
index 3dc5b0f..e5ee3e7 100644
--- a/src/tests/containerizer/perf_tests.cpp
+++ b/src/tests/containerizer/perf_tests.cpp
@@ -40,7 +40,7 @@ namespace tests {
 class PerfTest : public ::testing::Test {};
 
 
-TEST_F(PerfTest, ROOT_Events)
+TEST_F(PerfTest, ROOT_PERF_Events)
 {
   // Valid events.
   EXPECT_TRUE(perf::valid({"cycles", "task-clock"}));
@@ -50,7 +50,7 @@ TEST_F(PerfTest, ROOT_Events)
 }
 
 
-TEST_F(PerfTest, ROOT_Sample)
+TEST_F(PerfTest, ROOT_PERF_Sample)
 {
   // Sampling an empty set of cgroups should be a no-op.
   Future> sample =

http://git-wip-us.apache.org/repos/asf/mesos/blob/50f591a7/src/tests/environment.cpp
--
diff --git a/src/tests/environment.cpp b/src/tests/environment.cpp
index 0d22c4b..6960c2a 100644
--- a/src/tests/environment.cpp
+++ b/src/tests/environment.cpp
@@ -588,11 +588,11 @@ public:
   bool disable(const ::testing::TestInfo* test) const
   {
 // Disable all tests that try to sample 'cpu-cycles' events using 'perf'.
-return (matches(test, "ROOT_CGROUPS_Perf") ||
-matches(test, "ROOT_CGROUPS_Sample") ||
-matches(test, "ROOT_CGROUPS_UserCgroup") ||
-matches(test, "CGROUPS_ROOT_PerfRollForward") ||
-matches(test, "ROOT_Sample")) && perfError.isSome();
+return (matches(test, "ROOT_CGROUPS_PERF_PerfTest") ||
+matches(test, 

[2/5] mesos git commit: Added more assertions to master code.

2016-08-05 Thread vinodkone
Added more assertions to master code.

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


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

Branch: refs/heads/master
Commit: 60dbd347b409c788776760a8270965d943b6806e
Parents: 2992565
Author: Neil Conway 
Authored: Fri Aug 5 16:41:18 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 5 16:41:18 2016 -0700

--
 src/master/master.cpp | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/60dbd347/src/master/master.cpp
--
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 9259509..0bd1a34 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -4572,6 +4572,7 @@ void Master::_registerSlave(
 const string& version,
 const Future& admit)
 {
+  CHECK(slaves.registering.contains(pid));
   slaves.registering.erase(pid);
 
   CHECK(!admit.isDiscarded());
@@ -4822,6 +4823,7 @@ void Master::_reregisterSlave(
 const string& version,
 const Future& readmit)
 {
+  CHECK(slaves.reregistering.contains(slaveInfo.id()));
   slaves.reregistering.erase(slaveInfo.id());
 
   CHECK(!readmit.isDiscarded());
@@ -5933,6 +5935,7 @@ void Master::_authenticate(
 authenticated.put(pid, future.get().get());
   }
 
+  CHECK(authenticating.contains(pid));
   authenticating.erase(pid);
 }
 
@@ -6720,6 +6723,7 @@ void Master::_removeSlave(
 const string& message,
 Option reason)
 {
+  CHECK(slaves.removing.contains(slaveInfo.id()));
   slaves.removing.erase(slaveInfo.id());
 
   CHECK(!removed.isDiscarded());



[4/5] mesos git commit: Cleaned up comments in fault tolerance tests.

2016-08-05 Thread vinodkone
Cleaned up comments in fault tolerance tests.

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


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

Branch: refs/heads/master
Commit: 8a0b17a11560f482628e890094e83400fa805a80
Parents: 5de96fa
Author: Neil Conway 
Authored: Fri Aug 5 16:41:35 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 5 16:41:35 2016 -0700

--
 src/tests/fault_tolerance_tests.cpp | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/8a0b17a1/src/tests/fault_tolerance_tests.cpp
--
diff --git a/src/tests/fault_tolerance_tests.cpp 
b/src/tests/fault_tolerance_tests.cpp
index 661cc8b..5a9944c 100644
--- a/src/tests/fault_tolerance_tests.cpp
+++ b/src/tests/fault_tolerance_tests.cpp
@@ -158,7 +158,7 @@ TEST_F(FaultToleranceTest, MasterFailover)
 // This test ensures that a failed over master recovers completed tasks
 // from a slave's re-registration when the slave thinks the framework has
 // completed (but the framework has not actually completed yet from master's
-// point of view.
+// point of view).
 TEST_F(FaultToleranceTest, ReregisterCompletedFrameworks)
 {
   // Step 1. Start Master and Slave.
@@ -340,6 +340,7 @@ TEST_F(FaultToleranceTest, ReregisterCompletedFrameworks)
   Future executorLost;
   EXPECT_CALL(sched, executorLost(, DEFAULT_EXECUTOR_ID, _, _))
 .WillOnce(FutureSatisfy());
+
   // Induce an ExitedExecutorMessage from the slave.
   containerizer.destroy(
   frameworkId.get(), DEFAULT_EXECUTOR_INFO.executor_id());
@@ -1082,8 +1083,8 @@ TEST_F(FaultToleranceTest, 
ReregisterFrameworkExitedExecutor)
   //   2. Framework re-registration.
   //
   // To achieve this, we need to:
-  //   1. Restart the master (the slave / framework will not detect
-  //  the new master automatically using the BasicMasterDetector).
+  //   1. Restart the master (the slave / framework will not detect the
+  //  new master automatically using the StandaloneMasterDetector).
   //   2. Notify the slave of the new master.
   //   3. Kill the executor.
   //   4. Drop the status update, but allow the ExitedExecutorMessage.



[3/5] mesos git commit: Improved consistency of test code for partitioning an agent.

2016-08-05 Thread vinodkone
Improved consistency of test code for partitioning an agent.

Removed unnecessary `Clock::settle` calls: `Clock::settle` should
typically only be used when a test case does not have an easy way to
wait for a _specific_ event to occur. In this case, `Clock::settle` was
unnecessary because the test code immediately proceeded to `AWAIT_READY`
for a more specific event.

Also fixed up some whitespace.

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


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

Branch: refs/heads/master
Commit: 5de96fa4b3e603553dbae3f06aff6621b268a7be
Parents: 60dbd34
Author: Neil Conway 
Authored: Fri Aug 5 16:41:28 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 5 16:41:28 2016 -0700

--
 src/tests/partition_tests.cpp  | 14 --
 src/tests/slave_recovery_tests.cpp |  4 +---
 src/tests/slave_tests.cpp  |  6 --
 3 files changed, 9 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/5de96fa4/src/tests/partition_tests.cpp
--
diff --git a/src/tests/partition_tests.cpp b/src/tests/partition_tests.cpp
index bafc7ce..0a72b34 100644
--- a/src/tests/partition_tests.cpp
+++ b/src/tests/partition_tests.cpp
@@ -134,7 +134,7 @@ TEST_P(PartitionTest, PartitionedSlave)
 AWAIT_READY(ping);
 pings++;
 if (pings == masterFlags.max_agent_ping_timeouts) {
- break;
+  break;
 }
 ping = FUTURE_MESSAGE(Eq(PingSlaveMessage().GetTypeName()), _, _);
 Clock::advance(masterFlags.agent_ping_timeout);
@@ -265,15 +265,13 @@ TEST_P(PartitionTest, PartitionedSlaveReregistration)
 AWAIT_READY(ping);
 pings++;
 if (pings == masterFlags.max_agent_ping_timeouts) {
- break;
+  break;
 }
 ping = FUTURE_MESSAGE(Eq(PingSlaveMessage().GetTypeName()), _, _);
 Clock::advance(masterFlags.agent_ping_timeout);
-Clock::settle();
   }
 
   Clock::advance(masterFlags.agent_ping_timeout);
-  Clock::settle();
 
   // The master will have notified the framework of the lost task.
   AWAIT_READY(lostStatus);
@@ -392,15 +390,13 @@ TEST_P(PartitionTest, PartitionedSlaveStatusUpdates)
 AWAIT_READY(ping);
 pings++;
 if (pings == masterFlags.max_agent_ping_timeouts) {
- break;
+  break;
 }
 ping = FUTURE_MESSAGE(Eq(PingSlaveMessage().GetTypeName()), _, _);
 Clock::advance(masterFlags.agent_ping_timeout);
-Clock::settle();
   }
 
   Clock::advance(masterFlags.agent_ping_timeout);
-  Clock::settle();
 
   // Wait for the master to attempt to shut down the slave.
   AWAIT_READY(shutdownMessage);
@@ -543,15 +539,13 @@ TEST_P(PartitionTest, PartitionedSlaveExitedExecutor)
 AWAIT_READY(ping);
 pings++;
 if (pings == masterFlags.max_agent_ping_timeouts) {
- break;
+  break;
 }
 ping = FUTURE_MESSAGE(Eq(PingSlaveMessage().GetTypeName()), _, _);
 Clock::advance(masterFlags.agent_ping_timeout);
-Clock::settle();
   }
 
   Clock::advance(masterFlags.agent_ping_timeout);
-  Clock::settle();
 
   // The master will have notified the framework of the lost task.
   AWAIT_READY(lostStatus);

http://git-wip-us.apache.org/repos/asf/mesos/blob/5de96fa4/src/tests/slave_recovery_tests.cpp
--
diff --git a/src/tests/slave_recovery_tests.cpp 
b/src/tests/slave_recovery_tests.cpp
index 83e89d6..998d445 100644
--- a/src/tests/slave_recovery_tests.cpp
+++ b/src/tests/slave_recovery_tests.cpp
@@ -3276,15 +3276,13 @@ TYPED_TEST(SlaveRecoveryTest, PartitionedSlave)
 AWAIT_READY(ping);
 pings++;
 if (pings == masterFlags.max_agent_ping_timeouts) {
- break;
+  break;
 }
 ping = FUTURE_MESSAGE(Eq(PingSlaveMessage().GetTypeName()), _, _);
 Clock::advance(masterFlags.agent_ping_timeout);
-Clock::settle();
   }
 
   Clock::advance(masterFlags.agent_ping_timeout);
-  Clock::settle();
 
   // The master will notify the framework that the slave was lost.
   AWAIT_READY(slaveLost);

http://git-wip-us.apache.org/repos/asf/mesos/blob/5de96fa4/src/tests/slave_tests.cpp
--
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index b9fa85d..890119f 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -2425,13 +2425,14 @@ TEST_F(SlaveTest, RateLimitSlaveShutdown)
 AWAIT_READY(ping);
 pings++;
 if (pings == masterFlags.max_agent_ping_timeouts) {
-  Clock::advance(masterFlags.agent_ping_timeout);
   break;
 }
 ping 

[5/5] mesos git commit: Future-proofed some slave removal tests.

2016-08-05 Thread vinodkone
Future-proofed some slave removal tests.

These tests relied on the implementation detail that when an agent is
removed from the list of registered agents, the master sends a
ShutdownSlaveMessage to the agent. That will change in the future
(MESOS-4049). To prepare for this future planned behavior, adjust these
tests to be more robust by instead checking for the invocation of the
`slaveLost` scheduler callback.

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


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

Branch: refs/heads/master
Commit: 5220f77582a14d4cdd0a907ba8af6e9db87d8ab7
Parents: 8a0b17a
Author: Neil Conway 
Authored: Fri Aug 5 16:41:41 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 5 16:41:41 2016 -0700

--
 src/tests/slave_tests.cpp | 91 +-
 1 file changed, 63 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/5220f775/src/tests/slave_tests.cpp
--
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index 890119f..787ec5b 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -2377,10 +2377,10 @@ TEST_F(SlaveTest, PingTimeoutSomePings)
 }
 
 
-// This test ensures that when slave removal rate limit is specified
-// a slave that fails health checks is removed after a permit is
-// provided by the rate limiter.
-TEST_F(SlaveTest, RateLimitSlaveShutdown)
+// This test ensures that when a slave removal rate limit is
+// specified, the master only removes a slave that fails health checks
+// when it is permitted to do so by the rate limiter.
+TEST_F(SlaveTest, RateLimitSlaveRemoval)
 {
   // Start a master.
   auto slaveRemovalLimiter = std::make_shared();
@@ -2398,16 +2398,29 @@ TEST_F(SlaveTest, RateLimitSlaveShutdown)
   // Drop all the PONGs to simulate health check timeout.
   DROP_PROTOBUFS(PongSlaveMessage(), _, _);
 
-  Future slaveRegisteredMessage =
-FUTURE_PROTOBUF(SlaveRegisteredMessage(), _, _);
-
   Owned detector = master.get()->createDetector();
 
   // Start a slave.
   Try slave = StartSlave(detector.get());
   ASSERT_SOME(slave);
 
-  AWAIT_READY(slaveRegisteredMessage);
+  // Start a scheduler.
+  MockScheduler sched;
+  MesosSchedulerDriver driver(
+  , DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
+
+  EXPECT_CALL(sched, registered(, _, _));
+
+  Future resourceOffers;
+  EXPECT_CALL(sched, resourceOffers(, _))
+.WillOnce(FutureSatisfy())
+.WillRepeatedly(Return()); // Ignore subsequent offers.
+
+  driver.start();
+
+  // Need to make sure the framework AND slave have registered with
+  // master. Waiting for resource offers should accomplish both.
+  AWAIT_READY(resourceOffers);
 
   // Return a pending future from the rate limiter.
   Future acquire;
@@ -2416,7 +2429,12 @@ TEST_F(SlaveTest, RateLimitSlaveShutdown)
 .WillOnce(DoAll(FutureSatisfy(),
 Return(promise.future(;
 
-  Future shutdown = FUTURE_PROTOBUF(ShutdownMessage(), _, _);
+  EXPECT_CALL(sched, offerRescinded(, _))
+.WillOnce(Return()); // Expect a single offer to be rescinded.
+
+  Future slaveLost;
+  EXPECT_CALL(sched, slaveLost(, _))
+.WillOnce(FutureSatisfy());
 
   // Induce a health check failure of the slave.
   Clock::pause();
@@ -2436,21 +2454,25 @@ TEST_F(SlaveTest, RateLimitSlaveShutdown)
   // The master should attempt to acquire a permit.
   AWAIT_READY(acquire);
 
-  // The shutdown should not occur before the permit is satisfied.
+  // The slave should not be removed before the permit is satisfied;
+  // that means the scheduler shouldn't receive `slaveLost` yet.
   Clock::settle();
-  ASSERT_TRUE(shutdown.isPending());
+  ASSERT_TRUE(slaveLost.isPending());
 
-  // Once the permit is satisfied, the shutdown message
-  // should be sent.
+  // Once the permit is satisfied, the `slaveLost` scheduler callback
+  // should be invoked.
   promise.set(Nothing());
-  AWAIT_READY(shutdown);
+  AWAIT_READY(slaveLost);
+
+  driver.stop();
+  driver.join();
 }
 
 
 // This test verifies that when a slave responds to pings after the
-// slave observer has scheduled it for shutdown (due to health check
-// failure), the shutdown is cancelled.
-TEST_F(SlaveTest, CancelSlaveShutdown)
+// slave observer has scheduled it for removal (due to health check
+// failure), the slave removal is cancelled.
+TEST_F(SlaveTest, CancelSlaveRemoval)
 {
   // Start a master.
   auto slaveRemovalLimiter = std::make_shared();
@@ -2468,19 +2490,32 @@ TEST_F(SlaveTest, CancelSlaveShutdown)
   

[1/5] mesos git commit: Added more expectations to TASK_LOST test cases.

2016-08-05 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master cb3ef91a6 -> 5220f7758


Added more expectations to TASK_LOST test cases.

Check the reason and source of TASK_LOST status updates, replaced
ASSERT_ with EXPECT_ in various places where EXPECT_ is more
appropriate.

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


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

Branch: refs/heads/master
Commit: 29925658291be60bda7af7f83225d743e8d24870
Parents: cb3ef91
Author: Neil Conway 
Authored: Fri Aug 5 16:41:10 2016 -0700
Committer: Vinod Kone 
Committed: Fri Aug 5 16:41:10 2016 -0700

--
 src/tests/fault_tolerance_tests.cpp |   1 +
 src/tests/master_authorization_tests.cpp|   6 +
 src/tests/master_maintenance_tests.cpp  |   3 +
 src/tests/master_slave_reconciliation_tests.cpp |   6 +-
 src/tests/master_tests.cpp  |   6 +
 src/tests/partition_tests.cpp   |   2 +
 src/tests/slave_recovery_tests.cpp  | 144 +++
 7 files changed, 107 insertions(+), 61 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/29925658/src/tests/fault_tolerance_tests.cpp
--
diff --git a/src/tests/fault_tolerance_tests.cpp 
b/src/tests/fault_tolerance_tests.cpp
index 79f36a5..661cc8b 100644
--- a/src/tests/fault_tolerance_tests.cpp
+++ b/src/tests/fault_tolerance_tests.cpp
@@ -907,6 +907,7 @@ TEST_F(FaultToleranceTest, TaskLost)
 
   AWAIT_READY(status);
   EXPECT_EQ(TASK_LOST, status.get().state());
+  EXPECT_EQ(TaskStatus::REASON_MASTER_DISCONNECTED, status.get().reason());
 
   driver.stop();
   driver.join();

http://git-wip-us.apache.org/repos/asf/mesos/blob/29925658/src/tests/master_authorization_tests.cpp
--
diff --git a/src/tests/master_authorization_tests.cpp 
b/src/tests/master_authorization_tests.cpp
index e43b264..16f1ab4 100644
--- a/src/tests/master_authorization_tests.cpp
+++ b/src/tests/master_authorization_tests.cpp
@@ -373,7 +373,10 @@ TEST_F(MasterAuthorizationTest, SlaveRemoved)
 
   // Framework should get a TASK_LOST.
   AWAIT_READY(status);
+
   EXPECT_EQ(TASK_LOST, status.get().state());
+  EXPECT_EQ(TaskStatus::SOURCE_MASTER, status.get().source());
+  EXPECT_EQ(TaskStatus::REASON_SLAVE_REMOVED, status.get().reason());
 
   // No task launch should happen resulting in all resources being
   // returned to the allocator.
@@ -464,7 +467,10 @@ TEST_F(MasterAuthorizationTest, SlaveDisconnected)
 
   // Framework should get a TASK_LOST.
   AWAIT_READY(status);
+
   EXPECT_EQ(TASK_LOST, status.get().state());
+  EXPECT_EQ(TaskStatus::SOURCE_MASTER, status.get().source());
+  EXPECT_EQ(TaskStatus::REASON_SLAVE_REMOVED, status.get().reason());
 
   // No task launch should happen resulting in all resources being
   // returned to the allocator.

http://git-wip-us.apache.org/repos/asf/mesos/blob/29925658/src/tests/master_maintenance_tests.cpp
--
diff --git a/src/tests/master_maintenance_tests.cpp 
b/src/tests/master_maintenance_tests.cpp
index 2d4b45f..0820e63 100644
--- a/src/tests/master_maintenance_tests.cpp
+++ b/src/tests/master_maintenance_tests.cpp
@@ -698,7 +698,10 @@ TEST_F(MasterMaintenanceTest, EnterMaintenanceMode)
 
   // Verify that we received a TASK_LOST.
   AWAIT_READY(lostStatus);
+
   EXPECT_EQ(TASK_LOST, lostStatus.get().state());
+  EXPECT_EQ(TaskStatus::SOURCE_MASTER, lostStatus.get().source());
+  EXPECT_EQ(TaskStatus::REASON_SLAVE_REMOVED, lostStatus.get().reason());
 
   // Verify that the framework received the slave lost message.
   AWAIT_READY(slaveLost);

http://git-wip-us.apache.org/repos/asf/mesos/blob/29925658/src/tests/master_slave_reconciliation_tests.cpp
--
diff --git a/src/tests/master_slave_reconciliation_tests.cpp 
b/src/tests/master_slave_reconciliation_tests.cpp
index fdb9bb6..03405e3 100644
--- a/src/tests/master_slave_reconciliation_tests.cpp
+++ b/src/tests/master_slave_reconciliation_tests.cpp
@@ -233,8 +233,10 @@ TEST_F(MasterSlaveReconciliationTest, ReconcileLostTask)
 
   AWAIT_READY(status);
 
-  ASSERT_EQ(task.task_id(), status.get().task_id());
-  ASSERT_EQ(TASK_LOST, status.get().state());
+  EXPECT_EQ(task.task_id(), status.get().task_id());
+  EXPECT_EQ(TASK_LOST, status.get().state());
+  EXPECT_EQ(TaskStatus::SOURCE_SLAVE, status.get().source());
+  EXPECT_EQ(TaskStatus::REASON_RECONCILIATION, status.get().reason());
 

[3/3] mesos git commit: Mesos-slave --help should not return as failed.

2016-08-04 Thread vinodkone
Mesos-slave --help should not return as failed.

Doing a simple \`mesos-agent --help\` should return with exit_status=0.
It's not the case since work_dir is considered as mandatory.

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


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

Branch: refs/heads/1.0.x
Commit: cc86e4bfd4eeffbd1e93ec78b92903319baf2d53
Parents: c2e6cc6
Author: Pierre Cheynier 
Authored: Thu Aug 4 09:26:57 2016 -0700
Committer: Vinod Kone 
Committed: Thu Aug 4 09:30:53 2016 -0700

--
 src/slave/main.cpp | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/cc86e4bf/src/slave/main.cpp
--
diff --git a/src/slave/main.cpp b/src/slave/main.cpp
index a4d971a..6fb5b28 100644
--- a/src/slave/main.cpp
+++ b/src/slave/main.cpp
@@ -182,6 +182,11 @@ int main(int argc, char** argv)
 
   Try load = flags.load("MESOS_", argc, argv);
 
+  if (flags.help) {
+cout << flags.usage() << endl;
+return EXIT_SUCCESS;
+  }
+
   // TODO(marco): this pattern too should be abstracted away
   // in FlagsBase; I have seen it at least 15 times.
   if (load.isError()) {
@@ -189,11 +194,6 @@ int main(int argc, char** argv)
 return EXIT_FAILURE;
   }
 
-  if (flags.help) {
-cout << flags.usage() << endl;
-return EXIT_SUCCESS;
-  }
-
   if (flags.version) {
 cout << "mesos" << " " << MESOS_VERSION << endl;
 return EXIT_SUCCESS;



[1/3] mesos git commit: Added MESOS-5922 and MESOS-5928 to CHANGELOG for 1.0.1.

2016-08-04 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/1.0.x c2e6cc649 -> 8abecbfe5


Added MESOS-5922 and MESOS-5928 to CHANGELOG for 1.0.1.


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

Branch: refs/heads/1.0.x
Commit: 8abecbfe5d2b8dc0211fd5a9f656ea8884079efa
Parents: 6fe8978
Author: Vinod Kone 
Authored: Thu Aug 4 09:29:20 2016 -0700
Committer: Vinod Kone 
Committed: Thu Aug 4 09:30:53 2016 -0700

--
 CHANGELOG | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/8abecbfe/CHANGELOG
--
diff --git a/CHANGELOG b/CHANGELOG
index f3112db..2648282 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,14 +7,15 @@ All Issues:
   * [MESOS-5388] - MesosContainerizerLaunch flags execute arbitrary commands 
via shell.
   * [MESOS-5911] - Webui redirection to leader in browser does not work.
   * [MESOS-5913] - Stale socket FD usage when using libevent + SSL.
+  * [MESOS-5922] - mesos-agent --help exit status is 1
   * [MESOS-5923] - Ubuntu 14.04 LTS GPU Isolator "/run" directory is noexec.
   * [MESOS-5927] - Unable to run "scratch" Dockerfiles with Unified 
Containerizer.
+  * [MESOS-5928] - Agent's '--version' flag doesn't work
   * [MESOS-5943] - Incremental http parsing of URLs leads to decoder error.
   * [MESOS-5945] - NvidiaVolume::create() should check for root before 
creating volume.
   * [MESOS-5959] - All non-root tests fail on GPU machine.
   * [MESOS-5982] - NvidiaVolume errors out if any Nvidia binary is missing.
 
-
 Release Notes - Mesos - Version 1.0.0
 
 This release contains the following new features:



[1/2] mesos git commit: Mesos-slave --help should not return as failed.

2016-08-04 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 853821caf -> 335001ad2


Mesos-slave --help should not return as failed.

Doing a simple \`mesos-agent --help\` should return with exit_status=0.
It's not the case since work_dir is considered as mandatory.

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


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

Branch: refs/heads/master
Commit: 0984bdf553d12acfe4d54d9a6928b3eb1b54b611
Parents: 853821c
Author: Pierre Cheynier 
Authored: Thu Aug 4 09:26:57 2016 -0700
Committer: Vinod Kone 
Committed: Thu Aug 4 09:26:57 2016 -0700

--
 src/slave/main.cpp | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/0984bdf5/src/slave/main.cpp
--
diff --git a/src/slave/main.cpp b/src/slave/main.cpp
index 42ca115..c355a3c 100644
--- a/src/slave/main.cpp
+++ b/src/slave/main.cpp
@@ -182,6 +182,11 @@ int main(int argc, char** argv)
 
   Try load = flags.load("MESOS_", argc, argv);
 
+  if (flags.help) {
+cout << flags.usage() << endl;
+return EXIT_SUCCESS;
+  }
+
   // TODO(marco): this pattern too should be abstracted away
   // in FlagsBase; I have seen it at least 15 times.
   if (load.isError()) {
@@ -189,11 +194,6 @@ int main(int argc, char** argv)
 return EXIT_FAILURE;
   }
 
-  if (flags.help) {
-cout << flags.usage() << endl;
-return EXIT_SUCCESS;
-  }
-
   if (flags.version) {
 cout << "mesos" << " " << MESOS_VERSION << endl;
 return EXIT_SUCCESS;



[2/2] mesos git commit: Moved check for '--version' in master and agent 'main.cpp'.

2016-08-04 Thread vinodkone
Moved check for '--version' in master and agent 'main.cpp'.

The recent removal of the agent's default `work_dir`
requires us to check for the presence of the `--version`
flag before we check for errors in flag loading; this
patch makes that change, and also moves the
corresponding code in the master for consistency.

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


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

Branch: refs/heads/master
Commit: 335001ad26d7eb9f6cde6e2639296fa27cc959be
Parents: 0984bdf
Author: Greg Mann 
Authored: Thu Aug 4 09:27:07 2016 -0700
Committer: Vinod Kone 
Committed: Thu Aug 4 09:27:07 2016 -0700

--
 src/master/main.cpp | 12 ++--
 src/slave/main.cpp  | 10 +-
 2 files changed, 11 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/335001ad/src/master/main.cpp
--
diff --git a/src/master/main.cpp b/src/master/main.cpp
index 0bce1df..4a1a8e7 100644
--- a/src/master/main.cpp
+++ b/src/master/main.cpp
@@ -202,9 +202,9 @@ int main(int argc, char** argv)
 
   Try load = flags.load("MESOS_", argc, argv);
 
-  if (load.isError()) {
-cerr << flags.usage(load.error()) << endl;
-return EXIT_FAILURE;
+  if (flags.help) {
+cout << flags.usage() << endl;
+return EXIT_SUCCESS;
   }
 
   if (flags.version) {
@@ -212,9 +212,9 @@ int main(int argc, char** argv)
 return EXIT_SUCCESS;
   }
 
-  if (flags.help) {
-cout << flags.usage() << endl;
-return EXIT_SUCCESS;
+  if (load.isError()) {
+cerr << flags.usage(load.error()) << endl;
+return EXIT_FAILURE;
   }
 
   if (ip_discovery_command.isSome() && ip.isSome()) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/335001ad/src/slave/main.cpp
--
diff --git a/src/slave/main.cpp b/src/slave/main.cpp
index c355a3c..8c9d241 100644
--- a/src/slave/main.cpp
+++ b/src/slave/main.cpp
@@ -187,6 +187,11 @@ int main(int argc, char** argv)
 return EXIT_SUCCESS;
   }
 
+  if (flags.version) {
+cout << "mesos" << " " << MESOS_VERSION << endl;
+return EXIT_SUCCESS;
+  }
+
   // TODO(marco): this pattern too should be abstracted away
   // in FlagsBase; I have seen it at least 15 times.
   if (load.isError()) {
@@ -194,11 +199,6 @@ int main(int argc, char** argv)
 return EXIT_FAILURE;
   }
 
-  if (flags.version) {
-cout << "mesos" << " " << MESOS_VERSION << endl;
-return EXIT_SUCCESS;
-  }
-
   if (master.isNone() && flags.master_detector.isNone()) {
 cerr << flags.usage("Missing required option `--master` or "
 "`--master_detector`.") << endl;



mesos git commit: Fixed the flaky test case `MasterAPITest.GetTasks`.

2016-07-27 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master bc2062791 -> beda6ffb7


Fixed the flaky test case `MasterAPITest.GetTasks`.

This changes to wait for every `StatusUpdateAcknowledgementMessage`
exactly in this test case to make sure they don't conflict each other.

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


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

Branch: refs/heads/master
Commit: beda6ffb72687d9f5c23b07552cadf42756bcd75
Parents: bc20627
Author: haosdent huang 
Authored: Wed Jul 27 17:08:45 2016 -0700
Committer: Vinod Kone 
Committed: Wed Jul 27 17:08:45 2016 -0700

--
 src/tests/api_tests.cpp | 35 +--
 1 file changed, 25 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/beda6ffb/src/tests/api_tests.cpp
--
diff --git a/src/tests/api_tests.cpp b/src/tests/api_tests.cpp
index abf102f..e440d1b 100644
--- a/src/tests/api_tests.cpp
+++ b/src/tests/api_tests.cpp
@@ -462,6 +462,7 @@ TEST_P(MasterAPITest, GetState)
   EXPECT_NE(0u, offers.get().size());
 
   ContentType contentType = GetParam();
+
   {
 // GetState before task launch and check we have one framework, one agent
 // and zero tasks/executors.
@@ -488,6 +489,12 @@ TEST_P(MasterAPITest, GetState)
   EXPECT_CALL(exec, launchTask(_, _))
 .WillOnce(SendStatusUpdateFromTask(TASK_RUNNING));
 
+  Future acknowledgement =
+FUTURE_PROTOBUF(
+StatusUpdateAcknowledgementMessage(),
+Eq(master.get()->pid),
+Eq(slave.get()->pid));
+
   Future status;
   EXPECT_CALL(sched, statusUpdate(, _))
 .WillOnce(FutureArg<1>());
@@ -499,6 +506,8 @@ TEST_P(MasterAPITest, GetState)
 
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
+  AWAIT_READY(acknowledgement);
+
   {
 // GetState after task launch and check we have a running task.
 Future v1Response =
@@ -513,11 +522,10 @@ TEST_P(MasterAPITest, GetState)
 ASSERT_EQ(0u, getState.get_tasks().completed_tasks_size());
   }
 
-  Future acknowledgement =
-FUTURE_PROTOBUF(
-StatusUpdateAcknowledgementMessage(),
-_,
-Eq(slave.get()->pid));
+  acknowledgement = FUTURE_PROTOBUF(
+  StatusUpdateAcknowledgementMessage(),
+  Eq(master.get()->pid),
+  Eq(slave.get()->pid));
 
   Future status2;
   EXPECT_CALL(sched, statusUpdate(, _))
@@ -626,6 +634,12 @@ TEST_P(MasterAPITest, GetTasks)
   EXPECT_CALL(exec, launchTask(_, _))
 .WillOnce(SendStatusUpdateFromTask(TASK_RUNNING));
 
+  Future acknowledgement =
+FUTURE_PROTOBUF(
+StatusUpdateAcknowledgementMessage(),
+Eq(master.get()->pid),
+Eq(slave.get()->pid));
+
   Future status;
   EXPECT_CALL(sched, statusUpdate(, _))
 .WillOnce(FutureArg<1>());
@@ -639,6 +653,8 @@ TEST_P(MasterAPITest, GetTasks)
   EXPECT_TRUE(status.get().has_executor_id());
   EXPECT_EQ(exec.id, status.get().executor_id());
 
+  AWAIT_READY(acknowledgement);
+
   v1::master::Call v1Call;
   v1Call.set_type(v1::master::Call::GET_TASKS);
 
@@ -658,11 +674,10 @@ TEST_P(MasterAPITest, GetTasks)
 ASSERT_EQ("1", v1Response.get().get_tasks().tasks(0).task_id().value());
   }
 
-  Future acknowledgement =
-FUTURE_PROTOBUF(
-StatusUpdateAcknowledgementMessage(),
-_,
-Eq(slave.get()->pid));
+  acknowledgement = FUTURE_PROTOBUF(
+  StatusUpdateAcknowledgementMessage(),
+  Eq(master.get()->pid),
+  Eq(slave.get()->pid));
 
   Future status2;
   EXPECT_CALL(sched, statusUpdate(, _))



[2/2] mesos git commit: Fixed comment typos and whitespace infelicities.

2016-07-27 Thread vinodkone
Fixed comment typos and whitespace infelicities.

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


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

Branch: refs/heads/master
Commit: bc2062791d0e0e743e799409f4ba60d40c537888
Parents: b017d706
Author: Neil Conway 
Authored: Wed Jul 27 16:58:41 2016 -0700
Committer: Vinod Kone 
Committed: Wed Jul 27 16:58:41 2016 -0700

--
 src/tests/authorization_tests.cpp   | 21 ++---
 src/tests/slave_authorization_tests.cpp |  2 +-
 2 files changed, 11 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/bc206279/src/tests/authorization_tests.cpp
--
diff --git a/src/tests/authorization_tests.cpp 
b/src/tests/authorization_tests.cpp
index 38885ca..5d7e17b 100644
--- a/src/tests/authorization_tests.cpp
+++ b/src/tests/authorization_tests.cpp
@@ -1583,14 +1583,14 @@ TYPED_TEST(AuthorizationTest, ViewFramework)
   ASSERT_SOME(create);
   Owned authorizer(create.get());
 
-  // Create FrameworkInfo with a generic user as object to authorized.
+  // Create FrameworkInfo with a generic user as object to be authorized.
   FrameworkInfo frameworkInfo;
   {
 frameworkInfo.set_user("user");
 frameworkInfo.set_name("f");
   }
 
-  // Create FrameworkInfo with user "bar" as object to authorized.
+  // Create FrameworkInfo with user "bar" as object to be authorized.
   FrameworkInfo frameworkInfoBar;
   {
 frameworkInfoBar.set_user("bar");
@@ -1768,14 +1768,14 @@ TYPED_TEST(AuthorizationTest, ViewTask)
 taskBar.set_user("bar");
   }
 
-  // Create FrameworkInfo with a generic user as object to authorized.
+  // Create FrameworkInfo with a generic user as object to be authorized.
   FrameworkInfo frameworkInfo;
   {
 frameworkInfo.set_user("user");
 frameworkInfo.set_name("f");
   }
 
-  // Create FrameworkInfo with user "bar" as object to authorized.
+  // Create FrameworkInfo with user "bar" as object to be authorized.
   FrameworkInfo frameworkInfoBar;
   {
 frameworkInfoBar.set_user("bar");
@@ -2001,14 +2001,14 @@ TYPED_TEST(AuthorizationTest, ViewExecutor)
 executorInfoNoUser.mutable_command()->set_value("echo hello");
   }
 
-  // Create FrameworkInfo with a generic user as object to authorized.
+  // Create FrameworkInfo with a generic user as object to be authorized.
   FrameworkInfo frameworkInfo;
   {
 frameworkInfo.set_user("user");
 frameworkInfo.set_name("f");
   }
 
-  // Create FrameworkInfo with user "bar" as object to authorized.
+  // Create FrameworkInfo with user "bar" as object to be authorized.
   FrameworkInfo frameworkInfoBar;
   {
 frameworkInfoBar.set_user("bar");
@@ -2086,7 +2086,7 @@ TYPED_TEST(AuthorizationTest, ViewExecutor)
 }
 
 
-// This tests the authorization of sandboxe access.
+// This tests the authorization of sandbox access.
 TYPED_TEST(AuthorizationTest, SandBoxAccess)
 {
   // Setup ACLs.
@@ -2154,14 +2154,14 @@ TYPED_TEST(AuthorizationTest, SandBoxAccess)
 executorInfoNoUser.mutable_command()->set_value("echo hello");
   }
 
-  // Create FrameworkInfo with a generic user as object to authorized.
+  // Create FrameworkInfo with a generic user as object to be authorized.
   FrameworkInfo frameworkInfo;
   {
 frameworkInfo.set_user("user");
 frameworkInfo.set_name("f");
   }
 
-  // Create FrameworkInfo with user "bar" as object to authorized.
+  // Create FrameworkInfo with user "bar" as object to be authorized.
   FrameworkInfo frameworkInfoBar;
   {
 frameworkInfoBar.set_user("bar");
@@ -2313,7 +2313,6 @@ TYPED_TEST(AuthorizationTest, ViewFlags)
   ASSERT_SOME(create);
   Owned authorizer(create.get());
 
-
   {
 authorization::Request request;
 request.set_action(authorization::VIEW_FLAGS);
@@ -2393,7 +2392,7 @@ TYPED_TEST(AuthorizationTest, ValidateEndpoints)
 // This tests the authorization of requests to ViewRole.
 TYPED_TEST(AuthorizationTest, ViewRole)
 {
-// Setup ACLs.
+  // Setup ACLs.
   ACLs acls;
 
   {

http://git-wip-us.apache.org/repos/asf/mesos/blob/bc206279/src/tests/slave_authorization_tests.cpp
--
diff --git a/src/tests/slave_authorization_tests.cpp 
b/src/tests/slave_authorization_tests.cpp
index 4a66126..6f120b6 100644
--- a/src/tests/slave_authorization_tests.cpp
+++ b/src/tests/slave_authorization_tests.cpp
@@ -142,7 +142,7 @@ TYPED_TEST(SlaveAuthorizerTest, FilterStateEndpoint)
   Try master = this->StartMaster(authorizer.get());
   ASSERT_SOME(master);
 
-  // Resgister 

[1/2] mesos git commit: Fixed flakiness in SlaveAuthorizerTest.ViewFlags.

2016-07-27 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master b8da3f67d -> bc2062791


Fixed flakiness in SlaveAuthorizerTest.ViewFlags.

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


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

Branch: refs/heads/master
Commit: b017d706ef5fd07ffca42f83069b122b52d584b2
Parents: b8da3f6
Author: Neil Conway 
Authored: Wed Jul 27 16:58:37 2016 -0700
Committer: Vinod Kone 
Committed: Wed Jul 27 16:58:37 2016 -0700

--
 src/tests/slave_authorization_tests.cpp | 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/b017d706/src/tests/slave_authorization_tests.cpp
--
diff --git a/src/tests/slave_authorization_tests.cpp 
b/src/tests/slave_authorization_tests.cpp
index f76ed3a..4a66126 100644
--- a/src/tests/slave_authorization_tests.cpp
+++ b/src/tests/slave_authorization_tests.cpp
@@ -24,6 +24,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -46,6 +47,7 @@ using mesos::internal::slave::Slave;
 using mesos::master::detector::MasterDetector;
 using mesos::master::detector::StandaloneMasterDetector;
 
+using process::Clock;
 using process::Future;
 using process::Owned;
 
@@ -296,6 +298,11 @@ TYPED_TEST(SlaveAuthorizerTest, ViewFlags)
 
   ASSERT_SOME(agent);
 
+  // Ensure that the slave has finished recovery.
+  Clock::pause();
+  Clock::settle();
+  Clock::resume();
+
   // The default principal should be able to access the flags.
   {
 Future response = http::get(



mesos git commit: Set allocation level explicitly instead of implicitly in v1 api tests.

2016-07-27 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master 380ec46f8 -> b8da3f67d


Set allocation level explicitly instead of implicitly in v1 api tests.

As discussed with Neil, we are setting low allocation level
for ReserveResources and UnreserveResources operator api v1
tests explicitly instead of implicitly as it was set in
r50072. We are doing this to improve clarity in test cases.

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


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

Branch: refs/heads/master
Commit: b8da3f67df60a67290b1f9545e261733692468e1
Parents: 380ec46
Author: Abhishek Dasgupta 
Authored: Wed Jul 27 16:55:08 2016 -0700
Committer: Vinod Kone 
Committed: Wed Jul 27 16:55:08 2016 -0700

--
 src/tests/api_tests.cpp | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/b8da3f67/src/tests/api_tests.cpp
--
diff --git a/src/tests/api_tests.cpp b/src/tests/api_tests.cpp
index 88523fd..abf102f 100644
--- a/src/tests/api_tests.cpp
+++ b/src/tests/api_tests.cpp
@@ -92,14 +92,6 @@ class MasterAPITest
 public WithParamInterface
 {
 public:
-  virtual master::Flags CreateMasterFlags()
-  {
-// Set a low allocation interval to speed up tests.
-master::Flags flags = MesosTest::CreateMasterFlags();
-flags.allocation_interval = Milliseconds(50);
-return flags;
-  }
-
   // Helper function to post a request to "/api/v1" master endpoint and return
   // the response.
   Future post(
@@ -937,7 +929,11 @@ TEST_P(MasterAPITest, ReserveResources)
 
   EXPECT_CALL(allocator, initialize(_, _, _, _, _));
 
-  Try master = StartMaster();
+  // Set a low allocation interval to speed up this test.
+  master::Flags flags = MesosTest::CreateMasterFlags();
+  flags.allocation_interval = Milliseconds(50);
+
+  Try master = StartMaster(, flags);
   ASSERT_SOME(master);
 
   Future slaveId;
@@ -1027,7 +1023,11 @@ TEST_P(MasterAPITest, UnreserveResources)
 
   EXPECT_CALL(allocator, initialize(_, _, _, _, _));
 
-  Try master = StartMaster();
+  // Set a low allocation interval to speed up this test.
+  master::Flags flags = MesosTest::CreateMasterFlags();
+  flags.allocation_interval = Milliseconds(50);
+
+  Try master = StartMaster(, flags);
   ASSERT_SOME(master);
 
   Future slaveId;



svn commit: r1754308 - in /mesos/site/publish/blog/mesos-1-0-0-released: ./ index.html

2016-07-27 Thread vinodkone
Author: vinodkone
Date: Wed Jul 27 16:25:51 2016
New Revision: 1754308

URL: http://svn.apache.org/viewvc?rev=1754308=rev
Log:
Added 1.0 blog.

Added:
mesos/site/publish/blog/mesos-1-0-0-released/
mesos/site/publish/blog/mesos-1-0-0-released/index.html

Added: mesos/site/publish/blog/mesos-1-0-0-released/index.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/blog/mesos-1-0-0-released/index.html?rev=1754308=auto
==
--- mesos/site/publish/blog/mesos-1-0-0-released/index.html (added)
+++ mesos/site/publish/blog/mesos-1-0-0-released/index.html Wed Jul 27 16:25:51 
2016
@@ -0,0 +1,220 @@
+
+
+  
+
+Apache Mesos 1.0.0 Released
+
+
+
+
+
+
+
+
+
+
+
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-20226872-1']);
+_gaq.push(['_setDomainName', 'apache.org']);
+_gaq.push(['_trackPageview']);
+
+(function() {
+  var ga = document.createElement('script'); ga.type = 'text/javascript'; 
ga.async = true;
+  ga.src = ('https:' == document.location.protocol ? '<a  rel="nofollow" href="https://ssl">https://ssl</a>' : 
'<a  rel="nofollow" href="http://www">http://www</a>') + '.google-analytics.com/ga.js';
+  var s = document.getElementsByTagName('script')[0]; 
s.parentNode.insertBefore(ga, s);
+})();
+
+
+  
+  
+
+
+  
+
+  
+
+  Apache Software Foundation 

+  
+http://www.apache.org;>Apache Homepage
+http://www.apache.org/licenses/;>License
+http://www.apache.org/foundation/sponsorship.html;>Sponsorship
+http://www.apache.org/foundation/thanks.html;>Thanks
+http://www.apache.org/security/;>Security
+  
+
+  
+
+  http://mesos.apache.org;>Apache Mesos
+  
+  
+  Blog
+
+  
+  
+
+  
+
+
+
+
+  
+
+  
+  Toggle navigation
+  
+  
+  
+  
+  
+
+
+
+  
+Getting Started
+Blog
+Documentation
+Downloads
+Community
+  
+
+  
+
+
+
+  
+
+
+  
+    
+  
+    
+
+  Vinod Kone
+  http://twitter.com/vinodkone;>@vinodkone
+
+  
+  Posted July 27, 2016
+
+
+
+  https://twitter.com/share; 
class="twitter-share-button" data-via="apachemesos">Tweet
+
+  !function(d,s,id){var 
js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document,
 'script', 'twitter-wjs');
+
+  
+
+  
+  
+(function() {
+var po = document.createElement('script'); po.type = 
'text/javascript'; po.async = true;
+po.src = '<a  rel="nofollow" href="https://apis.google.com/js/plusone.js">https://apis.google.com/js/plusone.js</a>';
+var s = document.getElementsByTagName('script')[0]; 
s.parentNode.insertBefore(po, s);
+})();
+  
+
+  
+   lang: en_US
+  
+  
+
+  
+
+  
+Apache Mesos 1.0.0 Released
+
+Mesos 1.0 release is finally here for http://mesos.apache.org/downloads;>download!
+
+As most of you know, Apache Mesos has been running in production at some of 
the largest Internet companies like https://twitter.com;>Twitter, 
https://netflix.com;>Netflix, https://uber.com;>Uber 
and http://www.jpl.nasa.gov/;>NASA JPL for many years now. It has 
been proven to scale to tens of thousands of nodes, running hundreds of 
thousands of containers serving live traffic without interruption for months at 
a time.
+
+Given its track record at these high profile companies, Apache Mesos could 
have reached its 1.0 milestone a long time ago. But one thing we really wanted 
to improve upon before doing a 1.0 release was to develop new HTTP APIs to ease 
the lives of both framework developers and cluster operators alike. These new 
APIs make it really easy to write a new framework or develop a new tool with 
off-the-shelf HTTP libraries written in the language of your choice. After 
iterating on the new APIs for nearly a year, we are confident that they are now 
ready for widespread use. Combined with a versioning scheme for the new APIs 
and a well-formulated http://mesos.apache.org/documentation/latest/versioning/;>release and 
support process, we are happy to call our latest release of Apache Mesos 
1.0.
+
+In addition to the new APIs, the 1.0 release is jam-packed with features 
that makes running stateless and stateful workloads easy. Below, we will 
discuss some of the highlights in this release. F

svn commit: r1754298 [4/6] - in /mesos/site/publish: ./ api/latest/c++/ api/latest/java/ api/latest/java/org/apache/mesos/ blog/ documentation/api-client-libraries/ documentation/app-framework-develop

2016-07-27 Thread vinodkone
Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.DiskInfoOrBuilder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.DiskInfoOrBuilder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.DiskInfoOrBuilder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.DiskInfoOrBuilder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Resource.DiskInfoOrBuilder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfo.Builder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfo.Builder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfo.Builder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfo.Builder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Resource.ReservationInfo.Builder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfo.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfo.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfo.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfo.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Resource.ReservationInfo
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfoOrBuilder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfoOrBuilder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfoOrBuilder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.ReservationInfoOrBuilder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Resource.ReservationInfoOrBuilder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfo.Builder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfo.Builder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfo.Builder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfo.Builder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Resource.RevocableInfo.Builder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfo.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfo.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfo.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfo.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Resource.RevocableInfo
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfoOrBuilder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfoOrBuilder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfoOrBuilder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.RevocableInfoOrBuilder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Resource.RevocableInfoOrBuilder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.html?rev=1754298=1754297=1754298=diff
==
--- mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Resource.html 
(original)
+++ 

svn commit: r1754298 [1/6] - in /mesos/site/publish: ./ api/latest/c++/ api/latest/java/ api/latest/java/org/apache/mesos/ blog/ documentation/api-client-libraries/ documentation/app-framework-develop

2016-07-27 Thread vinodkone
Author: vinodkone
Date: Wed Jul 27 16:12:28 2016
New Revision: 1754298

URL: http://svn.apache.org/viewvc?rev=1754298=rev
Log:
Updated website for 1.0

Modified:
mesos/site/publish/api/latest/c++/numify_8hpp_source.html
mesos/site/publish/api/latest/java/allclasses-frame.html
mesos/site/publish/api/latest/java/allclasses-noframe.html
mesos/site/publish/api/latest/java/constant-values.html
mesos/site/publish/api/latest/java/deprecated-list.html
mesos/site/publish/api/latest/java/help-doc.html
mesos/site/publish/api/latest/java/index-all.html
mesos/site/publish/api/latest/java/index.html
mesos/site/publish/api/latest/java/org/apache/mesos/Executor.html
mesos/site/publish/api/latest/java/org/apache/mesos/ExecutorDriver.html
mesos/site/publish/api/latest/java/org/apache/mesos/Log.Entry.html

mesos/site/publish/api/latest/java/org/apache/mesos/Log.OperationFailedException.html
mesos/site/publish/api/latest/java/org/apache/mesos/Log.Position.html
mesos/site/publish/api/latest/java/org/apache/mesos/Log.Reader.html
mesos/site/publish/api/latest/java/org/apache/mesos/Log.Writer.html

mesos/site/publish/api/latest/java/org/apache/mesos/Log.WriterFailedException.html
mesos/site/publish/api/latest/java/org/apache/mesos/Log.html
mesos/site/publish/api/latest/java/org/apache/mesos/MesosExecutorDriver.html

mesos/site/publish/api/latest/java/org/apache/mesos/MesosNativeLibrary.Version.html
mesos/site/publish/api/latest/java/org/apache/mesos/MesosNativeLibrary.html

mesos/site/publish/api/latest/java/org/apache/mesos/MesosSchedulerDriver.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Address.Builder.html
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Address.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.AddressOrBuilder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Attribute.Builder.html
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Attribute.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.AttributeOrBuilder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CgroupInfo.Builder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CgroupInfo.NetCls.Builder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CgroupInfo.NetCls.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CgroupInfo.NetClsOrBuilder.html
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CgroupInfo.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CgroupInfoOrBuilder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CommandInfo.Builder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CommandInfo.URI.Builder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CommandInfo.URI.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CommandInfo.URIOrBuilder.html
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CommandInfo.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.CommandInfoOrBuilder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerID.Builder.html
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerID.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerIDOrBuilder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.Builder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.Builder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.Network.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMapping.Builder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMapping.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMappingOrBuilder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfoOrBuilder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.MesosInfo.Builder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.MesosInfo.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.MesosInfoOrBuilder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.Type.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfoOrBuilder.html

mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerStatus.Builder.html

mesos/site/publish/api/latest/java/org/apache/mesos

svn commit: r1754298 [3/6] - in /mesos/site/publish: ./ api/latest/c++/ api/latest/java/ api/latest/java/org/apache/mesos/ blog/ documentation/api-client-libraries/ documentation/app-framework-develop

2016-07-27 Thread vinodkone
Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.LabelOrBuilder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.LabelOrBuilder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.LabelOrBuilder.html 
(original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.LabelOrBuilder.html 
Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.LabelOrBuilder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Labels.Builder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Labels.Builder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Labels.Builder.html 
(original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Labels.Builder.html 
Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Labels.Builder
-
+
 
 
 

Modified: mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Labels.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Labels.html?rev=1754298=1754297=1754298=diff
==
--- mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Labels.html 
(original)
+++ mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Labels.html Wed 
Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Labels
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.LabelsOrBuilder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.LabelsOrBuilder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.LabelsOrBuilder.html 
(original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.LabelsOrBuilder.html 
Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.LabelsOrBuilder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineID.Builder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineID.Builder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineID.Builder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineID.Builder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.MachineID.Builder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineID.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineID.html?rev=1754298=1754297=1754298=diff
==
--- mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineID.html 
(original)
+++ mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineID.html 
Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.MachineID
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineIDOrBuilder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineIDOrBuilder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineIDOrBuilder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineIDOrBuilder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.MachineIDOrBuilder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineInfo.Builder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineInfo.Builder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineInfo.Builder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineInfo.Builder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.MachineInfo.Builder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineInfo.Mode.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.MachineInfo.Mode.html?rev=1754298=1754297=1754298=diff
==
--- 

svn commit: r1754298 [6/6] - in /mesos/site/publish: ./ api/latest/c++/ api/latest/java/ api/latest/java/org/apache/mesos/ blog/ documentation/api-client-libraries/ documentation/app-framework-develop

2016-07-27 Thread vinodkone
Modified: mesos/site/publish/sitemap.xml
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/sitemap.xml?rev=1754298=1754297=1754298=diff
==
--- mesos/site/publish/sitemap.xml (original)
+++ mesos/site/publish/sitemap.xml Wed Jul 27 16:12:28 2016
@@ -2,14154 +2,14158 @@
 http://www.sitemaps.org/schemas/sitemap/0.9;>
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2authenticator_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2authenticator_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2executor_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2executor_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2filter_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2filter_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2gc_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2gc_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2http_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2http_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2io_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2io_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2limiter_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2limiter_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2logging_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2logging_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2message_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2message_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2metrics_2metrics_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2metrics_2metrics_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2network_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2network_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2pid_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2pid_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2protobuf_8hpp.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/c++/3rdparty_2libprocess_2include_2process_2protobuf_8hpp_source.html
-2016-07-25T00:00:00+00:00
+2016-07-27T00:00:00+00:00
   
   
 

svn commit: r1754298 [2/6] - in /mesos/site/publish: ./ api/latest/c++/ api/latest/java/ api/latest/java/org/apache/mesos/ blog/ documentation/api-client-libraries/ documentation/app-framework-develop

2016-07-27 Thread vinodkone
Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.Network.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.Network.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.Network.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.Network.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.ContainerInfo.DockerInfo.Network
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMapping.Builder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMapping.Builder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMapping.Builder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMapping.Builder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.ContainerInfo.DockerInfo.PortMapping.Builder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMapping.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMapping.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMapping.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMapping.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.ContainerInfo.DockerInfo.PortMapping
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMappingOrBuilder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMappingOrBuilder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMappingOrBuilder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.PortMappingOrBuilder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.ContainerInfo.DockerInfo.PortMappingOrBuilder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfo.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.ContainerInfo.DockerInfo
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfoOrBuilder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfoOrBuilder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfoOrBuilder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.DockerInfoOrBuilder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.ContainerInfo.DockerInfoOrBuilder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.MesosInfo.Builder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.MesosInfo.Builder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.MesosInfo.Builder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.MesosInfo.Builder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.ContainerInfo.MesosInfo.Builder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.ContainerInfo.MesosInfo.html
URL: 

svn commit: r1754298 [5/6] - in /mesos/site/publish: ./ api/latest/c++/ api/latest/java/ api/latest/java/org/apache/mesos/ blog/ documentation/api-client-libraries/ documentation/app-framework-develop

2016-07-27 Thread vinodkone
Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Mode.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Mode.html?rev=1754298=1754297=1754298=diff
==
--- mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Mode.html 
(original)
+++ mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Mode.html 
Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Volume.Mode
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.Builder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.Builder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.Builder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.Builder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Volume.Source.Builder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolume.Builder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolume.Builder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolume.Builder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolume.Builder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Volume.Source.DockerVolume.Builder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolume.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolume.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolume.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolume.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Volume.Source.DockerVolume
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolumeOrBuilder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolumeOrBuilder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolumeOrBuilder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.DockerVolumeOrBuilder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Volume.Source.DockerVolumeOrBuilder
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.Type.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.Type.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.Type.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.Type.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Volume.Source.Type
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.html 
(original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.Source.html 
Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Volume.Source
-
+
 
 
 

Modified: 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.SourceOrBuilder.html
URL: 
http://svn.apache.org/viewvc/mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.SourceOrBuilder.html?rev=1754298=1754297=1754298=diff
==
--- 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.SourceOrBuilder.html
 (original)
+++ 
mesos/site/publish/api/latest/java/org/apache/mesos/Protos.Volume.SourceOrBuilder.html
 Wed Jul 27 16:12:28 2016
@@ -2,9 +2,9 @@
 
 
 
-
+
 Protos.Volume.SourceOrBuilder
-
+
 
 
 


[1/2] mesos git commit: Updated website for 1.0.

2016-07-27 Thread vinodkone
Repository: mesos
Updated Branches:
  refs/heads/master e04b82737 -> 6d63c6236


Updated website for 1.0.


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

Branch: refs/heads/master
Commit: 019c96e8a4f27eaa55c0810070edb37b81b90ee0
Parents: e04b827
Author: Vinod Kone 
Authored: Wed Jul 27 08:34:06 2016 -0700
Committer: Vinod Kone 
Committed: Wed Jul 27 08:34:06 2016 -0700

--
 site/data/releases.yml | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/019c96e8/site/data/releases.yml
--
diff --git a/site/data/releases.yml b/site/data/releases.yml
index 48c0119..3a23aa2 100644
--- a/site/data/releases.yml
+++ b/site/data/releases.yml
@@ -3,8 +3,8 @@
 #   `versions` below.
 # * When publishing a new blog post, we need to append an item to `news` below.
 latest_stable:
-  version: 0.28.2
-  jira_version: 12335646
+  version: 1.0.0
+  jira_version: 12324944
 news:
 ## * If the news is used to announce a release version, the item structure is
 ##   - title: (required)
@@ -15,6 +15,10 @@ news:
 ##   - title: (required)
 ## date: (required)
 ## blog: (required)
+  - title: Mesos 1.0.0 is released!
+date: July 27, 2016
+blog: mesos-1-0-0-released
+target_version: 1.0.0
   - title: Mesos 0.27.3 is released!
 date: June 12, 2016
 blog: mesos-0-27-3-released
@@ -88,6 +92,8 @@ versions:
 ## after we create the ReleaseNote for 0.28.1, we get the link:
 ## 
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311242=12335359.
 ## At here, 12335359 is the jira_version of 0.28.1.
+  - version: 1.0.0
+jira_version: 12324944
   - version: 0.28.2
 jira_version: 12335646
   - version: 0.28.1



[2/2] mesos git commit: Added 1.0 blogpost.

2016-07-27 Thread vinodkone
Added 1.0 blogpost.


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

Branch: refs/heads/master
Commit: 6d63c6236cec99a6ff79afd690c2287ccf3063eb
Parents: 019c96e
Author: Vinod Kone <vinodk...@gmail.com>
Authored: Sun Jul 10 21:37:27 2016 -0500
Committer: Vinod Kone <vinodk...@gmail.com>
Committed: Wed Jul 27 08:56:13 2016 -0700

--
 .../blog/2016-07-27-mesos-1-0-0-released.md | 63 
 1 file changed, 63 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/6d63c623/site/source/blog/2016-07-27-mesos-1-0-0-released.md
--
diff --git a/site/source/blog/2016-07-27-mesos-1-0-0-released.md 
b/site/source/blog/2016-07-27-mesos-1-0-0-released.md
new file mode 100644
index 000..6252c4d
--- /dev/null
+++ b/site/source/blog/2016-07-27-mesos-1-0-0-released.md
@@ -0,0 +1,63 @@
+---
+layout: post
+title: Apache Mesos 1.0.0 Released
+permalink: /blog/mesos-1-0-0-released/
+published: true
+post_author:
+  display_name: Vinod Kone
+  twitter: vinodkone
+tags: Release
+---
+
+Mesos 1.0 release is finally here for 
[download](http://mesos.apache.org/downloads)!
+
+As most of you know, Apache Mesos has been running in production at some of 
the largest Internet companies like [Twitter](https://twitter.com), 
[Netflix](https://netflix.com), [Uber](https://uber.com) and [NASA 
JPL](http://www.jpl.nasa.gov/) for many years now. It has been proven to scale 
to tens of thousands of nodes, running hundreds of thousands of containers 
serving live traffic without interruption for months at a time.
+
+Given its track record at these high profile companies, Apache Mesos could 
have reached its 1.0 milestone a long time ago. But one thing we really wanted 
to improve upon before doing a 1.0 release was to develop new HTTP APIs to ease 
the lives of both framework developers and cluster operators alike. These new 
APIs make it really easy to write a new framework or develop a new tool with 
off-the-shelf HTTP libraries written in the language of your choice. After 
iterating on the new APIs for nearly a year, we are confident that they are now 
ready for widespread use. Combined with a versioning scheme for the new APIs 
and a well-formulated [release and support 
process](http://mesos.apache.org/documentation/latest/versioning/), we are 
happy to call our latest release of Apache Mesos 1.0.
+
+In addition to the new APIs, the 1.0 release is jam-packed with features that 
makes running stateless and stateful workloads easy. Below, we will discuss 
some of the highlights in this release. For further details please refer to the 
[CHANGELOG](https://github.com/apache/mesos/blob/1.0.0/CHANGELOG).
+
+### HTTP API
+
+Before 1.0, there were essentially two types of APIs exposed by Mesos -- the 
driver-based Framework API used by schedulers and executors and the REST-based 
HTTP API used by operators and tools. While the driver-based API made writing 
frameworks easier by hiding the complexities of interfacing with Mesos itself 
(e.g., leader detection, reliable reconnection, message delivery, etc.) it had 
several drawbacks. For example, only a few languages had bindings for the 
driver (specifically, C++, Java and Python), limiting the languages that 
frameworks could be written in. Moreover, the driver required both the client 
(e.g., scheduler) and the server (e.g., master) to open connections to one 
another in order to communicate. This requirement for a bi-directional 
connection between clients and servers made it really hard for clients to run 
inside containers or behind firewalls.
+
+The new [HTTP 
API](https://www.youtube.com/watch?v=mDn_iyFSv38=13=PLGeM09tlguZQVL7ZsfNMffX9h1rGNVqnC)
 aims to solve these problems by providing an RPC-based HTTP API for both 
frameworks (i.e. 
[schedulers](http://mesos.apache.org/documentation/latest/scheduler-http-api/) 
and 
[executors](http://mesos.apache.org/documentation/latest/executor-http-api/)) 
and 
[operators](http://mesos.apache.org/documentation/latest/operator-http-api/). 
Since the API client libraries can be written in any language that speaks HTTP, 
it immediately opens the door for frameworks to be written in new languages. 
More importantly, the HTTP API doesn’t require servers to open a connection 
back to the client to communicate with it. As such, robust strategies for 
handling network partitions can now be implemented easily within the Mesos 
codebase itself.
+
+Apart from simplifying the API for framework developers and operators, one of 
the most exciting new features in the new HTTP API is **experiment

[mesos] Git Push Summary

2016-07-27 Thread vinodkone
Repository: mesos
Updated Tags:  refs/tags/1.0.0 [created] c9b70582e


svn commit: r14557 - in /release/mesos/1.0.0: ./ mesos-1.0.0.tar.gz mesos-1.0.0.tar.gz.asc mesos-1.0.0.tar.gz.md5

2016-07-27 Thread vinodkone
Author: vinodkone
Date: Wed Jul 27 07:22:19 2016
New Revision: 14557

Log:
Adding mesos-1.0.0.

Added:
release/mesos/1.0.0/
release/mesos/1.0.0/mesos-1.0.0.tar.gz   (with props)
release/mesos/1.0.0/mesos-1.0.0.tar.gz.asc
release/mesos/1.0.0/mesos-1.0.0.tar.gz.md5

Added: release/mesos/1.0.0/mesos-1.0.0.tar.gz
==
Binary file - no diff available.

Propchange: release/mesos/1.0.0/mesos-1.0.0.tar.gz
--
svn:mime-type = application/octet-stream

Added: release/mesos/1.0.0/mesos-1.0.0.tar.gz.asc
==
--- release/mesos/1.0.0/mesos-1.0.0.tar.gz.asc (added)
+++ release/mesos/1.0.0/mesos-1.0.0.tar.gz.asc Wed Jul 27 07:22:19 2016
@@ -0,0 +1,11 @@
+-BEGIN PGP SIGNATURE-
+Version: GnuPG v1
+
+iQEcBAABAgAGBQJXkwGBAAoJEBf21SiiwsdKszoIAL9al2TCMqLm1GvnMnpXP6aM
+gh1S8Xflmzy0pTa2rlOOLCxriIZqzgUg2IFvTwhb1fBgEZp0y4lE0nga16VxzM0M
+3iVxa97kzJMqpFBMOw1/AEuPufN44vfa8WL2jlRI4gzPq+nvZY5wcUb9nB0uad0W
+GI/zp3i1KNrsu+fEfJ2vXV3lk1o4tR8A23jhQ9JHz3DXXYkSvFVPrCMz94UBxEb8
+kIKfblZ270106aLiBRwut4KQbDXOijlkxs8I73FL0I2twiWTk7OuNMP6JGQwXCGt
+Liw+z02IdY4ilTml7ccQOTJNCXrC8UbapA5uU9kuMHazZqKtDaUr33fr4AfTcgA=
+=MxNp
+-END PGP SIGNATURE-

Added: release/mesos/1.0.0/mesos-1.0.0.tar.gz.md5
==
--- release/mesos/1.0.0/mesos-1.0.0.tar.gz.md5 (added)
+++ release/mesos/1.0.0/mesos-1.0.0.tar.gz.md5 Wed Jul 27 07:22:19 2016
@@ -0,0 +1 @@
+mesos-1.0.0.tar.gz: 8B 31 A9 34 CA 19 AA BF  21 05 D8 4D F5 EC 5D 9C




svn commit: r1754060 - in /mesos/site/publish/api/latest/c++: cgroups_8hpp.html cgroups_8hpp_source.html classScope-members.html classScope.html runtime_8hpp.html runtime_8hpp_source.html scope_8hpp.h

2016-07-25 Thread vinodkone
Author: vinodkone
Date: Tue Jul 26 00:20:32 2016
New Revision: 1754060

URL: http://svn.apache.org/viewvc?rev=1754060=rev
Log:
Removed missing files.

Removed:
mesos/site/publish/api/latest/c++/cgroups_8hpp.html
mesos/site/publish/api/latest/c++/cgroups_8hpp_source.html
mesos/site/publish/api/latest/c++/classScope-members.html
mesos/site/publish/api/latest/c++/classScope.html
mesos/site/publish/api/latest/c++/runtime_8hpp.html
mesos/site/publish/api/latest/c++/runtime_8hpp_source.html
mesos/site/publish/api/latest/c++/scope_8hpp.html
mesos/site/publish/api/latest/c++/scope_8hpp_source.html



<    1   2   3   4   5   6   7   8   9   10   >