K8S-based benchmark test unified abstraction implementation method and K8S-based benchmark test unified abstraction implementation system

By uniformly abstracting different benchmarking tools in the K8S environment, using the K8S API and event mechanism, the problems of advanced function customization and insufficient applicability of specific scenarios are solved, and the simplified configuration, flexible management and result consistency of benchmarking is achieved.

CN120295884APending Publication Date: 2025-07-11HANGZHOU YUNYUANSHENG DATA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311347348.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-18
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The existing K8S benchmark unified abstract model has insufficient advanced function customization and applicability of specific scenarios, resulting in limited tool functions and poor test consistency.

Method used

By receiving test instructions, coordinating the creation of CRD resources, monitoring server resource occupation, using the K8S API to interact with the cluster, deploying benchmark testing tools, collecting test results, and monitoring and sharing results in real time through the K8S event mechanism, supporting unified abstraction and automated management of multiple tools.

Benefits of technology

Simplifies benchmark configuration and management, improves tool usage consistency and comparability, enhances the flexibility and scalability of K8S clusters, realizes real-time monitoring and results sharing, and improves the reproducibility of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295884A_ABST
    Figure CN120295884A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer data processing and automatic testing, and solves the problems that in the prior art, some advanced functions need to be additionally customized or expanded, and the applicability of a unified abstract model is limited in some specific scenes. The K8S-based benchmark test unified abstraction realization method comprises the following steps: creating resources corresponding to each CRD through scheduling, and monitoring the resource occupation condition of each server to carry out proper resource scheduling; according to the method, various K8S task resources are created through coordination, test entity resources are created through the task resources, actual benchmark test operation is carried out in the test entity resources, different benchmark test tools are abstracted in a unified mode, the configuration and management process of benchmark test is simplified, and the test efficiency is improved. A user can more conveniently carry out benchmark tests of various tools on the K8S, and the method is suitable for K8S clusters with different scales and requirements and supports various benchmark test tools and deployment modes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical fields of computer data processing and automated testing, and in particular to a unified abstraction implementation method and system for benchmark testing based on K8S. Background Art

[0002] With the development of cloud-native architectures and container technologies, Kubernetes (K8S) has become one of the most popular container orchestration platforms. It provides a flexible and scalable way to deploy, manage, and scale applications. As more and more enterprises and organizations adopt K8S to build and manage their applications, the need to evaluate system performance and stability is also increasing. In the K8S ecosystem, benchmark testing is an important task for evaluating system performance, reliability, and scalability. To conduct benchmark testing, researchers and developers have proposed various tools and methods. However, these tools are usually designed for specific benchmark testing scenarios, resulting in differences and inconsistencies between different tools. To address this issue, a unified abstraction model for benchmark testing based on K8S has been proposed. The model aims to unify the abstraction of various benchmark testing tools (such as Sysbench, Pgbench, Ycsb, Tpcc, and Tpch tools) through the K8S API. Through this abstraction, benchmark testing can be performed on different K8S clusters using the same configuration and execution method, thus providing a consistent test environment and result analysis. However, despite the many advantages of the unified abstraction model for benchmark testing based on K8S, there are still some drawbacks that need to be considered.

[0003] 1. Different benchmark testing tools have different characteristics and functions. Unifying their abstraction may result in limited functionality for some tools. Some advanced functions may not be fully adapted to the unified abstraction model and require additional customization or extension.

[0004] 2. The unified abstraction model for benchmark testing based on K8S may not cover all possible test scenarios. Different application programs and system architectures may have different requirements and characteristics, and additional customization and configuration are required for accurate benchmark testing. This may lead to limitations in the applicability of the unified abstraction model in certain specific scenarios. Summary of the Invention

[0005] The purpose of this application is to overcome the problems in the prior art that additional customization or extension is required for some advanced functions and the applicability of the unified abstraction model is limited in certain specific scenarios, and to provide a unified abstraction implementation method and system for benchmark testing based on K8S.

[0006] In a first aspect, a unified abstraction implementation method for benchmark testing based on K8S is provided, including:

[0007] Receive an instruction to create a test;

[0008] Create resources corresponding to each CRD through coordination, and monitor the resource occupancy of each server to perform appropriate resource scheduling;

