Method, device and medium for dynamically scheduling value stream process plug-ins using K8S technology
Through custom "process + plug-in" mode and dynamic scheduling technology, the resource management and exception handling problems of K8S scheduler in the value flow process plug-in are solved, efficient resource utilization and stable operation are achieved, and system performance and fault recovery capabilities are improved. .
Patent Information
- Application Number
- CN202411417900.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-10-11
AI Technical Summary
When dealing with value flow process plug-ins, the K8S scheduler faces problems such as dynamic changes in resource requirements, low node resource utilization, complex plug-in dependencies and difficulty in handling exceptions, resulting in waste of resources and unstable system performance.
Through custom "process + plug-in" mode, integrate cross-platform R&D activities, use Redis distributed lock management plug-in to start, dynamically evaluate and select the optimal K8S node, monitor resource requirements in real time, and automatically under abnormal conditions. Handle fault recovery.
It improves resource utilization efficiency, reduces resource waste, enhances the stability of task execution and failure recovery speed, reduces manual intervention costs, and meets the needs of complex R&D environments.
Smart Images

Figure CN118963923B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of plug-in technology, and in particular to a method, device and medium for dynamically scheduling value stream process plug-ins using K8S technology. Background Art
[0002] With the rapid development of cloud computing and containerization technology, Kubernetes (K8S) has become the de facto standard for container orchestration and management. K8S greatly simplifies the deployment and management of complex applications by providing the ability to automatically deploy, expand and manage containerized applications. However, in actual applications, there are still many challenges in how to efficiently schedule and manage plug-ins in K8S clusters, especially for complex value stream process plug-ins.
[0003] Value stream management (VSM) is a method for optimizing the software delivery process. It aims to maximize the delivery of value by identifying and eliminating waste in the process. Value stream process plug-ins are usually used to automate, monitor and analyze various links in the software development life cycle. Since these plug-ins often require different computing resources (such as CPU, memory, storage, IO performance, etc.), how to efficiently schedule these plug-ins in the K8S environment to ensure optimal utilization of resources and efficient execution of the process has become an important technical problem.
[0004] Although the current K8S scheduler has certain resource scheduling capabilities, it still faces the following problems when processing value stream process plug-ins:
[0005] 1. Dynamic changes in resource requirements: Value stream process plug-ins may have different resource requirements at different stages, and it is difficult for the K8S scheduler to adjust resource allocation in real time and dynamically;
[0006] 2. Node resource utilization: The default scheduling strategy of K8S is usually based on static resource allocation, which may cause some node resources to be overloaded or idle, thus affecting the overall performance and stability of the system;
[0007] 3. Plug-in dependencies: There may be complex dependencies between value stream process plug-ins. How to consider these dependencies in the scheduling process to avoid resource competition and task delays is an issue worthy of attention.
[0008] 4. Handling of abnormal situations: When a plug-in encounters an exception during operation (such as resource exhaustion, node failure, etc.), how to quickly and automatically recover and reschedule the fault to minimize the impact on the entire value stream process is a key challenge.
[0009] In order to solve the above problems, a method, device and medium for dynamically scheduling value stream process plug-ins using K8S technology are still needed, which can ensure the stable operation of the plug-in while ensuring efficient resource utilization, and can quickly respond to and handle abnormal situations. Summary of the invention
[0010] The embodiment of the present application provides a method, device and medium for dynamically scheduling value stream process plug-ins using K8S technology to solve the problems existing in related technologies. The technical solution is as follows:
[0011] In a first aspect, an embodiment of the present application provides a method for dynamically scheduling a value stream process plug-in using K8S technology, including:
[0012] Step 1: In the configuration value stream process, the R&D process is modeled through the customized "process + plug-in" mode to integrate cross-platform R&D activities. The configuration includes status, status set, template management, stage configuration, plug-in configuration, value stream management, and data collection and processing. Users can configure these contents to standardize each stage of the value stream and the required R&D activities to ensure the standardization and efficiency of the R&D delivery process.
[0013] Step 2: Value stream startup. The system starts the value stream process according to the configuration. The value stream may be in the state of not started, starting, suspended or closed. When the value stream is saved and started, the system sets the current value stream state to "starting". The startup state of the plug-in is controlled by the Redis distributed lock to ensure that the same plug-in will not be started repeatedly. After startup, qualified work items will flow into the corresponding stages and plug-ins to ensure the smooth progress of the task.
[0014] In step 3, determine the optimal K8S node. The system needs to select the optimal K8S node for the plug-in to be run. First, check whether the plug-in is running for the first time and analyze the plug-in's historical running records and resource usage. Then, the system collects the CPU usage, memory usage, disk space, and disk IO performance of each node, and performs node health checks to ensure that the node's network connection and status are normal. Finally, based on these data, evaluate the resource usage of each node, select nodes with low resource utilization and good health to deploy the plug-in, and ensure balanced and efficient resource utilization.
[0015] Step 4: Resource requirements assessment
[0016] Step 4-1: First run check: determine whether the plug-in is running for the first time, query its historical run records, if there is no history, mark it as the first run, and start the plug-in according to the predetermined resource configuration; if there is a history, check its historical operation status and resource usage to determine whether the previous configuration can be used or needs to be adjusted;
[0017] Step 4-2: Resource requirement assessment: Based on the resource requirements of the plug-in (including CPU, memory, disk space, and IO performance), assess and configure the resource usage of the plug-in. The default configured resources include CPU, disk size, memory, etc., and support setting maximum resource limits to ensure efficient operation of the plug-in under different load conditions.
[0018] Step 4-3: Node selection and deployment. Based on the evaluation results, the system selects the K8S node that best meets the resource requirements for deployment. If the plug-in has been successfully run on a node, this node will be given priority. If there is no priority node, the node with the lowest current resource usage will be selected. After determining the optimal node, the system will deploy the plug-in to the node and monitor its running status in real time to ensure the successful execution of the task.
[0019] In step 5, in the dynamic scheduling service, the system starts the K8S container plug-in service according to the optimal K8S node selected in step 3 and the plug-in running information determined in step 4. After the container is started, the system will create the corresponding Service and use the probe technology to detect whether the plug-in is successfully started. After normal startup, the plug-in service will provide services to the outside world through the container orchestration capability of K8S, realizing efficient plug-in management and dynamic scheduling;
[0020] In step 6, when providing the value stream plug-in service, after the value stream plug-in is successfully started and running, the system configures it to provide external services. Users can access the plug-in function through the generated Service, thereby completing the execution and delivery of the entire value stream process;
[0021] Step 7 manages the life cycle of the value stream plug-in. This step manages the life cycle of the plug-in in the K8S container, covering the entire process from task initialization (WAITING), task execution (RUNNING), task failure (FAILED) to task success (SUCCEEDED). The system monitors each state and calls the corresponding API interface to delete abnormal containers and services, release resources and record logs when an exception occurs. The system will also restart the plug-in task when necessary to ensure the continuity of the process and the effective use of resources.
[0022] In a second aspect, an embodiment of the present application further provides an electronic device, comprising: a memory and a processor, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement a method in any one of the above-mentioned aspects, wherein the memory and the processor communicate with each other through an internal connection path.
[0023] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a computer, the method in any one of the above-mentioned embodiments is implemented.
[0024] The advantages or beneficial effects of the above technical solution include at least:
[0025] This application uses K8S dynamic scheduling technology to improve resource utilization efficiency and reduce resource waste. Through K8S's dynamic scheduling technology, the optimal K8S node is selected for deployment and operation according to the real-time resource requirements of the plug-in (CPU, memory, disk space, IO performance). Compared with the traditional static scheduling method, this application can adjust resource allocation more flexibly, improve the system's resource utilization, and effectively reduce resource waste caused by node overload or idle resources.
[0026] This application uses a plug-in lifecycle management method to improve the stability of task execution and reduce fault recovery time. It introduces a detailed plug-in lifecycle management mechanism, including precise management and monitoring of WAITING, RUNNING, FAILED, and SUCCEEDED states. When an exception occurs during the operation of the plug-in, the system can automatically call the deletion interface to remove the faulty container and release resources, while recording the exception log to ensure rapid recovery of the task. This automated fault handling mechanism greatly improves the stability of task execution and reduces the time and cost required for manual intervention.
[0027] This application takes into account multi-tenant value stream management and uses a reusable template management mechanism to improve the efficiency of process management and reduce the workload of repeated configuration. This application introduces a multi-tenant value stream template management mechanism in the value stream configuration, allowing users to model the R&D process and save it as a reusable template. This mechanism supports tenant-level and project-level template management, allowing different tenants and projects to share and reuse value stream configurations, greatly improving the efficiency of process management and reducing the workload of repeated configuration and the incidence of errors.
[0028] These improvements give this application obvious advantages in dynamic scheduling, resource management, fault recovery, and process configuration management of value stream process plug-ins, and can better meet the actual needs of enterprises in complex R&D environments.
[0029] The above overview is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. In the drawings, unless otherwise specified, the same figure marks throughout multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 A schematic diagram of the steps of a K8S technology dynamic scheduling value stream process plug-in method provided by the present invention;
[0032] Figure 2 A flow chart of a K8S technology dynamic scheduling value stream process plug-in method provided by the present invention; DETAILED DESCRIPTION
[0033] In the following, only certain exemplary embodiments are briefly described. As those skilled in the art can appreciate, the described embodiments can be modified in various different ways without departing from the spirit or scope of the present application. Therefore, the drawings and descriptions are regarded as illustrative rather than restrictive in nature.
[0034] This application discloses a K8S technology dynamic scheduling value stream process plug-in method, the method flow chart is as follows Figure 1 and Figure 2 As shown, the method may at least include the following steps:
[0035] Step 1: S10, configure the value stream process;
[0036] Step 2: S20, start the value stream;
[0037] Step 3: S30, determine the optimal K8S node;
[0038] Step 4: S40, resource demand assessment;
[0039] Step 5: S50, dynamic scheduling service;
[0040] Step 6: S60, providing value stream plug-in service;
[0041] Step 7: S70, manage the value stream plug-in life cycle;
[0042] Optionally, the plug-in container is a K8S container, and may be other containers in other embodiments.
[0043] In one embodiment, configuring the value stream process in step S10 includes steps S11-S12:
[0044] S11. Define the process model.
[0045] In the embodiment of the present application, the R&D process is modeled through a customized "process + plug-in" model, and the plug-in integrates various cross-platform R&D activities. The user needs to create a process model that conforms to the business logic according to actual needs. First, the user can define each process node and the transfer conditions between these nodes through an interface or a configuration file. This includes defining the function, input and output requirements, trigger conditions, etc. of each node. When defining the process model, it is necessary to consider the consistency and efficiency of the entire business process to ensure that the collaboration of each node can proceed smoothly. This step defines the stages that need to be experienced in the end-to-end value stream delivery process, the execution plug-in activities of each stage and their order.
[0046] S12. Set status and plugin configuration.
[0047] In an embodiment of the present application, the state set, template management, stage configuration and plug-in configuration of the value stream are configured, including the input and output of the plug-in, process control options, and work item state flow rules. This configuration ensures the orderly progress of R&D activities and accurate recording of data.
[0048] In one embodiment, starting the value stream in step S20 includes steps S21-S22:
[0049] S21, switch to the start state.
[0050] In the embodiment of the present application, the system will switch the configured value stream process from the initial state to the running state. This process involves checking all pre-set startup conditions, such as whether the process configuration is correct, whether the state exists, whether the resource configuration is completed, whether the node health is good, etc. If all conditions are met, the system will start the value stream, and the system will switch the status of the current value stream to "starting", indicating that the process has officially started. At the same time, the system will generate a unique identifier to track the entire operation process of the process for subsequent monitoring and management. During the startup process, work items flow into the corresponding stages and plug-ins according to the configured rules. Any abnormal situation will be recorded and the corresponding processing mechanism will be triggered to ensure that the process can be started smoothly.
[0051] S22. Redis lock management is started.
[0052] In the embodiment of the present application, the system will use Redis distributed locks to ensure the uniqueness and concurrency safety of the process. In a multi-node environment, the same process may be started by multiple instances at the same time, which may cause resource conflicts or data inconsistencies. In order to avoid these problems, the system will first acquire the Redis lock when starting the process to ensure that only one instance is executing the process at the same time. If the lock acquisition fails, the system will pause the startup and wait for the lock to be released. Once the lock is acquired successfully, the process will continue to execute. The Redis lock management mechanism can effectively prevent concurrency problems and ensure the safe and stable operation of the process.
[0053] In one embodiment, determining the optimal K8S node in step S30 includes steps S31-S34:
[0054] S31. Check the first run.
[0055] In the embodiment of the present application, it is first determined whether the plug-in is running for the first time, and the historical operation records are queried. If the plug-in has no historical operation record, it is marked as the first operation, and the system will perform a series of initialization operations, such as allocating resources, starting scripts, environment variables, nfs mount configuration, restart strategy, etc. If it is not the first run, the system will skip these initialization steps and directly enter the next stage of resource evaluation. The first run check ensures that the process can correctly initialize the required resources and configurations when it is started for the first time, avoiding insufficient resources or missing parameters that may occur in subsequent steps.
[0056] S32. Evaluate resource usage.
[0057] In an embodiment of the present application, the system will perform a detailed analysis of the resource usage of all available K8S nodes, including collecting and checking the CPU usage, memory usage, disk space, and disk IO performance of the nodes. The system will compare these data with the resource requirements of the process to determine which nodes can meet the current resource requirements. In addition, the system will also consider the load balancing of the nodes to avoid concentrating too many tasks on a few nodes to prevent resource overload. The evaluation of resource usage helps to select the optimal node to ensure efficient operation of the process.
[0058] S33. Perform a health check.
[0059] In an embodiment of the present application, the system will perform a health status assessment on all candidate K8S nodes, which includes checking the CPU usage, memory usage, disk space, and disk IO performance of the nodes to determine the current load health status. If the health status of a node does not meet the requirements, the system will automatically exclude the node and select a node with good health as an alternative. The purpose of the health check is to ensure that the selected nodes can run stably during the process execution to avoid process interruption due to node failure.
[0060] S34. Select the optimal node.
[0061] In the embodiment of the present application, the system will select an optimal K8S node as the execution node of the process based on the previous resource evaluation and health check results. The system will comprehensively consider various factors such as resource utilization efficiency, node health status, load balancing, etc., and finally select a node that best suits the current process. Once the node is selected, the system will assign the process tasks to the node and start the relevant plug-in container. Selecting the optimal node is a key step to ensure the efficient and stable operation of the process, which determines the execution efficiency and reliability of the entire process.
[0062] In one embodiment, the resource demand assessment in step S40 includes steps S41-S42:
[0063] S41. Determine CPU / memory / disk requirements.
[0064] In the embodiment of the present application, the minimum and recommended resource configurations required by the evaluation plug-in, including CPU, memory, disk space, IO performance, etc., are ensured to ensure reasonable and efficient resource allocation.
[0065] S42. Set resource configuration.
[0066] In the embodiment of the present application, based on the evaluation results, the resource requests requestCPU, requestMem and resource limits limitCPU, limitMem, etc. of the plug-in are set. These configuration files take effect when the container is started to ensure that the plug-in runs stably in the K8S environment.
[0067] In one embodiment, the dynamic scheduling service in step S50 includes steps S51-S54:
[0068] S51, encapsulate plug-in information.
[0069] In an embodiment of the present application, the running information of the plug-in (such as startup scripts, environment variables, nfs mount configuration, etc.) is encapsulated into a RunBuilder object. This encapsulation process ensures that the plug-in can be executed normally on different K8S nodes and can communicate effectively with other plug-ins or system components. The encapsulated plug-in information is usually packaged into a container image. When the system starts the image, it will automatically load all necessary dependencies and configurations to ensure the correct execution of the plug-in.
[0070] S52. Start the container plug-in.
[0071] In the embodiment of the present application, the plug-in service is started through the K8S container, and the startup script is responsible for creating the plug-in log directory, setting the port, obtaining the configuration file and starting the plug-in service.
[0072] S53. Check the startup status.
[0073] In the embodiment of the present application, after successful startup, the container state of the plug-in changes to RUNNING, and the value stream platform confirms whether the plug-in service is successfully started through the TCP port probe interface.
[0074] S54. Create a Service interface.
[0075] In the embodiment of the present application, the system will create a Service / api / builders / expose interface for the started container plug-in so that external systems or users can access the functions of the plug-in. The creation of the Service interface includes allocating network addresses, setting access permissions, configuring load balancing, etc. The system will create a dedicated interface for each plug-in based on the needs of the plug-in and the characteristics of external access, and ensure the high availability and security of the interface. The creation of the Service interface is the basis for the plug-in to provide services and determines the accessibility and stability of the plug-in functions.
[0076] In one embodiment, providing the value stream plug-in service in step S60 includes steps S61-S62:
[0077] S61. Generate a Service interface.
[0078] In an embodiment of the present application, the system will generate one or more Service interfaces for each plug-in. These interfaces are channels for external systems to access plug-in functions. The system will assign a unique network address and port number to each interface, and set different access rights and security policies according to the functional characteristics of the plug-in.
[0079] S62. User accesses plug-in function.
[0080] In the embodiment of the present application, the system will expose the specific functions of the plug-in through the Service interface. Users or external systems can access the functions of the plug-in, such as data processing, task allocation, notification push, etc., by calling these interfaces. In the process of exposing the plug-in functions, the system will monitor the access to the interface and dynamically adjust resource allocation according to the actual load to ensure the stability and response speed of the service. Exposing the plug-in functions is the core step for the plug-in to provide services to external systems, which directly affects the final business effect.
[0081] In one embodiment, the management of the value stream plug-in lifecycle in step S70 includes steps S71-S74:
[0082] S71. Monitor the plug-in status.
[0083] In an embodiment of the present application, the system will monitor all running plug-ins in real time, including monitoring the resource consumption, performance indicators, abnormal conditions, etc. of the plug-ins. The system will use a variety of monitoring methods, such as log analysis, performance sampling, anomaly detection, etc., to ensure the stable operation of the plug-in throughout its life cycle. If the system detects any abnormal conditions, such as resource exhaustion, performance degradation, etc., it will automatically trigger a fault handling mechanism, such as restarting the plug-in, adjusting resource configuration, or sending an alarm notification.
[0084] S72. Process abnormal situations.
[0085] In the embodiment of the present application, the system will take corresponding processing measures for abnormal situations discovered during the monitoring process. Exception handling includes automated fault recovery, such as restarting the plug-in, switching nodes, reallocating resources, etc., and also includes notifying operation and maintenance personnel to perform manual intervention. The design of the exception handling mechanism ensures that the plug-in can quickly resume normal operation when encountering problems, avoiding service interruption or data loss due to abnormal situations.
[0086] S73. Delete related resources.
[0087] In the embodiment of the present application, the system will automatically clean up the plug-ins that have completed their life cycle and their related resources, which includes deleting the plug-in container, releasing occupied resources, cleaning up related Service interfaces, etc. The system will regularly check and clean up plug-ins that are no longer needed according to the preset life cycle management strategy to ensure the effective use of system resources. Deleting plug-ins at the end of their life cycle is the last step in plug-in life cycle management, ensuring that the system is always in the best state and avoiding resource waste and system burden.
[0088] S74. Record a log.
[0089] In an embodiment of the present application, the system will record all log information generated during the operation of the plug-in and store it in a designated storage medium. The log information includes the startup process, execution status, exception records, etc. of the plug-in. The system will classify and analyze these logs for subsequent troubleshooting and performance optimization. The purpose of recording the operation log is to provide data support for the life cycle management of the plug-in. Through log analysis, the system can better understand the operation status of the plug-in and continuously optimize its performance and stability.
[0090] In one possible implementation, suppose a research and development project launches a value stream that includes a plug-in for automated testing. When the value stream starts, the system first selects the optimal K8S node to run the plug-in, evaluates resource requirements based on historical data and current load, and completes dynamic scheduling. When the plug-in runs successfully, the system generates a Service interface for users to access the test results.
[0091] In addition, the present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a program, and the processor is used to run the program, and when the program is run, the method provided by the above invention is executed.
[0092] Furthermore, the present invention also provides another computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method provided by the above invention is implemented.
[0093] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for dynamically scheduling value stream process plug-ins using K8S technology, characterized in that: include: Step 1: Configure the value stream process; Model the R&D process through a custom "process + plug-in" model and integrate cross-platform R&D activities; Step 2: Start the value stream; The startup status of the plug-in is controlled by Redis distributed lock to ensure that the same plug-in will not be started repeatedly. After startup, qualified work items will flow into the corresponding stage and plug-in to ensure the smooth progress of the task; Step 3: Determine the optimal K8S node; The system needs to select the optimal K8S node for the plug-in to be run; Step 4: Resource requirements assessment: Check the historical operation and resource usage of the plug-in to determine whether the previous configuration can be used or whether adjustments are needed; Step 5: Dynamically schedule services. After the K8S plug-in container is started, the system will create a corresponding Service and use probe technology to detect whether the plug-in is started successfully. The plug-in service will provide services to the outside world through the container orchestration capability of K8S to achieve efficient plug-in management and dynamic scheduling. Step 6: Provide value stream plug-in services; After the plug-in runs successfully, the system configures the plug-in to provide external services, and users access the plug-in functions through the generated Service; Step 7: Manage the life cycle of the value stream plug-in; the life cycle of the value stream plug-in refers to the life cycle in the K8S container, covering the entire process from WAITING, RUNNING, FAILED, and SUCCEEDED; The WAITING refers to task initialization. When the value stream plug-in event receives the start message, it will encapsulate the RunBuilder object according to the running information of the value stream plug-in and call the / api / builders / start interface to start the K8S container. When it is just triggered, the K8S container plug-in will be in a waiting state, which means that the task has not started to execute. The reason is one of the following: The container is being scheduled to a node but has not actually started running yet. Pulling the required image; Waiting for dependent resources to be ready, wherein the dependent resources include volumes and networks; Waiting for other prerequisite tasks to complete; RUNNING means that the task is being executed; After the value stream plug-in is ready in the WAITING state, it will enter the RUNNING state, indicating that the container plug-in is executing the task. The value stream platform will call the / api / builders / expose interface based on the RUNNING state sent back to create the plug-in's Service. At this time, the CPU and memory resource usage rates increase. The execution progress and status of the task can be viewed through the logs, indicating that the container plug-in is in an active state. The FAILED means that the task execution failed; the task execution of the container plug-in failed and the scheduled operation could not be completed; the value stream plug-in encountered an abnormal state during the WAITING or RUNNING state. When the abnormal state occurs, the value stream platform will call the / api / builders / delete interface to delete the container's Deployment and the Service provided to the outside, delete the Deployment object related to the abnormal plug-in, ensure that the container is stopped and removed, and release the allocated resources for use by other tasks; the allocated resources include CPU, memory and storage; Remove the Service object related to the plug-in and terminate the service access provided to the outside world to avoid potential resource waste and security issues caused by abnormal plug-ins. Finally, a detailed log of the exception handling process will be recorded to facilitate subsequent analysis and problem location of the value stream platform. The reason for failure is one of the following: An error occurred in the task script or command; Insufficient resources; The services or resources that you depend on are unavailable; Configuration errors; Network problems caused mission interruption; SUCCEEDED means that the task is successfully executed; the task of the value stream plug-in is successfully completed without any errors; Its characteristic is that it is set to success after returning the SUCCEEDED status through the probe technology, that is, the task output result is available.
2. The method according to claim 1, characterized in that The configuration value stream process includes: Modeling of the R&D process is carried out through a customized "process + plug-in". The plug-in integrates various cross-platform R&D activities in the R&D delivery process, and standardizes the stages that need to be experienced in end-to-end value stream delivery and the activities that need to be performed in each stage. The configured value stream process includes states, state sets, template management, stage configuration, plug-in configuration, value stream management, and data collection and processing information; The state refers to the process of implementing R&D delivery process management by the value stream, which is a process of gradually transferring work items from the initial state to the completed state by defining a set of work item states in advance and setting rules to drive the flow of work item states based on the plug-in execution results in the process orchestration; The state set refers to the state set of user-defined work items supported by the value stream, and each state set contains a set of states of the work item; in the specific implementation process, the user defines the required state set based on the actual scenario, and arranges the value stream template based on the state set, uses the arranged plug-in execution results to drive the required state flow, and records the state flow time data to provide basic data for value stream analysis; The template management refers to the value stream as a process management tool, which supports users to model the R&D process and save it as a reusable template; users organize the organization's R&D delivery process based on scenarios, define stages and stage activities, and then implement the process on the platform through value stream plug-ins and process orchestration capabilities; the value stream template is divided into tenant and project management, in which tenant-level value stream templates are defined under DevOps tenants, and then project-level value stream templates are generated under the project based on tenant-level value stream templates; The stage configuration refers to the associated demand status of the configuration stage, which is used for stage control and stage-by-stage value stream data statistics; The plug-in configuration refers to the process configuration of the plug-in after adding the plug-in, including: plug-in custom configuration, plug-in output and process control options; the process control options include plug-in activation, plug-in admission status, demand status flow rules and automatic triggering rules; each stage in the value stream supports binding multiple plug-ins; The value stream management refers to the value stream supporting the generation of value stream instances based on the project value stream template under the project; the object of value stream management is a group of work items, which include versions, iterations or other dimensions. By running the value stream plug-in, the platform tools are connected to each other and the processes between various systems are connected; The data collection and processing refers to the process data produced by the value stream being processed to visualize the entire value chain, providing key indicator analysis of the value stream, so that users can compare the performance of the current value stream with the same process value stream at different stages.
3. The method according to claim 1, characterized in that The startup value stream includes: The value stream has the following states: not started, starting, suspended, and closed. When the value stream is saved and started, the system sets the current value stream to the started state, i.e., the available state, and sets the value stream plug-in state to "starting" through the Redis distributed lock. At this time, if other value streams also start the same plug-in, they will return to plug-in startup instead of starting it repeatedly. The work items will flow the required requirements into the corresponding stages and plug-ins according to the process status of the stage configuration and the access status and requirement status flow rules of the plug-in configuration.
4. The method according to claim 1, characterized in that: Determining the optimal K8S node includes: In the process of starting the value stream in step 2 of claim 1, it is necessary to select an optimal K8S node to run the plug-in; this process is divided into three steps: Step 1: First run check; query the historical operation records of the plug-in. If there is no historical record, mark it as the first run; if there is a historical record, check the previous operation status and resource usage; Step 2: Resource demand assessment; check the current CPU usage of each node to ensure that the node has sufficient CPU resources to run the new task; check the current memory usage of each node to ensure that the node has sufficient memory resources to run the new task; check the available disk space of each node to ensure that the node has sufficient storage space to run the new task; check the disk IO performance of each node to ensure that the node can read and write data quickly to avoid IO bottlenecks; Step 3: Node health check: Check the health status of the node to ensure that the node is not in a faulty or maintenance state; ensure that the node's network connection is normal and can access necessary external resources and services; Evaluate the resource requirements for starting the plug-in and determine the minimum and recommended resource configuration required by the plug-in; the resource requirements include CPU, memory, disk space, and IO performance; when the plug-in has a historically successful node and the node is available, the node that has successfully run the plug-in in the past is preferred, otherwise the node with lower resource usage is selected to balance the load and avoid overloading some nodes; after determining the deployment node, deploy the plug-in to the determined optimal node, monitor the running status of the plug-in, and ensure successful deployment and normal operation; The value stream platform collects and evaluates node resource usage and plug-in operation status every 5 minutes, and makes dynamic adjustments and optimizations to ensure efficient operation of the system. Through the above-mentioned step 1: first run check, step 2: resource demand assessment, and step 3: node health check process, it ensures that the value stream plug-in runs on the optimal K8S node, thereby improving the system's resource utilization and task execution efficiency.
5. The method according to claim 1, characterized in that The resource needs assessment includes: The value stream plug-in needs to run in K8S and provide external services. When the value stream is started, if the access status meets the plug-in configuration, the work item will enter the plug-in. The first time the plug-in is started in K8S, it needs to have a startup image, image credentials, resources required by K8S, a startup script start.sh, environment variables, nfs mount configuration, and restart policy configuration; The resources required by K8S refer to the default configuration resources of the value stream platform initialization, CPU is 0.2, disk size is 5G, disk IO is 0, and memory is 256M; when developing a plug-in, the default resource size is set according to the usage level or demand, and the maximum resource limit is set, which is defined by the configuration file, including the maximum CPU limit, maximum disk size, maximum disk IO and maximum memory limit; The startup script start.sh includes functions such as creating a plug-in log directory, setting ports, obtaining service startup configuration files, obtaining service logs, and starting plug-in services; The environment variables include the plug-in's identifier, version, and devops domain name information; The nfs mount configuration means that the container plug-in operation log and the file data produced by the plug-in need to be mounted to the virtual machine disk to avoid loss; The restart strategy: never restart strategy, that is, when the container terminates and exits, the container will not be restarted.
6. The method according to claim 1, characterized in that The dynamic scheduling service includes: Select the best K8S node, encapsulate the value stream plug-in into a RunBuilder object on the K8S node, call the / api / builders / start interface to start the K8S container plug-in service, run the container and execute the startup script start.sh, cd to the directory where the plug-in is located and create a plug-in log directory, and finally start the container plug-in service through the nohup command. After the K8S container is successfully started, the plug-in status will change to RUNNING, indicating that the container plug-in is executing tasks. Then the value stream platform calls the TCP port probe interface of the plug-in container to determine whether the plug-in is started normally, because the plug-in container changing to RUNNING status does not mean that the container service is actually started, and it is also necessary to determine whether the plug-in service port is started normally based on the TCP port probe; after normal startup, the value stream platform will call the / api / builders / expose interface based on the RUNNING status sent back to create the plug-in Service, thereby realizing the external service of the plug-in container; The powerful container orchestration capabilities of K8S are used to achieve efficient management and dynamic scheduling of plug-ins. By designing and implementing a new plug-in scheduling algorithm and selecting the optimal K8S node characteristics, resource allocation can be flexibly adjusted according to actual node load conditions, thereby improving the overall performance and resource utilization of the system.
7. The method according to claim 1, characterized in that The provision of value stream plug-in services includes: After creating and running the value stream plug-in, the value stream plug-in provides service to the outside world, and users can access the value stream plug-in functions.
8. The method according to claim 1, characterized in that The management value stream plug-in life cycle includes: The value stream platform manages the life cycle of the plug-in according to the operation of the value stream. When it is found that the value stream plug-in meets the admission of the flow status and the plug-in is in the FAILED state, it will re-call the / api / builders / start interface to start the task of the plug-in and the / api / builders / expose interface to provide external Service services. Similarly, when the value stream finds that the plug-in is not within the scope of the process, that is, it does not meet the flow status rules, it will stop and delete the running container, Deployment and Service of this plug-in to ensure that system resources can be allocated and used more efficiently; these states are very important node states in the value stream plug-in, which help us understand and monitor the life cycle of the container and the execution of tasks.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores a program, and the processor is used to run the program, and when the program is run, the method according to any one of claims 1 to 8 is executed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
A parallel deep learning scheduling training method and system based on a container
CN109885389A
Value flow plug-in running method, device and equipment and storage medium
CN117032834A