You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ya...@apache.org on 2016/05/27 23:28:19 UTC
[1/2] mesos git commit: Renamed 'posix/disk' isolator as 'disk/du'.
Repository: mesos
Updated Branches:
refs/heads/master e5c586229 -> ee99415ae
Renamed 'posix/disk' isolator as 'disk/du'.
This better summarizes how the isolator works and is more consistent
with the 'disk/*' isolator naming pattern.
'posix/disk' is still allowed but a deprecation warning is logged.
Review: https://reviews.apache.org/r/47895
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ee99415a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ee99415a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ee99415a
Branch: refs/heads/master
Commit: ee99415aee50097b0f545033d75e5029ef1549de
Parents: 66b8712
Author: Jiang Yan Xu <ya...@jxu.me>
Authored: Tue May 17 16:10:50 2016 -0700
Committer: Jiang Yan Xu <ya...@jxu.me>
Committed: Fri May 27 16:27:07 2016 -0700
----------------------------------------------------------------------
docs/configuration.md | 4 ++--
docs/mesos-containerizer.md | 4 ++--
docs/multiple-disk.md | 2 +-
docs/sandbox.md | 2 +-
src/slave/containerizer/mesos/containerizer.cpp | 14 ++++++++++++++
src/slave/flags.cpp | 4 ++--
src/tests/containerizer/filesystem_isolator_tests.cpp | 4 ++--
src/tests/containerizer/xfs_quota_tests.cpp | 2 +-
src/tests/disk_quota_tests.cpp | 10 +++++-----
9 files changed, 30 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/ee99415a/docs/configuration.md
----------------------------------------------------------------------
diff --git a/docs/configuration.md b/docs/configuration.md
index ae9067d..edc6e26 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -1031,7 +1031,7 @@ Name of the root cgroup. (default: mesos)
</td>
<td>
The interval between disk quota checks for containers. This flag is
-used for the <code>posix/disk</code> isolator. (default: 15secs)
+used for the <code>disk/du</code> isolator. (default: 15secs)
</td>
</tr>
<tr>
@@ -1250,7 +1250,7 @@ Directory the Docker provisioner will store images in (default: /tmp/mesos/store
</td>
<td>
Whether to enable disk quota enforcement for containers. This flag
-is used for the <code>posix/disk</code> isolator. (default: false)
+is used for the <code>disk/du</code> isolator. (default: false)
</td>
</tr>
<tr>
http://git-wip-us.apache.org/repos/asf/mesos/blob/ee99415a/docs/mesos-containerizer.md
----------------------------------------------------------------------
diff --git a/docs/mesos-containerizer.md b/docs/mesos-containerizer.md
index cef520d..1bd2783 100644
--- a/docs/mesos-containerizer.md
+++ b/docs/mesos-containerizer.md
@@ -69,8 +69,8 @@ The Posix Disk isolator provides basic disk isolation. It is able to
report the disk usage for each sandbox and optionally enforce the disk
quota. It can be used on both Linux and OS X.
-To enable the Posix Disk isolator, append `posix/disk` to the
-`--isolation` flag when starting the agent.
+To enable the Posix Disk isolator, append `disk/du` to the `--isolation`
+flag when starting the agent.
By default, the disk quota enforcement is disabled. To enable it,
specify `--enforce_container_disk_quota` when starting the agent.
http://git-wip-us.apache.org/repos/asf/mesos/blob/ee99415a/docs/multiple-disk.md
----------------------------------------------------------------------
diff --git a/docs/multiple-disk.md b/docs/multiple-disk.md
index 2b272f0..20b99e0 100644
--- a/docs/multiple-disk.md
+++ b/docs/multiple-disk.md
@@ -110,7 +110,7 @@ and provide the mount point as the `root` of the `Mount` in `DiskInfo`'s
Aside from the performance advantages of `Mount` disks, applications running on
them should be able to rely on disk errors when they attempt to exceed the
capacity of the volume. This holds true as long as the file system in use
-correctly propagates these errors. Due to this expectation, the `posix/disk`
+correctly propagates these errors. Due to this expectation, the `disk/du`
isolation is disabled for `Mount` disks.
An example resources value for a `Mount` disk is shown below. Note that the
http://git-wip-us.apache.org/repos/asf/mesos/blob/ee99415a/docs/sandbox.md
----------------------------------------------------------------------
diff --git a/docs/sandbox.md b/docs/sandbox.md
index 5acddff..db973e3 100644
--- a/docs/sandbox.md
+++ b/docs/sandbox.md
@@ -145,7 +145,7 @@ executor and isolators:
* Mesos containerizer - For backwards compatibility, the Mesos containerizer
does not enforce a container's disk quota by default. However, if the
`--enforce_container_disk_quota` flag is enabled on the agent, and
- `posix/disk` is specified in the `--isolation` flag, the executor
+ `disk/du` is specified in the `--isolation` flag, the executor
will be killed if the sandbox size exceeds the executor's `disk` resource.
* Docker containerizer - As of Docker `1.9.1`, the Docker containerizer
does not enforce nor support a disk quota. See the
http://git-wip-us.apache.org/repos/asf/mesos/blob/ee99415a/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index edc9118..b154587 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -163,6 +163,16 @@ Try<MesosContainerizer*> MesosContainerizer::create(
flags_.isolation += ",filesystem/posix";
}
+ if (strings::contains(flags_.isolation, "posix/disk")) {
+ LOG(WARNING) << "'posix/disk' has been renamed as 'disk/du', "
+ << "please update your --isolation flag to use 'disk/du'";
+
+ if (strings::contains(flags_.isolation, "disk/du")) {
+ return Error(
+ "Using 'posix/disk' and 'disk/du' simultaneously is disallowed");
+ }
+ }
+
#ifdef __linux__
// One and only one `network` isolator is required. The network
// isolator is responsible for preparing the network namespace for
@@ -237,7 +247,11 @@ Try<MesosContainerizer*> MesosContainerizer::create(
// Runtime isolators.
{"posix/cpu", &PosixCpuIsolatorProcess::create},
{"posix/mem", &PosixMemIsolatorProcess::create},
+
+ // "posix/disk" is deprecated in favor of the name "disk/du".
{"posix/disk", &PosixDiskIsolatorProcess::create},
+ {"disk/du", &PosixDiskIsolatorProcess::create},
+
#if ENABLE_XFS_DISK_ISOLATOR
{"disk/xfs", &XfsDiskIsolatorProcess::create},
#endif
http://git-wip-us.apache.org/repos/asf/mesos/blob/ee99415a/src/slave/flags.cpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
index d3543a0..d30f39c 100644
--- a/src/slave/flags.cpp
+++ b/src/slave/flags.cpp
@@ -675,7 +675,7 @@ mesos::internal::slave::Flags::Flags()
add(&Flags::container_disk_watch_interval,
"container_disk_watch_interval",
"The interval between disk quota checks for containers. This flag is\n"
- "used for the `posix/disk` isolator.",
+ "used for the `disk/du` isolator.",
Seconds(15));
// TODO(jieyu): Consider enabling this flag by default. Remember
@@ -683,7 +683,7 @@ mesos::internal::slave::Flags::Flags()
add(&Flags::enforce_container_disk_quota,
"enforce_container_disk_quota",
"Whether to enable disk quota enforcement for containers. This flag\n"
- "is used for the `posix/disk` isolator.",
+ "is used for the `disk/du` isolator.",
false);
// This help message for --modules flag is the same for
http://git-wip-us.apache.org/repos/asf/mesos/blob/ee99415a/src/tests/containerizer/filesystem_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/filesystem_isolator_tests.cpp b/src/tests/containerizer/filesystem_isolator_tests.cpp
index 115250f..30aab76 100644
--- a/src/tests/containerizer/filesystem_isolator_tests.cpp
+++ b/src/tests/containerizer/filesystem_isolator_tests.cpp
@@ -608,7 +608,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_RecoverOrphanedPersistentVolume)
slave::Flags flags = CreateSlaveFlags();
flags.image_provisioner_backend = "copy";
flags.resources = "cpus:2;mem:1024;disk(role1):1024";
- flags.isolation = "posix/disk,filesystem/linux";
+ flags.isolation = "disk/du,filesystem/linux";
Try<Owned<MesosContainerizer>> containerizer = createContainerizer(
flags,
@@ -1474,7 +1474,7 @@ TEST_F(LinuxFilesystemIsolatorTest, ROOT_VolumeUsageExceedsSandboxQuota)
ASSERT_SOME(master);
slave::Flags flags = CreateSlaveFlags();
- flags.isolation = "posix/disk,filesystem/linux";
+ flags.isolation = "disk/du,filesystem/linux";
// NOTE: We can't pause the clock because we need the reaper to reap
// the 'du' subprocess.
http://git-wip-us.apache.org/repos/asf/mesos/blob/ee99415a/src/tests/containerizer/xfs_quota_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/xfs_quota_tests.cpp b/src/tests/containerizer/xfs_quota_tests.cpp
index 091d768..243ef33 100644
--- a/src/tests/containerizer/xfs_quota_tests.cpp
+++ b/src/tests/containerizer/xfs_quota_tests.cpp
@@ -396,7 +396,7 @@ TEST_F(ROOT_XFS_QuotaTest, DiskUsageExceedsQuota)
EXPECT_EQ(task.task_id(), status2.get().task_id());
EXPECT_EQ(TASK_FAILED, status2.get().state());
- // Unlike the posix/disk isolator, the reason for task failure
+ // Unlike the 'disk/du' isolator, the reason for task failure
// should be that dd got an IO error.
EXPECT_EQ(TaskStatus::SOURCE_EXECUTOR, status2.get().source());
EXPECT_EQ("Command exited with status 1", status2.get().message());
http://git-wip-us.apache.org/repos/asf/mesos/blob/ee99415a/src/tests/disk_quota_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/disk_quota_tests.cpp b/src/tests/disk_quota_tests.cpp
index ac373be..61ed464 100644
--- a/src/tests/disk_quota_tests.cpp
+++ b/src/tests/disk_quota_tests.cpp
@@ -183,7 +183,7 @@ TEST_F(DiskQuotaTest, DiskUsageExceedsQuota)
ASSERT_SOME(master);
slave::Flags flags = CreateSlaveFlags();
- flags.isolation = "posix/cpu,posix/mem,posix/disk";
+ flags.isolation = "posix/cpu,posix/mem,disk/du";
// NOTE: We can't pause the clock because we need the reaper to reap
// the 'du' subprocess.
@@ -253,7 +253,7 @@ TEST_F(DiskQuotaTest, VolumeUsageExceedsQuota)
ASSERT_SOME(master);
slave::Flags slaveFlags = CreateSlaveFlags();
- slaveFlags.isolation = "posix/cpu,posix/mem,posix/disk";
+ slaveFlags.isolation = "posix/cpu,posix/mem,disk/du";
// NOTE: We can't pause the clock because we need the reaper to reap
// the 'du' subprocess.
@@ -347,7 +347,7 @@ TEST_F(DiskQuotaTest, NoQuotaEnforcement)
ASSERT_SOME(master);
slave::Flags flags = CreateSlaveFlags();
- flags.isolation = "posix/cpu,posix/mem,posix/disk";
+ flags.isolation = "posix/cpu,posix/mem,disk/du";
// NOTE: We can't pause the clock because we need the reaper to reap
// the 'du' subprocess.
@@ -445,7 +445,7 @@ TEST_F(DiskQuotaTest, ResourceStatistics)
ASSERT_SOME(master);
slave::Flags flags = CreateSlaveFlags();
- flags.isolation = "posix/cpu,posix/mem,posix/disk";
+ flags.isolation = "posix/cpu,posix/mem,disk/du";
// NOTE: We can't pause the clock because we need the reaper to reap
// the 'du' subprocess.
@@ -541,7 +541,7 @@ TEST_F(DiskQuotaTest, SlaveRecovery)
ASSERT_SOME(master);
slave::Flags flags = CreateSlaveFlags();
- flags.isolation = "posix/cpu,posix/mem,posix/disk";
+ flags.isolation = "posix/cpu,posix/mem,disk/du";
flags.container_disk_watch_interval = Milliseconds(1);
Fetcher fetcher;
[2/2] mesos git commit: Renamed 'xfs/disk' isolator to 'disk/xfs'.
Posted by ya...@apache.org.
Renamed 'xfs/disk' isolator to 'disk/xfs'.
Review: https://reviews.apache.org/r/47894
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/66b8712e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/66b8712e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/66b8712e
Branch: refs/heads/master
Commit: 66b8712ece37d6f56fcaaba5737267a299d3749d
Parents: e5c5862
Author: Jiang Yan Xu <ya...@jxu.me>
Authored: Tue May 17 00:53:50 2016 -0700
Committer: Jiang Yan Xu <ya...@jxu.me>
Committed: Fri May 27 16:27:07 2016 -0700
----------------------------------------------------------------------
CHANGELOG | 2 +-
docs/mesos-containerizer.md | 4 ++--
src/slave/containerizer/mesos/containerizer.cpp | 2 +-
src/tests/containerizer/xfs_quota_tests.cpp | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/66b8712e/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index d9b155d..c778aee 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -38,7 +38,7 @@ This release contains the following new features:
`mesos.scheduler`. `mesos.native` still exists, combining both modules for
backwards compatibility with existing code.
- * [MESOS-4828] - **Experimental** support for a new `xfs/disk' isolator
+ * [MESOS-4828] - **Experimental** support for a new `disk/xfs' isolator
has been added to isolate disk resources more efficiently. Please refer to
docs/mesos-containerizer.md for more details.
http://git-wip-us.apache.org/repos/asf/mesos/blob/66b8712e/docs/mesos-containerizer.md
----------------------------------------------------------------------
diff --git a/docs/mesos-containerizer.md b/docs/mesos-containerizer.md
index 22dffe0..cef520d 100644
--- a/docs/mesos-containerizer.md
+++ b/docs/mesos-containerizer.md
@@ -97,8 +97,8 @@ The XFS disk isolator is functionally similar to Posix Disk isolator
but avoids the cost of repeatedly running the `du`. Though they will
not interfere with each other, it is not recommended to use them together.
-To enable the XFS Disk isolator, append `xfs/disk` to the
-`--isolation` flag when starting the agent.
+To enable the XFS Disk isolator, append `disk/xfs` to the `--isolation`
+flag when starting the agent.
The XFS Disk isolator requires the sandbox directory to be located
on an XFS filesystem that is mounted with the `pquota` option. There
http://git-wip-us.apache.org/repos/asf/mesos/blob/66b8712e/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index e50f721..edc9118 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -239,7 +239,7 @@ Try<MesosContainerizer*> MesosContainerizer::create(
{"posix/mem", &PosixMemIsolatorProcess::create},
{"posix/disk", &PosixDiskIsolatorProcess::create},
#if ENABLE_XFS_DISK_ISOLATOR
- {"xfs/disk", &XfsDiskIsolatorProcess::create},
+ {"disk/xfs", &XfsDiskIsolatorProcess::create},
#endif
#ifdef __linux__
{"cgroups/cpu", &CgroupsCpushareIsolatorProcess::create},
http://git-wip-us.apache.org/repos/asf/mesos/blob/66b8712e/src/tests/containerizer/xfs_quota_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/xfs_quota_tests.cpp b/src/tests/containerizer/xfs_quota_tests.cpp
index ce16006..091d768 100644
--- a/src/tests/containerizer/xfs_quota_tests.cpp
+++ b/src/tests/containerizer/xfs_quota_tests.cpp
@@ -162,7 +162,7 @@ public:
// We only need an XFS-specific directory for the work directory. We
// don't mind that other flags refer to a different temp directory.
flags.work_dir = mountPoint.get();
- flags.isolation = "xfs/disk";
+ flags.isolation = "disk/xfs";
return flags;
}