[0009] Create various K8S task resources through coordination, and create test entity resources through the task resources to perform actual benchmark test operations in the test entity resources.

[0010] Furthermore, it also includes: obtaining specific test process logs and corresponding benchmark test results by operating on and viewing the test entity resources.

[0011] Furthermore, the resource scheduling includes: through the Kubelet service deployed on each server, scheduling and creating resources to the corresponding servers.

[0012] Furthermore, it also includes: interacting with the K8S cluster using the API of K8S, and dynamically obtaining the configuration information of the cluster, deploying benchmark test tools, and collecting test results through the API.

[0013] Furthermore, it also includes: enabling users to specify benchmark test parameters, target resources, and test strategies by using the CRD or configuration file of K8S.

[0014] Furthermore, it also includes: achieving automated benchmark testing by defining test plans and scheduled tasks, and saving the benchmark test results in a specified location.

[0015] Furthermore, it also includes: summarizing the benchmark test results and parsing the benchmark test results, and generating an analysis report based on the results of the summary and parsing.

[0016] In a second aspect, a unified abstract implementation system for benchmark testing based on K8S is provided, including:

[0017] The K8S service layer, the K8S service layer includes an API Server and a Kubelet. Among them, the API Server is used to interact with the K8S API, and the Kubelet is used to manage and run containers on nodes;

[0018] The control layer, the control layer includes a Controller and a CRD. Among them, the Controller is used to automatically manage and expand K8S application programs and custom resources, and the CRD is used to customize and expand the K8S API, and allows users to define and create custom resource types and behaviors, and interact with the API Server through the CRD;

[0019] Data layer, the data layer contains K8S resources created by the benchmark through CRD, where the K8S resources include benchmark resources, K8S task resources, and test entity resources.

[0020] In a third aspect, a computer-readable storage medium is provided. The computer-readable medium stores program code for a device to execute, and the program code includes steps for executing the method in any one of the implementation manners in the first aspect.

[0021] In a fourth aspect, an electronic device is provided. The electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the method in any one of the implementation manners in the first aspect is implemented.

[0022] The present application has the following beneficial effects:

[0023] 1. Simplify configuration management and use: By uniformly abstracting different benchmark tools, the present application simplifies the configuration and management process of benchmark tests, enabling users to more conveniently conduct benchmark tests of various tools on K8S, and reducing the learning and usage costs between different tools.

[0024] 2. Flexibility and scalability: Based on the flexible architecture and plug-in mechanism of K8S, and based on K8S Operator and custom declarative APIs, the present application abstracts a unified abstract model for benchmark tests, adapts to K8S clusters of different scales and requirements, and can support various benchmark tools and deployment modes.

[0025] 3. Real-time monitoring, analysis, and sharing of results: By running in the K8S environment and utilizing the event mechanism of K8S, the present application can monitor and collect the status and results of benchmark test tasks in real time. Moreover, it is not very convenient for others to view the test process and results by running in the server. Deploying in K8S can keep the results for a long time and also facilitate sharing the test results with other users through K8S services.

[0026] 4. Improve comparability and reproducibility: By running in the K8S environment, the present application ensures that the environment pulled each time is consistent, and only one step is required to quickly run a benchmark test. By uniformly abstracting the test result formats and representation methods of different tools, the comparability and reproducibility of benchmark test results can be improved. Description of the Drawings

[0027] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application.

[0028] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0029] Figure 1 is a flowchart of the unified abstract implementation method for benchmark testing based on K8S in Embodiment 1 of the present application;

[0030] Figure 2 is an example diagram of resource creation in the unified abstract implementation method for benchmark testing based on K8S in Embodiment 1 of the present application;

[0031] Figure 3 is a structural block diagram of the unified abstract implementation system for benchmark testing based on K8S in Embodiment 2 of the present application;

[0032] Figure 4 is a schematic internal structure diagram of an electronic device in Embodiment 4 of the present application. Detailed implementation manners

[0033] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0034] Embodiment 1

