mesos git commit: CMake: Fixed the http_parser patch command.

2016-11-23 Thread josephwu
Repository: mesos
Updated Branches:
  refs/heads/master 1fc0551db -> d6b117e6e


CMake: Fixed the http_parser patch command.

The Posix/Linux builds for the http_parser did not apply the
patch to rename a header field.

The Windows build had an incorect path to the patch file.


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

Branch: refs/heads/master
Commit: d6b117e6e1f8ccb876db91261fe604ce826bf791
Parents: 1fc0551
Author: Joseph Wu 
Authored: Wed Nov 23 14:35:24 2016 -0800
Committer: Joseph Wu 
Committed: Wed Nov 23 14:41:18 2016 -0800

--
 3rdparty/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/d6b117e6/3rdparty/CMakeLists.txt
--
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 770a382..092184b 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -124,11 +124,11 @@ endif (NOT WIN32)
 set(HTTP_PARSER_UPDATE_CMD ${CMAKE_COMMAND} -E copy 
${MESOS_3RDPARTY_SRC}/http-parser/CMakeLists.txt.template 
${HTTP_PARSER_ROOT}/CMakeLists.txt)
 
 if (NOT WIN32)
-  set(HTTP_PARSER_PATCH_CMD  ${CMAKE_NOOP})
+  PATCH_CMD(${MESOS_3RDPARTY_SRC}/http-parser-${HTTP_PARSER_VERSION}.patch 
HTTP_PARSER_PATCH_CMD)
 elseif (WIN32)
   # Set the patch command which will utilize patch.exe under
   # `\Users\\AppData\Local\Temp with no elevation prompt`
-  set(HTTP_PARSER_PATCH_CMD ${PATCHEXE_LOCATION} --binary -p1 < 
${MESOS_3RDPARTY_BIN}/http-parser-${HTTP_PARSER_VERSION}.patch)
+  set(HTTP_PARSER_PATCH_CMD ${PATCHEXE_LOCATION} --binary -p1 < 
${MESOS_3RDPARTY_SRC}/http-parser-${HTTP_PARSER_VERSION}.patch)
 endif (NOT WIN32)
 
 set(LIBEVENT_CMAKE_ARGS



[2/9] mesos git commit: Added new parameter for user to ContainerLogger's prepare function.

2016-11-23 Thread josephwu
Added new parameter for user to ContainerLogger's prepare function.

This new parameter allows the containerizer to pass along the
user the container will eventually run as.  The ContainerLogger
module may choose to launch subprocesses under that user if applicable.

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


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

Branch: refs/heads/master
Commit: d4ba90fac3b8d0507d8d952c413730b78c8be4ee
Parents: 120274a
Author: Sivaram Kannan 
Authored: Wed Nov 23 11:14:39 2016 -0800
Committer: Joseph Wu 
Committed: Wed Nov 23 11:47:52 2016 -0800

--
 include/mesos/slave/container_logger.hpp|  3 ++-
 src/slave/container_loggers/lib_logrotate.cpp   | 11 ---
 src/slave/container_loggers/lib_logrotate.hpp   |  3 ++-
 src/slave/container_loggers/sandbox.cpp |  9 ++---
 src/slave/container_loggers/sandbox.hpp |  3 ++-
 src/slave/containerizer/docker.cpp  | 10 --
 src/slave/containerizer/mesos/containerizer.cpp |  8 +++-
 src/tests/container_logger_tests.cpp|  6 +++---
 8 files changed, 38 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/d4ba90fa/include/mesos/slave/container_logger.hpp
--
diff --git a/include/mesos/slave/container_logger.hpp 
b/include/mesos/slave/container_logger.hpp
index 9399747..43bd4b6 100644
--- a/include/mesos/slave/container_logger.hpp
+++ b/include/mesos/slave/container_logger.hpp
@@ -150,7 +150,8 @@ public:
*/
   virtual process::Future prepare(
   const ExecutorInfo& executorInfo,
-  const std::string& sandboxDirectory) = 0;
+  const std::string& sandboxDirectory,
+  const Option& user) = 0;
 };
 
 } // namespace slave {

http://git-wip-us.apache.org/repos/asf/mesos/blob/d4ba90fa/src/slave/container_loggers/lib_logrotate.cpp
--
diff --git a/src/slave/container_loggers/lib_logrotate.cpp 
b/src/slave/container_loggers/lib_logrotate.cpp
index 53698d3..27726ab 100644
--- a/src/slave/container_loggers/lib_logrotate.cpp
+++ b/src/slave/container_loggers/lib_logrotate.cpp
@@ -73,7 +73,8 @@ public:
   // the files according to the configured maximum size and number of files.
   Future prepare(
   const ExecutorInfo& executorInfo,
-  const std::string& sandboxDirectory)
+  const std::string& sandboxDirectory,
+  const Option& user)
   {
 // Inherit most, but not all of the agent's environment.
 // Since the subprocess links to libmesos, it will need some of the
@@ -163,6 +164,7 @@ public:
 outFlags.logrotate_options = overridenFlags.logrotate_stdout_options;
 outFlags.log_filename = path::join(sandboxDirectory, "stdout");
 outFlags.logrotate_path = flags.logrotate_path;
+outFlags.user = user;
 
 // If we are on systemd, then extend the life of the process as we
 // do with the executor. Any grandchildren's lives will also be
@@ -220,6 +222,7 @@ public:
 errFlags.logrotate_options = overridenFlags.logrotate_stderr_options;
 errFlags.log_filename = path::join(sandboxDirectory, "stderr");
 errFlags.logrotate_path = flags.logrotate_path;
+errFlags.user = user;
 
 Try errProcess = subprocess(
 path::join(flags.launcher_dir, mesos::internal::logger::rotate::NAME),
@@ -275,13 +278,15 @@ Try LogrotateContainerLogger::initialize()
 
 Future LogrotateContainerLogger::prepare(
 const ExecutorInfo& executorInfo,
-const std::string& sandboxDirectory)
+const std::string& sandboxDirectory,
+const Option& user)
 {
   return dispatch(
   process.get(),
   ::prepare,
   executorInfo,
-  sandboxDirectory);
+  sandboxDirectory,
+  user);
 }
 
 } // namespace logger {

