AI platform fault repair method, device, and storage medium

By defining and starting the queues and pods of the AI ​​platform in priority order, it solves the problem of abnormal pod creation caused by the priority startup of business containers during AI platform failure recovery, achieving efficient recovery of the cluster and reduction of operation and maintenance costs.

CN115098226BActive Publication Date: 2024-10-22INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210912650.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-30
Publication Date
2024-10-22
Estimated Expiration
2042-07-30

AI Technical Summary

Technical Problem

When the AI ​​platform fails to recover, the business container takes precedence over the cluster and platform component services for image startup, causing the pod creation to get stuck abnormally and the cluster to be unable to recover.

Method used

Define the queue priority and pod priority within the cluster, and start the k8s cluster and AI platform image in order of priority to ensure orderly service startup and avoid pod pull exceptions.

Benefits of technology

By starting services and containers in an orderly manner, cluster recovery efficiency is improved, the probability of manual recovery by operation and maintenance personnel is reduced, and operation and maintenance costs are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098226B_ABST
    Figure CN115098226B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of platform fault repair, and specifically provides an AI platform fault repair method, device, and storage medium, the method comprising the following steps: defining the queue priority and pod priority in the cluster; when the docker service of the cluster master node is normal, starting the k8s cluster and AI platform image pulling operation; obtaining all queue information in the cluster and starting the service in the order of pulling the image according to the queue priority and pod priority. Queuing is performed through the space queue queue and pod priority identifier to realize polling service startup, and both the queue queue and the pod container have priority identifiers. Thereby, the service startup is started in a certain order to avoid the long-term unavailability of the cluster due to pod pulling anomalies. When encountering the situation of server or cluster restart, the cluster startup, platform service recovery and business container reconstruction are carried out in an orderly manner to improve the cluster recovery efficiency and reduce the operation and maintenance cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of platform fault repair, and in particular to an AI platform fault repair method, device, and storage medium. Background Art

[0002] As the amount of data traffic used for AI platforms and deep learning tasks increases, the requirements for platform stability and reliability are also increasing.

[0003] However, due to uncontrollable problems such as platform server failures and unexpected power outages, service anomalies occur. After the server is repaired or power is restored, the platform service is started in serial pull. If there are business containers before the platform anomalies, the business containers will be pulled first after the server is turned on. In this case, since the platform component service is not started, there is a high probability that a pod (the smallest unit level managed by K8S, a combination of one or more containers) will be created abnormally when pulling the business container, causing the cluster to be unusable for a long time and can only be repaired manually.

[0004] In the existing technical solution, after the cluster is powered off and then powered on again, the cluster and platform services are started in series because k8s (Kubernetes is used to manage containerized applications on multiple hosts in the cloud platform). Cluster system services, platform component services, and business containers are started randomly. For platform fault recovery in which all services and business containers are started in series, if the business container in the cluster takes precedence over the cluster and platform component services in pulling images for startup, the pod creation will be stuck abnormally and the cluster will be unable to recover. Summary of the invention

[0005] For platform fault recovery in which all services and business containers are started serially, if the business container in the cluster takes precedence over the cluster and platform component services to pull the image and start it, it will cause the pod creation to be abnormally stuck and the cluster cannot be recovered. The present invention provides an AI platform fault repair method, device, and storage medium.

[0006] In a first aspect, the technical solution of the present invention provides an AI platform fault repair method, comprising the following steps:

[0007] Define the queue priority and pod priority within the cluster;

[0008] When the docker service of the cluster master node is normal, start the k8s cluster and AI platform image pull operation;

[0009] Get all queue information in the cluster and start the service by determining the order of pulling images according to queue priority and pod priority.

[0010] Preferably, the steps of defining the queue priority and pod priority within the cluster include:

[0011] The priorities in the defined queues are from high to low: k8s cluster system services, platform component services, and user groups in the platform;

[0012] Defines the priority of each pod in the queue.

[0013] Preferably, the steps of defining the priority of each pod within the queue include:

[0014] When deploying k8s cluster system services and platform component services, the pod priority is preset and defined according to performance and stability requirements;

[0015] Define the task priority when creating users in the queue user group.

[0016] Preferably, the method includes: sorting queues of different types according to their priority, and then pulling and starting services according to the priority of pods in their respective queues;

[0017] For queues of the same type, the queue priorities are the same, and tasks are scheduled in multiple queues in round-robin fashion according to user priorities.