[0035] A unified abstraction implementation method for benchmark testing based on K8S according to Embodiment 1 of the present application includes: receiving an instruction to create a test; creating resources corresponding to each CRD through coordination and monitoring the resource occupancy of each server for appropriate resource scheduling; creating various K8S task resources through coordination, and creating test entity resources through the task resources, and performing actual benchmark testing operations in the test entity resources. The present application simplifies the configuration and management process of benchmark testing by uniformly abstracting different benchmark testing tools, enabling users to more conveniently perform benchmark testing of various tools on K8S, reducing the learning and usage costs between different tools. Secondly, based on the flexible architecture and plug-in mechanism of K8S, and based on K8S Operator and custom declarative APIs, the present application abstracts a unified abstraction model for benchmark testing, which can adapt to K8S clusters of different scales and requirements, and support various benchmark testing tools and deployment modes. By running in the K8S environment, the present application can utilize the event mechanism of K8S to monitor and collect the status and results of benchmark testing tasks in real time. Moreover, it is not very convenient for others to view the testing process and results by running in the server. Deploying in K8S can keep the results for a long time and facilitate sharing the test results with other users through the K8S service. In addition, by running in the K8S environment, the present application ensures that the environment pulled up each time is consistent, and only one step is required to quickly run a benchmark test. By uniformly abstracting the test result formats and representation methods of different tools, the comparability and reproducibility of benchmark test results can be improved.

[0036] Specifically, Figure 1 The flowchart of the unified abstraction implementation method for benchmark testing based on K8S in Embodiment 1 of the application is shown, including:

[0037] S101. Receive the instruction to create a test sent by the user through the client;

[0038] S102. After the API Server of K8S receives the instruction, it synchronously triggers the controller (i.e., Controller) to create resources corresponding to each CRD (i.e., benchmark test resources) through coordination, and monitors the resource occupancy of each server for appropriate resource scheduling;

[0039] After the resources corresponding to S103 and CRD are successfully created, the controller creates various K8S task resources (i.e., Jobs) through coordination, and creates test entity resources (i.e., Pods) through the task resources, and conducts actual benchmark test operations in the test entity resources. This method uniformly abstracts different benchmark test tools through an abstract model. This abstract model allows users to configure and manage different benchmark test tools in the same way without paying attention to the differences between tools. This unified abstract model simplifies the benchmark test process and improves the user experience.

[0040] In a further embodiment, it further includes: obtaining specific test process logs and corresponding benchmark test results by operating on and viewing the test entity resources.

[0041] In a further embodiment, the resource scheduling includes: scheduling and creating resources to the corresponding servers through the Kubelet service deployed on each server.

[0042] In a further embodiment, it further includes: interacting with the K8S cluster using the API of K8S, and dynamically obtaining the cluster configuration information, deploying benchmark test tools, and collecting test results through the API. By integrating the benchmark test tools with the K8S API, the automated execution of benchmark tests and integration into the continuous integration / continuous deployment (CI / CD) process can be achieved. This helps improve the efficiency of the development team and the product quality, while reducing manual operations and relieving the burden on personnel.

[0043] In a further embodiment, it further includes: enabling users to specify benchmark test parameters, target resources, and test strategies by using the CRD (Custom Resource Definition in Kubernetes, i.e., custom resource definition in Kubernetes) or configuration files of K8S (Kubernetes, abbreviated as K8s). This flexible configuration management allows users to perform customized benchmark test settings according to actual needs and supports multiple common benchmark test tools, such as Sysbench, Pgbench, Ycsb, Tpcc, and Tpch, etc., providing a flexible architecture that can easily integrate other benchmark test tools to meet the needs of different users.

[0044] In a further embodiment, it further includes: achieving automated benchmark tests by defining test plans and scheduled tasks, and saving the benchmark test results in a specified location. Users can achieve automated benchmark tests by defining test plans and scheduled tasks, and can also automatically trigger tests according to a predetermined plan and save the results in a specified location.

[0045] In a further embodiment, it further includes: summarizing the benchmark test results and parsing the benchmark test results, generating an analysis report based on the results of the summarization and parsing, which helps users evaluate the cluster performance and discover potential problems and optimization opportunities.

[0046] In a specific embodiment, the specific implementation of the Sysbench tool based on the unified abstraction model of the K8S benchmark test is as follows:

[0047] Sysbench benchmark test model Yaml:

[0048]

[0049] The user executes the Yaml command through the client Kubectl to create a benchmark test, and creates benchmark test resources through the coordination of the Controller (i.e., the controller) and the scheduling of Kubectl.

