You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gi...@apache.org on 2019/06/11 22:51:09 UTC
[mesos] branch master updated (46c7349 -> 1961e41)
This is an automated email from the ASF dual-hosted git repository.
gilbert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git.
from 46c7349 Fixed test `QuotaRoleAllocateNonQuotaResource`.
new f24c54e Supported file operations for command tasks.
new 1961e41 Improved container-specific cgroups test by checking `cpu.shares`.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/launcher/executor.cpp | 3 +++
src/tests/containerizer/cgroups_isolator_tests.cpp | 16 ++++++++--------
2 files changed, 11 insertions(+), 8 deletions(-)
[mesos] 02/02: Improved container-specific cgroups test by checking
`cpu.shares`.
Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gilbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 1961e41a61def2b7baca7563c0b7e1855880b55c
Author: Qian Zhang <zh...@gmail.com>
AuthorDate: Tue Jun 11 15:50:47 2019 -0700
Improved container-specific cgroups test by checking `cpu.shares`.
This is to ensure the symbolic links (see below as an example) we
create for the container exist.
ln -s /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/cpu
Review: https://reviews.apache.org/r/70827/
---
src/tests/containerizer/cgroups_isolator_tests.cpp | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/tests/containerizer/cgroups_isolator_tests.cpp b/src/tests/containerizer/cgroups_isolator_tests.cpp
index 957f72d..eef8eb2 100644
--- a/src/tests/containerizer/cgroups_isolator_tests.cpp
+++ b/src/tests/containerizer/cgroups_isolator_tests.cpp
@@ -2185,7 +2185,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_NestedContainerSpecificCgroupsMount)
{
// Disable AuthN on the agent.
slave::Flags flags = CreateSlaveFlags();
- flags.isolation = "filesystem/linux,docker/runtime,cgroups/mem";
+ flags.isolation = "filesystem/linux,docker/runtime,cgroups/mem,cgroups/cpu";
flags.image_providers = "docker";
flags.authenticate_http_readwrite = false;
@@ -2234,9 +2234,8 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_NestedContainerSpecificCgroupsMount)
const v1::Offer& offer = offers->offers(0);
- // Create a task to check if its memory (including both executor and task's
- // memory) is correctly set in its specific cgroup, e.g.:
- // `/sys/fs/cgroup/memory/memory.soft_limit_in_bytes`
+ // Create a task to check if its memory and CPU shares (including both
+ // executor's and task's) are correctly set in its specific cgroup.
//
// And we also verify the freezer cgroup is correctly mounted for this task
// by checking if the current shell PID is included in the freezer cgroup.
@@ -2244,6 +2243,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_NestedContainerSpecificCgroupsMount)
offer.agent_id(),
v1::Resources::parse("cpus:0.1;mem:32;disk:32").get(),
"test `cat /sys/fs/cgroup/memory/memory.soft_limit_in_bytes` = 67108864 "
+ "&& test `cat /sys/fs/cgroup/cpu/cpu.shares` = 204"
"&& grep $$ /sys/fs/cgroup/freezer/cgroup.procs");
mesos::v1::Image image;
@@ -2299,7 +2299,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_CommandTaskSpecificCgroupsMount)
Owned<MasterDetector> detector = master.get()->createDetector();
slave::Flags flags = CreateSlaveFlags();
- flags.isolation = "filesystem/linux,docker/runtime,cgroups/mem";
+ flags.isolation = "filesystem/linux,docker/runtime,cgroups/mem,cgroups/cpu";
flags.image_providers = "docker";
Try<Owned<cluster::Slave>> slave = StartSlave(detector.get(), flags);
@@ -2321,9 +2321,8 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_CommandTaskSpecificCgroupsMount)
AWAIT_READY(offers);
EXPECT_EQ(1u, offers->size());
- // Create a task to check if its memory (including both executor and task's
- // memory) is correctly set in its specific cgroup, e.g.:
- // `/sys/fs/cgroup/memory/memory.soft_limit_in_bytes`
+ // Create a task to check if its memory and CPU shares (including both
+ // executor's and task's) are correctly set in its specific cgroup.
//
// And we also verify the freezer cgroup is correctly mounted for this task
// by checking if the current shell PID is included in the freezer cgroup.
@@ -2331,6 +2330,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_CommandTaskSpecificCgroupsMount)
offers->front().slave_id(),
Resources::parse("cpus:0.1;mem:32;disk:32").get(),
"test `cat /sys/fs/cgroup/memory/memory.soft_limit_in_bytes` = 67108864 "
+ "&& test `cat /sys/fs/cgroup/cpu/cpu.shares` = 204"
"&& grep $$ /sys/fs/cgroup/freezer/cgroup.procs");
Image image;
[mesos] 01/02: Supported file operations for command tasks.
Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gilbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit f24c54e85e08bc9c8b118cce29ad487661a0ffc6
Author: Qian Zhang <zh...@gmail.com>
AuthorDate: Tue Jun 11 15:50:43 2019 -0700
Supported file operations for command tasks.
Review: https://reviews.apache.org/r/70826/
---
src/launcher/executor.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/launcher/executor.cpp b/src/launcher/executor.cpp
index fa4bcaa..38d8261 100644
--- a/src/launcher/executor.cpp
+++ b/src/launcher/executor.cpp
@@ -494,6 +494,9 @@ protected:
if (taskLaunchInfo.isSome()) {
launchInfo.mutable_mounts()->CopyFrom(taskLaunchInfo->mounts());
+ launchInfo.mutable_file_operations()->CopyFrom(
+ taskLaunchInfo->file_operations());
+
launchInfo.mutable_pre_exec_commands()->CopyFrom(
taskLaunchInfo->pre_exec_commands());