http://git-wip-us.apache.org/repos/asf/mesos/blob/d4ba90fa/src/slave/container_loggers/lib_logrotate.hpp
--
diff --git a/src/slave/container_loggers/lib_logrotate.hpp 
b/src/slave/container_loggers/lib_logrotate.hpp
index 28fdf3b..f2abfe7 100644
--- a/src/slave/container_loggers/lib_logrotate.hpp
+++ b/src/slave/container_loggers/lib_logrotate.hpp
@@ -198,7 +198,8 @@ public:
   virtual process::Future
   prepare(
   const ExecutorInfo& executorInfo,
-  const std::string& sandboxDirectory);
+  const std::string& sandboxDirectory,
+  const Option& user);
 
 protected:
   Flags flags;

http://git-wip-us.apache.org/repos/asf/mesos/blob/d4ba90fa/src/slave/container_loggers/sandbox.cpp

[6/9] mesos git commit: Modified a test to use the updated Bytes operators.

2016-11-23 Thread josephwu
Modified a test to use the updated Bytes operators.

This is the only test that multiplies/divides Bytes by a decimal value.

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


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

Branch: refs/heads/master
Commit: c1218239da746a8db7a79beffb6982d466a018d1
Parents: 4c79b39
Author: Joseph Wu 
Authored: Wed Nov 23 13:08:43 2016 -0800
Committer: Joseph Wu 
Committed: Wed Nov 23 13:08:43 2016 -0800

--
 src/tests/hierarchical_allocator_tests.cpp | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/c1218239/src/tests/hierarchical_allocator_tests.cpp
--
diff --git a/src/tests/hierarchical_allocator_tests.cpp 
b/src/tests/hierarchical_allocator_tests.cpp
index edd5cea..3b0eb75 100644
--- a/src/tests/hierarchical_allocator_tests.cpp
+++ b/src/tests/hierarchical_allocator_tests.cpp
@@ -1061,15 +1061,15 @@ TEST_F(HierarchicalAllocatorTest, Allocatable)
 
   // Not enough memory or cpu to be considered allocatable.
   SlaveInfo slave1 = createSlaveInfo(
-  "cpus:" + stringify(MIN_CPUS / 2) + ";"
-  "mem:" + stringify((MIN_MEM / 2).megabytes()) + ";"
+  "cpus:" + stringify(MIN_CPUS / 2u) + ";"
+  "mem:" + stringify((MIN_MEM / 2u).megabytes()) + ";"
   "disk:128");
   allocator->addSlave(slave1.id(), slave1, None(), slave1.resources(), {});
 
   // Enough cpus to be considered allocatable.
   SlaveInfo slave2 = createSlaveInfo(
   "cpus:" + stringify(MIN_CPUS) + ";"
-  "mem:" + stringify((MIN_MEM / 2).megabytes()) + ";"
+  "mem:" + stringify((MIN_MEM / 2u).megabytes()) + ";"
   "disk:128");
   allocator->addSlave(slave2.id(), slave2, None(), slave2.resources(), {});
 
@@ -1082,7 +1082,7 @@ TEST_F(HierarchicalAllocatorTest, Allocatable)
 
   // Enough memory to be considered allocatable.
   SlaveInfo slave3 = createSlaveInfo(
-  "cpus:" + stringify(MIN_CPUS / 2) + ";"
+  "cpus:" + stringify(MIN_CPUS / 2u) + ";"
   "mem:" + stringify((MIN_MEM).megabytes()) + ";"
   "disk:128");
   allocator->addSlave(slave3.id(), slave3, None(), slave3.resources(), {});
@@ -1097,10 +1097,10 @@ TEST_F(HierarchicalAllocatorTest, Allocatable)
   // slave4 has enough cpu and memory to be considered allocatable,
   // but it lies across unreserved and reserved resources!
   SlaveInfo slave4 = createSlaveInfo(
-  "cpus:" + stringify(MIN_CPUS / 1.5) + ";"
-  "mem:" + stringify((MIN_MEM / 2).megabytes()) + ";"
-  "cpus(role1):" + stringify(MIN_CPUS / 1.5) + ";"
-  "mem(role1):" + stringify((MIN_MEM / 2).megabytes()) + ";"
+  "cpus:" + stringify(MIN_CPUS * 3u / 2u) + ";"
+  "mem:" + stringify((MIN_MEM / 2u).megabytes()) + ";"
+  "cpus(role1):" + stringify(MIN_CPUS * 3u / 2u) + ";"
+  "mem(role1):" + stringify((MIN_MEM / 2u).megabytes()) + ";"
   "disk:128");
   allocator->addSlave(slave4.id(), slave4, None(), slave4.resources(), {});
 



[8/9] mesos git commit: Transformed env variable parsing into Flags in libprocess.

2016-11-23 Thread josephwu
Transformed env variable parsing into Flags in libprocess.

This retains existing environment variables read by libprocess
(LIBPROCESS + IP, ADVERTISE_IP, PORT, ADVERTISE_PORT) but parsing
is done via a Flags object.  This also documents the behavior and
expectations of the flags, and prints a more helpful error message
if the environment variables are set incorrectly.

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


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

Branch: refs/heads/master
Commit: 1d33559fad35a4ca84f275b1c1544aa5afa48e28
Parents: d022300
Author: Armand Grillet 
Authored: Wed Nov 23 13:21:32 2016 -0800
Committer: Joseph Wu 
Committed: Wed Nov 23 13:42:13 2016 -0800

--
 3rdparty/libprocess/src/process.cpp | 125 ++-
 1 file changed, 90 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/1d33559f/3rdparty/libprocess/src/process.cpp