[0050] As Figure 2 shown, first create Sysbenches benchmark test resources, then create K8S task resources Jobs, and finally create test entity resources Pods. After all resources are successfully tuned and created, the benchmark test is completed.

[0051] During the test process, the logs of the Pods can be viewed through the Kubectl basic command logs, or other basic commands can be used to view the status of each resource, and the test process logs and test results can be viewed in real time. Sysbench benchmark test result Yaml:

[0052]

[0053]

[0054]

[0055] The final summary result of the benchmark test will also be filled into the Sysbench resources after the benchmark test is completed, which is convenient for users to view and record.

[0056] Similarly, the specific implementation processes of the benchmark test models of other tools such as Pgbench, Ycsb, Tpcc, and Tpch are also the same as that of Sysbench.

[0057] It should be noted that the method in this embodiment simplifies configuration management and usage: Usually when we conduct a benchmark test, we need to be familiar with and understand the installation and operation of a tool. The installation of the tool varies depending on the environment, and some tools may not be successfully installed in any environment. With the development of the K8S cloud-native architecture and container technology, the operating environment is no longer a problem. However, the usage methods of different tools on the K8S environment often vary greatly, and even many tools do not have a direct way to be used on K8S. It is also very difficult to be familiar with and understand the operation of these tools on K8S. Therefore, by uniformly abstracting different benchmark test tools, the configuration and management process of benchmark tests is simplified. Users can more conveniently conduct benchmark tests of various tools on K8S, which can reduce the learning and usage costs between different tools.

[0058] Secondly, this method has flexibility and scalability: Usually, there are certain differences and inconsistencies between different benchmark test tools, making it difficult to unify different tools, and currently no platform or tool has such an ability. Based on the flexible architecture and plug-in mechanism of K8S, and based on the K8S Operator and custom declarative APIs, a unified abstract model for benchmark tests is abstracted, which can adapt to K8S clusters of different scales and requirements and support various benchmark test tools and deployment modes.

[0059] In addition, this method can also monitor, analyze and share results in real time: Usually when we conduct a benchmark test, it is in the server, running directly through the client or running in the background in a daemon manner to prevent accidental interruption of the test process. However, none of these running methods have a perfect process and status that can be observed. Therefore, when running in the K8S environment, using the event mechanism of K8S, the status and results of the benchmark test task can be monitored and collected in real time. Moreover, it is not very convenient for others to view the test process and results by running in the server. Deploying in K8S can keep the results for a long time and also facilitate sharing the test results with other users through the K8S service.

[0060] It is worth noting that this method also improves comparability and reproducibility: Usually when we conduct a benchmark test, the process of installing the tool and running the benchmark test on a single server is rather cumbersome, and it is very difficult to ensure the complete consistency of the environment and running results. By running in the K8S environment, it is ensured that the environment pulled each time is the same, and only one step is required to quickly run a benchmark test. By further uniformly abstracting the test result formats and representation methods of different tools, the comparability and reproducibility of the benchmark test results can be improved.

[0061] Embodiment 2

[0062] As Figure 3As shown in the figure, a unified abstract implementation system for benchmark testing based on K8S involved in Embodiment 2 of the present application includes:

[0063] The K8S service layer, which includes an API Server and a Kubelet. Among them, the API Server is used to interact with the K8S API, and the Kubelet is used to manage and run containers on nodes;

[0064] The control layer, which includes a Controller and CRDs (such as Sysbench CRD, Pgbench CRD, Ycsb CRD, Tpcc CRD, and Tpch CRD, etc.). Among them, the Controller is used to automatically manage and expand K8S application programs and custom resources, and the CRD is used to customize and expand the K8S API, and allows users to define and create custom resource types and behaviors, and interact with the API Server through the CRD;

[0065] The data layer, which contains K8S resources created by the benchmark test through the CRD. Among them, the K8S resources include benchmark test resources (such as Sysbench, Pgbench, Ycsb, Tpcc, and Tpch, etc.), K8S task resources (i.e., Jobs), and test entity resources (i.e., Pods).

[0066] It should be noted that for other specific implementation manners of the unified abstract implementation system for benchmark testing based on K8S in the embodiments of the present invention, reference can be made to the specific implementation manners of the unified abstract implementation method for benchmark testing based on K8S above. To avoid redundancy, it will not be elaborated here.

