add support for cgroup v2
Signed-off-by: zhongtao <zhongtao17@huawei.com> (cherry picked from commit 8e60786a9fa82786c1d59abc85822ea46edc4d7d)
This commit is contained in:
parent
fb68704adb
commit
5d08c15356
1084
0027-feature-add-support-for-cgroup-v2-metrics.patch
Normal file
1084
0027-feature-add-support-for-cgroup-v2-metrics.patch
Normal file
File diff suppressed because it is too large
Load Diff
254
0028-use-supervisor-to-notify-sandbox-exit-event.patch
Normal file
254
0028-use-supervisor-to-notify-sandbox-exit-event.patch
Normal file
@ -0,0 +1,254 @@
|
||||
From 835185f7c4739993c2ca26d737bb0a45277ad932 Mon Sep 17 00:00:00 2001
|
||||
From: jikai <jikai11@huawei.com>
|
||||
Date: Wed, 20 Mar 2024 15:48:42 +0800
|
||||
Subject: [PATCH 28/34] use supervisor to notify sandbox exit event
|
||||
|
||||
Signed-off-by: jikai <jikai11@huawei.com>
|
||||
---
|
||||
src/daemon/modules/api/container_api.h | 2 +-
|
||||
.../modules/container/restore/restore.c | 6 +++-
|
||||
.../modules/container/supervisor/supervisor.c | 15 +++++++-
|
||||
.../modules/service/service_container.c | 9 +++--
|
||||
.../controller/shim/shim_controller.cc | 35 ++-----------------
|
||||
src/daemon/sandbox/sandbox_ops.cc | 23 ++++++++++++
|
||||
src/daemon/sandbox/sandbox_ops.h | 2 ++
|
||||
7 files changed, 53 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/src/daemon/modules/api/container_api.h b/src/daemon/modules/api/container_api.h
|
||||
index 4602d244..43d66d64 100644
|
||||
--- a/src/daemon/modules/api/container_api.h
|
||||
+++ b/src/daemon/modules/api/container_api.h
|
||||
@@ -270,7 +270,7 @@ bool container_is_valid_state_string(const char *state);
|
||||
void container_update_health_monitor(const char *container_id);
|
||||
|
||||
extern int container_supervisor_add_exit_monitor(int fd, const pid_ppid_info_t *pid_info, const char *name,
|
||||
- const char *runtime);
|
||||
+ const char *runtime, bool sandbox_container);
|
||||
|
||||
extern char *container_exit_fifo_create(const char *cont_state_path);
|
||||
|
||||
diff --git a/src/daemon/modules/container/restore/restore.c b/src/daemon/modules/container/restore/restore.c
|
||||
index 2669ea22..76868e28 100644
|
||||
--- a/src/daemon/modules/container/restore/restore.c
|
||||
+++ b/src/daemon/modules/container/restore/restore.c
|
||||
@@ -57,6 +57,7 @@ static int restore_supervisor(const container_t *cont)
|
||||
char *statepath = cont->state_path;
|
||||
char *runtime = cont->runtime;
|
||||
pid_ppid_info_t pid_info = { 0 };
|
||||
+ bool sandbox_container = false;
|
||||
|
||||
nret = snprintf(container_state, sizeof(container_state), "%s/%s", statepath, id);
|
||||
if (nret < 0 || (size_t)nret >= sizeof(container_state)) {
|
||||
@@ -90,8 +91,11 @@ static int restore_supervisor(const container_t *cont)
|
||||
pid_info.ppid = cont->state->state->p_pid;
|
||||
pid_info.start_time = cont->state->state->start_time;
|
||||
pid_info.pstart_time = cont->state->state->p_start_time;
|
||||
+#ifdef ENABLE_CRI_API_V1
|
||||
+ sandbox_container = is_sandbox_container(cont->common_config->sandbox_info);
|
||||
+#endif
|
||||
|
||||
- if (container_supervisor_add_exit_monitor(exit_fifo_fd, &pid_info, id, runtime)) {
|
||||
+ if (container_supervisor_add_exit_monitor(exit_fifo_fd, &pid_info, id, runtime, sandbox_container)) {
|
||||
ERROR("Failed to add exit monitor to supervisor");
|
||||
ret = -1;
|
||||
goto out;
|
||||
diff --git a/src/daemon/modules/container/supervisor/supervisor.c b/src/daemon/modules/container/supervisor/supervisor.c
|
||||
index 1f9a043c..63289283 100644
|
||||
--- a/src/daemon/modules/container/supervisor/supervisor.c
|
||||
+++ b/src/daemon/modules/container/supervisor/supervisor.c
|
||||
@@ -38,6 +38,9 @@
|
||||
#include "container_api.h"
|
||||
#include "event_type.h"
|
||||
#include "utils_file.h"
|
||||
+#ifdef ENABLE_CRI_API_V1
|
||||
+#include "sandbox_ops.h"
|
||||
+#endif
|
||||
|
||||
pthread_mutex_t g_supervisor_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
struct epoll_descr g_supervisor_descr;
|
||||
@@ -47,6 +50,7 @@ struct supervisor_handler_data {
|
||||
int exit_code;
|
||||
char *name;
|
||||
char *runtime;
|
||||
+ bool is_sandbox_container;
|
||||
pid_ppid_info_t pid_info;
|
||||
};
|
||||
|
||||
@@ -211,6 +215,14 @@ retry:
|
||||
|
||||
(void)isulad_monitor_send_container_event(name, STOPPED, (int)pid, data->exit_code, NULL, NULL);
|
||||
|
||||
+#ifdef ENABLE_CRI_API_V1
|
||||
+ if (data->is_sandbox_container) {
|
||||
+ if (sandbox_on_sandbox_exit(name, data->exit_code) < 0) {
|
||||
+ ERROR("Failed to handle sandbox %s exit", name);
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
supervisor_handler_data_free(data);
|
||||
|
||||
DAEMON_CLEAR_ERRMSG();
|
||||
@@ -259,7 +271,7 @@ static int supervisor_exit_cb(int fd, uint32_t events, void *cbdata, struct epol
|
||||
|
||||
/* supervisor add exit monitor */
|
||||
int container_supervisor_add_exit_monitor(int fd, const pid_ppid_info_t *pid_info, const char *name,
|
||||
- const char *runtime)
|
||||
+ const char *runtime, bool sandbox_container)
|
||||
{
|
||||
int ret = 0;
|
||||
struct supervisor_handler_data *data = NULL;
|
||||
@@ -285,6 +297,7 @@ int container_supervisor_add_exit_monitor(int fd, const pid_ppid_info_t *pid_inf
|
||||
data->fd = fd;
|
||||
data->name = util_strdup_s(name);
|
||||
data->runtime = util_strdup_s(runtime);
|
||||
+ data->is_sandbox_container = sandbox_container;
|
||||
data->pid_info.pid = pid_info->pid;
|
||||
data->pid_info.start_time = pid_info->start_time;
|
||||
data->pid_info.ppid = pid_info->ppid;
|
||||
diff --git a/src/daemon/modules/service/service_container.c b/src/daemon/modules/service/service_container.c
|
||||
index a3606a82..7b34cc7f 100644
|
||||
--- a/src/daemon/modules/service/service_container.c
|
||||
+++ b/src/daemon/modules/service/service_container.c
|
||||
@@ -275,13 +275,14 @@ static void clean_resources_on_failure(const container_t *cont, const char *engi
|
||||
return;
|
||||
}
|
||||
|
||||
-static int do_post_start_on_success(const char *id, const char *runtime, const char *pidfile, int exit_fifo_fd,
|
||||
+static int do_post_start_on_success(const char *id, const char *runtime, bool sandbox_container,
|
||||
+ const char *pidfile, int exit_fifo_fd,
|
||||
const pid_ppid_info_t *pid_info)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
// exit_fifo_fd was closed in container_supervisor_add_exit_monitor
|
||||
- if (container_supervisor_add_exit_monitor(exit_fifo_fd, pid_info, id, runtime)) {
|
||||
+ if (container_supervisor_add_exit_monitor(exit_fifo_fd, pid_info, id, runtime, sandbox_container)) {
|
||||
ERROR("Failed to add exit monitor to supervisor");
|
||||
ret = -1;
|
||||
}
|
||||
@@ -749,6 +750,7 @@ static int do_start_container(container_t *cont, const char *console_fifos[], bo
|
||||
oci_runtime_spec *oci_spec = NULL;
|
||||
rt_create_params_t create_params = { 0 };
|
||||
rt_start_params_t start_params = { 0 };
|
||||
+ bool sandbox_container;
|
||||
|
||||
nret = snprintf(bundle, sizeof(bundle), "%s/%s", cont->root_path, id);
|
||||
if (nret < 0 || (size_t)nret >= sizeof(bundle)) {
|
||||
@@ -897,6 +899,7 @@ static int do_start_container(container_t *cont, const char *console_fifos[], bo
|
||||
if (cont->common_config->sandbox_info != NULL) {
|
||||
create_params.task_addr = cont->common_config->sandbox_info->task_address;
|
||||
}
|
||||
+ sandbox_container = is_sandbox_container(cont->common_config->sandbox_info);
|
||||
#endif
|
||||
|
||||
if (runtime_create(id, runtime, &create_params) != 0) {
|
||||
@@ -921,7 +924,7 @@ static int do_start_container(container_t *cont, const char *console_fifos[], bo
|
||||
|
||||
ret = runtime_start(id, runtime, &start_params, pid_info);
|
||||
if (ret == 0) {
|
||||
- if (do_post_start_on_success(id, runtime, pidfile, exit_fifo_fd, pid_info) != 0) {
|
||||
+ if (do_post_start_on_success(id, runtime, sandbox_container, pidfile, exit_fifo_fd, pid_info) != 0) {
|
||||
ERROR("Failed to do post start on runtime start success");
|
||||
ret = -1;
|
||||
goto clean_resources;
|
||||
diff --git a/src/daemon/sandbox/controller/shim/shim_controller.cc b/src/daemon/sandbox/controller/shim/shim_controller.cc
|
||||
index 39fcf8ea..593fade9 100644
|
||||
--- a/src/daemon/sandbox/controller/shim/shim_controller.cc
|
||||
+++ b/src/daemon/sandbox/controller/shim/shim_controller.cc
|
||||
@@ -397,39 +397,8 @@ bool ShimController::Stop(const std::string &sandboxId, uint32_t timeoutSecs, Er
|
||||
|
||||
bool ShimController::Wait(std::shared_ptr<SandboxStatusCallback> cb, const std::string &sandboxId, Errors &error)
|
||||
{
|
||||
- std::thread([this, cb, sandboxId]() {
|
||||
- if (m_cb == nullptr || m_cb->container.wait == nullptr) {
|
||||
- ERROR("Unimplemented callback");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- auto requestWrapper = makeUniquePtrCStructWrapper<container_wait_request>(free_container_wait_request);
|
||||
- if (requestWrapper == nullptr) {
|
||||
- ERROR("Out of memory");
|
||||
- return;
|
||||
- }
|
||||
- auto request = requestWrapper->get();
|
||||
- request->id = isula_strdup_s(sandboxId.c_str());
|
||||
- request->condition = WAIT_CONDITION_STOPPED;
|
||||
- container_wait_response *response { nullptr };
|
||||
-
|
||||
- int ret = m_cb->container.wait(request, &response);
|
||||
- auto responseWrapper = makeUniquePtrCStructWrapper<container_wait_response>(response, free_container_wait_response);
|
||||
-
|
||||
- if (ret != 0) {
|
||||
- std::string msg = (response != nullptr && response->errmsg != nullptr) ? response->errmsg : "internal";
|
||||
- ERROR("Failed to wait sandbox %s: %s", sandboxId.c_str(), msg.c_str());
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- ControllerExitInfo info;
|
||||
- auto currentTime = std::chrono::high_resolution_clock::now();
|
||||
- auto duration = currentTime.time_since_epoch();
|
||||
- info.exitedAt = std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count();
|
||||
- info.exitStatus = response->exit_code;
|
||||
- cb->OnSandboxExit(info);
|
||||
- }).detach();
|
||||
-
|
||||
+ // ShimController will use sandbox_on_exit callback of supervisor in lower container level
|
||||
+ // to notify the sandbox exit event
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/src/daemon/sandbox/sandbox_ops.cc b/src/daemon/sandbox/sandbox_ops.cc
|
||||
index 005063c0..b7fb40bf 100644
|
||||
--- a/src/daemon/sandbox/sandbox_ops.cc
|
||||
+++ b/src/daemon/sandbox/sandbox_ops.cc
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <isula_libutils/log.h>
|
||||
|
||||
#include "controller_manager.h"
|
||||
+#include "sandbox_manager.h"
|
||||
#include "namespace.h"
|
||||
#include "utils.h"
|
||||
|
||||
@@ -175,3 +176,25 @@ int sandbox_purge_exec(const container_config_v2_common_config *config, const ch
|
||||
{
|
||||
return do_sandbox_purge(config, exec_id);
|
||||
}
|
||||
+
|
||||
+int sandbox_on_sandbox_exit(const char *sandbox_id, int exit_code)
|
||||
+{
|
||||
+ if (nullptr == sandbox_id) {
|
||||
+ ERROR("Invalid parameter: sandbox_id");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ auto sandbox = sandbox::SandboxManager::GetInstance()->GetSandbox(sandbox_id);
|
||||
+ if (nullptr == sandbox) {
|
||||
+ ERROR("Sandbox %s not found", sandbox_id);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ sandbox::ControllerExitInfo info;
|
||||
+ auto currentTime = std::chrono::high_resolution_clock::now();
|
||||
+ auto duration = currentTime.time_since_epoch();
|
||||
+ info.exitedAt = std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count();
|
||||
+ info.exitStatus = exit_code;
|
||||
+ sandbox->OnSandboxExit(info);
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/src/daemon/sandbox/sandbox_ops.h b/src/daemon/sandbox/sandbox_ops.h
|
||||
index bef884fb..8189efd6 100644
|
||||
--- a/src/daemon/sandbox/sandbox_ops.h
|
||||
+++ b/src/daemon/sandbox/sandbox_ops.h
|
||||
@@ -36,6 +36,8 @@ int sandbox_purge_container(const container_config_v2_common_config *config);
|
||||
|
||||
int sandbox_purge_exec(const container_config_v2_common_config *config, const char *exec_id);
|
||||
|
||||
+int sandbox_on_sandbox_exit(const char *sandbox_id, int exit_code);
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
--
|
||||
2.25.1
|
||||
|
||||
2538
0029-refactor-cgroup-module.patch
Normal file
2538
0029-refactor-cgroup-module.patch
Normal file
File diff suppressed because it is too large
Load Diff
351
0030-adaptor-unit-test-for-cgroup-module.patch
Normal file
351
0030-adaptor-unit-test-for-cgroup-module.patch
Normal file
@ -0,0 +1,351 @@
|
||||
From 59e7ea0f16e83e0bdbc39bdc41d1ade8d3db885e Mon Sep 17 00:00:00 2001
|
||||
From: zhongtao <zhongtao17@huawei.com>
|
||||
Date: Thu, 22 Feb 2024 09:52:30 +0800
|
||||
Subject: [PATCH 30/34] adaptor unit test for cgroup module
|
||||
|
||||
Signed-off-by: zhongtao <zhongtao17@huawei.com>
|
||||
---
|
||||
src/daemon/modules/image/CMakeLists.txt | 6 ++++--
|
||||
test/cgroup/cpu/CMakeLists.txt | 7 +++++--
|
||||
test/cgroup/cpu/cgroup_cpu_ut.cc | 12 ++++++++++--
|
||||
test/image/oci/oci_config_merge/CMakeLists.txt | 7 +++++--
|
||||
test/image/oci/registry/CMakeLists.txt | 7 +++++--
|
||||
test/network/network_ns/CMakeLists.txt | 7 +++++--
|
||||
test/runtime/isula/CMakeLists.txt | 7 +++++--
|
||||
test/runtime/lcr/CMakeLists.txt | 7 +++++--
|
||||
.../execute/execution_extend/CMakeLists.txt | 6 +++++-
|
||||
test/specs/specs/CMakeLists.txt | 7 +++++--
|
||||
test/specs/specs_extend/CMakeLists.txt | 7 +++++--
|
||||
test/specs/verify/CMakeLists.txt | 7 +++++--
|
||||
test/volume/CMakeLists.txt | 7 +++++--
|
||||
13 files changed, 69 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/src/daemon/modules/image/CMakeLists.txt b/src/daemon/modules/image/CMakeLists.txt
|
||||
index f8bc5840..d8b78ce1 100644
|
||||
--- a/src/daemon/modules/image/CMakeLists.txt
|
||||
+++ b/src/daemon/modules/image/CMakeLists.txt
|
||||
@@ -68,8 +68,9 @@ set(LIB_ISULAD_IMG_SRCS
|
||||
${CMAKE_SOURCE_DIR}/src/utils/buffer/buffer.c
|
||||
${CMAKE_SOURCE_DIR}/src/daemon/common/err_msg.c
|
||||
${CMAKE_SOURCE_DIR}/src/daemon/common/sysinfo.c
|
||||
- ${CMAKE_SOURCE_DIR}/src/daemon/common/cgroup.c
|
||||
- ${CMAKE_SOURCE_DIR}/src/daemon/common/cgroup_v1.c
|
||||
+ ${CMAKE_SOURCE_DIR}/src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_SOURCE_DIR}/src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_SOURCE_DIR}/src/daemon/common/cgroup/cgroup_v2.c
|
||||
${CMAKE_SOURCE_DIR}/src/utils/tar/util_gzip.c
|
||||
${CMAKE_SOURCE_DIR}/src/daemon/config/isulad_config.c
|
||||
${CMAKE_SOURCE_DIR}/src/daemon/config/daemon_arguments.c
|
||||
@@ -102,6 +103,7 @@ target_include_directories(${LIB_ISULAD_IMG} PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/utils/tar
|
||||
${CMAKE_SOURCE_DIR}/src/daemon/config
|
||||
${CMAKE_SOURCE_DIR}/src/daemon/common
|
||||
+ ${CMAKE_SOURCE_DIR}/src/daemon/common/cgroup
|
||||
${CMAKE_SOURCE_DIR}/src/daemon/modules/spec/
|
||||
${CMAKE_SOURCE_DIR}/src/utils/cutils
|
||||
${CMAKE_SOURCE_DIR}/src/utils/cutils/map
|
||||
diff --git a/test/cgroup/cpu/CMakeLists.txt b/test/cgroup/cpu/CMakeLists.txt
|
||||
index 32fe0a23..30bfc417 100644
|
||||
--- a/test/cgroup/cpu/CMakeLists.txt
|
||||
+++ b/test/cgroup/cpu/CMakeLists.txt
|
||||
@@ -6,8 +6,10 @@ add_executable(${EXE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/utils/cutils/path.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/err_msg.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/sysinfo.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v2.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_common.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/command_parser.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config/daemon_arguments.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config/isulad_config.c
|
||||
@@ -20,6 +22,7 @@ target_include_directories(${EXE} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/common
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup
|
||||
${CMAKE_BINARY_DIR}/conf
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd
|
||||
diff --git a/test/cgroup/cpu/cgroup_cpu_ut.cc b/test/cgroup/cpu/cgroup_cpu_ut.cc
|
||||
index eaee90c0..6e6e04f4 100644
|
||||
--- a/test/cgroup/cpu/cgroup_cpu_ut.cc
|
||||
+++ b/test/cgroup/cpu/cgroup_cpu_ut.cc
|
||||
@@ -69,13 +69,21 @@ TEST(CgroupCpuUnitTest, test_common_find_cgroup_mnt_and_root)
|
||||
{
|
||||
char *mnt = NULL;
|
||||
char *root = NULL;
|
||||
- ASSERT_EQ(common_find_cgroup_mnt_and_root(nullptr, &mnt, &root), -1);
|
||||
+
|
||||
+ int ret = cgroup_ops_init();
|
||||
+ ASSERT_EQ(ret, 0);
|
||||
+
|
||||
+ ASSERT_EQ(common_get_cgroup_mnt_and_root_path(nullptr, &mnt, &root), -1);
|
||||
}
|
||||
|
||||
TEST(CgroupCpuUnitTest, test_sysinfo_cgroup_controller_cpurt_mnt_path)
|
||||
{
|
||||
MOCK_SET(util_common_calloc_s, nullptr);
|
||||
ASSERT_EQ(get_sys_info(true), nullptr);
|
||||
- ASSERT_EQ(sysinfo_cgroup_controller_cpurt_mnt_path(), nullptr);
|
||||
+
|
||||
+ int ret = cgroup_ops_init();
|
||||
+ ASSERT_EQ(ret, 0);
|
||||
+
|
||||
+ ASSERT_EQ(sysinfo_get_cpurt_mnt_path(), nullptr);
|
||||
MOCK_CLEAR(util_common_calloc_s);
|
||||
}
|
||||
diff --git a/test/image/oci/oci_config_merge/CMakeLists.txt b/test/image/oci/oci_config_merge/CMakeLists.txt
|
||||
index 90809080..d13ec738 100644
|
||||
--- a/test/image/oci/oci_config_merge/CMakeLists.txt
|
||||
+++ b/test/image/oci/oci_config_merge/CMakeLists.txt
|
||||
@@ -25,8 +25,10 @@ add_executable(${EXE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/err_msg.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/config/isulad_config.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/sysinfo.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup/cgroup_v2.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup/cgroup_common.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/cmd/command_parser.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/config/daemon_arguments.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../test/image/oci/oci_ut_common.cc
|
||||
@@ -55,6 +57,7 @@ target_include_directories(${EXE} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/utils/cutils/map
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/volume
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/api
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/runtime/engines
|
||||
diff --git a/test/image/oci/registry/CMakeLists.txt b/test/image/oci/registry/CMakeLists.txt
|
||||
index 77a7907e..5b5bc3f5 100644
|
||||
--- a/test/image/oci/registry/CMakeLists.txt
|
||||
+++ b/test/image/oci/registry/CMakeLists.txt
|
||||
@@ -26,8 +26,10 @@ add_executable(${EXE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/image/oci/storage/image_store/image_type.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/image/oci/registry_type.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/sysinfo.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup/cgroup_v2.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup/cgroup_common.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/image/oci/storage/image_store/image_store.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/image/oci/storage/remote_layer_support/ro_symlink_maintain.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/image/oci/registry/registry.c
|
||||
@@ -58,6 +60,7 @@ target_include_directories(${EXE} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/api
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/cgroup
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/image/oci/storage
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/image/oci/storage/image_store
|
||||
diff --git a/test/network/network_ns/CMakeLists.txt b/test/network/network_ns/CMakeLists.txt
|
||||
index 50520427..71b8039d 100644
|
||||
--- a/test/network/network_ns/CMakeLists.txt
|
||||
+++ b/test/network/network_ns/CMakeLists.txt
|
||||
@@ -30,8 +30,10 @@ add_executable(${EXE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config/daemon_arguments.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/err_msg.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/sysinfo.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v2.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_common.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/command_parser.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_ut_common.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/image_mock.cc
|
||||
@@ -55,6 +57,7 @@ target_include_directories(${EXE} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/options
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/api
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/volume
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/runtime
|
||||
diff --git a/test/runtime/isula/CMakeLists.txt b/test/runtime/isula/CMakeLists.txt
|
||||
index cc1178b8..c1f0a5cc 100644
|
||||
--- a/test/runtime/isula/CMakeLists.txt
|
||||
+++ b/test/runtime/isula/CMakeLists.txt
|
||||
@@ -21,8 +21,10 @@ add_executable(${EXE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/utils/cutils/mainloop.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/err_msg.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/sysinfo.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v2.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_common.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/command_parser.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config/daemon_arguments.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_ut_common.cc
|
||||
@@ -51,6 +53,7 @@ target_include_directories(${EXE} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/container
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/container/restart_manager
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/container/health_check
|
||||
diff --git a/test/runtime/lcr/CMakeLists.txt b/test/runtime/lcr/CMakeLists.txt
|
||||
index 424a6101..c3b93d67 100644
|
||||
--- a/test/runtime/lcr/CMakeLists.txt
|
||||
+++ b/test/runtime/lcr/CMakeLists.txt
|
||||
@@ -18,8 +18,10 @@ add_executable(${EXE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/utils/cutils/map/rb_tree.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/err_msg.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/sysinfo.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v2.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_common.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/command_parser.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config/daemon_arguments.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_ut_common.cc
|
||||
@@ -39,6 +41,7 @@ target_include_directories(${EXE} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/utils/cutils/map
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/api
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/container
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/container/restart_manager
|
||||
diff --git a/test/services/execution/execute/execution_extend/CMakeLists.txt b/test/services/execution/execute/execution_extend/CMakeLists.txt
|
||||
index 68e0f443..f0875fd7 100644
|
||||
--- a/test/services/execution/execute/execution_extend/CMakeLists.txt
|
||||
+++ b/test/services/execution/execute/execution_extend/CMakeLists.txt
|
||||
@@ -21,7 +21,10 @@ add_executable(${EXE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/cutils/mainloop.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/cutils/filters.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/common/err_msg.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/common/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/common/cgroup/cgroup_v2.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/common/cgroup/cgroup_common.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/modules/events_sender/event_sender.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/console/console.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/cutils/utils.c
|
||||
@@ -59,6 +62,7 @@ target_include_directories(${EXE} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/console
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/common
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/common/cgroup
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/cutils
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/modules/api
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/daemon/modules/image
|
||||
diff --git a/test/specs/specs/CMakeLists.txt b/test/specs/specs/CMakeLists.txt
|
||||
index 508123fa..45f688f9 100644
|
||||
--- a/test/specs/specs/CMakeLists.txt
|
||||
+++ b/test/specs/specs/CMakeLists.txt
|
||||
@@ -28,8 +28,10 @@ add_executable(${EXE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/spec/specs_security.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/err_msg.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/sysinfo.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v2.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_common.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/command_parser.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config/daemon_arguments.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_ut_common.cc
|
||||
@@ -54,6 +56,7 @@ target_include_directories(${EXE} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/isulad
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/api
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/volume
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/runtime
|
||||
diff --git a/test/specs/specs_extend/CMakeLists.txt b/test/specs/specs_extend/CMakeLists.txt
|
||||
index bf4b378e..1b737089 100644
|
||||
--- a/test/specs/specs_extend/CMakeLists.txt
|
||||
+++ b/test/specs/specs_extend/CMakeLists.txt
|
||||
@@ -28,8 +28,10 @@ add_executable(${EXE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/spec/specs_security.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/err_msg.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/sysinfo.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v2.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_common.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/command_parser.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config/daemon_arguments.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_ut_common.cc
|
||||
@@ -54,6 +56,7 @@ target_include_directories(${EXE} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/isulad
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/volume
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/api
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/container
|
||||
diff --git a/test/specs/verify/CMakeLists.txt b/test/specs/verify/CMakeLists.txt
|
||||
index 0e60a39e..b0602127 100644
|
||||
--- a/test/specs/verify/CMakeLists.txt
|
||||
+++ b/test/specs/verify/CMakeLists.txt
|
||||
@@ -23,8 +23,10 @@ add_executable(${EXE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/utils/cutils/map/rb_tree.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/err_msg.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/sysinfo.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_v2.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup/cgroup_common.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/spec/verify.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../test/image/oci/oci_ut_common.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../test/mocks/containers_store_mock.cc
|
||||
@@ -50,6 +52,7 @@ target_include_directories(${EXE} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/cmd/isulad
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/common/cgroup
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/api
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/volume
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../src/daemon/modules/runtime
|
||||
diff --git a/test/volume/CMakeLists.txt b/test/volume/CMakeLists.txt
|
||||
index cc309352..27d07330 100644
|
||||
--- a/test/volume/CMakeLists.txt
|
||||
+++ b/test/volume/CMakeLists.txt
|
||||
@@ -20,8 +20,10 @@ add_executable(${EXE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../src/utils/sha256/sha256.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/common/err_msg.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/common/sysinfo.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/common/cgroup.c
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/common/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/common/cgroup/cgroup.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/common/cgroup/cgroup_v1.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/common/cgroup/cgroup_v2.c
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/common/cgroup/cgroup_common.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../src/cmd/command_parser.c
|
||||
volume_ut.cc)
|
||||
|
||||
@@ -34,6 +36,7 @@ target_include_directories(${EXE} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../src/utils/http
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/modules/api
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/common
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/common/cgroup
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../src/daemon/modules/volume
|
||||
${CMAKE_BINARY_DIR}/conf
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../src/utils/sha256
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@ -0,0 +1,71 @@
|
||||
From 8e11a1eea62cb8061f1613379ff83bd9a721fa50 Mon Sep 17 00:00:00 2001
|
||||
From: zhongtao <zhongtao17@huawei.com>
|
||||
Date: Wed, 31 Jan 2024 18:10:46 +0800
|
||||
Subject: [PATCH 31/34] cgroup v2 does not support isulad setting cpu_rt
|
||||
options
|
||||
|
||||
Signed-off-by: zhongtao <zhongtao17@huawei.com>
|
||||
---
|
||||
src/cmd/isulad/isulad_commands.c | 32 ++++++++++++++++++++++++++++++++
|
||||
1 file changed, 32 insertions(+)
|
||||
|
||||
diff --git a/src/cmd/isulad/isulad_commands.c b/src/cmd/isulad/isulad_commands.c
|
||||
index 5fb55689..619e36d1 100644
|
||||
--- a/src/cmd/isulad/isulad_commands.c
|
||||
+++ b/src/cmd/isulad/isulad_commands.c
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "utils_verify.h"
|
||||
#include "opt_ulimit.h"
|
||||
#include "opt_log.h"
|
||||
+#include "sysinfo.h"
|
||||
|
||||
const char isulad_desc[] = "GLOBAL OPTIONS:";
|
||||
const char isulad_usage[] = "[global options]";
|
||||
@@ -411,6 +412,33 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int check_args_cpu_rt(const struct service_arguments *args)
|
||||
+{
|
||||
+ int ret = 0;
|
||||
+ __isula_auto_sysinfo_t sysinfo_t *sysinfo = NULL;
|
||||
+
|
||||
+ sysinfo = get_sys_info(true);
|
||||
+ if (sysinfo == NULL) {
|
||||
+ COMMAND_ERROR("Failed to get system info");
|
||||
+ ERROR("Failed to get system info");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (!(sysinfo->cgcpuinfo.cpu_rt_period) && args->json_confs->cpu_rt_period != 0) {
|
||||
+ COMMAND_ERROR("Invalid --cpu-rt-period: Your kernel does not support cgroup rt period");
|
||||
+ ERROR("Invalid --cpu-rt-period: Your kernel does not support cgroup rt period");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (!(sysinfo->cgcpuinfo.cpu_rt_runtime) && args->json_confs->cpu_rt_runtime != 0) {
|
||||
+ COMMAND_ERROR("Invalid --cpu-rt-runtime: Your kernel does not support cgroup rt runtime");
|
||||
+ ERROR("Invalid --cpu-rt-runtime: Your kernel does not support cgroup rt runtime");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
int check_args(struct service_arguments *args)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -471,6 +499,10 @@ int check_args(struct service_arguments *args)
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ if (check_args_cpu_rt(args) != 0) {
|
||||
+ ret = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
From 1ab0f4608fb749b50aa6f8d8188db23aa8a6e1ac Mon Sep 17 00:00:00 2001
|
||||
From: zhongtao <zhongtao17@huawei.com>
|
||||
Date: Thu, 1 Feb 2024 10:48:45 +0800
|
||||
Subject: [PATCH 32/34] add test that isulad cannot set cpu_rt parameters when
|
||||
adding cgroup v2
|
||||
|
||||
Signed-off-by: zhongtao <zhongtao17@huawei.com>
|
||||
---
|
||||
CI/test_cases/container_cases/cpu_rt.sh | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/CI/test_cases/container_cases/cpu_rt.sh b/CI/test_cases/container_cases/cpu_rt.sh
|
||||
index bdc43a5e..23d3baed 100755
|
||||
--- a/CI/test_cases/container_cases/cpu_rt.sh
|
||||
+++ b/CI/test_cases/container_cases/cpu_rt.sh
|
||||
@@ -106,7 +106,10 @@ function test_kernel_without_cpurt()
|
||||
|
||||
msg_info "${test} starting..."
|
||||
|
||||
- start_isulad_without_valgrind --cpu-rt-period 1000000 --cpu-rt-runtime 950000
|
||||
+ isulad --cpu-rt-period 1000000 --cpu-rt-runtime 950000 2>&1 | grep 'Your kernel does not support cgroup rt period'
|
||||
+ [[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - kernel does not support cpu-rt, but start isulad with cpu-rt success" && ((ret++))
|
||||
+
|
||||
+ start_isulad_without_valgrind
|
||||
|
||||
isula pull ${image}
|
||||
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - failed to pull image: ${image}" && return ${FAILURE}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
26
0033-fix-sandbox-container-bool-value-uninitialized.patch
Normal file
26
0033-fix-sandbox-container-bool-value-uninitialized.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From f62df3dedbbe11bb56e6da7dd610c573fd3ed828 Mon Sep 17 00:00:00 2001
|
||||
From: jikai <jikai11@huawei.com>
|
||||
Date: Mon, 25 Mar 2024 10:01:56 +0800
|
||||
Subject: [PATCH 33/34] fix sandbox container bool value uninitialized
|
||||
|
||||
Signed-off-by: jikai <jikai11@huawei.com>
|
||||
---
|
||||
src/daemon/modules/service/service_container.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/daemon/modules/service/service_container.c b/src/daemon/modules/service/service_container.c
|
||||
index 7b34cc7f..a8090d5a 100644
|
||||
--- a/src/daemon/modules/service/service_container.c
|
||||
+++ b/src/daemon/modules/service/service_container.c
|
||||
@@ -750,7 +750,7 @@ static int do_start_container(container_t *cont, const char *console_fifos[], bo
|
||||
oci_runtime_spec *oci_spec = NULL;
|
||||
rt_create_params_t create_params = { 0 };
|
||||
rt_start_params_t start_params = { 0 };
|
||||
- bool sandbox_container;
|
||||
+ bool sandbox_container = false;
|
||||
|
||||
nret = snprintf(bundle, sizeof(bundle), "%s/%s", cont->root_path, id);
|
||||
if (nret < 0 || (size_t)nret >= sizeof(bundle)) {
|
||||
--
|
||||
2.25.1
|
||||
|
||||
47
0034-bugfix-for-cpurt.sh.patch
Normal file
47
0034-bugfix-for-cpurt.sh.patch
Normal file
@ -0,0 +1,47 @@
|
||||
From 411483ad9b2a0c50190f9b56779d41889c895014 Mon Sep 17 00:00:00 2001
|
||||
From: zhongtao <zhongtao17@huawei.com>
|
||||
Date: Wed, 27 Mar 2024 10:29:11 +0800
|
||||
Subject: [PATCH 34/34] bugfix for cpurt.sh
|
||||
|
||||
Signed-off-by: zhongtao <zhongtao17@huawei.com>
|
||||
---
|
||||
CI/test_cases/container_cases/cpu_rt.sh | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/CI/test_cases/container_cases/cpu_rt.sh b/CI/test_cases/container_cases/cpu_rt.sh
|
||||
index 23d3baed..64dcd81f 100755
|
||||
--- a/CI/test_cases/container_cases/cpu_rt.sh
|
||||
+++ b/CI/test_cases/container_cases/cpu_rt.sh
|
||||
@@ -109,7 +109,7 @@ function test_kernel_without_cpurt()
|
||||
isulad --cpu-rt-period 1000000 --cpu-rt-runtime 950000 2>&1 | grep 'Your kernel does not support cgroup rt period'
|
||||
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - kernel does not support cpu-rt, but start isulad with cpu-rt success" && ((ret++))
|
||||
|
||||
- start_isulad_without_valgrind
|
||||
+ start_isulad_with_valgrind
|
||||
|
||||
isula pull ${image}
|
||||
[[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - failed to pull image: ${image}" && return ${FAILURE}
|
||||
@@ -194,6 +194,9 @@ function do_test()
|
||||
test_cpurt_isulad_abnormal $runtime || ((ret++))
|
||||
test_isula_update_normal $runtime || ((ret++))
|
||||
test_isula_update_abnormal $runtime || ((ret++))
|
||||
+ stop_isulad_without_valgrind
|
||||
+ # set cpu-rt to the initial state
|
||||
+ start_isulad_with_valgrind --cpu-rt-period 1000000 --cpu-rt-runtime 0
|
||||
else
|
||||
test_kernel_without_cpurt $runtime || ((ans++))
|
||||
fi
|
||||
@@ -211,10 +214,6 @@ do
|
||||
|
||||
do_test $element || ((ans++))
|
||||
|
||||
- stop_isulad_without_valgrind
|
||||
- # set cpu-rt to the initial state
|
||||
- start_isulad_with_valgrind --cpu-rt-period 1000000 --cpu-rt-runtime 0
|
||||
-
|
||||
isula rm -f $(isula ps -aq)
|
||||
done
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
16
iSulad.spec
16
iSulad.spec
@ -1,5 +1,5 @@
|
||||
%global _version 2.1.5
|
||||
%global _release 2
|
||||
%global _release 3
|
||||
%global is_systemd 1
|
||||
%global enable_criv1 1
|
||||
%global enable_shimv2 1
|
||||
@ -41,6 +41,14 @@ Patch0023: 0023-add-benchmark-result-of-perf-test-in-cri.patch
|
||||
Patch0024: 0024-add-support-for-systemd-cgroup-driver.patch
|
||||
Patch0025: 0025-add-ci-cases-for-systemd-cgroup-driver.patch
|
||||
Patch0026: 0026-move-systemd_cgroup-CI-test-to-manual-cases.patch
|
||||
Patch0027: 0027-feature-add-support-for-cgroup-v2-metrics.patch
|
||||
Patch0028: 0028-use-supervisor-to-notify-sandbox-exit-event.patch
|
||||
Patch0029: 0029-refactor-cgroup-module.patch
|
||||
Patch0030: 0030-adaptor-unit-test-for-cgroup-module.patch
|
||||
Patch0031: 0031-cgroup-v2-does-not-support-isulad-setting-cpu_rt-opt.patch
|
||||
Patch0032: 0032-add-test-that-isulad-cannot-set-cpu_rt-parameters-wh.patch
|
||||
Patch0033: 0033-fix-sandbox-container-bool-value-uninitialized.patch
|
||||
Patch0034: 0034-bugfix-for-cpurt.sh.patch
|
||||
|
||||
%ifarch x86_64 aarch64
|
||||
Provides: libhttpclient.so()(64bit)
|
||||
@ -295,6 +303,12 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Sat Mar 30 2024 zhongtao <zhongtao17@huawei.com> - 2.1.5-3
|
||||
- Type: update
|
||||
- ID: NA
|
||||
- SUG: NA
|
||||
- DESC: add support for cgroup v2
|
||||
|
||||
* Tue Mar 19 2024 zhongtao <zhongtao17@huawei.com> - 2.1.5-2
|
||||
- Type: update
|
||||
- ID: NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user