[0018] Preferably, the step of obtaining all queue information in the cluster and determining the order of pulling images according to queue priority and pod priority to start the service includes:

[0019] Get all queue information in the cluster and pull the image according to the queue priority. First, start the k8s cluster system service; then start the platform component service;

[0020] Finally, the queue and pod priority jointly determine the startup order to start the task containers of the user groups in each platform.

[0021] Preferably, the steps of starting the task containers of the user groups in each platform in a startup order determined by the queue and the pod priority include:

[0022] When different users in different user groups create tasks, they enter the corresponding group queues respectively;

[0023] The group queue sorts the tasks according to their priorities and starts the task containers according to the sorting of the tasks.

[0024] Preferably, the step of grouping the queues to sort the tasks according to the task priorities and starting the task containers according to the task sorting includes:

[0025] Sort the priorities of tasks created by the corresponding users according to the user task priority level.

[0026] When the tasks have the same priority, they are prioritized according to the proportion of task resources of each task;

[0027] When the resource ratios of multiple tasks are the same, pods are recreated based on the task creation time.

[0028] The task container is started by querying the queue information of the underlying queued tasks.

[0029] Preferably, when the tasks have the same priority, the step of prioritizing the tasks according to the task resource ratio of each task includes:

[0030] When the task priorities are the same, the percentage of the requested resources of the task GPU, memory and CPU and the cluster allocatable resources are calculated respectively; and the maximum value of the three percentage values ​​is taken as the task resource ratio; the requested resources are the resources required for the task to run when the task is created; the cluster allocatable resources are the sum of the available resources of all nodes in the k8s cluster;

[0031] Priorities are set between different tasks by comparing their resource ratios; tasks with smaller resource ratios have higher priorities and are placed at the front of the queue.

[0032] In a second aspect, the technical solution of the present invention provides an electronic device, the electronic device comprising:

[0033] at least one processor; and,

[0034] a memory communicatively connected to the at least one processor; wherein,

[0035] The memory stores computer program instructions that can be executed by at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the AI ​​platform fault repair method as described in the first aspect.

[0036] In a third aspect, the technical solution of the present invention also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions enable the computer to execute the AI ​​platform fault repair method as described in the first aspect.

[0037] It can be seen from the above technical solutions that the present invention has the following advantages: queuing is performed through the space queue and the Pod priority identifier to realize polling service startup, and both the queue and the Pod container have priority identifiers. Thus, the service startup is started in a certain order, avoiding the long-term unavailability of the cluster caused by pod pull exceptions.

[0038] When a server or cluster restarts, the cluster is started, platform services are restored, and business containers are rebuilt in an orderly manner to improve cluster recovery efficiency, greatly reduce the probability of operation and maintenance personnel manually restoring the cluster, and reduce operation and maintenance costs.

[0039] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect.

[0040] It can be seen that compared with the prior art, the present invention has outstanding substantive features and significant progress, and the beneficial effects of its implementation are also obvious. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention.

[0043] Figure 2 The figure is a diagram showing queue and pod priority definitions according to an embodiment of the present invention. DETAILED DESCRIPTION

[0044] However, due to uncontrollable problems such as platform server failures and unexpected power outages, service anomalies occur. After the server is repaired or power is restored, the platform service is started in serial pull. If there are business containers before the platform anomalies, the business containers will be pulled first after the server is turned on. In this case, since the platform component service is not started, there is a high probability that a pod (the smallest unit level managed by K8S, a combination of one or more containers) will be created abnormally when pulling the business container, causing the cluster to be unusable for a long time and can only be repaired manually.

[0045] In the prior art, after the cluster is powered off and then powered on again, the k8s (Kubernetes is used to manage containerized applications on multiple hosts in the cloud platform) cluster and platform service startup are performed serially. Cluster system services, platform component services, and business containers are started randomly. For platform fault recovery in which all services and business containers are started serially, if the business container in the cluster takes precedence over the cluster and platform component services to pull images and start, the pod creation will be abnormally stuck and the cluster cannot be recovered. In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present invention.

[0046] like Figure 1 As shown, an embodiment of the present invention provides an AI platform fault repair method, comprising the following steps:

[0047] Step 1: Define the queue priority and pod priority within the cluster;

[0048] Step 2: When the docker service of the cluster master node is normal, start the k8s cluster and AI platform image pull operation;

[0049] Step 3: Get all queue information in the cluster and start the service by determining the order of pulling images according to the queue priority and pod priority.

