You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by "DevinLeamy (via GitHub)" <gi...@apache.org> on 2024/03/11 18:09:40 UTC

[PR] [cgroups2] Adds cgroups2::prepare() setup entrypoint. [mesos]

DevinLeamy opened a new pull request, #510:
URL: https://github.com/apache/mesos/pull/510

   Adds cgroups2::prepare() which:
   - Checks that cgroups2 is enabled, and
   - The requested cgroups2 controllers are available, and
   - The cgroup2 filesystem is correctly mounted before enabling the requested controllers in the root cgroup.
   
   This serves as the entrypoint to cgroups2, like how `cgroups::prepare()` is used for cgroups v1.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [cgroups2] Adds cgroups2::enabled() to obtain the set of enabled subsystems [mesos]

Posted by "bmahler (via GitHub)" <gi...@apache.org>.
bmahler commented on code in PR #510:
URL: https://github.com/apache/mesos/pull/510#discussion_r1521824848


##########
src/tests/containerizer/cgroups2_tests.cpp:
##########
@@ -59,6 +59,20 @@ TEST_F(Cgroups2Test, ROOT_CGROUPS2_AvailableSubsystems)
   }
 }
 
+
+TEST_F(Cgroups2Test, ROOT_CGROUPS2_Enable)
+{
+  Try<set<string>> available =
+    cgroups2::controllers::available(cgroups2::ROOT_CGROUP);
+  ASSERT_SOME(available);
+  EXPECT_TRUE(available.get().count("cpu") == 1);
+  EXPECT_SOME(cgroups2::controllers::enable(cgroups2::ROOT_CGROUP, {"cpu"}));
+  Try<set<string>> enabled =

Review Comment:
   nit: newline above this



##########
src/tests/containerizer/cgroups2_tests.cpp:
##########
@@ -59,6 +59,20 @@ TEST_F(Cgroups2Test, ROOT_CGROUPS2_AvailableSubsystems)
   }
 }
 
+
+TEST_F(Cgroups2Test, ROOT_CGROUPS2_Enable)
+{
+  Try<set<string>> available =
+    cgroups2::controllers::available(cgroups2::ROOT_CGROUP);
+  ASSERT_SOME(available);
+  EXPECT_TRUE(available.get().count("cpu") == 1);
+  EXPECT_SOME(cgroups2::controllers::enable(cgroups2::ROOT_CGROUP, {"cpu"}));
+  Try<set<string>> enabled =
+    cgroups2::controllers::enabled(cgroups2::ROOT_CGROUP);
+  ASSERT_SOME(enabled);
+  EXPECT_TRUE(enabled.get().find("cpu") != enabled.get().end());

Review Comment:
   ditto here



##########
src/tests/containerizer/cgroups2_tests.cpp:
##########
@@ -59,6 +59,20 @@ TEST_F(Cgroups2Test, ROOT_CGROUPS2_AvailableSubsystems)
   }
 }
 
+
+TEST_F(Cgroups2Test, ROOT_CGROUPS2_Enable)
+{
+  Try<set<string>> available =
+    cgroups2::controllers::available(cgroups2::ROOT_CGROUP);
+  ASSERT_SOME(available);
+  EXPECT_TRUE(available.get().count("cpu") == 1);

Review Comment:
   you can use s/.get()./->/, actually tidy will complain about this, but since tidy is broken we're not gonna notice these



##########
src/tests/containerizer/cgroups2_tests.cpp:
##########
@@ -59,6 +59,20 @@ TEST_F(Cgroups2Test, ROOT_CGROUPS2_AvailableSubsystems)
   }
 }
 
+
+TEST_F(Cgroups2Test, ROOT_CGROUPS2_Enable)
+{
+  Try<set<string>> available =
+    cgroups2::controllers::available(cgroups2::ROOT_CGROUP);
+  ASSERT_SOME(available);
+  EXPECT_TRUE(available.get().count("cpu") == 1);

Review Comment:
   maybe EXPECT_EQ here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [cgroups2] Adds cgroups2::controllers::enabled() to obtain the set of enabled controllers. [mesos]

Posted by "bmahler (via GitHub)" <gi...@apache.org>.
bmahler closed pull request #510: [cgroups2] Adds cgroups2::controllers::enabled() to obtain the set of enabled controllers.
URL: https://github.com/apache/mesos/pull/510


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org