--
diff --git a/3rdparty/libprocess/src/process.cpp 
b/3rdparty/libprocess/src/process.cpp
index a2382ef..7a7586b 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -91,6 +91,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -99,6 +100,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -150,6 +152,72 @@ using std::vector;
 
 namespace process {
 
+namespace internal {
+
+// These are environment variables expected in `process::initialize`.
+// All these flags should be loaded with the prefix "LIBPROCESS_".
+struct Flags : public virtual flags::FlagsBase
+{
+  Flags()
+  {
+add(::ip,
+"ip",
+"The IP address for communication to and from libprocess.\n"
+"If not specified, libprocess will attempt to reverse-DNS lookup\n"
+"the hostname and use that IP instead.");
+
+add(::advertise_ip,
+"advertise_ip",
+"The IP address that will be advertised to the outside world\n"
+"for communication to and from libprocess.  This is useful,\n"
+"for example, for containerized tasks in which communication\n"
+"is bound locally to a non-public IP that will be inaccessible\n"
+"to the master.");
+
+add(::port,
+"port",
+"The port for communication to and from libprocess.\n"
+"If not specified or set to 0, libprocess will bind it to a random\n"
+"available port.",
+[](const Option& value) -> Option {
+  if (value.isSome()) {
+if (value.get() < 0 || value.get() > USHRT_MAX) {
+  return Error(
+  "LIBPROCESS_PORT=" + stringify(value.get()) +
+  " is not a valid port");
+}
+  }
+
+  return None();
+});
+
+add(::advertise_port,
+"advertise_port",
+"The port that will be advertised to the outside world\n"
+"for communication to and from libprocess.  NOTE: This port\n"
+"will not actually be bound (only the local '--port' will be), so\n"
+"redirection to the local IP and port must be provided separately.",
+[](const Option& value) -> Option {
+  if (value.isSome()) {
+if (value.get() <= 0 || value.get() > USHRT_MAX) {
+  return Error(
+  "LIBPROCESS_ADVERTISE_PORT=" + stringify(value.get()) +
+  " is not a valid port");
+}
+  }
+
+  return None();
+});
+  }
+
+  Option ip;
+  Option advertise_ip;
+  Option port;
+  Option advertise_port;
+};
+
+} // namespace internal {
+
 namespace ID {
 
 string generate(const string& prefix)
@@ -1001,28 +1069,28 @@ bool initialize(
 
   Clock::initialize(lambda::bind(, lambda::_1));
 
+  // Fill in the local IP and port for inter-libprocess communication.
   __address__ = Address::LOCALHOST_ANY();
 
-  // Check environment for ip.
-  Option value = os::getenv("LIBPROCESS_IP");
-  if (value.isSome()) {
-Try ip = net::IP::parse(value.get(), AF_INET);
-if (ip.isError()) {
-  LOG(FATAL) << "Parsing LIBPROCESS_IP=" << value.get()
- << " failed: " << ip.error();
-}
-__address__.ip = ip.get();
+  // Fetch and parse the libprocess environment variables.
+  internal::Flags flags;
+  Try load = flags.load("LIBPROCESS_");
+
+  if (load.isError()) {
+LOG(FATAL) << flags.usage(load.error());
   }
 
-  // Check environment for port.
-  value = os::getenv("LIBPROCESS_PORT");
-  if (value.isSome()) {
-Try result = 

[5/9] mesos git commit: Changed Bytes operators to take unsigned integers.

2016-11-23 Thread josephwu
Changed Bytes operators to take unsigned integers.

The multiplication and division operators for `Bytes` take a `double`
argument.  Changing this to an unsigned integer removes the implicit
`double` to `uint64_t` casting.  These operators are currently only
used in tests.

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


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

Branch: refs/heads/master
Commit: 4c79b39330e38c865c5e9812e5911f598c1710fd
Parents: 842c4cf
Author: Joseph Wu 
Authored: Wed Nov 23 13:08:42 2016 -0800
Committer: Joseph Wu 
Committed: Wed Nov 23 13:08:42 2016 -0800

--
 3rdparty/stout/include/stout/bytes.hpp | 28 
 3rdparty/stout/tests/bytes_tests.cpp   |  4 ++--
 2 files changed, 6 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/4c79b393/3rdparty/stout/include/stout/bytes.hpp
--
diff --git a/3rdparty/stout/include/stout/bytes.hpp 
b/3rdparty/stout/include/stout/bytes.hpp
index 9debe2f..98223db 100644
--- a/3rdparty/stout/include/stout/bytes.hpp
+++ b/3rdparty/stout/include/stout/bytes.hpp
@@ -97,24 +97,14 @@ public:
 return *this;
   }
 
-  Bytes& operator*=(double multiplier)
+  Bytes& operator*=(uint64_t multiplier)
   {
-if (multiplier < 0) {
-  ABORT("Multiplying Bytes by negative multiplier "
-"'" + stringify(multiplier) + "'");
-}
-
 value *= multiplier;
 return *this;
   }
 
-  Bytes& operator/=(double divisor)
+  Bytes& operator/=(uint64_t divisor)
   {
-if (divisor < 0) {
-  ABORT("Dividing Bytes by negative divisor "
-"'" + stringify(divisor) + "'");
-}
-
 value /= divisor;
 return *this;
   }
@@ -194,26 +184,16 @@ inline Bytes operator-(const Bytes& lhs, const Bytes& rhs)
 }
 
 
-inline Bytes operator*(const Bytes& lhs, double multiplier)
+inline Bytes operator*(const Bytes& lhs, uint64_t multiplier)
 {
-  if (multiplier < 0) {
-ABORT("Multiplying Bytes by negative multiplier "
-  "'" + stringify(multiplier) + "'");
-  }
-
   Bytes result = lhs;
   result *= multiplier;
   return result;
 }
 
 
-inline Bytes operator/(const Bytes& lhs, double divisor)
+inline Bytes operator/(const Bytes& lhs, uint64_t divisor)
 {
-  if (divisor < 0) {
-ABORT("Dividing Bytes by negative divisor "
-  "'" + stringify(divisor) + "'");
-  }
-
   Bytes result = lhs;
   result /= divisor;
   return result;

http://git-wip-us.apache.org/repos/asf/mesos/blob/4c79b393/3rdparty/stout/tests/bytes_tests.cpp
--
diff --git a/3rdparty/stout/tests/bytes_tests.cpp 
b/3rdparty/stout/tests/bytes_tests.cpp
index 9d32ea1..1e175d7 100644
--- a/3rdparty/stout/tests/bytes_tests.cpp
+++ b/3rdparty/stout/tests/bytes_tests.cpp
@@ -44,9 +44,9 @@ TEST(BytesTest, Arithmetic)
   EXPECT_EQ(Terabytes(1), Gigabytes(512) + Gigabytes(512));
   EXPECT_EQ(Terabytes(1), Terabytes(2) - Terabytes(1));
 
-  EXPECT_EQ(Terabytes(1), Gigabytes(1) * 1024);
+  EXPECT_EQ(Terabytes(1), Gigabytes(1) * 1024u);
 
-  EXPECT_EQ(Gigabytes(1), Terabytes(1) / 1024);
+  EXPECT_EQ(Gigabytes(1), Terabytes(1) / 1024u);
 }
 
 



svn commit: r17147 - /release/mesos/KEYS

2016-11-23 Thread anand
Author: anand
Date: Wed Nov 23 22:00:28 2016
New Revision: 17147

Log:
Added Anand Mazumdar's pgp keys.

Modified:
release/mesos/KEYS

Modified: release/mesos/KEYS
==
--- release/mesos/KEYS (original)
+++ release/mesos/KEYS Wed Nov 23 22:00:28 2016
@@ -671,3 +671,61 @@ IsNowsSiM8Fg5rrWA7zZIaFrzbKsBsdZciejCXdE
 gxCK7jy7+ihNHgQOB3BPTeqHrMHDj1sTyp27Az4CqlcJddRqetSmBCkjmtE=
 =nWYk
 -END PGP PUBLIC KEY BLOCK-
+pub   4096R/C5FF85C1 2016-11-23 [expires: 2036-11-18]
+uid   [ultimate] Anand Mazumdar 
+sig 3C5FF85C1 2016-11-23  Anand Mazumdar 
+sub   4096R/70F880FA 2016-11-23 [expires: 2036-11-18]
+sig  C5FF85C1 2016-11-23  Anand Mazumdar 
+
+-BEGIN PGP PUBLIC KEY BLOCK-
+Version: GnuPG v2
+
+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
+GUpY6S3PgYxwkoIA/w==
+=yIvm
+-END PGP PUBLIC KEY BLOCK-




[3/9] mesos git commit: Added test cases for the logrotate module with --switch_user.

2016-11-23 Thread josephwu
Added test cases for the logrotate module with --switch_user.

This adds two regression tests for running a task under a different
user than the agent.  In both cases, the logrotate module should
still rotate logs, but the user that owns the log files will differ.

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


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

Branch: refs/heads/master
Commit: 1f93bdd9240d9d23456e4a5da1299dc4135512e7
Parents: d4ba90f
Author: Sivaram Kannan 
Authored: Wed Nov 23 11:14:41 2016 -0800
Committer: Joseph Wu 
Committed: Wed Nov 23 12:05:00 2016 -0800

--
 src/tests/container_logger_tests.cpp | 192 ++
 1 file changed, 192 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/1f93bdd9/src/tests/container_logger_tests.cpp
--
diff --git a/src/tests/container_logger_tests.cpp 
b/src/tests/container_logger_tests.cpp
index 3c7626d..6f69c08 100644
--- a/src/tests/container_logger_tests.cpp
+++ b/src/tests/container_logger_tests.cpp
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "master/master.hpp"
 
@@ -89,6 +90,7 @@ using std::vector;
 using testing::_;
 using testing::AtMost;
 using testing::Return;
+using testing::WithParamInterface;
 
 namespace mesos {
 namespace internal {
@@ -579,6 +581,196 @@ TEST_F(ContainerLoggerTest, LOGROTATE_ModuleFDOwnership)
   driver.join();
 }
 
+
+// These tests are parameterized by the boolean `--switch-user` agent flag.
+class UserContainerLoggerTest
+  : public ContainerLoggerTest, public WithParamInterface {};
+
+INSTANTIATE_TEST_CASE_P(
+bool,
+UserContainerLoggerTest,
+::testing::Values(true, false));
+
+
+// Tests that the packaged logrotate container logger will rotate files when
+// the agent is root, but the executor is launched as a non-root user.
+//
+// 1. When `--switch_user` is true on the agent, the logger module should
+//launch subprocesses with the same user as the executor.
+// 2. When `--switch_user` is false on the agent, the logger module should
+//inherit the user of the agent.
+TEST_P(UserContainerLoggerTest, ROOT_LOGROTATE_RotateWithSwitchUserTrueOrFalse)
+{
+  // Create a master, agent, and framework.
+  Try master = StartMaster();
+  ASSERT_SOME(master);
+
+  Future slaveRegisteredMessage =
+FUTURE_PROTOBUF(SlaveRegisteredMessage(), _, _);
+
+  // We'll need access to these flags later.
+  slave::Flags flags = CreateSlaveFlags();
+
+  // Use the non-default container logger that rotates logs.
+  flags.container_logger = LOGROTATE_CONTAINER_LOGGER_NAME;
+
+  // Parameterize the `--switch_user` flag to test both options.
+  flags.switch_user = GetParam();
+
+  // In order for the unprivileged user to successfully chdir, the
+  // agent's work directory needs to have execute permissions.
+  Try chmod = os::chmod(
+  flags.work_dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
+  ASSERT_SOME(chmod);
+
+  Fetcher fetcher;
+
+  // We use an actual containerizer + executor since we want something to run.
+  Try _containerizer =
+MesosContainerizer::create(flags, false, );
+
+  CHECK_SOME(_containerizer);
+  Owned containerizer(_containerizer.get());
+
+  Owned detector = master.get()->createDetector();
+
+  Try slave =
+StartSlave(detector.get(), containerizer.get(), flags);
+  ASSERT_SOME(slave);
+
+  AWAIT_READY(slaveRegisteredMessage);
+  SlaveID slaveId = slaveRegisteredMessage.get().slave_id();
+
+  MockScheduler sched;
+  MesosSchedulerDriver driver(
+  , DEFAULT_FRAMEWORK_INFO, master.get()->pid, DEFAULT_CREDENTIAL);
+
+  Future frameworkId;
+  EXPECT_CALL(sched, registered(, _, _))
+.WillOnce(FutureArg<1>());
+
+  // Wait for an offer, and start a task.
+  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());
+
+  // Start a task that spams stdout with 3 MB of (mostly blank) output.
+  // The logrotate container logger module is loaded with parameters that limit
+  // the log size to five files of 2 MB each.  After the task completes, there
+  // should be two files with a total size of 3 MB.  The "stdout" file should
+  // be 1 MB large.
+  TaskInfo task = createTask(
+  offers.get()[0],
+  "i=0; while [ $i -lt 3072 ]; "
+  "do printf '%-1024d\\n' $i; i=$((i+1)); done");
+
+  // Start the task as a 

svn commit: r17149 - in /dev/mesos/0.28.3-rc1: ./ mesos-0.28.3.tar.gz mesos-0.28.3.tar.gz.asc mesos-0.28.3.tar.gz.md5

2016-11-23 Thread anand
Author: anand
Date: Wed Nov 23 22:59:09 2016
New Revision: 17149

Log:
Adding mesos-0.28.3-rc1.

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

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

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

Added: dev/mesos/0.28.3-rc1/mesos-0.28.3.tar.gz.asc
==
--- dev/mesos/0.28.3-rc1/mesos-0.28.3.tar.gz.asc (added)
+++ dev/mesos/0.28.3-rc1/mesos-0.28.3.tar.gz.asc Wed Nov 23 22:59:09 2016
@@ -0,0 +1,17 @@
+-BEGIN PGP SIGNATURE-
+Version: GnuPG v2
+
+iQIcBAABCAAGBQJYNh85AAoJEBdPufrF/4XBAMsP/2MAPH9U04yaPyuNFaHKKMrU
+7XNpKAcOeGgH+8nKGz562/99D4VQiJmzpxYJKkY/u6XF/2mq6/aDW3NfEdkoAUzN
+dzl78UxW5IVWNFe6D2aLSPBI9CsVyhPe6MIGvTspRRIRyOQ8QyAMsuSIxeCiG3RL
+2EL7ugWBB7iUQDaBwMuHXMKwrNpZ6ZP/N+p2RJccpxE9c4ap/VJlUjdl1vMqXOAz
+nqxlbm3dhsQnRaK3kAYcHzb4POYpDYClYPYB61Ic3r0MtK4TnlRdjLBG2IsZ+U9h
+YnM91qogA7iLfbVKIdD//cW66uDpqjycMTXYH3/rY7SFWpygOjNiOgurXoVi39aA
+WcNkJjg31MgJUzlarGGWO/4G2oViTsIGJ1LF1zTBI3ZXItAXy97X5N5R763T/jmR
+5Sa5QRwcKEjqcJAvkdKB0hDPNMQBMerZ5egoW1B0Yk8yMsh2wnIv3qKx8YKjGNKT
+LgFAkTymG0N/m6s9GtRyX8F2v//HFBYgYVMAWvE5gOQ7M1VIpZLWF6A9AgNhdx05
+r8ParR8Phsslhbu+nz8uwJExUsLIAg436UcBsdb4iaMzJGiz6Su+1ktXcRLwKU+j
+CM5Y2B/SU5pcBbL0cXe7VRDVFC/9De9/b0Ajwsv2H08nbrbhgKNC2FfdA6yeIfjJ
+/J6OuYxbSgM4+9cb185i
+=3hvz
+-END PGP SIGNATURE-

Added: dev/mesos/0.28.3-rc1/mesos-0.28.3.tar.gz.md5
==
--- dev/mesos/0.28.3-rc1/mesos-0.28.3.tar.gz.md5 (added)
+++ dev/mesos/0.28.3-rc1/mesos-0.28.3.tar.gz.md5 Wed Nov 23 22:59:09 2016
@@ -0,0 +1 @@
+mesos-0.28.3.tar.gz: FF B8 D5 8E 34 86 74 BB  08 CF 66 04 6C 8E 69 A1




[4/4] mesos git commit: Added backport of r52910 to 1.1.x.

2016-11-23 Thread qianzhang
Added backport of r52910 to 1.1.x.


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

Branch: refs/heads/1.1.x
Commit: b7f0bc1943bb5cbe5830df987a9888d90bbcd18e
Parents: de3a1b5
Author: Qian Zhang 
Authored: Wed Nov 23 17:49:17 2016 +0800
Committer: Qian Zhang 
Committed: Thu Nov 24 09:37:56 2016 +0800

--
 src/Makefile.am |  1 +
 .../containerizer/mesos/provisioner/backend.cpp |  9 ++---
 .../mesos/provisioner/constants.hpp | 34 ++
 .../mesos/provisioner/docker/paths.cpp  |  4 ++-
 src/slave/flags.cpp |  4 ++-
 .../containerizer/provisioner_appc_tests.cpp| 13 ---
 .../containerizer/provisioner_backend_tests.cpp | 37 
 7 files changed, 76 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/b7f0bc19/src/Makefile.am
--
diff --git a/src/Makefile.am b/src/Makefile.am
index 3bcc0f2..73d337d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -967,6 +967,7 @@ libmesos_no_3rdparty_la_SOURCES +=  
\
   slave/containerizer/mesos/isolators/volume/sandbox_path.hpp  \
   slave/containerizer/mesos/isolators/windows.hpp  \
   slave/containerizer/mesos/provisioner/backend.hpp\
+  slave/containerizer/mesos/provisioner/constants.hpp  \
   slave/containerizer/mesos/provisioner/paths.hpp  \
   slave/containerizer/mesos/provisioner/provisioner.hpp
\
   slave/containerizer/mesos/provisioner/store.hpp  \

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7f0bc19/src/slave/containerizer/mesos/provisioner/backend.cpp
--
diff --git a/src/slave/containerizer/mesos/provisioner/backend.cpp 
b/src/slave/containerizer/mesos/provisioner/backend.cpp
index 9c258ed..157967f 100644
--- a/src/slave/containerizer/mesos/provisioner/backend.cpp
+++ b/src/slave/containerizer/mesos/provisioner/backend.cpp
@@ -23,6 +23,7 @@
 #endif
 
 #include "slave/containerizer/mesos/provisioner/backend.hpp"
+#include "slave/containerizer/mesos/provisioner/constants.hpp"
 
 #ifdef __linux__
 #include "slave/containerizer/mesos/provisioner/backends/aufs.hpp"
@@ -46,14 +47,14 @@ hashmap Backend::create(const 
Flags& flags)
   hashmap(*)(const Flags&)> creators;
 
 #ifdef __linux__
-  creators.put("bind", ::create);
+  creators.put(BIND_BACKEND, ::create);
 
   Try aufsSupported = fs::supported("aufs");
   if (aufsSupported.isError()) {
 LOG(WARNING) << "Failed to check aufs availability: '"
  << aufsSupported.error();
   } else if (aufsSupported.get()) {
-creators.put("aufs", ::create);
+creators.put(AUFS_BACKEND, ::create);
   }
 
   Try overlayfsSupported = fs::supported("overlayfs");
@@ -61,11 +62,11 @@ hashmap Backend::create(const 
Flags& flags)
 LOG(WARNING) << "Failed to check overlayfs availability: '"
  << overlayfsSupported.error();
   } else if (overlayfsSupported.get()) {
-creators.put("overlay", ::create);
+creators.put(OVERLAY_BACKEND, ::create);
   }
 #endif // __linux__
 
-  creators.put("copy", ::create);
+  creators.put(COPY_BACKEND, ::create);
 
   hashmap backends;
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/b7f0bc19/src/slave/containerizer/mesos/provisioner/constants.hpp
--
diff --git a/src/slave/containerizer/mesos/provisioner/constants.hpp 
b/src/slave/containerizer/mesos/provisioner/constants.hpp
new file mode 100644
index 000..ab488eb
--- /dev/null
+++ b/src/slave/containerizer/mesos/provisioner/constants.hpp
@@ -0,0 +1,34 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 

[1/4] mesos git commit: Added backport of MESOS-6360 (Mesos part) to 1.1.x.

2016-11-23 Thread qianzhang
Repository: mesos
Updated Branches:
  refs/heads/1.1.x de3a1b58a -> b810e22d3


Added backport of MESOS-6360 (Mesos part) to 1.1.x.


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

Branch: refs/heads/1.1.x
Commit: b810e22d37cffd4431599ea75ec509db56d10460
Parents: 2d65576
Author: Qian Zhang 
Authored: Wed Nov 23 17:39:33 2016 +0800
Committer: Qian Zhang 
Committed: Thu Nov 24 09:37:56 2016 +0800

--
 src/CMakeLists.txt  |   2 +
 src/Makefile.am |   3 +
 .../mesos/provisioner/backends/copy.cpp | 108 ++-
 .../mesos/provisioner/docker/store.cpp  |  24 +++-
 .../mesos/provisioner/provisioner.cpp   | 118 +---
 .../mesos/provisioner/provisioner.hpp   |   5 -
 .../containerizer/mesos/provisioner/utils.cpp   | 133 +++
 .../containerizer/mesos/provisioner/utils.hpp   |  37 ++
 src/slave/containerizer/mesos/utils.cpp |  40 ++
 src/slave/containerizer/mesos/utils.hpp |  15 +--
 .../containerizer/provisioner_docker_tests.cpp  |  95 +
 11 files changed, 411 insertions(+), 169 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/b810e22d/src/CMakeLists.txt
--
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e60d34c..85acbbe 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -325,9 +325,11 @@ set(AGENT_SRC
   slave/containerizer/mesos/launcher.cpp
   slave/containerizer/mesos/mount.cpp
   slave/containerizer/mesos/paths.cpp
+  slave/containerizer/mesos/utils.cpp
   slave/containerizer/mesos/provisioner/paths.cpp
   slave/containerizer/mesos/provisioner/provisioner.cpp
   slave/containerizer/mesos/provisioner/store.cpp
+  slave/containerizer/mesos/provisioner/utils.cpp
   slave/containerizer/mesos/provisioner/appc/cache.cpp
   slave/containerizer/mesos/provisioner/appc/fetcher.cpp
   slave/containerizer/mesos/provisioner/appc/paths.cpp

http://git-wip-us.apache.org/repos/asf/mesos/blob/b810e22d/src/Makefile.am
--
diff --git a/src/Makefile.am b/src/Makefile.am
index 73d337d..f82c985 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -828,6 +828,7 @@ libmesos_no_3rdparty_la_SOURCES +=  
\
   slave/containerizer/mesos/launcher.cpp   \
   slave/containerizer/mesos/mount.cpp  \
   slave/containerizer/mesos/paths.cpp  \
+  slave/containerizer/mesos/utils.cpp  \
   slave/containerizer/mesos/isolators/docker/volume/driver.cpp \
   slave/containerizer/mesos/isolators/docker/volume/paths.cpp  \
   slave/containerizer/mesos/isolators/filesystem/posix.cpp \
@@ -839,6 +840,7 @@ libmesos_no_3rdparty_la_SOURCES +=  
\
   slave/containerizer/mesos/provisioner/paths.cpp  \
   slave/containerizer/mesos/provisioner/provisioner.cpp
\
   slave/containerizer/mesos/provisioner/store.cpp  \
+  slave/containerizer/mesos/provisioner/utils.cpp  \
   slave/containerizer/mesos/provisioner/appc/cache.cpp \
   slave/containerizer/mesos/provisioner/appc/fetcher.cpp   \
   slave/containerizer/mesos/provisioner/appc/paths.cpp \
@@ -971,6 +973,7 @@ libmesos_no_3rdparty_la_SOURCES +=  
\
   slave/containerizer/mesos/provisioner/paths.hpp  \
   slave/containerizer/mesos/provisioner/provisioner.hpp
\
   slave/containerizer/mesos/provisioner/store.hpp  \
+  slave/containerizer/mesos/provisioner/utils.hpp  \
   slave/containerizer/mesos/provisioner/appc/cache.hpp \
   slave/containerizer/mesos/provisioner/appc/fetcher.hpp   \
   slave/containerizer/mesos/provisioner/appc/paths.hpp \

http://git-wip-us.apache.org/repos/asf/mesos/blob/b810e22d/src/slave/containerizer/mesos/provisioner/backends/copy.cpp
--
diff --git a/src/slave/containerizer/mesos/provisioner/backends/copy.cpp 
b/src/slave/containerizer/mesos/provisioner/backends/copy.cpp
index 9c5354e..0ce3e1e 100644
--- a/src/slave/containerizer/mesos/provisioner/backends/copy.cpp
+++ 

[mesos] Git Push Summary

2016-11-23 Thread anand
Repository: mesos
Updated Tags:  refs/tags/0.28.3-rc1 [created] 52a0b0a41


[3/4] mesos git commit: Added backport of MESOS-6360 (stout part) to 1.1.x.

2016-11-23 Thread qianzhang
Added backport of MESOS-6360 (stout part) to 1.1.x.


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

Branch: refs/heads/1.1.x
Commit: 2d6557601ead04d51b9d5ca461c2c20c3f5f65a4
Parents: 14355b7
Author: Qian Zhang 
Authored: Wed Nov 23 17:38:11 2016 +0800
Committer: Qian Zhang 
Committed: Thu Nov 24 09:37:56 2016 +0800

--
 3rdparty/stout/include/Makefile.am  |  3 +
 3rdparty/stout/include/stout/os.hpp |  1 +
 3rdparty/stout/include/stout/os/posix/xattr.hpp | 99 
 .../stout/include/stout/os/windows/xattr.hpp| 38 
 3rdparty/stout/include/stout/os/xattr.hpp   | 26 +
 3rdparty/stout/tests/os/filesystem_tests.cpp| 38 
 6 files changed, 205 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/2d655760/3rdparty/stout/include/Makefile.am
--
diff --git a/3rdparty/stout/include/Makefile.am 
b/3rdparty/stout/include/Makefile.am
index 1eb9c14..d5bc728 100644
--- a/3rdparty/stout/include/Makefile.am
+++ b/3rdparty/stout/include/Makefile.am
@@ -104,6 +104,7 @@ nobase_include_HEADERS =\
   stout/os/utime.hpp   \
   stout/os/wait.hpp\
   stout/os/write.hpp   \
+  stout/os/xattr.hpp   \
   stout/os/posix/bootid.hpp\
   stout/os/posix/chown.hpp \
   stout/os/posix/chroot.hpp\
@@ -128,6 +129,7 @@ nobase_include_HEADERS =\
   stout/os/posix/stat.hpp  \
   stout/os/posix/su.hpp\
   stout/os/posix/write.hpp \
+  stout/os/posix/xattr.hpp \
   stout/os/raw/argv.hpp\
   stout/os/raw/environment.hpp \
   stout/os/windows/bootid.hpp  \
@@ -153,6 +155,7 @@ nobase_include_HEADERS =\
   stout/os/windows/stat.hpp\
   stout/os/windows/su.hpp  \
   stout/os/windows/write.hpp   \
+  stout/os/windows/xattr.hpp   \
   stout/path.hpp   \
   stout/preprocessor.hpp   \
   stout/proc.hpp   \

http://git-wip-us.apache.org/repos/asf/mesos/blob/2d655760/3rdparty/stout/include/stout/os.hpp
--
diff --git a/3rdparty/stout/include/stout/os.hpp 
b/3rdparty/stout/include/stout/os.hpp
index 96e8621..af43bbf 100644
--- a/3rdparty/stout/include/stout/os.hpp
+++ b/3rdparty/stout/include/stout/os.hpp
@@ -64,6 +64,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2d655760/3rdparty/stout/include/stout/os/posix/xattr.hpp
--
diff --git a/3rdparty/stout/include/stout/os/posix/xattr.hpp 
b/3rdparty/stout/include/stout/os/posix/xattr.hpp
new file mode 100644
index 000..518940f
--- /dev/null
+++ b/3rdparty/stout/include/stout/os/posix/xattr.hpp
@@ -0,0 +1,99 @@
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef __STOUT_OS_POSIX_XATTR_HPP__
+#define __STOUT_OS_POSIX_XATTR_HPP__
+
+#include 
+
+namespace os {
+
+inline Try setxattr(
+const std::string& path,
+const std::string& name,
+const std::string& value,
+int flags)
+{
+#ifdef __APPLE__
+  if (::setxattr(
+  path.c_str(),
+  name.c_str(),
+  value.c_str(),
+  value.length(),
+  0,
+  flags) < 0) {
+#else
+  if (::setxattr(
+path.c_str(),
+name.c_str(),
+value.c_str(),
+value.length(),
+flags) < 0) {
+#endif
+return ErrnoError();
+  }
+
+  return Nothing();
+}
+
+
+inline Try getxattr(
+const std::string& path,
+const std::string& name)
+{
+  // Get the current size of the attribute.
+#ifdef __APPLE__
+  ssize_t size = ::getxattr(path.c_str(), 

[2/4] mesos git commit: Added backport of MESOS-6002 to 1.1.x.

2016-11-23 Thread qianzhang
Added backport of MESOS-6002 to 1.1.x.


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

Branch: refs/heads/1.1.x
Commit: 14355b757ac0dd39db1928c00cb9dad5fd2deb65
Parents: b7f0bc1
Author: Qian Zhang 
Authored: Wed Nov 23 20:41:10 2016 +0800
Committer: Qian Zhang 
Committed: Thu Nov 24 09:37:56 2016 +0800

--
 .../mesos/provisioner/backends/aufs.cpp | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/14355b75/src/slave/containerizer/mesos/provisioner/backends/aufs.cpp
--
diff --git a/src/slave/containerizer/mesos/provisioner/backends/aufs.cpp 
b/src/slave/containerizer/mesos/provisioner/backends/aufs.cpp
index c69dc42..c92c6c7 100644
--- a/src/slave/containerizer/mesos/provisioner/backends/aufs.cpp
+++ b/src/slave/containerizer/mesos/provisioner/backends/aufs.cpp
@@ -145,12 +145,16 @@ Future AufsBackendProcess::provision(
 
   // See http://aufs.sourceforge.net/aufs2/man.html
   // for the mount syntax for aufs.
-  string options = "dirs=" + workdir + ":";
-
-  // For aufs, the specified lower directories will be stacked
-  // beginning from the rightmost one and going left. But we need the
-  // first layer in the vector to be the bottom most layer.
-  options += strings::join(":", adaptor::reverse(layers));
+  string options = "dirs=" + workdir + "=rw";
+
+  // For aufs, the specified lower directories will be stacked beginning
+  // from the rightmost one and going left. But we need the first layer
+  // in the vector to be the bottom most layer. And for each layer, we
+  // need to mount it with the option 'ro+wh' so that it will be read-only
+  // and its whiteout files (if any) will be well handled.
+  foreach (const string& layer, adaptor::reverse(layers)) {
+options += ":" + layer + "=ro+wh";
+  }
 
   VLOG(1) << "Provisioning image rootfs with aufs: '" << options << "'";
 



[7/9] mesos git commit: Added net::IP parsing template to the flags parsers.

2016-11-23 Thread josephwu
Added net::IP parsing template to the flags parsers.

This will allow us to specify the `net::IP` type
as a field inside flags.

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


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

Branch: refs/heads/master
Commit: d022300acc907bfe507a7cb8f1c5767a2bd6d7bb
Parents: c121823
Author: Armand Grillet 
Authored: Wed Nov 23 13:21:31 2016 -0800
Committer: Joseph Wu 
Committed: Wed Nov 23 13:37:44 2016 -0800

--
 3rdparty/stout/include/stout/flags/parse.hpp | 8 
 1 file changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/d022300a/3rdparty/stout/include/stout/flags/parse.hpp
--
diff --git a/3rdparty/stout/include/stout/flags/parse.hpp 
b/3rdparty/stout/include/stout/flags/parse.hpp
index 67a89c9..65edd86 100644
--- a/3rdparty/stout/include/stout/flags/parse.hpp
+++ b/3rdparty/stout/include/stout/flags/parse.hpp
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -77,6 +78,13 @@ inline Try parse(const std::string& value)
 
 
 template <>
+inline Try parse(const std::string& value)
+{
+  return net::IP::parse(value, AF_INET);
+}
+
+
+template <>
 inline Try parse(const std::string& value)
 {
   // A value that already starts with 'file://' will properly be



[1/9] mesos git commit: Added flag for passing in a user to the logrotate module.

2016-11-23 Thread josephwu
Repository: mesos
Updated Branches:
  refs/heads/master 212486a93 -> 1fc0551db


Added flag for passing in a user to the logrotate module.

This adds an optional field to the LogrotateContainerLogger's
companion binary.  When specified, the companion binary should switch
to the given user after being launched.

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


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

Branch: refs/heads/master
Commit: 120274ac51e5ae10e9530201ab67e56fa29edd6e
Parents: 212486a
Author: Sivaram Kannan 
Authored: Wed Nov 23 11:14:36 2016 -0800
Committer: Joseph Wu 
Committed: Wed Nov 23 11:39:05 2016 -0800

--
 src/slave/container_loggers/logrotate.cpp | 11 +++
 src/slave/container_loggers/logrotate.hpp |  5 +
 2 files changed, 16 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/120274ac/src/slave/container_loggers/logrotate.cpp
--
diff --git a/src/slave/container_loggers/logrotate.cpp 
b/src/slave/container_loggers/logrotate.cpp
index 431bc3c..61484b1 100644
--- a/src/slave/container_loggers/logrotate.cpp
+++ b/src/slave/container_loggers/logrotate.cpp
@@ -37,6 +37,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include "slave/container_loggers/logrotate.hpp"
@@ -242,6 +243,16 @@ int main(int argc, char** argv)
   << ErrnoError("Failed to put child in a new session").message;
   }
 
+  // If the `--user` flag is set, change the UID of this process to that user.
+  if (flags.user.isSome()) {
+Try result = os::su(flags.user.get());
+
+if (result.isError()) {
+  EXIT(EXIT_FAILURE)
+<< ErrnoError("Failed to switch user for logrotate process").message;
+}
+  }
+
   // Asynchronously control the flow and size of logs.
   LogrotateLoggerProcess process(flags);
   spawn();

http://git-wip-us.apache.org/repos/asf/mesos/blob/120274ac/src/slave/container_loggers/logrotate.hpp
--
diff --git a/src/slave/container_loggers/logrotate.hpp 
b/src/slave/container_loggers/logrotate.hpp
index d1db692..96dbd2d 100644
--- a/src/slave/container_loggers/logrotate.hpp
+++ b/src/slave/container_loggers/logrotate.hpp
@@ -112,12 +112,17 @@ struct Flags : public virtual flags::FlagsBase
 
   return None();
 });
+
+add(::user,
+"user",
+"The user this command should run as.");
   }
 
   Bytes max_size;
   Option logrotate_options;
   Option log_filename;
   std::string logrotate_path;
+  Option user;
 };
 
 } // namespace rotate {



[4/9] mesos git commit: Added note about MESOS-5856 to the upgrade doc.

2016-11-23 Thread josephwu
Added note about MESOS-5856 to the upgrade doc.

The 1.2 release contains a breaking change to the ContainerLogger
interface.  The change is an additional argument in one of the
module's methods.


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

Branch: refs/heads/master
Commit: 842c4cf42766473764fe58d78bad430745abc043
Parents: 1f93bdd
Author: Joseph Wu 
Authored: Wed Nov 23 11:32:03 2016 -0800
Committer: Joseph Wu 
Committed: Wed Nov 23 12:29:55 2016 -0800

--
 docs/upgrades.md | 24 
 1 file changed, 24 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/842c4cf4/docs/upgrades.md
--
diff --git a/docs/upgrades.md b/docs/upgrades.md
index 8e45fdb..74f4367 100644
--- a/docs/upgrades.md
+++ b/docs/upgrades.md
@@ -53,6 +53,24 @@ We categorize the changes as follows:
   
   
 
+  C Container Logger 
prepare method
+
+  
+  
+  
+
+
+  
+  1.1.x
+  
+  
+  
+  
+  
+  
+  
+  
+
   R Container Logger 
recovery method
 
 
@@ -205,6 +223,12 @@ We categorize the changes as follows:
 
 
 
+## Upgrading from 1.1.x to 1.2.x ##
+
+
+
+* Mesos 1.2 modifies the `ContainerLogger`'s `prepare()` method.  The method 
now takes an additional argument for the `user` the logger should run a 
subprocess as.  Please see 
[MESOS-5856](https://issues.apache.org/jira/browse/MESOS-5856) for more 
information.
+
 ## Upgrading from 1.0.x to 1.1.x ##
 
 



[9/9] mesos git commit: Transformed a fatal log message into a simple exit.

2016-11-23 Thread josephwu
Transformed a fatal log message into a simple exit.

The failures we see while validating flags in libprocess does not
warrant printing a stack trace on validation error.  The stack trace
gives a false impression that something went wrong in libprocess,
versus the user specifying an incorrect environment variable.

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


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

Branch: refs/heads/master
Commit: 1fc0551db54cd4492c3772d68212b9d7c6571728
Parents: 1d33559
Author: Armand Grillet 
Authored: Wed Nov 23 13:21:34 2016 -0800
Committer: Joseph Wu 
Committed: Wed Nov 23 13:44:57 2016 -0800

--
 3rdparty/libprocess/src/process.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/1fc0551d/3rdparty/libprocess/src/process.cpp
--
diff --git a/3rdparty/libprocess/src/process.cpp 
b/3rdparty/libprocess/src/process.cpp
index 7a7586b..e9a4bbb 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -1077,7 +1077,7 @@ bool initialize(
   Try load = flags.load("LIBPROCESS_");
 
   if (load.isError()) {
-LOG(FATAL) << flags.usage(load.error());
+EXIT(EXIT_FAILURE) << flags.usage(load.error());
   }
 
   // Log any flag warnings.