diff --git a/0001-add-libisula.pc.patch b/0001-add-libisula.pc.patch deleted file mode 100644 index c16bbcc..0000000 --- a/0001-add-libisula.pc.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 83b3f2f2b114915c250bdc4500138a8531750192 Mon Sep 17 00:00:00 2001 -From: zhangxiaoyu -Date: Mon, 6 Feb 2023 20:36:17 +0800 -Subject: [PATCH] add libisula.pc - -Signed-off-by: zhangxiaoyu ---- - CMakeLists.txt | 7 +++++++ - lcr.pc.in | 2 +- - libisula.pc.in | 12 ++++++++++++ - 3 files changed, 20 insertions(+), 1 deletion(-) - create mode 100644 libisula.pc.in - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c1acbab..8ee67c1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -75,6 +75,11 @@ configure_file( - "${CMAKE_BINARY_DIR}/conf/lcr.pc" - ) - -+configure_file( -+ "${CMAKE_CURRENT_SOURCE_DIR}/libisula.pc.in" -+ "${CMAKE_BINARY_DIR}/conf/libisula.pc" -+) -+ - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party) - - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src) -@@ -112,6 +117,8 @@ endif() - # install all files - install(FILES ${CMAKE_BINARY_DIR}/conf/lcr.pc - DESTINATION ${LIB_INSTALL_DIR_DEFAULT}/pkgconfig PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ WORLD_EXECUTE) -+install(FILES ${CMAKE_BINARY_DIR}/conf/libisula.pc -+ DESTINATION ${LIB_INSTALL_DIR_DEFAULT}/pkgconfig PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE WORLD_READ WORLD_EXECUTE) - install(FILES src/lcrcontainer.h - DESTINATION include/lcr) - -diff --git a/lcr.pc.in b/lcr.pc.in -index e102dbb..419e187 100644 ---- a/lcr.pc.in -+++ b/lcr.pc.in -@@ -7,6 +7,6 @@ Name: liblcr - Description: light-weighted container runtime library - Version: @LCR_VERSION@ - URL: liblcr --Libs: -L@CMAKE_INSTALL_PREFIX@/lib -llcr -lisula_libutils -+Libs: -L@CMAKE_INSTALL_PREFIX@/lib -llcr - Cflags: -I@CMAKE_INSTALL_PREFIX@/include - -diff --git a/libisula.pc.in b/libisula.pc.in -new file mode 100644 -index 0000000..2738dd3 ---- /dev/null -+++ b/libisula.pc.in -@@ -0,0 +1,12 @@ -+prefix=@CMAKE_INSTALL_PREFIX@ -+libdir=@CMAKE_INSTALL_PREFIX@/lib -+localstatedir=@CMAKE_INSTALL_PREFIX@/var -+includedir=@CMAKE_INSTALL_PREFIX@/include -+ -+Name: libisula -+Description: light-weighted container json and log libraries -+Version: @LCR_VERSION@ -+URL: libisula -+Libs: -L@CMAKE_INSTALL_PREFIX@/lib -lisula_libutils -+Cflags: -I@CMAKE_INSTALL_PREFIX@/include -+ --- -2.25.1 - diff --git a/0002-add-unified-and-memory_swap_limit_in_bytes-into-host.patch b/0002-add-unified-and-memory_swap_limit_in_bytes-into-host.patch deleted file mode 100644 index e5ba946..0000000 --- a/0002-add-unified-and-memory_swap_limit_in_bytes-into-host.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 9bd736bc14da91bfc6ca8bf38f05218e5703adf5 Mon Sep 17 00:00:00 2001 -From: "ilya.kuksenok" -Date: Tue, 7 Feb 2023 13:51:44 +0300 -Subject: [PATCH 2/4] add unified and memory_swap_limit_in_bytes into - host-config - ---- - .gitignore | 2 ++ - src/json/schema/host-config.json | 8 +++++++- - 2 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/.gitignore b/.gitignore -index 0995486..973ceef 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -1,3 +1,5 @@ - *.pyc - build - .vscode -+.idea -+cmake-build-debug -diff --git a/src/json/schema/host-config.json b/src/json/schema/host-config.json -index c308558..0367a76 100644 ---- a/src/json/schema/host-config.json -+++ b/src/json/schema/host-config.json -@@ -139,9 +139,15 @@ - "Memory": { - "type": "int64" - }, -+ "Unified": { -+ "$ref": "defs.json#/definitions/mapStringString" -+ }, - "OomScoreAdj": { - "type": "integer" - }, -+ "MemorySwapLimitInBytes":{ -+ "type": "int64" -+ }, - "BlkioWeight": { - "type": "uint16" - }, -@@ -292,4 +298,4 @@ - "type": "string" - } - } --} -\ No newline at end of file -+} --- -2.25.1 - diff --git a/0003-fix-update-cpu-rt-period-failed.patch b/0003-fix-update-cpu-rt-period-failed.patch deleted file mode 100644 index fdc15b9..0000000 --- a/0003-fix-update-cpu-rt-period-failed.patch +++ /dev/null @@ -1,35 +0,0 @@ -From d332dbb9050510f91445625b56952fd533ec530a Mon Sep 17 00:00:00 2001 -From: songbuhuang <544824346@qq.com> -Date: Wed, 8 Feb 2023 10:53:25 +0800 -Subject: [PATCH 3/4] fix update cpu-rt period failed - -Signed-off-by: songbuhuang <544824346@qq.com> ---- - src/lcrcontainer_execute.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/src/lcrcontainer_execute.c b/src/lcrcontainer_execute.c -index 3f5860f..ff4685b 100644 ---- a/src/lcrcontainer_execute.c -+++ b/src/lcrcontainer_execute.c -@@ -360,13 +360,14 @@ static bool update_resources_cpu_v1(struct lxc_container *c, const struct lcr_cg - goto err_out; - } - -- if (update_resources_cpu_rt_period(c, cr) != 0) { -- goto err_out; -- } - if (update_resources_cpu_rt_runtime(c, cr) != 0) { - goto err_out; - } - -+ if (update_resources_cpu_rt_period(c, cr) != 0) { -+ goto err_out; -+ } -+ - ret = true; - err_out: - return ret; --- -2.25.1 - diff --git a/0004-fix-writing-config-line-with-wrong-length.patch b/0004-fix-writing-config-line-with-wrong-length.patch deleted file mode 100644 index 641b948..0000000 --- a/0004-fix-writing-config-line-with-wrong-length.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 4df2c0f530bfa62b98e22ea87a01fa567cf01ef3 Mon Sep 17 00:00:00 2001 -From: zhangxiaoyu -Date: Thu, 9 Feb 2023 10:18:01 +0800 -Subject: [PATCH 4/4] fix writing config line with wrong length - -Signed-off-by: zhangxiaoyu ---- - src/lcrcontainer_extend.c | 8 +++----- - 1 file changed, 3 insertions(+), 5 deletions(-) - -diff --git a/src/lcrcontainer_extend.c b/src/lcrcontainer_extend.c -index f6d1465..fb43b22 100644 ---- a/src/lcrcontainer_extend.c -+++ b/src/lcrcontainer_extend.c -@@ -841,7 +841,6 @@ static int lcr_spec_write_config(FILE *fp, const struct lcr_list *lcr_conf) - } - - nret = snprintf(line, len, "%s = %s", item->name, item->value); -- - if (nret < 0 || (size_t)nret >= len) { - ERROR("Sprintf failed"); - goto cleanup; -@@ -853,11 +852,10 @@ static int lcr_spec_write_config(FILE *fp, const struct lcr_list *lcr_conf) - goto cleanup; - } - -- nret = strlen(line_encode); -- -- line_encode[nret] = '\n'; -+ len = strlen(line_encode); -+ line_encode[len] = '\n'; - -- if (fwrite(line_encode, 1, len, fp) != len) { -+ if (fwrite(line_encode, 1, len + 1, fp) != len + 1) { - ERROR("Write file failed: %s", strerror(errno)); - goto cleanup; - } --- -2.25.1 - diff --git a/0005-Add-memory-related-fields.patch b/0005-Add-memory-related-fields.patch deleted file mode 100644 index 3326e9a..0000000 --- a/0005-Add-memory-related-fields.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 3acca1f09f56d871fe38c741917822b96636b540 Mon Sep 17 00:00:00 2001 -From: "ilya.kuksenok" -Date: Wed, 8 Feb 2023 15:59:18 +0300 -Subject: [PATCH 5/8] Add memory related fields - ---- - src/json/schema/container/info.json | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/src/json/schema/container/info.json b/src/json/schema/container/info.json -index 8ce10af5..1db0ccf4 100644 ---- a/src/json/schema/container/info.json -+++ b/src/json/schema/container/info.json -@@ -17,6 +17,21 @@ - "cpu_use_user": { - "type": "uint64" - }, -+ "avaliable_bytes": { -+ "type": "uint64" -+ }, -+ "usage_bytes": { -+ "type": "uint64" -+ }, -+ "rss_bytes": { -+ "type": "uint64" -+ }, -+ "page_faults": { -+ "type": "uint64" -+ }, -+ "major_page_faults": { -+ "type": "uint64" -+ }, - "cpu_use_kernel": { - "type": "uint64" - }, --- -2.25.1 - diff --git a/0006-mod-headers.patch b/0006-mod-headers.patch deleted file mode 100644 index 0e3024d..0000000 --- a/0006-mod-headers.patch +++ /dev/null @@ -1,28 +0,0 @@ -From aa7af4993648e2d1fe002fabf2c103ae728d5888 Mon Sep 17 00:00:00 2001 -From: "ilya.kuksenok" -Date: Tue, 14 Feb 2023 14:01:46 +0300 -Subject: [PATCH 6/8] mod headers - ---- - src/lcrcontainer.h | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/lcrcontainer.h b/src/lcrcontainer.h -index 5134b59d..a222ac97 100644 ---- a/src/lcrcontainer.h -+++ b/src/lcrcontainer.h -@@ -90,6 +90,11 @@ struct lcr_container_state { - /* Memory usage */ - uint64_t mem_used; - uint64_t mem_limit; -+ uint64_t avaliable_bytes; -+ uint64_t usage_bytes; -+ uint64_t rss_bytes; -+ uint64_t page_faults; -+ uint64_t major_page_faults; - /* Kernel Memory usage */ - uint64_t kmem_used; - uint64_t kmem_limit; --- -2.25.1 - diff --git a/0007-add-cgroup-resources-json-schema-for-isula-update.patch b/0007-add-cgroup-resources-json-schema-for-isula-update.patch deleted file mode 100644 index fb52360..0000000 --- a/0007-add-cgroup-resources-json-schema-for-isula-update.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 6ca6e250fc0cc10290c6e495168b29e09e2a70e9 Mon Sep 17 00:00:00 2001 -From: zhongtao -Date: Wed, 15 Feb 2023 16:05:39 +0800 -Subject: [PATCH 7/8] add cgroup resources json schema for isula update - -Signed-off-by: zhongtao ---- - .../schema/shim/client/cgroup-resources.json | 58 +++++++++++++++++++ - .../schema/shim/client/process-state.json | 1 + - .../schema/shim/client/runtime-stats.json | 1 + - 3 files changed, 60 insertions(+) - create mode 100644 src/json/schema/shim/client/cgroup-resources.json - -diff --git a/src/json/schema/shim/client/cgroup-resources.json b/src/json/schema/shim/client/cgroup-resources.json -new file mode 100644 -index 00000000..10310710 ---- /dev/null -+++ b/src/json/schema/shim/client/cgroup-resources.json -@@ -0,0 +1,58 @@ -+{ -+ "_comment": "third party depend: runc", -+ "description": "cgroup resources", -+ "type": "object", -+ "properties": { -+ "blockIO": { -+ "type": "object", -+ "properties": { -+ "weight": { -+ "$ref": "../../defs.json#/definitions/uint64" -+ } -+ } -+ }, -+ "cpu": { -+ "type": "object", -+ "properties": { -+ "shares": { -+ "$ref": "../../defs.json#/definitions/uint64" -+ }, -+ "period": { -+ "$ref": "../../defs.json#/definitions/uint64" -+ }, -+ "quota": { -+ "$ref": "../../defs.json#/definitions/int64" -+ }, -+ "realtimeRuntime": { -+ "$ref": "../../defs.json#/definitions/int64" -+ }, -+ "realtimePeriod": { -+ "$ref": "../../defs.json#/definitions/int64" -+ }, -+ "cpus": { -+ "type": "string" -+ }, -+ "mems": { -+ "type": "string" -+ } -+ } -+ }, -+ "memory": { -+ "type": "object", -+ "properties": { -+ "limit": { -+ "$ref": "../../defs.json#/definitions/uint64" -+ }, -+ "swap": { -+ "$ref": "../../defs.json#/definitions/uint64" -+ }, -+ "reservation": { -+ "$ref": "../../defs.json#/definitions/uint64" -+ }, -+ "kernel": { -+ "$ref": "../../defs.json#/definitions/uint64" -+ } -+ } -+ } -+ } -+} -diff --git a/src/json/schema/shim/client/process-state.json b/src/json/schema/shim/client/process-state.json -index 05f55fc5..f07d14f1 100644 ---- a/src/json/schema/shim/client/process-state.json -+++ b/src/json/schema/shim/client/process-state.json -@@ -1,4 +1,5 @@ - { -+ "_comment": "third party depend: runc", - "description": "process state info", - "type": "object", - "required": [ -diff --git a/src/json/schema/shim/client/runtime-stats.json b/src/json/schema/shim/client/runtime-stats.json -index 6ed9473d..ae77e9db 100644 ---- a/src/json/schema/shim/client/runtime-stats.json -+++ b/src/json/schema/shim/client/runtime-stats.json -@@ -1,4 +1,5 @@ - { -+ "_comment": "third party depend: runc", - "description": "runtime stats", - "type": "object", - "properties": { --- -2.25.1 - diff --git a/0008-add-field-for-isulad-daemon-configs.patch b/0008-add-field-for-isulad-daemon-configs.patch deleted file mode 100644 index 7f0e9b7..0000000 --- a/0008-add-field-for-isulad-daemon-configs.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 825554c1318b94edd29d4f22a9c5cbc3270cf277 Mon Sep 17 00:00:00 2001 -From: "Neil.wrz" -Date: Wed, 15 Feb 2023 19:11:45 -0800 -Subject: [PATCH 8/8] add field for isulad daemon configs - -Signed-off-by: Neil.wrz ---- - src/json/schema/isulad-daemon-configs.json | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/json/schema/isulad-daemon-configs.json b/src/json/schema/isulad-daemon-configs.json -index b1f60cf1..9ac8ee04 100644 ---- a/src/json/schema/isulad-daemon-configs.json -+++ b/src/json/schema/isulad-daemon-configs.json -@@ -46,6 +46,9 @@ - "storage-opts": { - "type": "ArrayOfStrings" - }, -+ "storage-enable-remote-layer": { -+ "type": "boolean" -+ }, - "pidfile": { - "type": "string" - }, --- -2.25.1 - diff --git a/0009-adapt-to-repo-of-openeuler-url-changed.patch b/0009-adapt-to-repo-of-openeuler-url-changed.patch deleted file mode 100644 index 819356c..0000000 --- a/0009-adapt-to-repo-of-openeuler-url-changed.patch +++ /dev/null @@ -1,33 +0,0 @@ -From cd4ce196a2b144327f050269a14d8391a88e9920 Mon Sep 17 00:00:00 2001 -From: zhongtao -Date: Mon, 6 Mar 2023 15:28:43 +0800 -Subject: [PATCH 09/15] adapt to repo of openeuler url changed - -Signed-off-by: zhongtao ---- - CI/pr-gateway.sh | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/CI/pr-gateway.sh b/CI/pr-gateway.sh -index df345bd..66c2074 100755 ---- a/CI/pr-gateway.sh -+++ b/CI/pr-gateway.sh -@@ -14,7 +14,15 @@ - ##- @Create: 2021-12-20 - ####################################################################### - -+sed -i "s#http://repo.openeuler.org#https://repo.huaweicloud.com/openeuler#g" /etc/yum.repos.d/openEuler.repo -+ -+dnf update -y -+ - dnf install -y gtest-devel gmock-devel diffutils cmake gcc-c++ yajl-devel patch make libtool libevent-devel libevhtp-devel grpc grpc-plugins grpc-devel protobuf-devel libcurl libcurl-devel sqlite-devel libarchive-devel device-mapper-devel http-parser-devel libseccomp-devel libcap-devel libselinux-devel libwebsockets libwebsockets-devel systemd-devel git chrpath -+if [ $? -ne 0 ]; then -+ echo "install dependences failed" -+ exit 1 -+fi - - cd ~ - --- -2.25.1 - diff --git a/0010-add-call-timeout-check-macro.patch b/0010-add-call-timeout-check-macro.patch deleted file mode 100644 index 43b947f..0000000 --- a/0010-add-call-timeout-check-macro.patch +++ /dev/null @@ -1,97 +0,0 @@ -From edb2ec1336f59ad8ca093f8cf2b2e092ff62575e Mon Sep 17 00:00:00 2001 -From: haozi007 -Date: Wed, 8 Mar 2023 10:33:40 +0800 -Subject: [PATCH 10/15] add call timeout check macro - -1. add macro for check call function timeout, and output a log; -2. add testcase for call timeout check macro; - -Signed-off-by: haozi007 ---- - tests/log_ut.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ - third_party/log.h | 11 +++++++++++ - 2 files changed, 51 insertions(+) - -diff --git a/tests/log_ut.cpp b/tests/log_ut.cpp -index 8cf6599..2638e85 100644 ---- a/tests/log_ut.cpp -+++ b/tests/log_ut.cpp -@@ -166,6 +166,8 @@ TEST(log_testcases, test_isula_libutils_log_enable) - DEBUG("debug log"); - check_log(fd, false, false, "debug log"); - isula_libutils_log_disable(); -+ -+ unlink(fname); - } - - TEST(log_testcases, test_isula_libutils_log_prefix) -@@ -202,5 +204,43 @@ TEST(log_testcases, test_isula_libutils_log_prefix) - isula_libutils_set_log_prefix(""); - INFO("fake log"); - check_log(fd, true, true, default_prefix); -+ -+ isula_libutils_log_disable(); -+ unlink(fname); -+} -+ -+static int do_sleep(int time) -+{ -+ sleep(time); -+ return 1; - } - -+TEST(log_testcases, test_call_check_timeout) -+{ -+ struct isula_libutils_log_config tconf = {0}; -+ const char *default_prefix = "iSula"; -+ const char *prio = "INFO"; -+ const char *fname = "/tmp/fake.fifo"; -+ int fd = -1; -+ int nret; -+ -+ tconf.driver = ISULA_LOG_DRIVER_FIFO; -+ tconf.priority = prio; -+ tconf.file = fname; -+ isula_libutils_log_enable(&tconf); -+ -+ fd = isula_libutils_get_log_fd(); -+ ASSERT_GE(fd, 0); -+ -+ // not timeout, will no log -+ CALL_CHECK_TIMEOUT(2, do_sleep(1)); -+ check_log(fd, false, false, default_prefix); -+ -+ // timeout, should have log -+ CALL_CHECK_TIMEOUT(1, nret = do_sleep(2)); -+ check_log(fd, true, true, "use 1 sec, timeout!!"); -+ ASSERT_EQ(nret, 1); -+ -+ isula_libutils_log_disable(); -+ unlink(fname); -+} -\ No newline at end of file -diff --git a/third_party/log.h b/third_party/log.h -index 2db0d98..fad04a1 100644 ---- a/third_party/log.h -+++ b/third_party/log.h -@@ -452,6 +452,17 @@ void isula_libutils_log_disable(); - - int isula_libutils_get_log_fd(void); - -+#define CALL_CHECK_TIMEOUT(timeout, caller) \ -+ do { \ -+ struct timespec tbeg, tend; \ -+ (void)clock_gettime(CLOCK_REALTIME, &tbeg); \ -+ caller; \ -+ (void)clock_gettime(CLOCK_REALTIME, &tend); \ -+ if (tend.tv_sec - tbeg.tv_sec >= (timeout)) { \ -+ ERROR("Call: "#caller" use %d sec, timeout!!", timeout); \ -+ } \ -+ } while (0) -+ - #ifdef __cplusplus - } - #endif --- -2.25.1 - diff --git a/0011-add-files_limit-to-oci-spec.patch b/0011-add-files_limit-to-oci-spec.patch deleted file mode 100644 index 9789867..0000000 --- a/0011-add-files_limit-to-oci-spec.patch +++ /dev/null @@ -1,37 +0,0 @@ -From de9dad87ccd54bd2beceb0d8dbb6bd5c442270ff Mon Sep 17 00:00:00 2001 -From: zhongtao -Date: Sat, 8 Apr 2023 11:38:50 +0800 -Subject: [PATCH 11/15] add files_limit to oci spec - -Signed-off-by: zhongtao ---- - src/json/schema/defs.json | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/src/json/schema/defs.json b/src/json/schema/defs.json -index cfbaa19..58c56fe 100644 ---- a/src/json/schema/defs.json -+++ b/src/json/schema/defs.json -@@ -989,6 +989,19 @@ - "limit" - ] - }, -+ "files": { -+ "id": "https://opencontainers.org/schema/bundle/linux/resources/files", -+ "type": "object", -+ "properties": { -+ "limit": { -+ "id": "https://opencontainers.org/schema/bundle/linux/resources/files/limit", -+ "$ref": "#/definitions/int64" -+ } -+ }, -+ "required": [ -+ "limit" -+ ] -+ }, - "blockIO": { - "id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO", - "type": "object", --- -2.25.1 - diff --git a/0012-add-memory-info-from-runtime.patch b/0012-add-memory-info-from-runtime.patch deleted file mode 100644 index 302ae7c..0000000 --- a/0012-add-memory-info-from-runtime.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 85a5823c87f8b0e5d5b2172aa5e4564f50fbc011 Mon Sep 17 00:00:00 2001 -From: zhangxiaoyu -Date: Fri, 21 Apr 2023 09:51:16 +0800 -Subject: [PATCH 12/15] add memory info from runtime - -Signed-off-by: zhangxiaoyu ---- - src/json/schema/container/info.json | 2 +- - src/json/schema/shim/client/runtime-stats.json | 9 +++++++++ - src/lcrcontainer.h | 2 -- - src/lcrcontainer_execute.c | 3 +++ - 4 files changed, 13 insertions(+), 3 deletions(-) - -diff --git a/src/json/schema/container/info.json b/src/json/schema/container/info.json -index 1db0ccf..19107a1 100644 ---- a/src/json/schema/container/info.json -+++ b/src/json/schema/container/info.json -@@ -20,7 +20,7 @@ - "avaliable_bytes": { - "type": "uint64" - }, -- "usage_bytes": { -+ "workingset_bytes": { - "type": "uint64" - }, - "rss_bytes": { -diff --git a/src/json/schema/shim/client/runtime-stats.json b/src/json/schema/shim/client/runtime-stats.json -index ae77e9d..6fdc579 100644 ---- a/src/json/schema/shim/client/runtime-stats.json -+++ b/src/json/schema/shim/client/runtime-stats.json -@@ -52,6 +52,15 @@ - "properties": { - "total_inactive_file": { - "$ref": "../../defs.json#/definitions/uint64" -+ }, -+ "rss": { -+ "$ref": "../../defs.json#/definitions/uint64" -+ }, -+ "pgfault": { -+ "$ref": "../../defs.json#/definitions/uint64" -+ }, -+ "pgmajfault": { -+ "$ref": "../../defs.json#/definitions/uint64" - } - } - } -diff --git a/src/lcrcontainer.h b/src/lcrcontainer.h -index a222ac9..edfc869 100644 ---- a/src/lcrcontainer.h -+++ b/src/lcrcontainer.h -@@ -90,8 +90,6 @@ struct lcr_container_state { - /* Memory usage */ - uint64_t mem_used; - uint64_t mem_limit; -- uint64_t avaliable_bytes; -- uint64_t usage_bytes; - uint64_t rss_bytes; - uint64_t page_faults; - uint64_t major_page_faults; -diff --git a/src/lcrcontainer_execute.c b/src/lcrcontainer_execute.c -index ff4685b..4d72050 100644 ---- a/src/lcrcontainer_execute.c -+++ b/src/lcrcontainer_execute.c -@@ -789,6 +789,9 @@ void do_lcr_state(struct lxc_container *c, struct lcr_container_state *lcs) - lcs->mem_limit = lxc_metrics.mem_limit; - lcs->kmem_used = lxc_metrics.kmem_used; - lcs->kmem_limit = lxc_metrics.kmem_limit; -+ lcs->rss_bytes = lxc_metrics.rss_bytes; -+ lcs->page_faults = lxc_metrics.page_faults; -+ lcs->major_page_faults = lxc_metrics.major_page_faults; - - lcs->cache = lxc_metrics.cache; - lcs->cache_total = lxc_metrics.cache_total; --- -2.25.1 - diff --git a/0013-add-unified-resources-and-remove-useless-MemorySwapL.patch b/0013-add-unified-resources-and-remove-useless-MemorySwapL.patch deleted file mode 100644 index 563e4b4..0000000 --- a/0013-add-unified-resources-and-remove-useless-MemorySwapL.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 1839c09872b1e5a19109992c6ab52d9b45655ac6 Mon Sep 17 00:00:00 2001 -From: zhangxiaoyu -Date: Wed, 26 Apr 2023 17:08:04 +0800 -Subject: [PATCH 13/15] add unified resources and remove useless - MemorySwapLimitInBytes - -Signed-off-by: zhangxiaoyu ---- - src/json/schema/defs.json | 4 ++++ - src/json/schema/host-config.json | 3 --- - src/json/schema/shim/client/cgroup-resources.json | 3 +++ - 3 files changed, 7 insertions(+), 3 deletions(-) - -diff --git a/src/json/schema/defs.json b/src/json/schema/defs.json -index 58c56fe..d96ac4c 100644 ---- a/src/json/schema/defs.json -+++ b/src/json/schema/defs.json -@@ -969,6 +969,10 @@ - "id": "https://opencontainers.org/schema/bundle/linux/resources", - "type": "object", - "properties": { -+ "unified": { -+ "id": "https://opencontainers.org/schema/bundle/linux/resources/unified", -+ "$ref": "#/definitions/mapStringString" -+ }, - "devices": { - "id": "https://opencontainers.org/schema/bundle/linux/resources/devices", - "type": "array", -diff --git a/src/json/schema/host-config.json b/src/json/schema/host-config.json -index 0367a76..302a537 100644 ---- a/src/json/schema/host-config.json -+++ b/src/json/schema/host-config.json -@@ -145,9 +145,6 @@ - "OomScoreAdj": { - "type": "integer" - }, -- "MemorySwapLimitInBytes":{ -- "type": "int64" -- }, - "BlkioWeight": { - "type": "uint16" - }, -diff --git a/src/json/schema/shim/client/cgroup-resources.json b/src/json/schema/shim/client/cgroup-resources.json -index 1031071..693bcf0 100644 ---- a/src/json/schema/shim/client/cgroup-resources.json -+++ b/src/json/schema/shim/client/cgroup-resources.json -@@ -53,6 +53,9 @@ - "$ref": "../../defs.json#/definitions/uint64" - } - } -+ }, -+ "unified": { -+ "$ref": "../../defs.json#/definitions/mapStringString" - } - } - } --- -2.25.1 - diff --git a/0014-Add-resources-info-to-pod-inspection.patch b/0014-Add-resources-info-to-pod-inspection.patch deleted file mode 100644 index 43fe982..0000000 --- a/0014-Add-resources-info-to-pod-inspection.patch +++ /dev/null @@ -1,61 +0,0 @@ -From e76e5dec8ca66102fc883e1f4a9a1a4d9b102ada Mon Sep 17 00:00:00 2001 -From: xuepeng -Date: Fri, 28 Apr 2023 04:58:21 +0800 -Subject: [PATCH 14/15] Add resources info to pod inspection - -Signed-off-by: xuepeng ---- - src/json/schema/container/inspect.json | 37 ++++++++++++++++++++++++++ - 1 file changed, 37 insertions(+) - -diff --git a/src/json/schema/container/inspect.json b/src/json/schema/container/inspect.json -index d6dc8c3..9c76c33 100644 ---- a/src/json/schema/container/inspect.json -+++ b/src/json/schema/container/inspect.json -@@ -54,6 +54,43 @@ - } - } - }, -+ "Resources": { -+ "type": "object", -+ "properties": { -+ "CPUPeriod": { -+ "type": "int64" -+ }, -+ "CPUQuota": { -+ "type": "int64" -+ }, -+ "CPUShares": { -+ "type": "int64" -+ }, -+ "Memory": { -+ "type": "int64" -+ }, -+ "MemorySwap": { -+ "type": "int64" -+ }, -+ "Hugetlbs": { -+ "type": "array", -+ "items": { -+ "type": "object", -+ "properties": { -+ "PageSize": { -+ "type": "string" -+ }, -+ "Limit": { -+ "type": "uint64" -+ } -+ } -+ } -+ }, -+ "unified": { -+ "$ref": "../defs.json#/definitions/mapStringString" -+ } -+ } -+ }, - "Image": { - "type": "string" - }, --- -2.25.1 - diff --git a/0015-Add-timestamp-and-calculated-cpu-usage-for-cpu-usage.patch b/0015-Add-timestamp-and-calculated-cpu-usage-for-cpu-usage.patch deleted file mode 100644 index f9d86a3..0000000 --- a/0015-Add-timestamp-and-calculated-cpu-usage-for-cpu-usage.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 9335aa89a00618814ca957dd2617d502a955f598 Mon Sep 17 00:00:00 2001 -From: xuepeng -Date: Fri, 5 May 2023 08:06:22 +0800 -Subject: [PATCH 15/15] Add timestamp and calculated cpu usage for cpu usage - support - -Signed-off-by: xuepeng ---- - src/json/schema/container/info.json | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/json/schema/container/info.json b/src/json/schema/container/info.json -index 19107a1..53d8a91 100644 ---- a/src/json/schema/container/info.json -+++ b/src/json/schema/container/info.json -@@ -14,6 +14,9 @@ - "cpu_use_nanos": { - "type": "uint64" - }, -+ "cpu_use_nanos_per_second": { -+ "type": "uint64" -+ }, - "cpu_use_user": { - "type": "uint64" - }, -@@ -73,6 +76,9 @@ - }, - "inactive_file_total": { - "type": "uint64" -+ }, -+ "timestamp": { -+ "type": "uint64" - } - } - } --- -2.25.1 - diff --git a/lcr.spec b/lcr.spec index 2e21434..f28a6c8 100644 --- a/lcr.spec +++ b/lcr.spec @@ -1,5 +1,5 @@ -%global _version 2.1.1 -%global _release 9 +%global _version 2.1.2 +%global _release 1 %global _inner_name isula_libutils %global enable_lxc 0 @@ -13,22 +13,6 @@ Group: Applications/System License: LGPLv2.1+ BuildRoot: %{_tmppath}/lcr-%{version} -Patch0001: 0001-add-libisula.pc.patch -Patch0002: 0002-add-unified-and-memory_swap_limit_in_bytes-into-host.patch -Patch0003: 0003-fix-update-cpu-rt-period-failed.patch -Patch0004: 0004-fix-writing-config-line-with-wrong-length.patch -Patch0005: 0005-Add-memory-related-fields.patch -Patch0006: 0006-mod-headers.patch -Patch0007: 0007-add-cgroup-resources-json-schema-for-isula-update.patch -Patch0008: 0008-add-field-for-isulad-daemon-configs.patch -Patch0009: 0009-adapt-to-repo-of-openeuler-url-changed.patch -Patch0010: 0010-add-call-timeout-check-macro.patch -Patch0011: 0011-add-files_limit-to-oci-spec.patch -Patch0012: 0012-add-memory-info-from-runtime.patch -Patch0013: 0013-add-unified-resources-and-remove-useless-MemorySwapL.patch -Patch0014: 0014-Add-resources-info-to-pod-inspection.patch -Patch0015: 0015-Add-timestamp-and-calculated-cpu-usage-for-cpu-usage.patch - %define lxcver_lower 4.0.3-2022102400 %define lxcver_upper 5.0.3 @@ -93,13 +77,13 @@ install -m 0644 ./conf/lcr.pc %{buildroot}/%{_libdir}/pkgconfig/lcr.pc chmod +x %{buildroot}/%{_libdir}/liblcr.so %endif -install -m 0644 ../src/lcrcontainer.h %{buildroot}/%{_includedir}/lcr/lcrcontainer.h +install -m 0644 ../src/runtime/lcrcontainer.h %{buildroot}/%{_includedir}/lcr/lcrcontainer.h install -m 0644 ./src/libisula_libutils.so %{buildroot}/%{_libdir}/libisula_libutils.so install -m 0644 ./conf/libisula.pc %{buildroot}/%{_libdir}/pkgconfig/libisula.pc install -d $RPM_BUILD_ROOT/%{_includedir}/%{_inner_name} install -m 0644 ../build/json/*.h %{buildroot}/%{_includedir}/%{_inner_name}/ install -m 0644 ../src/json/*.h %{buildroot}/%{_includedir}/%{_inner_name}/ -install -m 0644 ../third_party/*.h %{buildroot}/%{_includedir}/%{_inner_name}/ +install -m 0644 ../src/third_party/*.h %{buildroot}/%{_includedir}/%{_inner_name}/ chmod +x %{buildroot}/%{_libdir}/libisula_libutils.so find %{buildroot} -type f -name '*.la' -exec rm -f {} ';' @@ -133,6 +117,12 @@ rm -rf %{buildroot} %{_includedir}/lcr/lcrcontainer.h %changelog +* Tue Aug 29 2023 xuxuepeng - 2.1.2-1 +- Type:enhancement +- CVE:NA +- SUG:NA +- DESC:upgrade to v2.1.2 + * Mon Aug 07 2023 zhangxiaoyu - 2.1.1-9 - Type:enhancement - CVE:NA diff --git a/v2.1.1.tar.gz b/v2.1.1.tar.gz deleted file mode 100644 index 321666b..0000000 Binary files a/v2.1.1.tar.gz and /dev/null differ diff --git a/v2.1.2.tar.gz b/v2.1.2.tar.gz new file mode 100644 index 0000000..5a64472 Binary files /dev/null and b/v2.1.2.tar.gz differ