[0050] In some embodiments, the steps of defining queue priorities and pod priorities within the cluster include:

[0051] The priorities in the defined queues are from high to low: k8s cluster system services, platform component services, and user groups in the platform;

[0052] According to the k8s cluster system service, platform component service, and user group or project group in the platform, the queue defined by the k8s cluster system service has the highest priority; the platform component service is second; the user group created in the platform also creates a queue in the k8s bottom layer, which has the last priority (the bottom layer can use the kubectl get queue command to obtain different queue information).

[0053] Defines the priority of each pod in the queue.

[0054] The pod priority is defined within each queue. Cluster system services (such as kube-system) and platform component services (such as ai) are pre-defined with pod priority according to performance and stability requirements during deployment. Users user1 / user2 are created in the user group queue to different user groups. The task priority identifier Priority is defined when creating the user and is divided into three levels: high, medium and low. The priority identifier when the user submits a task is specified according to different users.

[0055] In some embodiments, queues of different types are sorted according to the priority of the categories, and then the services are pulled and started according to the priority of the pods in the respective queues;

[0056] For queues of the same type, the queue priorities are the same, and tasks are scheduled in multiple queues in round-robin fashion according to user priorities.

[0057] Different types of queues are sorted according to the priority of the category, and then the service is pulled and started according to the priority of the pods in each queue. Queues of the same type, such as platform user group namespace, have the same queue priority, and the pods are polled and scheduled to start in multiple queues according to the user priority.

[0058] In some embodiments, the step of obtaining all queue information in the cluster and determining the order of pulling images according to queue priority and pod priority to start the service includes:

[0059] Get all queue information in the cluster and pull the image according to the queue priority. First, start the k8s cluster system service; then start the platform component service;

[0060] Finally, the queue and pod priority jointly determine the startup order to start the task containers of the user groups in each platform.

[0061] When a cluster is restarted, the queues and pod priorities in the cluster are defined as follows: Figure 2 As shown in . When the docker service of the cluster master node is normal, start the k8s cluster and AI platform image pull operation. When pulling the image, first obtain all queue information in the cluster. Figure 2 Detailed queue priority in . First, start the k8s cluster kubernetes system service; second, start the platform module service. Due to the sequential dependency, the startup priority of the kubernetes service and each platform module service has been built-in and defined during deployment. Finally, start the task container of each namespace in the platform; the startup order of the task container is determined by the queue and the custom pod priority.

[0062] In some embodiments, the steps of starting the task containers of the user groups in each platform by jointly determining the startup order by the queue and the pod priority include:

[0063] When different users in different user groups create tasks, they enter the corresponding group queues respectively;

[0064] The group queue sorts tasks according to their priorities and starts task containers according to the sorting of tasks; specifically, it includes:

[0065] S01: Sort the priorities of tasks created by the corresponding users according to the user task priority level; Sort the tasks according to the priority level. For example, if user 1 is a high-priority job user and creates task job 1, and user 2 is a low-priority user and creates task job 2, then job 1 is ahead of job 2 in queue 1 and will be scheduled and started first.

[0066] S02: When the tasks have the same priority, they are prioritized according to the proportion of task resources of each task;

[0067] Calculate the percentage of the requested resources of the task GPU, memory and CPU and the cluster allocatable resources respectively. (Note: the requested resources are the resources required for the task to run when the task is created; the cluster allocatable resources are the sum of the available resources of all nodes in the k8s cluster) After calculating the three values, take the maximum value of the three percentage values ​​as the task resource ratio. By comparing the task resource ratios between different tasks, the tasks with the smaller task resource ratios are placed at the front of the queue.

[0068] S03: When the task resource ratios of multiple tasks are the same, pods are recreated according to the task creation time;

[0069] S04: Start the task container by querying the queue information of the underlying queued tasks.

[0070] The resources in the cluster are released, and the k8s scheduler queries the queue information of the underlying queued tasks (querying queue1 and queue2), and then selects job1 from queue1 and job1 from queue2 respectively, followed by high-priority tasks in queue1 and queue2, until the task runs to the end. In this process, tasks in different queues are not affected by each other's priorities. For example: task job2 in queue1 is a task created by a low-priority user, and task job2 in queue2 is a task created by a high-priority user. At this time, when queue1 is polled, task job2 in queue1 will still be executed first.

