Task scheduling methods, devices, equipment, and storage media
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2026-08-14
AI Technical Summary
一些集群(如Kubernetes集群,简称K8S集群)虽能提供资源管理的功能,但是管理粒度还不够细致,资源利用率较低
[0019]根据本公开的第五方面,提供了一种计算机程序产品,包括计算机程序,该计算机程序在被处理器执行时实现上述第一方面所提供的方法。
Smart Images

Figure CN114911598B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more particularly to the field of artificial intelligence technology development, specifically to a task scheduling method, apparatus, device, and storage medium. Background Technology
[0002] In machine learning scenarios, computing resources often require unified management. While some clusters (such as Kubernetes clusters, or K8S clusters for short) can provide resource management functions, the management granularity is not fine enough, resulting in low resource utilization. Summary of the Invention
[0003] This disclosure provides a task scheduling method, apparatus, device, and storage medium.
[0004] According to a first aspect of this disclosure, a task scheduling method is provided, comprising:
[0005] Obtain the initial Pod request, which includes resource request information;
[0006] Based on the resource request information, determine the resource allocation information;
[0007] Based on this resource configuration information, obtain the target Pod request;
[0008] Send the target Pod request, which instructs the target cluster system to schedule tasks according to the resource configuration information.
[0009] According to a second aspect of this disclosure, a task scheduling apparatus is provided, comprising:
[0010] The acquisition module is used to acquire the initial Pod request, which includes resource request information;
[0011] The first determining module is used to determine the resource configuration information based on the resource application information;
[0012] The second determination module is used to obtain the target Pod request based on the resource configuration information;
[0013] The sending module is used to send the target Pod request, which instructs the target cluster system to schedule tasks according to the resource configuration information.
[0014] According to a third aspect of this disclosure, an electronic device is provided, comprising:
[0015] At least one processor; and
[0016] The memory is communicatively connected to the at least one processor; wherein,
[0017] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method provided in the first aspect above.
[0018] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the method provided in the first aspect above.
[0019] According to a fifth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method provided in the first aspect described above.
[0020] The embodiments disclosed herein can improve the resource utilization of the target cluster system.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0022] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0023] Figure 1 This is a schematic diagram of a distributed cluster system according to an embodiment of the present disclosure;
[0024] Figure 2 This is a flowchart illustrating a task scheduling method according to an embodiment of the present disclosure. Figure 1 ;
[0025] Figure 3 This is a flowchart illustrating a task scheduling method according to an embodiment of the present disclosure. Figure 2 ;
[0026] Figure 4 This is a schematic diagram of node management according to an embodiment of the present disclosure;
[0027] Figure 5 This is a schematic diagram of the task scheduling architecture according to an embodiment of the present disclosure;
[0028] Figure 6 This is a schematic diagram of the process for changing Pod affinity according to an embodiment of this disclosure;
[0029] Figure 7 This is a schematic diagram of the composition of a task scheduling device according to an embodiment of the present disclosure;
[0030] Figure 8 This is a schematic diagram of the composition of a task scheduling system according to an embodiment of the present disclosure;
[0031] Figure 9 This is a block diagram of an electronic device used to implement the task scheduling method of the embodiments of this disclosure. Detailed Implementation
[0032] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0033] The terms "first," "second," and "third," etc., used in the embodiments, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as including a series of steps or units. A method, system, product, or apparatus is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.
[0034] Figure 1 This is a schematic diagram of a distributed cluster system according to an embodiment of the present disclosure. This distributed cluster system is an example of a cluster system and can be used for task processing, such as model training and object detection. The aforementioned distributed cluster system can be a Kubernetes (K8S) cluster system. Figure 1 As shown, this distributed cluster system includes multiple nodes (such as server cluster 101, server 102, server cluster 103, server 104, and server 105; server 105 can also connect to electronic devices, such as mobile phone 1051 and laptop 1052). Multiple nodes, as well as multiple nodes and connected electronic devices, can jointly execute one or more tasks. Improving the resource utilization of a distributed cluster system, such as a Kubernetes cluster system, will help execute more tasks.
[0035] This disclosure provides a task scheduling method. Figure 2This is a flowchart illustrating a task scheduling method according to an embodiment of the present disclosure. This task scheduling method can be applied to an electronic device, including but not limited to fixed devices and / or mobile devices, which performs task scheduling functions. For example, the electronic device can be deployed on a distributed cluster system, or it can be independent of the distributed cluster system but connected to it. In some possible implementations, the method can also be implemented by a processor calling computer-readable instructions stored in memory. In some possible implementations, the method can be applied to... Figure 1 The distributed cluster system shown is connected to electronic devices, such as a Kubernetes cluster system. Figure 2 As shown, the task scheduling method includes:
[0036] S201: Obtain the initial Pod request, which includes resource request information;
[0037] S202: Based on the resource request information, determine the resource allocation information;
[0038] S203: Based on this resource configuration information, obtain the target Pod request;
[0039] S204: Send the target Pod request, which instructs the target cluster system to schedule tasks according to the resource configuration information.
[0040] In this embodiment of the disclosure, resource request information is used to represent information related to a pre-request for resource usage. For example, the resource request information includes at least the resource request type and the resource request quantity. Here, the resource request type can be categorized as: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and memory. Here, the resource request quantity refers to the amount of resource to be pre-requested for use.
[0041] In this embodiment of the disclosure, the target cluster system includes multiple node pools, each with a different identifier. Each node pool includes at least one node (also referred to as a machine), which can be a bare metal, a physical machine, a virtual machine, etc.
[0042] Here, the target cluster system can be a cluster delivered by a private cloud, such as a cluster built on Kubernetes (K8S), a cluster built on an open-source distributed resource management framework (e.g., the open-source distributed resource management framework Mesos) and an application testing tool (e.g., the application testing tool Marathon), etc.
[0043] K8S is a container cluster management platform based on a cluster manager. It provides unified management of underlying host, network and storage resources based on container technology. It provides functions such as application deployment, maintenance and expansion mechanisms. K8S can be used to easily manage containerized applications running across machines.
[0044] In this embodiment of the disclosure, the resource configuration information is the resource information allocated for the initial Pod request. The resource configuration information includes at least the target node. This target node is the node in the target cluster system used to execute the tasks carried in the Pod request.
[0045] In this embodiment of the disclosure, the resource configuration information may further include the permitted resource usage.
[0046] Here, the resource usage in the resource configuration information can be adjusted based on the available resources in the target cluster system and information such as whether modifying the resource request amount is permitted, carried in the initial Pod request. For example, the resource usage in the resource configuration information can be equal to the resource request amount carried in the initial Pod request. Alternatively, the resource usage in the resource configuration information can be greater than the resource request amount carried in the initial Pod request. Yet another example is that the resource usage in the resource configuration information can be less than the resource request amount carried in the initial Pod request.
[0047] In this embodiment of the disclosure, obtaining a target Pod request based on the resource configuration information may include: modifying the initial Pod request based on the resource configuration information, adding the identifier of the target node to the initial Pod request, and thus obtaining the target Pod request.
[0048] In this embodiment of the disclosure, obtaining the target Pod request based on the resource configuration information may further include: modifying the initial Pod request based on the resource configuration information, adding the permitted resource usage to the initial Pod request, and obtaining the target Pod request.
[0049] The technical solution described in this disclosure, compared to directly sending the initial Pod request to the target cluster system, first determines resource configuration information for the initial Pod request based on the resource request information in the initial Pod request; then obtains the target Pod request based on the resource configuration information; and finally sends the target Pod request to the target cluster system. This not only reduces the workload of the target cluster system but also allocates resources to the Pod request according to the currently available resources of the target cluster system, achieving unified allocation and management of resources for the target cluster system, thereby improving resource utilization. Furthermore, since resource allocation is performed uniformly on each initial Pod request, it helps to make resource allocation more reasonable, increasing the number of tasks the target cluster system can process simultaneously, thereby further improving resource utilization.
[0050] In some embodiments, the resource request information includes a node pool identifier, which identifies a node pool consisting of at least one node. In some embodiments, determining resource configuration information based on the resource request information may include: determining a target node pool based on the node pool identifier; obtaining schedulable nodes in the target node pool and schedulable resource information of the schedulable nodes; and determining a target node from the schedulable nodes based on the schedulable resource information of the schedulable nodes, wherein the resource configuration information includes the target node.
[0051] Here, a schedulable node refers to a node that has unused resources, that is, a node that has idle resources.
[0052] Here, the schedulable resource information includes the schedulable resource type and the schedulable resource quantity corresponding to the schedulable resource type.
[0053] For example, the target cluster system includes N node pools, denoted as node pool 1, node pool 2, ..., node pool N. If the node pool identifier carried in the initial Pod request is the identifier representing node pool 1, then node pool 1 is determined as the target node pool. If node pool 1 includes M nodes, where nodes 1 to i have GPU resource cards, CPU resource cards, and memory, and nodes i+1 to M have CPU resource cards and memory; if the resource request information carried in the initial Pod request includes a GPU resource request amount of 0.1, then the node among nodes 1 to i that has available GPU resources is determined as the target node. If both node 1 and node i currently have available GPU resources, then one of node 1 and node i is determined as the target node.
[0054] In this way, the initial Pod request can be identified as a target node in the specified node pool that meets its resource request information, which helps to improve the success rate of task scheduling.
[0055] In some embodiments, determining a target node from schedulable nodes based on schedulable resource information of schedulable nodes includes: determining a first type of node with GPU resources from schedulable nodes when the resource request information includes GPU resource request amount; determining a first candidate node that meets the GPU resource request amount from the first type of node; and determining the node with the highest GPU resource usage among the first candidate nodes as the target node.
[0056] Here, the first type of node is a node with GPU resources.
[0057] Here, the first candidate node is the node in the first type of node that meets the GPU resource request requirements.
[0058] For example, the target cluster system includes N node pools, denoted as node pool 1, node pool 2, ..., node pool N. If the node pool identifier carried in the initial Pod request 1 is the identifier representing node pool 1, then node pool 1 is determined as the target node pool. If node pool 1 includes M nodes, where nodes 1 to i have GPU resource cards, CPU resource cards, and memory, and nodes i+1 to M have CPU resource cards and memory; assuming the resource request information carried in the initial Pod request 1 includes the GPU resource request amount, if nodes 1, i-1, and i currently have available GPU resources, then nodes 1, i-1, and i can be considered as first-class nodes. Assuming the resource request information carried in the initial Pod request 1 includes a GPU resource request amount of 0.1, if node 1's GPU resource usage is 0.9, node i-1's GPU resource usage is 0.7, and node i's GPU resource usage is 0.95, then nodes 1 and i-1 can be considered as first-class candidate nodes. Since node 1 has the highest GPU resource usage and can meet the GPU resource request amount of 0.1 requested in Pod Request 1, node 1 is determined as the target node. If the node pool identifier carried in the initial Pod Request 2 is the identifier representing node pool 1, and the GPU resource request amount is 0.25, then only the GPU resources of node i-1 can meet the resource request amount of the initial Pod Request 2, and node i-1 is determined as the target node.
[0059] In this way, not only can the target node that meets the resource request information of the Pod be identified, but the resources of the target node can also be fully utilized, thereby improving the resource utilization rate of the target cluster system.
[0060] In some embodiments, determining a target node from schedulable nodes based on schedulable resource information of schedulable nodes includes: determining a second type of node from schedulable nodes that does not have GPU resources when the resource request information includes CPU resource request amount but does not include GPU resource request amount; determining a second candidate node from the second type of node that meets the CPU resource request amount; and determining the node with the highest CPU resource usage among the second candidate nodes as the target node.
[0061] Here, the second type of node is the node that does not have GPU resources.
[0062] Here, the second candidate node is the node in the second type of node that meets the CPU resource request requirement.
[0063] For example, the target cluster system includes N node pools, denoted as node pool 1, node pool 2, ..., node pool N. If the node pool identifier carried in the initial Pod request 3 is the identifier representing node pool 1, then node pool 1 is identified as the target node pool. If node pool 1 includes M nodes, where nodes 1 to i have GPU resource cards, CPU resource cards, and memory, and nodes i+1 to M have CPU resource cards and memory; assuming that the resource request information carried in the initial Pod request 3 only includes the CPU resource request amount, then the nodes i+1 to M that currently still have available CPU resources are identified as the second type of nodes. Assuming the initial Pod request 3 carries resource request information including a CPU resource request of 0.5, if nodes i+2, M-1, and M currently have available CPU resources, and node i+2 has a CPU resource utilization of 0.8, node M-1 has a CPU resource utilization of 0.4, and node M has a CPU resource utilization of 0.2, then nodes M-1 and M are the nodes that can satisfy the CPU resource request of 0.5 in the initial Pod request 3. Nodes M-1 and M are then selected as the second candidate nodes. Since node M-1 has the highest CPU resource utilization and can satisfy the CPU resource request of 0.5, node M-1 is determined as the target node.
[0064] In this way, not only can the target node that meets the resource request information of the Pod be identified, but the resources of the target node can also be fully utilized, thereby improving the resource utilization rate of the target cluster system.
[0065] In some embodiments, such as Figure 3 As shown, the above task scheduling method may further include:
[0066] S301: Receive node partitioning request;
[0067] S302: Based on the node partitioning request, the nodes of the target cluster system are partitioned to obtain multiple node pools, each of which has a corresponding node pool identifier.
[0068] Different node pools have different node pool identifiers.
[0069] Here, S301 and S302 are executed before S201.
[0070] Here, the node partitioning request is used to instruct the nodes of the target cluster system to be partitioned to obtain multiple node pools.
[0071] Here, the node partitioning request includes node grouping information. For example, nodes 1, 2, and 3 are grouped together and assigned to node pool a; nodes 4 and 5 are grouped together and assigned to node pool b; and nodes 6, 7, 8, and 9 are grouped together and assigned to node pool c.
[0072] In some implementations, receiving a node partitioning request includes: receiving a node partitioning request input by a user through a user interface. In some implementations, receiving a node partitioning request includes: receiving a node partitioning request forwarded by another device. This disclosure does not limit how the node partitioning request is obtained.
[0073] In this way, dividing the nodes of the target cluster system into multiple node pools helps to achieve effective management and utilization of the resources of the target cluster system.
[0074] In some embodiments, the task scheduling method described above may further include: outputting a prompt message when the number of nodes in any of the multiple node pools changes.
[0075] Here, the notification message is used to indicate changes in the nodes of the target cluster system. For example, the number of nodes in node pool 1 changes from 3 to 2, and node pool 1 currently includes node 1 and node 2. Or, node 3 is removed from node pool 1. This disclosure does not limit the specific type and format of the notification message, and will not exhaustively list them here.
[0076] In practical applications, prompts can be output through a user interface, a voice broadcaster, or by sending short messages to user terminals such as mobile phones. This disclosure does not limit the output methods, and will not exhaustively list them here.
[0077] Figure 4 A diagram illustrating node management is shown, such as... Figure 4 As shown, multiple node pools are created, including node pool A, node pool B, and node pool C. Node pool A includes node 1, node 2, and node 3; node pool B includes node 4; and node pool C includes node 5 and node 6. Users can migrate existing nodes between the different node pools. For example, migrating node 3 from node pool A to node pool B. Users can also bring multiple nodes online and offline. For example, taking node 6 offline from a node pool. Here, "bringing online" can be understood as enabling a node, and "going offline" can be understood as shutting down a node.
[0078] In this way, by outputting prompts, users can be reminded of the dynamic changes in the nodes of the target cluster system, thus avoiding the problem that the user's edited tasks cannot achieve the expected results due to the user's lack of awareness of node changes.
[0079] In some embodiments, after obtaining multiple node pools, the above task scheduling method may further include: calculating the remaining GPU resources of each GPU resource card included in each node of the multiple node pools.
[0080] Here, the remaining GPU resources are represented by the ratio of the GPU resource usage of the GPU resource card to the total GPU resources of the GPU resource card.
[0081] Additionally, the remaining GPU resources can be converted into a value represented by the GPU card, where the value represented by the GPU resource card is greater than 0 and less than 1.
[0082] Here, the values represented by the GPU resource card are the quantized values of the GPU resources in the GPU resource card.
[0083] In some implementations, GPU virtualization technology is used to divide the resources in the GPU resource cards included in each node pool.
[0084] This disclosure does not limit the GPU virtualization technology. Any technology that can partition GPU resources can be used as a GPU virtualization technology.
[0085] In some embodiments, determining resource configuration information based on resource request information includes: when the resource request information includes the amount of GPU resource requests, determining a target node based on the amount of GPU resource requests and the remaining GPU resources of each GPU resource card included in each node in the node pool, wherein the resource configuration information includes the target node.
[0086] For example, the target cluster system includes N node pools, denoted as node pool 1, node pool 2, ..., node pool N. If the node pool identifier carried in the initial Pod request 4 is the identifier representing node pool 1, then node pool 1 is determined as the target node pool. If node pool 1 includes M nodes, where nodes 1 to i have GPU resource cards, CPU resource cards, and memory, and nodes i+1 to M have CPU resource cards and memory; assuming the resource request information carried in the initial Pod request 4 includes the GPU resource request amount, and the GPU resource request amount is required to be 0.3, if it is detected that nodes 1, node i-1, and node i still have available GPU resources, and each of nodes 1, node i-1, and node i includes one GPU resource card, the remaining GPU resource amount of node 1 is 0.1, the remaining GPU resource amount of node i-1 is 0.3, and the remaining GPU resource amount of node i is 0.95, then nodes i-1 and node i can both be candidate nodes. To make full use of the resources of each node, node i-1 is selected as the target node.
[0087] In this way, by quantizing the GPU resources in the GPU resource card, the same GPU resource card can serve multiple Pod requests at the same time, improving the utilization of the GPU resource card, and thus also improving the resource utilization of the node.
[0088] Figure 5A schematic diagram of a task scheduling architecture is provided, such as... Figure 5 As shown, the architecture is divided into three main parts: node management service, task management service, and resource monitoring service.
[0089] The node management service includes node classification and GPU virtualization.
[0090] Node classification specifically includes: if a certain type of node is only used to run specific types of jobs, these nodes can be assigned to a node pool. During system initialization, all nodes belong to the default node pool. Users can migrate certain nodes from the default node pool to other node pools as needed. When submitting a task, users can specify which node pool's resources to use.
[0091] GPU virtualization includes: utilizing Baidu's GPU virtualization technology to enable multiple containers to reuse a single GPU resource card according to pre-allocated resources. When a user submits a task, the number of GPU cards requested can be less than one. The resource management component in this architecture is responsible for converting the user's GPU request into a low-level resource description, such as a GPU resource request of 0.1. By supporting GPU resource reuse, resource utilization is improved.
[0092] The task management service includes reducing resource fragmentation. For example, by using the Binpack mechanism, scheduling tasks to nodes with high GPU utilization is prioritized.
[0093] Task management also includes: changing node affinity. Based on the resource information requested by the Pod and the node pool information, the system optimizes the selection of schedulable nodes and then modifies the node affinity of the Pod.
[0094] Figure 6 The flowchart for modifying Pod affinity is shown. Figure 6 In the process, after receiving a task from a user, the Pod creation service calls the Kubernetes system interface to create a Pod request. The task management service receives this Pod request through the MutatingAdmission Controller. The task management service performs an admission review on the Pod request; through affinity adaptation, it modifies the Pod request's attributes (Pod Spec), including modifying the nodes and restricting the Pod request to run on only a few nodes; after modification, it returns an admission response to the MutatingAdmission Controller, so that the MutatingAdmission Controller can store the modified Pod request (including the binding information of the nodes adapted to the Pod request, and the resource configuration information of each node) in the Kubernetes system's configuration file, such as a distributed unified key-value store (etcd).
[0095] The resource monitoring service includes node monitoring and monitoring of used resources.
[0096] Here, node monitoring includes: dynamically sensing the resources used by the system (excluding user tasks). If a node anomaly is detected, the abnormal node situation is reported.
[0097] Here, resource monitoring is used, including converting the resources already used in Pod requests into quantified values of the actual resource cards used.
[0098] Thus, the above system architecture utilizes node affinity and GPU virtualization technology for resource and task management; it can allocate nodes that match the task attributes to the task, thereby improving the task isolation capability and resource utilization of the target cluster system.
[0099] This disclosure provides a task scheduling device, such as... Figure 7 As shown, the task scheduling device may include: an acquisition module 701, used to acquire an initial Pod request, the initial Pod request including resource request information; a first determination module 702, used to determine resource configuration information based on the resource request information; a second determination module 703, used to acquire a target Pod request based on the resource configuration information; and a sending module 704, used to send the target Pod request, the target Pod request being used to instruct the target cluster system to perform task scheduling according to the resource configuration information.
[0100] In some embodiments, the resource request information includes a node pool identifier, which identifies a node pool consisting of at least one node.
[0101] In some embodiments, the first determining module 702 includes: a first determining submodule, configured to determine a target node pool based on a node pool identifier; an obtaining submodule, configured to obtain schedulable nodes in the target node pool and schedulable resource information of the schedulable nodes; and a second determining submodule, configured to determine a target node from the schedulable nodes based on the schedulable resource information of the schedulable nodes, wherein the resource configuration information includes the target node.
[0102] In some embodiments, the second determining submodule is specifically configured to, when the resource request information includes the GPU resource request amount, determine a first type of node with GPU resources from the schedulable nodes; determine a first candidate node that meets the GPU resource request amount from the first type of nodes; and determine the node with the highest GPU resource usage among the first candidate nodes as the target node.
[0103] In some embodiments, the second determining submodule is specifically configured to: determine a second type of node that does not have GPU resources from the schedulable nodes when the resource request information includes CPU resource request amount but does not include GPU resource request amount; determine a second candidate node that meets the CPU resource request amount from the second type of nodes; and determine the node with the highest CPU resource usage among the second candidate nodes as the target node.
[0104] In some embodiments, the task scheduling device may further include: a receiving module 705 (not shown in the figure) for receiving a node partitioning request; and a node partitioning module 706 (not shown in the figure) for partitioning the nodes of the target cluster system based on the node partitioning request to obtain multiple node pools, each of which has a corresponding node pool identifier.
[0105] In some embodiments, the node partitioning module 706 is also configured to output a prompt message when the number of nodes in any of the multiple node pools changes.
[0106] In some embodiments, the task scheduling device may further include: a resource statistics module 707 (not shown in the figure), used to count the remaining GPU resources of each GPU resource card included in each node in multiple node pools. The first determination module 702 is further used to determine a target node based on the GPU resource request amount and the remaining GPU resources of each GPU resource card included in each node in the node pool, when the resource request information includes the GPU resource request amount, and the resource configuration information includes the target node.
[0107] Those skilled in the art should understand that the functions of each processing module in the task scheduling device of this disclosure embodiment can be understood with reference to the relevant description of the task scheduling method described above. Each processing module in the task scheduling device of this disclosure embodiment can be implemented by an analog circuit that implements the functions described in the embodiments of this disclosure, or by running software that performs the functions described in the embodiments of this disclosure on an electronic device.
[0108] The task scheduling device of this disclosure can improve the resource utilization of the target cluster system and also improve the task isolation capability of the target cluster system.
[0109] This disclosure provides an embodiment of a task scheduling system, such as... Figure 8As shown, the task scheduling system may include: a resource management module 801, used to obtain an initial Pod request, the initial Pod request including resource request information; and to determine resource configuration information for the initial Pod request based on the resource request information; a task scheduling module 802, used to obtain a target Pod request for the initial Pod request based on the resource configuration information; and to send the target Pod request, the target Pod request being used to instruct the target cluster system to perform task scheduling according to the resource configuration information.
[0110] In some embodiments, the resource request information includes a node pool identifier. The resource management module 801 is used to: determine a target node pool based on the node pool identifier; obtain schedulable nodes in the target node pool and schedulable resource information of the schedulable nodes; and determine a target node from the schedulable nodes based on the schedulable resource information of the schedulable nodes. The resource configuration information includes the target node.
[0111] In some embodiments, the resource request information includes a node pool identifier. The resource management module 801 is used to: determine a first type of node with GPU resources from the schedulable nodes when the resource request information includes the GPU resource request amount; determine a first candidate node that meets the GPU resource request amount from the first type of nodes; and determine the node with the highest GPU resource occupancy among the first candidate nodes as the target node.
[0112] In some embodiments, the resource management module 801 is configured to: determine a second type of node that does not have GPU resources from the schedulable nodes when the resource request information includes CPU resource request amount but does not include GPU resource request amount; determine a second candidate node that meets the CPU resource request amount from the second type of nodes; and determine the node with the highest CPU resource usage among the second candidate nodes as the target node.
[0113] In some embodiments, the task scheduling system described above may further include: a node management module 803 (not shown in the figure), used to receive a node partitioning request; and to partition the nodes of the target cluster system based on the node partitioning request to obtain multiple node pools, each of which has a corresponding node pool identifier.
[0114] In some embodiments, the node management module 803 is further configured to: output a prompt message when the number of nodes in any of the multiple node pools changes.
[0115] In some embodiments, the resource management module 801 is further configured to: after the node management module 803 obtains multiple node pools, to count the remaining GPU resources of each GPU resource card included in each node in the multiple node pools; and, if the resource request information includes the GPU resource request amount, to determine the target node based on the GPU resource request amount and the remaining GPU resources of each GPU resource card included in each node in the node pool, wherein the resource configuration information includes the target node.
[0116] The task scheduling system in this embodiment can improve the resource utilization of the target cluster system and also improve the task isolation capability of the target cluster system.
[0117] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0118] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0119] Figure 9 A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0120] like Figure 9 As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 902 or a computer program loaded from storage unit 908 into random access memory (RAM) 903. RAM 903 may also store various programs and data required for the operation of device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.
[0121] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0122] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as task scheduling methods. For example, in some embodiments, the task scheduling method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the task scheduling method described above may be performed. Alternatively, in other embodiments, computing unit 901 may be configured to perform a task scheduling method by any other suitable means (e.g., by means of firmware).
[0123] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0125] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM), flash memory, optical fiber, compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0126] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0127] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0128] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0129] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0130] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A task scheduling method, comprising: Obtain the initial container set Pod request, which includes resource request information, including the node pool identifier; The target node pool is determined based on the node pool identifier; Obtain the schedulable nodes and schedulable resource information of the schedulable nodes in the target node pool; Based on the schedulable resource information, a target node is determined from the schedulable nodes, wherein: if the resource request information includes GPU resource request quantity, a first type of node with GPU resources is determined from the schedulable nodes, a first candidate node satisfying the GPU resource request quantity is determined from the first type of node, and the node with the highest GPU resource usage among the first candidate nodes is determined as the target node; or, if the resource request information includes CPU resource request quantity but does not include GPU resource request quantity, a second type of node without GPU resources is determined from the schedulable nodes, a second candidate node satisfying the CPU resource request quantity is determined from the second type of node, and the node with the highest CPU resource usage among the second candidate nodes is determined as the target node; Modify the Pod request to restrict the nodes allowed to run the Pod request to include the target node, and generate the target Pod request; Send the target Pod request, which is used to instruct the target cluster system to schedule tasks according to the target node.
2. The method according to claim 1, wherein, The GPU resource request amount is a quantized value less than 1, indicating the virtualization segmentation and use of the GPU resource card.
3. The method according to claim 1, further comprising: Receive node partitioning requests; Based on the node partitioning request, the nodes of the target cluster system are partitioned to obtain multiple node pools, each of which has a corresponding node pool identifier.
4. The method according to claim 3, further comprising: If the number of nodes in any of the multiple node pools changes, a prompt message will be output.
5. The method according to claim 3, wherein, After obtaining multiple node pools, it also includes: The remaining GPU resources of each GPU resource card included in each node in the multiple node pools are statistically analyzed. The step of determining the target node from the schedulable nodes based on the schedulable resource information includes: If the resource request information includes the amount of GPU resources requested, the target node is determined based on the amount of GPU resources requested and the remaining GPU resources of each GPU resource card included in each node in the node pool.
6. A task scheduling device, comprising: The acquisition module is used to acquire the initial container set Pod request, which includes resource request information, including the node pool identifier. The first determining module is used to determine resource configuration information based on the resource application information, determine a target node pool based on the node pool identifier, and obtain schedulable nodes and schedulable resource information of the schedulable nodes in the target node pool. Based on the schedulable resource information, a target node is determined from the schedulable nodes, wherein: if the resource request information includes GPU resource request quantity, a first type of node with GPU resources is determined from the schedulable nodes, a first candidate node satisfying the GPU resource request quantity is determined from the first type of node, and the node with the highest GPU resource usage among the first candidate nodes is determined as the target node; or, if the resource request information includes CPU resource request quantity but does not include GPU resource request quantity, a second type of node without GPU resources is determined from the schedulable nodes, a second candidate node satisfying the CPU resource request quantity is determined from the second type of node, and the node with the highest CPU resource usage among the second candidate nodes is determined as the target node; The second determining module is used to modify the Pod request to restrict the nodes allowed to run the Pod request to include the target node, and to generate the target Pod request; The sending module is used to send the target Pod request, which is used to instruct the target cluster system to perform task scheduling according to the target node.
7. The apparatus according to claim 6, wherein, The GPU resource request amount is a quantized value less than 1, indicating the virtualization segmentation and use of the GPU resource card.
8. The apparatus according to claim 6, further comprising: The receiving module is used to receive node partitioning requests; The node partitioning module is used to partition the nodes of the target cluster system based on the node partitioning request to obtain multiple node pools, each of which has a corresponding node pool identifier.
9. The apparatus according to claim 8, wherein, The node partitioning module is also used for: If the number of nodes in any of the multiple node pools changes, a prompt message will be output.
10. The apparatus according to claim 8, further comprising: The resource statistics module is used to count the remaining GPU resources of each GPU resource card included in each node of the multiple node pools; The first determining module is further configured to: determine the target node based on the GPU resource request amount and the remaining GPU resources of each GPU resource card included in each node in the node pool, when the resource request information includes the GPU resource request amount.
11. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-5.
13. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-5.
Citation Information
Patent Citations
Multi-resource scheduling method and device
CN110166507A
Cluster resource scheduling method and device, equipment and storage medium
CN112860383A