You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/03/02 08:55:42 UTC
[1/7] mesos git commit: Windows: Added suppport for
`slave/monitor.cpp`.
Repository: mesos
Updated Branches:
refs/heads/master 2de2e5791 -> 1c7c84999
Windows: Added suppport for `slave/monitor.cpp`.
Review: https://reviews.apache.org/r/40620/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/1c7c8499
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/1c7c8499
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/1c7c8499
Branch: refs/heads/master
Commit: 1c7c84999db52651a651f6f2ef2509fcbcfa0df3
Parents: aa2f528
Author: Daniel Pravat <dp...@outlook.com>
Authored: Tue Mar 1 23:30:00 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Tue Mar 1 23:55:26 2016 -0800
----------------------------------------------------------------------
src/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/1c7c8499/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 144dabd..9d29fad 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -238,6 +238,7 @@ set(AGENT_SRC
slave/gc.cpp
slave/http.cpp
slave/metrics.cpp
+ slave/monitor.cpp
slave/paths.cpp
slave/qos_controller.cpp
slave/qos_controllers/noop.cpp
@@ -253,7 +254,6 @@ if (NOT WIN32)
slave/container_logger.cpp
slave/container_loggers/sandbox.cpp
slave/flags.cpp
- slave/monitor.cpp
slave/resource_estimator.cpp
slave/slave.cpp
slave/containerizer/composing.cpp
[7/7] mesos git commit: Stout:[2/2] Added significant test coverage
of `os::rmdir`.
Posted by jo...@apache.org.
Stout:[2/2] Added significant test coverage of `os::rmdir`.
Review: https://reviews.apache.org/r/43908/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c55ca294
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c55ca294
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c55ca294
Branch: refs/heads/master
Commit: c55ca2941b0119c13764bccdebcea46119e69e4e
Parents: fbe1f37
Author: Alex Clemmer <cl...@gmail.com>
Authored: Tue Mar 1 23:29:31 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Tue Mar 1 23:55:26 2016 -0800
----------------------------------------------------------------------
3rdparty/libprocess/3rdparty/stout/Makefile.am | 1 +
.../3rdparty/stout/tests/CMakeLists.txt | 1 +
.../stout/tests/os/filesystem_tests.cpp | 2 +-
.../3rdparty/stout/tests/os/rmdir_tests.cpp | 173 +++++++++++++++++++
.../3rdparty/stout/tests/os_tests.cpp | 103 -----------
5 files changed, 176 insertions(+), 104 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/c55ca294/3rdparty/libprocess/3rdparty/stout/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/Makefile.am b/3rdparty/libprocess/3rdparty/stout/Makefile.am
index 756aa29..400c6dc 100644
--- a/3rdparty/libprocess/3rdparty/stout/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/Makefile.am
@@ -46,6 +46,7 @@ EXTRA_DIST = \
tests/option_tests.cpp \
tests/os_tests.cpp \
tests/os/filesystem_tests.cpp \
+ tests/os/rmdir_tests.cpp \
tests/os/sendfile_tests.cpp \
tests/os/signals_tests.cpp \
tests/os/strerror_tests.cpp \
http://git-wip-us.apache.org/repos/asf/mesos/blob/c55ca294/3rdparty/libprocess/3rdparty/stout/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/CMakeLists.txt b/3rdparty/libprocess/3rdparty/stout/tests/CMakeLists.txt
index 6f9d46c..03e09fb 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/CMakeLists.txt
+++ b/3rdparty/libprocess/3rdparty/stout/tests/CMakeLists.txt
@@ -38,6 +38,7 @@ set(STOUT_TESTS_SRC
numify_tests.cpp
option_tests.cpp
os/filesystem_tests.cpp
+ os/rmdir_tests.cpp
protobuf_tests.pb.h
protobuf_tests.proto
result_tests.cpp
http://git-wip-us.apache.org/repos/asf/mesos/blob/c55ca294/3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp
index d0592ef..4c30189 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/os/filesystem_tests.cpp
@@ -96,7 +96,7 @@ TEST_F(FsTest, ReadWriteString)
}
-TEST_F(FsTest, Rmdir)
+TEST_F(FsTest, Mkdir)
{
const hashset<string> EMPTY;
const string tmpdir = os::getcwd();
http://git-wip-us.apache.org/repos/asf/mesos/blob/c55ca294/3rdparty/libprocess/3rdparty/stout/tests/os/rmdir_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/os/rmdir_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/os/rmdir_tests.cpp
new file mode 100644
index 0000000..291a22b
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/tests/os/rmdir_tests.cpp
@@ -0,0 +1,173 @@
+// 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
+
+#include <list>
+#include <map>
+#include <set>
+#include <string>
+
+#include <stout/path.hpp>
+
+#include <stout/os/getcwd.hpp>
+#include <stout/os/ls.hpp>
+#include <stout/os/mkdir.hpp>
+#include <stout/os/touch.hpp>
+
+#include <stout/tests/utils.hpp>
+
+using std::list;
+using std::set;
+using std::string;
+
+
+const hashset<string>& EMPTY = hashset<string>::EMPTY;
+
+
+static hashset<string> listfiles(const string& directory)
+{
+ hashset<string> fileset;
+ Try<list<string>> entries = os::ls(directory);
+ if (entries.isSome()) {
+ foreach (const string& entry, entries.get()) {
+ fileset.insert(entry);
+ }
+ }
+ return fileset;
+}
+
+
+class RmdirTest : public TemporaryDirectoryTest {};
+
+
+// TODO(hausdorff): This test is almost copy-pasted from
+// `TrivialRemoveEmptyDirectoryRelativePath`; we should parameterize them to
+// reduce redundancy.
+TEST_F(RmdirTest, TrivialRemoveEmptyDirectoryAbsolutePath)
+{
+ const string tmpdir = os::getcwd();
+ hashset<string> expectedListing = EMPTY;
+
+ // Directory is initially empty.
+ EXPECT_EQ(expectedListing, listfiles(tmpdir));
+
+ // Successfully make directory using absolute path.
+ const string newDirectoryName = "newDirectory";
+ const string newDirectoryAbsolutePath = path::join(tmpdir, newDirectoryName);
+ expectedListing.insert(newDirectoryName);
+ EXPECT_SOME(os::mkdir(newDirectoryAbsolutePath));
+ EXPECT_EQ(expectedListing, listfiles(tmpdir));
+ EXPECT_EQ(EMPTY, listfiles(newDirectoryAbsolutePath));
+
+ // Successfully remove.
+ EXPECT_SOME(os::rmdir(newDirectoryAbsolutePath));
+ EXPECT_EQ(EMPTY, listfiles(tmpdir));
+}
+
+
+TEST_F(RmdirTest, TrivialRemoveEmptyDirectoryRelativePath)
+{
+ const string tmpdir = os::getcwd();
+ hashset<string> expectedListing = EMPTY;
+
+ // Directory is initially empty.
+ EXPECT_EQ(expectedListing, listfiles(tmpdir));
+
+ // Successfully make directory using relative path.
+ const string newDirectoryName = "newDirectory";
+ expectedListing.insert(newDirectoryName);
+ EXPECT_SOME(os::mkdir(newDirectoryName));
+ EXPECT_EQ(expectedListing, listfiles(tmpdir));
+ EXPECT_EQ(EMPTY, listfiles(newDirectoryName));
+
+ // Successfully remove.
+ EXPECT_SOME(os::rmdir(newDirectoryName));
+ EXPECT_EQ(EMPTY, listfiles(tmpdir));
+}
+
+
+TEST_F(RmdirTest, RemoveRecursiveByDefault)
+{
+ const string tmpdir = os::getcwd();
+ hashset<string> expectedRootListing = EMPTY;
+ hashset<string> expectedSubListing = EMPTY;
+
+ // Directory is initially empty.
+ EXPECT_EQ(expectedRootListing, listfiles(tmpdir));
+
+ // Successfully make directory using absolute path, and then `touch` a file
+ // in that folder.
+ const string newDirectoryName = "newDirectory";
+ const string newDirectoryAbsolutePath = path::join(tmpdir, newDirectoryName);
+ const string newFileName = "newFile";
+ const string newFileAbsolutePath = path::join(
+ newDirectoryAbsolutePath,
+ newFileName);
+
+ expectedRootListing.insert(newDirectoryName);
+ expectedSubListing.insert(newFileName);
+
+ EXPECT_SOME(os::mkdir(newDirectoryAbsolutePath));
+ EXPECT_SOME(os::touch(newFileAbsolutePath));
+ EXPECT_EQ(expectedRootListing, listfiles(tmpdir));
+ EXPECT_EQ(expectedSubListing, listfiles(newDirectoryAbsolutePath));
+
+ // Successfully remove.
+ EXPECT_SOME(os::rmdir(newDirectoryAbsolutePath));
+ EXPECT_EQ(EMPTY, listfiles(tmpdir));
+ EXPECT_EQ(EMPTY, listfiles(newDirectoryAbsolutePath));
+}
+
+
+TEST_F(RmdirTest, TrivialFailToRemoveInvalidPath)
+{
+ // Directory is initially empty.
+ EXPECT_EQ(EMPTY, listfiles(os::getcwd()));
+
+ // Removing fake relative paths should error out.
+ EXPECT_ERROR(os::rmdir("fakeRelativePath", false));
+ EXPECT_ERROR(os::rmdir("fakeRelativePath", true));
+
+ // Directory still empty.
+ EXPECT_EQ(EMPTY, listfiles(os::getcwd()));
+}
+
+
+TEST_F(RmdirTest, FailTRemoveNestedInvalidPath)
+{
+ const string tmpdir = os::getcwd();
+ hashset<string> expectedRootListing = EMPTY;
+
+ // Directory is initially empty.
+ EXPECT_EQ(expectedRootListing, listfiles(tmpdir));
+
+ // Successfully make directory using absolute path.
+ const string newDirectoryName = "newDirectory";
+ const string newDirectoryAbsolutePath = path::join(tmpdir, newDirectoryName);
+
+ expectedRootListing.insert(newDirectoryName);
+
+ EXPECT_SOME(os::mkdir(newDirectoryAbsolutePath));
+ EXPECT_EQ(expectedRootListing, listfiles(tmpdir));
+ EXPECT_EQ(EMPTY, listfiles(newDirectoryAbsolutePath));
+
+ // Fail to remove a path to an invalid folder inside the
+ // `newDirectoryAbsolutePath`.
+ const string fakeAbsolutePath = path::join(newDirectoryAbsolutePath, "fake");
+ EXPECT_ERROR(os::rmdir(fakeAbsolutePath, false));
+ EXPECT_EQ(expectedRootListing, listfiles(tmpdir));
+ EXPECT_EQ(EMPTY, listfiles(newDirectoryAbsolutePath));
+
+ // Test the same thing, but using the `recursive` flag.
+ EXPECT_ERROR(os::rmdir(fakeAbsolutePath, true));
+ EXPECT_EQ(expectedRootListing, listfiles(tmpdir));
+ EXPECT_EQ(EMPTY, listfiles(newDirectoryAbsolutePath));
+}
http://git-wip-us.apache.org/repos/asf/mesos/blob/c55ca294/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
index a2bc5c4..a69fd2d 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
@@ -61,19 +61,6 @@ using std::string;
using std::vector;
-static hashset<string> listfiles(const string& directory)
-{
- hashset<string> fileset;
- Try<list<string> > entries = os::ls(directory);
- if (entries.isSome()) {
- foreach (const string& entry, entries.get()) {
- fileset.insert(entry);
- }
- }
- return fileset;
-}
-
-
#ifdef __FreeBSD__
static bool isJailed() {
int mib[4];
@@ -115,44 +102,6 @@ TEST_F(OsTest, Environment)
}
-TEST_F(OsTest, Rmdir)
-{
- const hashset<string> EMPTY;
- const string tmpdir = os::getcwd();
-
- hashset<string> expectedListing = EMPTY;
- EXPECT_EQ(expectedListing, listfiles(tmpdir));
-
- os::mkdir(tmpdir + "/a/b/c");
- os::mkdir(tmpdir + "/a/b/d");
- os::mkdir(tmpdir + "/e/f");
-
- expectedListing = EMPTY;
- expectedListing.insert("a");
- expectedListing.insert("e");
- EXPECT_EQ(expectedListing, listfiles(tmpdir));
-
- expectedListing = EMPTY;
- expectedListing.insert("b");
- EXPECT_EQ(expectedListing, listfiles(tmpdir + "/a"));
-
- expectedListing = EMPTY;
- expectedListing.insert("c");
- expectedListing.insert("d");
- EXPECT_EQ(expectedListing, listfiles(tmpdir + "/a/b"));
-
- expectedListing = EMPTY;
- EXPECT_EQ(expectedListing, listfiles(tmpdir + "/a/b/c"));
- EXPECT_EQ(expectedListing, listfiles(tmpdir + "/a/b/d"));
-
- expectedListing.insert("f");
- EXPECT_EQ(expectedListing, listfiles(tmpdir + "/e"));
-
- expectedListing = EMPTY;
- EXPECT_EQ(expectedListing, listfiles(tmpdir + "/e/f"));
-}
-
-
TEST_F(OsTest, System)
{
EXPECT_EQ(0, os::system("exit 0"));
@@ -211,28 +160,6 @@ TEST_F(OsTest, Nonblock)
}
-TEST_F(OsTest, Touch)
-{
- const string testfile = path::join(os::getcwd(), UUID::random().toString());
-
- ASSERT_SOME(os::touch(testfile));
- ASSERT_TRUE(os::exists(testfile));
-}
-
-
-TEST_F(OsTest, ReadWriteString)
-{
- const string testfile = path::join(os::getcwd(), UUID::random().toString());
- const string teststr = "line1\nline2";
-
- ASSERT_SOME(os::write(testfile, teststr));
-
- Try<string> readstr = os::read(testfile);
-
- EXPECT_SOME_EQ(teststr, readstr);
-}
-
-
// Tests whether a file's size is reported by os::stat::size as expected.
// Tests all four combinations of following a link or not and of a file
// or a link as argument. Also tests that an error is returned for a
@@ -265,36 +192,6 @@ TEST_F(OsTest, Size)
}
-TEST_F(OsTest, Find)
-{
- const string testdir = path::join(os::getcwd(), UUID::random().toString());
- const string subdir = testdir + "/test1";
- ASSERT_SOME(os::mkdir(subdir)); // Create the directories.
-
- // Now write some files.
- const string file1 = testdir + "/file1.txt";
- const string file2 = subdir + "/file2.txt";
- const string file3 = subdir + "/file3.jpg";
-
- ASSERT_SOME(os::touch(file1));
- ASSERT_SOME(os::touch(file2));
- ASSERT_SOME(os::touch(file3));
-
- // Find "*.txt" files.
- Try<list<string> > result = os::find(testdir, ".txt");
- ASSERT_SOME(result);
-
- hashset<string> files;
- foreach (const string& file, result.get()) {
- files.insert(file);
- }
-
- ASSERT_EQ(2u, files.size());
- ASSERT_TRUE(files.contains(file1));
- ASSERT_TRUE(files.contains(file2));
-}
-
-
TEST_F(OsTest, BootId)
{
Try<string> bootId = os::bootId();
[6/7] mesos git commit: Windows: Added support for `slave/gc.cpp`.
Posted by jo...@apache.org.
Windows: Added support for `slave/gc.cpp`.
Review: https://reviews.apache.org/r/40115/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/aa2f5288
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/aa2f5288
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/aa2f5288
Branch: refs/heads/master
Commit: aa2f5288dae04fbb5b809da223a5afefa5b6faf5
Parents: acd2f5e
Author: Daniel Pravat <dp...@outlook.com>
Authored: Tue Mar 1 23:29:50 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Tue Mar 1 23:55:26 2016 -0800
----------------------------------------------------------------------
src/CMakeLists.txt | 2 +-
src/slave/gc.cpp | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/aa2f5288/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 75c67f7..144dabd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -235,6 +235,7 @@ set(STATE_SRC
set(AGENT_SRC
${AGENT_SRC}
slave/constants.cpp
+ slave/gc.cpp
slave/http.cpp
slave/metrics.cpp
slave/paths.cpp
@@ -252,7 +253,6 @@ if (NOT WIN32)
slave/container_logger.cpp
slave/container_loggers/sandbox.cpp
slave/flags.cpp
- slave/gc.cpp
slave/monitor.cpp
slave/resource_estimator.cpp
slave/slave.cpp
http://git-wip-us.apache.org/repos/asf/mesos/blob/aa2f5288/src/slave/gc.cpp
----------------------------------------------------------------------
diff --git a/src/slave/gc.cpp b/src/slave/gc.cpp
index 7a8c69b..eedb8ca 100644
--- a/src/slave/gc.cpp
+++ b/src/slave/gc.cpp
@@ -20,7 +20,8 @@
#include <process/dispatch.hpp>
#include <stout/foreach.hpp>
-#include <stout/os.hpp>
+
+#include <stout/os/rmdir.hpp>
#include "logging/logging.hpp"
[2/7] mesos git commit: Added rmdir tests target.
Posted by jo...@apache.org.
Added rmdir tests target.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/acd2f5e6
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/acd2f5e6
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/acd2f5e6
Branch: refs/heads/master
Commit: acd2f5e6fbc51d7a0397eec0e626e670842b0f84
Parents: c55ca29
Author: Joris Van Remoortere <jo...@gmail.com>
Authored: Tue Mar 1 23:53:14 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Tue Mar 1 23:55:26 2016 -0800
----------------------------------------------------------------------
3rdparty/libprocess/3rdparty/Makefile.am | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/acd2f5e6/3rdparty/libprocess/3rdparty/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/Makefile.am b/3rdparty/libprocess/3rdparty/Makefile.am
index 42c95a9..ddf7e3d 100644
--- a/3rdparty/libprocess/3rdparty/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/Makefile.am
@@ -183,6 +183,7 @@ stout_tests_SOURCES = \
$(STOUT)/tests/option_tests.cpp \
$(STOUT)/tests/os_tests.cpp \
$(STOUT)/tests/os/filesystem_tests.cpp \
+ $(STOUT)/tests/os/rmdir_tests.cpp \
$(STOUT)/tests/os/sendfile_tests.cpp \
$(STOUT)/tests/os/signals_tests.cpp \
$(STOUT)/tests/os/strerror_tests.cpp \
[4/7] mesos git commit: CMake: Added leveldb library to 3rdparty
external builds.
Posted by jo...@apache.org.
CMake: Added leveldb library to 3rdparty external builds.
Review: https://reviews.apache.org/r/43889/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/312ad65c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/312ad65c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/312ad65c
Branch: refs/heads/master
Commit: 312ad65c929db8ce76c0c66bf8a2bfd27686bc95
Parents: 2de2e57
Author: Diana Arroyo <da...@us.ibm.com>
Authored: Tue Mar 1 23:07:16 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Tue Mar 1 23:55:26 2016 -0800
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 21 ++++++++++++++++
3rdparty/Makefile.am | 2 +-
3rdparty/cmake/Mesos3rdpartyConfigure.cmake | 3 +++
3rdparty/cmake/Versions.cmake | 1 +
3rdparty/leveldb-1.4.patch | 30 +++++++++++++++++++++++
3rdparty/leveldb-1.4.tar.gz | Bin 0 -> 198113 bytes
3rdparty/leveldb.patch | 30 -----------------------
3rdparty/leveldb.tar.gz | Bin 195703 -> 0 bytes
3rdparty/versions.am | 1 +
LICENSE | 2 +-
src/Makefile.am | 2 +-
src/python/native/ext_modules.py.in | 2 +-
src/slave/cmake/SlaveConfigure.cmake | 3 +++
13 files changed, 63 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 68020dc..7ff10d5 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -27,8 +27,10 @@ set(UPSTREAM_URL ${3RDPARTY_DEPENDENCIES})
set(REBUNDLED_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if (REBUNDLED)
+ set(LEVELDB_URL ${REBUNDLED_DIR}/leveldb-${LEVELDB_VERSION}.tar.gz)
set(ZOOKEEPER_URL ${REBUNDLED_DIR}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz)
else (REBUNDLED)
+ set(LEVELDB_URL ${UPSTREAM_URL}/leveldb-${LEVELDB_VERSION}.tar.gz)
set(ZOOKEEPER_URL ${UPSTREAM_URL}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz)
endif (REBUNDLED)
@@ -80,3 +82,22 @@ ExternalProject_Add(
INSTALL_COMMAND ${ZOOKEEPER_INSTALL_CMD}
URL ${ZOOKEEPER_URL}
)
+
+if (NOT WIN32)
+ set(LEVELDB_CONFIG_CMD cd ${LEVELDB_ROOT} && ./configure --prefix=${LEVELDB_ROOT}-lib)
+ set(LEVELDB_BUILD_CMD cd ${LEVELDB_ROOT} && make)
+ set(LEVELDB_INSTALL_CMD cd ${LEVELDB_ROOT} && make install)
+ PATCH_CMD(
+ ${MESOS_3RDPARTY_SRC}/leveldb-${LEVELDB_VERSION}.patch
+ LEVELDB_PATCH_CMD)
+
+ ExternalProject_Add(
+ ${LEVELDB_TARGET}
+ PREFIX ${LEVELDB_TARGET}
+ PATCH_COMMAND ${LEVELDB_PATCH_CMD}
+ CONFIGURE_COMMAND ${CMAKE_NOOP}
+ BUILD_COMMAND ${LEVELDB_BUILD_CMD}
+ INSTALL_COMMAND ${CMAKE_NOOP}
+ URL ${LEVELDB_URL}
+ )
+endif (NOT WIN32)
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/3rdparty/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/Makefile.am b/3rdparty/Makefile.am
index 3782583..49aa557 100644
--- a/3rdparty/Makefile.am
+++ b/3rdparty/Makefile.am
@@ -33,7 +33,7 @@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ --enable-shared=no --with-pic --srcdir=.
include versions.am
DISTRIBUTE = distribute-$(DISTRIBUTE_VERSION)
-LEVELDB = leveldb
+LEVELDB = leveldb-$(LEVELDB_VERSION)
PIP = pip-$(PIP_VERSION)
WHEEL = wheel-$(WHEEL_VERSION)
ZOOKEEPER = zookeeper-$(ZOOKEEPER_VERSION)
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
index aaf1651..eeb2786 100755
--- a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
+++ b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
@@ -20,6 +20,7 @@ set(MESOS_3RDPARTY_SRC ${CMAKE_SOURCE_DIR}/3rdparty)
set(MESOS_3RDPARTY_BIN ${CMAKE_BINARY_DIR}/3rdparty)
if (NOT WIN32)
+ EXTERNAL("leveldb" ${LEVELDB_VERSION} "${MESOS_3RDPARTY_BIN}")
EXTERNAL("zookeeper" ${ZOOKEEPER_VERSION} "${MESOS_3RDPARTY_BIN}")
elseif (WIN32)
# The latest release of ZK, 3.4.7, does not compile on Windows. Therefore, we
@@ -32,6 +33,7 @@ set(ZOOKEEPER_C_ROOT ${ZOOKEEPER_ROOT}/src/c)
set(ZOOKEEPER_LIB ${ZOOKEEPER_ROOT}/src/c)
# Convenience variables for include directories of third-party dependencies.
+set(LEVELDB_INCLUDE_DIR ${LEVELDB_ROOT}/include)
set(ZOOKEEPER_INCLUDE_GENDIR ${ZOOKEEPER_C_ROOT}/generated)
set(ZOOKEEPER_INCLUDE_DIR ${ZOOKEEPER_C_ROOT}/include)
@@ -45,6 +47,7 @@ endif (NOT WIN32)
# Convenience variables for "lflags", the symbols we pass to CMake to generate
# things like `-L/path/to/glog` or `-lglog`.
if (NOT WIN32)
+ set(LEVELDB_LFLAG ${LEVELDB_ROOT}/libleveldb.a)
set(ZOOKEEPER_LFLAG ${ZOOKEEPER_LIB}/lib/libzookeeper_mt.a)
else (NOT WIN32)
set(ZOOKEEPER_LFLAG zookeeper)
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/3rdparty/cmake/Versions.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/Versions.cmake b/3rdparty/cmake/Versions.cmake
index 932f2f6..6eac4dc 100644
--- a/3rdparty/cmake/Versions.cmake
+++ b/3rdparty/cmake/Versions.cmake
@@ -3,6 +3,7 @@ set(CURL_VERSION "7.43.0")
set(GLOG_VERSION "0.3.3")
set(GMOCK_VERSION "1.7.0")
set(HTTP_PARSER_VERSION "1c3624a")
+set(LEVELDB_VERSION "1.4")
set(LIBAPR_VERSION "1.5.2")
set(LIBEV_VERSION "4.15")
# TODO(hausdorff): (MESOS-3529) transition this back to a non-beta version.
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/3rdparty/leveldb-1.4.patch
----------------------------------------------------------------------
diff --git a/3rdparty/leveldb-1.4.patch b/3rdparty/leveldb-1.4.patch
new file mode 100644
index 0000000..ad8c19b
--- /dev/null
+++ b/3rdparty/leveldb-1.4.patch
@@ -0,0 +1,30 @@
+diff --git a/build_detect_platform b/build_detect_platform
+index b71bf02..864e5fb 100755
+--- a/build_detect_platform
++++ b/build_detect_platform
+@@ -128,24 +128,8 @@ EOF
+ COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
+ fi
+
+- # Test whether Snappy library is installed
+- # http://code.google.com/p/snappy/
+- $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null <<EOF
+- #include <snappy.h>
+- int main() {}
+-EOF
+- if [ "$?" = 0 ]; then
+- COMMON_FLAGS="$COMMON_FLAGS -DSNAPPY"
+- PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -lsnappy"
+- fi
++# Removed tests for TCMALLOC and SNAPPY to prevent additional dependencies.
+
+- # Test whether tcmalloc is available
+- $CXX $CFLAGS -x c++ - -o /dev/null -ltcmalloc 2>/dev/null <<EOF
+- int main() {}
+-EOF
+- if [ "$?" = 0 ]; then
+- PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -ltcmalloc"
+- fi
+ fi
+
+ PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS"
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/3rdparty/leveldb-1.4.tar.gz
----------------------------------------------------------------------
diff --git a/3rdparty/leveldb-1.4.tar.gz b/3rdparty/leveldb-1.4.tar.gz
new file mode 100644
index 0000000..2ddbc0c
Binary files /dev/null and b/3rdparty/leveldb-1.4.tar.gz differ
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/3rdparty/leveldb.patch
----------------------------------------------------------------------
diff --git a/3rdparty/leveldb.patch b/3rdparty/leveldb.patch
deleted file mode 100644
index ad8c19b..0000000
--- a/3rdparty/leveldb.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/build_detect_platform b/build_detect_platform
-index b71bf02..864e5fb 100755
---- a/build_detect_platform
-+++ b/build_detect_platform
-@@ -128,24 +128,8 @@ EOF
- COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
- fi
-
-- # Test whether Snappy library is installed
-- # http://code.google.com/p/snappy/
-- $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null <<EOF
-- #include <snappy.h>
-- int main() {}
--EOF
-- if [ "$?" = 0 ]; then
-- COMMON_FLAGS="$COMMON_FLAGS -DSNAPPY"
-- PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -lsnappy"
-- fi
-+# Removed tests for TCMALLOC and SNAPPY to prevent additional dependencies.
-
-- # Test whether tcmalloc is available
-- $CXX $CFLAGS -x c++ - -o /dev/null -ltcmalloc 2>/dev/null <<EOF
-- int main() {}
--EOF
-- if [ "$?" = 0 ]; then
-- PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -ltcmalloc"
-- fi
- fi
-
- PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS"
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/3rdparty/leveldb.tar.gz
----------------------------------------------------------------------
diff --git a/3rdparty/leveldb.tar.gz b/3rdparty/leveldb.tar.gz
deleted file mode 100644
index b6ea2c7..0000000
Binary files a/3rdparty/leveldb.tar.gz and /dev/null differ
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/3rdparty/versions.am
----------------------------------------------------------------------
diff --git a/3rdparty/versions.am b/3rdparty/versions.am
index 3f4513d..c2dae2f 100644
--- a/3rdparty/versions.am
+++ b/3rdparty/versions.am
@@ -20,6 +20,7 @@
# still need to update version numbers in src/python/setup.py.in too!
DISTRIBUTE_VERSION = 0.6.26
+LEVELDB_VERSION = 1.4
PIP_VERSION = 7.1.2
WHEEL_VERSION = 0.24.0
ZOOKEEPER_VERSION = 3.4.5
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index c3aaa43..66a99b8 100644
--- a/LICENSE
+++ b/LICENSE
@@ -399,7 +399,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
======================================================================
-For leveldb (3rdparty/leveldb.tar.gz):
+For leveldb (3rdparty/leveldb-1.4.tar.gz):
======================================================================
Copyright (c) 2011 The LevelDB Authors. All rights reserved.
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index f49d512..fe549a8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,7 +28,7 @@ include ../3rdparty/libprocess/3rdparty/versions.am
DISTRIBUTE = 3rdparty/distribute-$(DISTRIBUTE_VERSION)
PIP = 3rdparty/pip-$(PIP_VERSION)
WHEEL = 3rdparty/wheel-$(WHEEL_VERSION)
-LEVELDB = 3rdparty/leveldb
+LEVELDB = 3rdparty/leveldb-$(LEVELDB_VERSION)
ZOOKEEPER = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/src/c
ZOOKEEPER_JAR = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/zookeeper-$(ZOOKEEPER_VERSION).jar
LIBPROCESS = 3rdparty/libprocess
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/src/python/native/ext_modules.py.in
----------------------------------------------------------------------
diff --git a/src/python/native/ext_modules.py.in b/src/python/native/ext_modules.py.in
index 4682e5e..eb93864 100644
--- a/src/python/native/ext_modules.py.in
+++ b/src/python/native/ext_modules.py.in
@@ -27,7 +27,7 @@ abs_top_builddir = '@abs_top_builddir@'
src_python_native = os.path.join(
'src', 'python', 'native', 'src', 'mesos', 'native')
-leveldb = os.path.join('3rdparty', 'leveldb')
+leveldb = os.path.join('3rdparty', 'leveldb-1.4')
zookeeper = os.path.join('3rdparty', 'zookeeper-3.4.5', 'src', 'c')
libprocess = os.path.join('3rdparty', 'libprocess')
http://git-wip-us.apache.org/repos/asf/mesos/blob/312ad65c/src/slave/cmake/SlaveConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/slave/cmake/SlaveConfigure.cmake b/src/slave/cmake/SlaveConfigure.cmake
index 5697a0b..187b5cb 100644
--- a/src/slave/cmake/SlaveConfigure.cmake
+++ b/src/slave/cmake/SlaveConfigure.cmake
@@ -29,6 +29,7 @@ set(AGENT_DEPENDENCIES
${PROCESS_DEPENDENCIES}
${PROCESS_TARGET}
${ZOOKEEPER_TARGET}
+ ${LEVELDB_TARGET}
make_bin_include_dir
make_bin_src_dir
)
@@ -48,6 +49,7 @@ set(AGENT_INCLUDE_DIRS
${PROCESS_INCLUDE_DIRS}
${ZOOKEEPER_INCLUDE_DIR}
${ZOOKEEPER_INCLUDE_GENDIR}
+ ${LEVELDB_INCLUDE_DIR}
)
# Define third-party lib install directories. Used to tell the compiler
@@ -73,6 +75,7 @@ set(AGENT_LIBS
if (NOT WIN32)
set(AGENT_LIBS
${AGENT_LIBS}
+ ${LEVELDB_LFLAG}
${SASL_LFLAG}
)
endif (NOT WIN32)
[3/7] mesos git commit: CMake: Added files to be built as part of
libmesos.
Posted by jo...@apache.org.
CMake: Added files to be built as part of libmesos.
Review: https://reviews.apache.org/r/43906/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2ab9b91e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2ab9b91e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2ab9b91e
Branch: refs/heads/master
Commit: 2ab9b91eefd281d0039f9773eca745dfb02aacc5
Parents: 312ad65
Author: Alex Clemmer <cl...@gmail.com>
Authored: Tue Mar 1 23:28:27 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Tue Mar 1 23:55:26 2016 -0800
----------------------------------------------------------------------
src/CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/2ab9b91e/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0832f1e..75c67f7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -45,6 +45,7 @@ PROTOC_TO_SRC_DIR(REGISTRY master/registry)
PROTOC_TO_SRC_DIR(MESSAGES messages/messages)
PROTOC_TO_SRC_DIR(FLAGS messages/flags)
+PROTOC_TO_SRC_DIR(LOG messages/log)
PROTOC_TO_SRC_DIR(STATE messages/state)
PROTOC_TO_SRC_DIR(MESSAGE slave/containerizer/mesos/provisioner/docker/message)
@@ -71,6 +72,7 @@ set(MESOS_PROTOBUF_SRC
${OVERSUBSCRIPTION_PROTO_CC}
${MESSAGES_PROTO_CC}
${FLAGS_PROTO_CC}
+ ${LOG_PROTO_CC}
${STATE_PROTO_CC}
${ISOLATOR_PROTO_CC}
${REGISTRY_PROTO_CC}
@@ -105,11 +107,13 @@ set(AUTHORIZER_SRC
set(COMMON_SRC
common/attributes.cpp
+ common/build.cpp
common/command_utils.cpp
common/http.cpp
common/protobuf_utils.cpp
common/resources.cpp
common/resources_utils.cpp
+ common/roles.cpp
common/type_utils.cpp
common/values.cpp
)
@@ -167,6 +171,22 @@ set(LOCAL_SRC
local/local.cpp
)
+set(LOG_SRC
+ ${LOG_SRC}
+ log/catchup.cpp
+ log/consensus.cpp
+ log/coordinator.cpp
+ log/leveldb.cpp
+ log/log.cpp
+ log/main.cpp
+ log/recover.cpp
+ log/replica.cpp
+ log/tool/benchmark.cpp
+ log/tool/initialize.cpp
+ log/tool/read.cpp
+ log/tool/replica.cpp
+ )
+
set(LOGGING_SRC
logging/flags.cpp
logging/logging.cpp
@@ -206,6 +226,12 @@ set(SCHEDULER_SRC
scheduler/scheduler.cpp
)
+set(STATE_SRC
+ ${STATE_SRC}
+ state/in_memory.cpp
+ state/log.cpp
+ )
+
set(AGENT_SRC
${AGENT_SRC}
slave/constants.cpp
@@ -223,9 +249,12 @@ set(AGENT_SRC
if (NOT WIN32)
set(AGENT_SRC
${AGENT_SRC}
- slave/gc.cpp
+ slave/container_logger.cpp
+ slave/container_loggers/sandbox.cpp
slave/flags.cpp
+ slave/gc.cpp
slave/monitor.cpp
+ slave/resource_estimator.cpp
slave/slave.cpp
slave/containerizer/composing.cpp
slave/containerizer/composing.hpp
@@ -239,7 +268,9 @@ if (NOT WIN32)
slave/containerizer/mesos/launch.cpp
slave/containerizer/mesos/launcher.cpp
slave/containerizer/mesos/mount.cpp
+ slave/containerizer/mesos/isolators/filesystem/posix.cpp
slave/containerizer/mesos/isolators/posix/disk.cpp
+ slave/containerizer/mesos/provisioner/docker/local_puller.cpp
slave/containerizer/mesos/provisioner/paths.cpp
slave/containerizer/mesos/provisioner/provisioner.cpp
slave/containerizer/mesos/provisioner/store.cpp
@@ -318,12 +349,14 @@ if (NOT WIN32)
${HOOK_SRC}
${INTERNAL_SRC}
${LOCAL_SRC}
+ ${LOG_SRC}
${LOGGING_SRC}
${MESSAGES_SRC}
${MASTER_SRC}
${MODULE_SRC}
${SCHED_SRC}
${SCHEDULER_SRC}
+ ${STATE_SRC}
${URI_SRC}
${USAGE_SRC}
${V1_SRC}
@@ -338,7 +371,7 @@ if (LINUX)
set(MESOS_SRC ${MESOS_SRC} ${LINUX_SRC})
endif (LINUX)
-add_definitions(-DUSE_STATIC_LIB)
+add_definitions(-DUSE_STATIC_LIB -DBUILD_DATE=0 -DBUILD_TIME=0 -DBUILD_USER="frank" -DBUILD_FLAGS="" -DBUILD_JAVA_JVM_LIBRARY="")
# INCLUDE DIRECTIVES FOR MESOS LIBRARY (generates, e.g., -I/path/to/thing
# on Linux).
[5/7] mesos git commit: Stout:[1/2] Fixed error reporting bug in
`os::rmdir`.
Posted by jo...@apache.org.
Stout:[1/2] Fixed error reporting bug in `os::rmdir`.
Review: https://reviews.apache.org/r/43907/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/fbe1f37f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fbe1f37f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fbe1f37f
Branch: refs/heads/master
Commit: fbe1f37f65fd9f1d4f2c30a3cfd7a50df92ccc2c
Parents: 2ab9b91
Author: Alex Clemmer <cl...@gmail.com>
Authored: Tue Mar 1 23:29:21 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Tue Mar 1 23:55:26 2016 -0800
----------------------------------------------------------------------
.../3rdparty/stout/include/stout/os/posix/rmdir.hpp | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/fbe1f37f/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/rmdir.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/rmdir.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/rmdir.hpp
index 3da85dd..cf21e7f 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/rmdir.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/rmdir.hpp
@@ -21,6 +21,8 @@
#include <stout/nothing.hpp>
#include <stout/try.hpp>
+#include <stout/os/exists.hpp>
+
namespace os {
@@ -35,6 +37,14 @@ inline Try<Nothing> rmdir(const std::string& directory, bool recursive = true)
return ErrnoError();
}
} else {
+ // NOTE: `fts_open` will not always return `NULL` if the path does not
+ // exist. We manually induce an error here to indicate that we can't remove
+ // a directory that does not exist.
+ if (!os::exists(directory)) {
+ errno = ENOENT;
+ return ErrnoError();
+ }
+
char* paths[] = {const_cast<char*>(directory.c_str()), NULL};
FTS* tree = fts_open(paths, FTS_NOCHDIR, NULL);