[0067] Embodiment 3

[0068] A computer-readable storage medium involved in Embodiment 3 of the present application, where the computer-readable medium stores program code for a device to execute, and the program code includes steps for executing the method in any one of the implementation manners in Embodiment 1 of the present application;

[0069] Among them, the computer-readable storage medium can be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM); the computer-readable storage medium can store program code, and when the program stored in the computer-readable storage medium is executed by a processor, the processor is used to execute the steps of the method in any one of the implementation manners in Embodiment 1 of the present application.

[0070] Embodiment 4

[0071] As Figure 4 shown, an electronic device involved in Embodiment 4 of the present application. The electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, it implements the method in any one of the implementation manners in Embodiment 1 of the present application;

[0072] Among them, the processor may adopt a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more integrated circuits, and is used to execute relevant programs to implement the method in any one of the implementation manners in Embodiment 1 of the present application.

[0073] The processor may also be an integrated circuit electronic device with the ability to process signals. In the implementation process, each step of the method in any one of the implementation manners in Embodiment 1 of the present application may be completed by the integrated logic circuit in the hardware of the processor or the instruction in the form of software.

[0074] The above-mentioned processor may also be a general-purpose processor, a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application may be directly embodied as being executed and completed by the hardware decoding processor, or implemented by a combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the functions required to be executed by the units included in the data processing device of the embodiments of the present application, or execute the method in any one of the implementation manners in Embodiment 1 of the present application.

[0075] The above is only a preferred specific implementation manner of the present application; however, the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application, according to the technical solution of the present application and its improved concept, makes an equivalent replacement or change, and should be covered by the protection scope of the present application.

Claims

1. A unified abstract implementation method for benchmark testing based on K8S, characterized in that, Including: Receiving an instruction to create a test; Coordinating to create resources corresponding to each CRD, and monitoring the resource occupancy of each server to perform appropriate resource scheduling; Coordinating to create various K8S task resources, and creating test entity resources through the task resources to perform actual benchmark testing operations in the test entity resources.

2. The method for unified abstract implementation of benchmark testing based on K8S according to claim 1, wherein Also including: Obtaining specific test process logs and corresponding benchmark test results by operating and viewing the test entity resources.

3. The method for unified abstract implementation of benchmark testing based on K8S according to claim 1, wherein The resource scheduling includes: Scheduling and creating resources to the corresponding servers through the Kubelet service deployed on each server.

4. The method for unified abstract implementation of benchmark testing based on K8S according to claim 1, wherein, Also including: Interacting with the K8S cluster using the K8S API, and dynamically obtaining the cluster configuration information, deploying benchmark testing tools, and collecting test results through the API.

5. The unified abstract implementation method for benchmark testing based on K8S according to claim 1, wherein Also including: Enabling users to specify benchmark test parameters, target resources, and test strategies by using the K8S CRD or configuration files.

6. The method for unified abstraction implementation of benchmark testing based on K8S according to claim 2, wherein, Also including: Implementing automated benchmark testing by defining test plans and scheduled tasks, and saving the benchmark test results in a specified location.

7. The method for unified abstract implementation of benchmark testing based on K8S according to claim 2 or 6, characterized in that, Also including: Summarizing the benchmark test results and parsing the benchmark test results, and generating an analysis report based on the results of the summary and parsing.

8. A unified abstraction implementation system for benchmark testing based on K8S, which is used to implement the method described in any one of claims 1-7, and is characterized in that, Including: The K8S service layer, which includes an API Server and a Kubelet. Among them, the API Server is used to interact with the K8S API, and the Kubelet is used to manage and run containers on nodes; The control layer, which includes a Controller and a CRD. Among them, the Controller is used to automatically manage and expand K8S application programs and custom resources, and the CRD is used to customize and expand the K8S API, and allows users to define and create custom resource types and behaviors, and interact with the API Server through the CRD; The data layer, which contains K8S resources created by the benchmark test through the CRD. Among them, the K8S resources include benchmark test resources, K8S task resources, and test entity resources.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code for device execution, and the program code includes steps for executing the method according to any one of claims 1-7.

10. An electronic device, characterized in that, The electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the method according to any one of claims 1-7 is implemented.