[0071] By queuing through space queues and Pod priority identifiers, when encountering a server or cluster restart, the cluster is started, the platform service is restored, and the business container is rebuilt in an orderly manner, which improves the cluster recovery efficiency, greatly reduces the probability of operation and maintenance personnel manually restoring the cluster, and reduces operation and maintenance costs.

[0072] An embodiment of the present invention also provides an electronic device, comprising: a processor, a communication interface, a memory and a bus, wherein the processor, the communication interface and the memory communicate with each other through the bus. The bus can be used for information transmission between the electronic device and the sensor. The processor can call the logic instructions in the memory to execute the following method: Step 1: define the queue priority and pod priority in the cluster; Step 2: when the docker service of the cluster master node is normal, start the k8s cluster and AI platform image pulling operation; Step 3: obtain all queue information in the cluster and determine the order of pulling the image according to the queue priority and pod priority to start the service.

[0073] In some embodiments, the processor can call the logic instructions in the memory to execute the following method: obtain all queue information in the cluster and pull the image according to the queue priority, first start the k8s cluster system service; secondly, start the platform component service; finally, the queue and pod priority jointly determine the startup order to start the task container of the user group in each platform.

[0074] In some embodiments, the processor may call logic instructions in the memory to execute the following method: S01: prioritize tasks created by the corresponding user according to the user task priority level, high, medium, and low; S02: when the task priorities are the same, prioritize tasks according to the task resource ratio of each task; S03: when the task resource ratios of multiple tasks are the same, recreate the pod according to the task creation time; S04: start the task container by querying the queue information of the underlying queued tasks.

[0075] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0076] An embodiment of the present invention provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions enable a computer to execute the method provided by the above method embodiment, for example, including: Step 1: define the queue priority and pod priority within the cluster; Step 2: when the docker service of the cluster master node is normal, start the k8s cluster and AI platform image pulling operation; Step 3: obtain all queue information in the cluster and determine the order of pulling the image according to the queue priority and pod priority to start the service.

[0077] Although the present invention has been described in detail by referring to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A method for repairing an AI platform fault, characterized in that: The steps include: Define the queue priority and pod priority within the cluster; When the docker service of the cluster master node is normal, start the k8s cluster and AI platform image pull operation; Obtain all queue information in the cluster and start the service by determining the order of pulling images according to queue priority and pod priority; The steps to define the queue priority and pod priority within the cluster include: The priorities in the defined queues are from high to low: k8s cluster system services, platform component services, and user groups in the platform; Define the priority of each pod in the queue; The steps to define the priority of each pod within a queue include: When deploying k8s cluster system services and platform component services, the pod priority is preset and defined according to performance and stability requirements; Define task priorities when creating users in a queue user group; The method includes: sorting queues of different types according to their priority, and then pulling and starting services according to the priority of pods in their respective queues; For queues of the same type and with the same queue priority, tasks are scheduled in multiple queues in round-robin fashion according to user priority. The steps to obtain all queue information in the cluster and start the service in the order of pulling images according to the queue priority and pod priority include: Get all queue information in the cluster and pull the image according to the queue priority. First, start the k8s cluster system service; then start the platform component service; Finally, the queue and pod priority jointly determine the startup order to start the task containers of the user groups in each platform; The steps of starting the task containers of user groups in each platform in the order determined by the queue and pod priority include: When different users in different user groups create tasks, they enter the corresponding group queues respectively; The group queue sorts the tasks according to their priorities and starts the task containers according to the sorting of the tasks; The steps of grouping queues to sort tasks according to task priorities and start task containers according to the sorting of tasks include: Sort the priorities of tasks created by the corresponding users according to the user task priority level. When the tasks have the same priority, they are prioritized according to the proportion of task resources of each task; When the resource ratios of multiple tasks are the same, pods are recreated based on the task creation time. Start the task container by querying the queue information of the underlying queued tasks; When the tasks have the same priority, the steps for prioritizing tasks according to their resource ratios include: When the task priorities are the same, the percentage of the requested resources of the task GPU, memory and CPU and the cluster allocatable resources are calculated respectively; and the maximum value of the three percentage values ​​is taken as the task resource ratio; the requested resources are the resources required for the task to run when the task is created; the cluster allocatable resources are the sum of the available resources of all nodes in the k8s cluster; Priorities are set between different tasks by comparing their resource ratios; tasks with smaller resource ratios have higher priorities and are placed at the front of the queue.

2. An electronic device, characterized in that: The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the AI ​​platform fault repair method as described in claim 1.

3. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the AI ​​platform fault repair method as claimed in claim 1.