Resource management method, electronic device, and storage medium

By introducing an intermediate proxy component into the Kubernetes cluster, the resource names of computing devices from different manufacturers and models in the heterogeneous cluster are unified into a single name, which solves the problem of difficult resource management and enables unified scheduling and management of resources.

CN121037187BActive Publication Date: 2026-02-27SHANGHAI BIREN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511553977.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-02-27
Estimated Expiration
2045-10-29

AI Technical Summary

Technical Problem

In Kubernetes clusters, the inconsistent names of computing device resources from different vendors and product models make resource management difficult and make it impossible to uniformly schedule and manage computing resources in heterogeneous clusters.

Method used

An intermediate proxy component is added to the node. This component converts the vendor-defined first resource name reported by the device plugin into a unified second name and reports it to the cluster end, thereby unifying the resource names of computing devices from different manufacturers and models.

Benefits of technology

It reduces the difficulty of resource management in heterogeneous clusters, enabling the cluster to uniformly manage and schedule computing resources, thereby improving the efficiency and reliability of resource management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121037187B_ABST
    Figure CN121037187B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and provides a resource management method, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring first resource information reported by a device plug-in of a node, the first resource information comprising a first name of a computing device of the node, and the computing devices of different device information corresponding to different first names; converting the first name in the first resource information into a second name to obtain second resource information, the computing devices of different device information corresponding to the same second name; and reporting the second resource information to a cluster end through a node agent component of the node. According to the method, the electronic device and the storage medium provided by the application, an intermediate agent component is additionally arranged on the node, the first name in the first resource information reported by the device plug-in is converted into the second name through the intermediate agent component, thereby realizing the unification of the resource names of the computing devices under different manufacturers and different models, and greatly reducing the resource management difficulty under a heterogeneous cluster.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a resource management method, an electronic device and a storage medium. BACKGROUND

[0002] In a large-scale cluster environment, thousands or even tens of thousands of computing devices are often deployed. These thousands of computing devices may come from different manufacturers or belong to different product models.

[0003] To realize dynamic allocation and management of computing devices, in a K8S (Kubernetes) cluster, a device plugin can be used to report the manufacturer and quantity of computing devices. However, the resource names of computing devices reported by device plugins of different manufacturers are all defined by the manufacturers, and the resource names corresponding to different manufacturers or different product models are all different. The K8S cluster regards different resource names as different types of computing resources, which makes it difficult to manage resources in a heterogeneous cluster in which computing devices of different manufacturers or different product models are deployed. SUMMARY

[0004] The present application provides a resource management method, an electronic device and a storage medium to solve the defect of difficult resource management in a heterogeneous cluster in the related art.

[0005] The present application provides a resource management method, which is applied to an intermediate agent component of a node, and the method comprises:

[0006] Obtaining first resource information reported by a device plugin of the node, wherein the first resource information comprises a first name of a computing device of the node, and computing devices of different device information correspond to different first names;

[0007] Converting the first name in the first resource information into a second name to obtain second resource information, wherein computing devices of different device information correspond to the same second name;

[0008] Reporting the second resource information to a cluster end through a node agent component of the node.

[0009] According to the resource management method provided by the present application, the first resource information reported by the device plugin of the node is obtained, and the obtaining comprises at least one of the following:

[0010] Based on a simulated device plugin registration interface, obtaining first resource registration information reported by the device plugin of the node, wherein the configuration address of the device plugin registration interface in the device plugin is the address of the simulated device plugin registration interface;

[0011] Based on the simulated Pod resource interface, first resource allocation information reported by a device plugin of the node is obtained, and a configuration address of the Pod resource interface in the device plugin is the address of the simulated Pod resource interface.

[0012] According to the resource management method provided by the application, the address of the simulated device plugin registration interface is the same as the address of the simulated Pod resource interface.

[0013] According to the resource management method provided by the application, the method further comprises:

[0014] A second resource allocation request sent by the node agent component is obtained, and the second resource allocation request comprises a second name of a requested computing device.

[0015] The second name in the second resource allocation request is converted into a first name to obtain a first resource allocation request.

[0016] The first resource allocation request is sent to the device plugin.

[0017] According to the resource management method provided by the application, the second resource allocation request sent by the node agent component is obtained, and the method comprises:

[0018] Based on a simulated device plugin interface, a second resource allocation request sent by the node agent component is obtained, and a configuration address of the device plugin interface in the node agent component is the address of the simulated device plugin interface.

[0019] According to the resource management method provided by the application, the method further comprises:

[0020] Based on the device information of the node, a general device model of the node is determined, and the node label of the node is updated to the general device model based on the cluster end.

[0021] The application further provides a resource management method, and the method is applied to a user end, and the method comprises:

[0022] A Pod creation request is obtained, and the Pod creation request comprises a second name of a computing device allocated for a created Pod.

[0023] The Pod creation request is sent to a cluster end.

[0024] The second name is obtained by converting a first name in first resource information reported by a device plugin by a node intermediate agent component, different computing devices with different device information correspond to different first names, and different computing devices with different device information correspond to the same second name.

[0025] According to the resource management method provided by the application, the Pod creation request further comprises a node label of a node allocated to the created Pod, and the node label is a general device model of the node determined by the intermediate agent component based on device information of the node.

[0026] The application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the resource management method according to any one of the above when executing the program.

[0027] The application further provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the resource management method according to any one of the above.

[0028] The application further provides a computer program product, which comprises a computer program, and the computer program is executable on a processor to implement the resource management method according to any one of the above.

[0029] The resource management method, the electronic device and the storage medium provided by the application greatly reduce the difficulty of resource management in a heterogeneous cluster by adding an intermediate agent component on a node, and converting a first name in the first resource information reported by a device plug-in into a second name by the intermediate agent component, thereby realizing the unification of resource names of computing devices of different manufacturers and different models. BRIEF DESCRIPTION OF DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the application or the related art, the following will briefly introduce the drawings needed to be used in the embodiments or the related art description. Obviously, the drawings in the following description are some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.

[0031] Figure 1 is a process schematic diagram of resource management based on a K8S cluster in the related art.

[0032] Figure 2 is one of the process schematic diagrams of the resource management method provided by the application.

[0033] Figure 3 is another process schematic diagram of the resource management method provided by the application.

[0034] Figure 4 is a third process schematic diagram of the resource management method provided by the application.

[0035] Figure 5 is one of the structural schematic diagrams of the resource management device provided by the application.

[0036] Figure 6 FIG. 2 is a structural schematic diagram of a resource management device provided by the present application.

[0037] Figure 7 FIG. 3 is a structural schematic diagram of an electronic device provided by the present application. DETAILED DESCRIPTION

[0038] In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0039] In a large-scale cluster environment, thousands or even tens of thousands of computing devices are often deployed. These thousands of computing devices may come from different manufacturers or belong to different product models under the same manufacturer.

[0040] Here, the computing device can be specifically an artificial intelligence chip, for example, can be any one or more of a GPU (Graphics Processing Unit), a TPU (Tensor Processing Unit), a NPU (Neural network Processing Unit), a DPU (Deep learning Processing Unit), an APU (Accelerated Processing Unit), and a GPGPU (General-Purpose computing on Graphics Processing Unit), and the present application does not make specific limitations thereon.

[0041] A K8S cluster is an open-source cloud server management platform. Taking a GPU as an example, in order to realize dynamic allocation and management of GPU resources, in the K8S cluster, the manufacturer and quantity of the GPU can be reported through a device plug-in, so as to realize registration and management of GPU resources.

[0042] For example, Figure 1 FIG. 1 is a flow schematic diagram of resource management based on a K8S cluster in the related art. As shown in FIG. 1, in the related art, in order to realize registration and management of GPU resources, the GPU manufacturer and quantity are reported through a device plug-in, and then the GPU resources are registered and managed. Figure 1As shown, at node 1 and node 2, two vendors, vendor A and vendor B, are respectively deployed with GPUs, wherein the GPUs belonging to vendor A include GPU1-GPU4, and the GPUs belonging to vendor B include GPU5-GPU8. For the GPUs belonging to vendor A, vendor A provides a device plugin for the K8S cluster; in addition, for the GPUs belonging to vendor B, vendor B also provides a device plugin for the K8S cluster, so that the device plugin of vendor A is installed at node 1 and the device plugin of vendor B is installed at node 2, so that the K8S cluster can recognize the GPUs belonging to vendor A and vendor B.

[0043] In the process of resource management, the following five steps can be divided:

[0044] Step 1: The device plugin of each vendor reports the number of GPUs belonging to the vendor to the node agent component (also known as Kubelet) at the node. For example, at node 1, the device plugin of vendor A reports the information A.com / GPU:4, and at node 2, the device plugin of vendor B reports the information B.com / GPU:4.

[0045] Step 2: The node agent component of each node reports the number of GPUs of each vendor to the API (Application Programming Interface, application programming interface) server (also known as API Server).

[0046] Step 3: The API server receives the Pod creation request sent by the user end, wherein the Pod creation request can carry the required resources, for example, two GPUs of vendor B, which can be identified as B.com / GPU:2. Here, the Pod is the smallest deployment unit in the K8S cluster, which can represent a container or a combination of multiple containers.

[0047] Step 4: The K8S scheduler (also known as K8S Scheduler) listens to the Pod creation, and can schedule the Pod to node 2 according to the resources required by the Pod creation.

[0048] Step 5: The node agent component of node 2 interacts with the device plugin of vendor B required by the Pod creation, and allocates two GPUs from the GPUs of vendor B to the Pod.

[0049] In the foregoing scheme, for the case that multiple vendors' GPUs exist in the K8S cluster, device plugins of each vendor need to be installed to facilitate the implementation of corresponding GPU recognition. Moreover, the resource names of the GPUs reported by the device plugins of different vendors are defined by the vendors themselves, and the resource names corresponding to different vendors or different product models can be different, for example, the resource name defined by vendor A is A.com / GPU, and the resource name defined by vendor B is B.com / GPU.

[0050] Corresponding to the K8S cluster, due to the different resource names, the K8S cluster regards the GPUs of different vendors as different types of computing resources. For the case that a large number of GPUs from different vendors or belonging to different product models are deployed under the K8S cluster environment, that is, the case that a large number of heterogeneous GPUs are deployed in the K8S cluster, these heterogeneous GPUs are regarded as different types of computing resources at the K8S cluster, and it is impossible to apply for and schedule resources in a unified resource type, for example, it is impossible to uniformly regard the heterogeneous GPUs as GPUs for resource application and scheduling, and instead, the GPUs under different resource names need to be regarded as different types of resources for separate management, which obviously greatly increases the difficulty of resource management of the K8S cluster.

[0051] To solve the foregoing problem, an embodiment of the present application provides a resource management method. Figure 2 is one of flowcharts of the resource management method provided by the present application, as shown in Figure 2 The method is applied to a node of a heterogeneous cluster, and is specifically applied to an intermediate agent component of the node. The heterogeneous cluster here refers to a computing cluster composed of computing devices from different vendors or belonging to different product models of the same vendor.

[0052] At each node of the heterogeneous cluster, a computing device can be deployed, and a device plugin of the same vendor as the computing device can be deployed, and a node agent component (also referred to as Kubelet) for communication with the cluster end can be deployed. In the related art, the device plugin can directly communicate with the node agent component, so as to report the computing device deployed at the node to the cluster end through the node agent component. The cluster end here, that is, the resource management end of the heterogeneous cluster, for example, can be a K8S cluster, and specifically can include an API server, a scheduler and the like in the K8S cluster, which are not limited by the present application.

[0053] Different from the related art, the present embodiment increases an intermediate agent component between the device plugin and the node agent component. The intermediate agent component can be regarded as a component for information relay between the device plugin and the node agent component, that is, the information originally sent by the device plugin to the node agent component and the information sent by the node agent component to the device plugin are both relayed through the intermediate agent component.

[0054] The resource management method comprises the following steps:

[0055] In step 210, first resource information reported by a device plug-in of the node is acquired, wherein the first resource information comprises a first name of a computing device of the node, and different computing devices correspond to different first names.

[0056] Specifically, in the heterogeneous cluster, the node is a physical server in the heterogeneous cluster, and the node carries a computing device required for running the heterogeneous cluster. One or more computing devices can be deployed on each node, and the computing device is regarded as a computing resource in the heterogeneous cluster.

[0057] In the embodiment of the present application, for any node, the computing devices deployed at the node can come from the same manufacturer or belong to the same product model under the same manufacturer, and for different nodes, the computing devices respectively deployed at the different nodes can come from different manufacturers or belong to different product models under the same manufacturer.

[0058] As a newly added component at each node in the heterogeneous cluster, the intermediate agent component is connected with the device plug-in and the node agent component, thereby undertaking the task of communication conversion between the device plug-in and the node agent component.

[0059] On any node, the device plug-in can report the first resource information to the intermediate agent component based on the connection between the device plug-in and the intermediate agent component. Here, the first resource information can be information for registering the computing device, and the first resource information can contain the resource name and quantity of the computing device; for example, the first resource information can be information for reporting the resource allocation of the computing device, and the first resource information can contain the resource name of the computing device, whether the computing device is occupied by a Pod, and the Pod occupying the computing device, etc.

[0060] In the embodiment of the present application, the resource name of the computing device in the first resource information is recorded as a first name. In accordance with the related art, the device plug-in of different manufacturers can define the resource name of the computing device to be reported by themselves, that is, the device plug-in of different manufacturers can define the first name of the computing device to be reported by themselves. Therefore, the computing devices with different device information can correspond to different first names. The device information here can include information identifying the computing device, which can be the device ID (Identity document) of the computing device, the device model, etc. Alternatively, the device information can include the manufacturer information of the computing device, for example, the device ID of the computing device. In a specific implementation, one manufacturer can define one first name for one model of computing device, that is, the first names of different models of computing devices can be different; one manufacturer can also define one first name for the computing devices produced by itself, that is, the first names of computing devices of different manufacturers can be different.

[0061] In this case, on any node, the intermediate agent component can receive the first resource information reported by the device plug-in, and the first resource information contains the first name. Comparing different nodes deploying computing devices of different manufacturers or deploying computing devices of different models, the first names in the first resource information received by different intermediate agent components on different nodes can be different. For example, at node 1 and node 2, there are two manufacturers of GPU, manufacturer A and manufacturer B, respectively, the first name in the first resource information received by the intermediate agent component at node 1 is defined by manufacturer A, specifically A.com / GPU, and the first name in the first resource information received by the intermediate agent component at node 2 is defined by manufacturer B, specifically B.com / GPU.

[0062] In step 220, the first name in the first resource information is converted into a second name to obtain second resource information, and the computing devices with different device information correspond to the same second name.

[0063] Specifically, the device plug-in of each manufacturer can define the first name of the computing device, which makes the first names of computing devices of different manufacturers and even different models possibly different. If the first name is directly reported to the cluster end, the computing devices corresponding to different first names will be regarded as different types of computing devices at the cluster end, resulting in that resource application and scheduling cannot be uniformly performed. In view of this situation, at any node, after the intermediate agent component receives the first resource information, the first name contained in the first resource information can be converted into a second name, and the first resource information converted into the second name is taken as second resource information.

[0064] Here, the second name is a pre-agreed uniform name for computing devices produced by each manufacturer or of various models. That is, the resource name of the computing device can be unified as the second name regardless of the manufacturer of the computing device or the model of the computing device. The second resource information obtained in this way has the same function as the first resource information, except that the resource name in the second resource information is no longer the first name defined by the manufacturer, but a second name that is uniform regardless of the manufacturer and the model. That is, the second name in the second resource information at different intermediate agent components is the same on different nodes of computing devices of different manufacturers or on different nodes of computing devices of different models.

[0065] For example, the first name in the first resource information received by the intermediate agent component at node 1 is A.com / GPU, and the second name in the second resource information after name conversion can be examp.com / fakedevice; the first name in the first resource information received by the intermediate agent component at node 2 is B.com / GPU, and the second name in the second resource information after name conversion is also examp.com / fakedevice.

[0066] Step 230, reporting the second resource information to the cluster end through the node agent component of the node.

[0067] Specifically, at any node, the intermediate agent component can report the second resource information obtained after conversion to the node agent component. The node agent component can report the second resource information to the cluster end, so that the cluster end can manage the resources of the computing device on the node based on the second resource information.

[0068] It can be understood that at each node, the intermediate agent component reports the second resource information to the cluster end through the node agent component. Therefore, the second resource information of each node obtained by the cluster end has a uniform second name for the resource name of the computing device. The uniform second name allows the cluster end to regard the computing devices reported by different nodes as the same type of resource, so that resource application and scheduling can be performed according to a uniform resource type, thereby greatly reducing the difficulty of resource management.

[0069] In the resource management method provided in the embodiment of the application, by adding an intermediate agent component on the node, the intermediate agent component converts the first name in the first resource information reported by the device plug-in to a second name, thereby realizing the unification of the resource names of computing devices of different manufacturers and different models, and greatly reducing the difficulty of resource management in a heterogeneous cluster.

[0070] Based on the above embodiment, in step 210, the first resource information reported by the device plugin of the node is obtained, including:

[0071] Based on the simulation device plugin registration interface, the first resource registration information reported by the device plugin of the node is obtained, and the configuration address of the device plugin registration interface in the device plugin is the address of the simulation device plugin registration interface.

[0072] Specifically, the device plugin registration interface exists in the node agent component. In the related art, the device plugin can report the resource registration information through the device plugin registration interface of the node agent component, thereby realizing the resource registration of the computing device at the node.

[0073] In the embodiment of the application, in order to convert the vendor-defined resource name in the resource registration information into a unified resource name before resource registration, a simulation device plugin registration interface needs to be set at the intermediate agent component. It can be understood that the simulation device plugin registration interface is an interface set for simulating the device plugin registration interface at the node agent component.

[0074] The address of the device plugin registration interface exists in the device plugin, so that the device plugin can transmit the resource registration information to the device plugin registration interface.

[0075] In order to enable the device plugin to transmit the resource registration information originally transmitted to the device plugin registration interface at the node agent component to the simulation device plugin registration interface of the intermediate agent component, the address of the device plugin registration interface in the device plugin can be configured, and specifically, the address of the device plugin registration interface in the device plugin is modified to the address of the simulation device plugin registration interface. Here, the address field reserved for the device plugin registration interface in the device plugin is denoted as a configuration address, and in the embodiment of the application, the configuration address can be modified, so that the configuration address is set as the address of the simulation device plugin registration interface, and thus the device plugin transmits the resource registration information to the simulation device plugin registration interface.

[0076] Correspondingly, the intermediate agent component can obtain the resource registration information reported by the device plugin based on the simulation device plugin registration interface. Since the resource name in the resource registration information directly reported by the device plugin is a first name, the resource registration information is denoted as first resource registration information here. The first resource registration information can include a first name of a computing device, and can also include the number of computing devices, for example, A.com / GPU:4, indicating that there are four computing devices with the resource name A.com / GPU on the node.

[0077] On this basis, the intermediate agent component can convert the first name in the first resource registration information into a second name, thereby obtaining second resource registration information, and then report the second resource registration information to the node agent component through the device plugin registration interface of the node agent component, and the node agent component performs resource registration based on the second resource registration information.

[0078] For example, the grpc sock interface of the node agent component can be regarded as the device plugin registration interface of the node agent component, and the grpc sock interface address of the node agent component can be / var / lib / kubelet / device-plugins / kubelet.sock. In the related art, when the device plugin is started, it will create its own grpc sock in the same directory as the grpc sock interface of the node agent component, for example, the naming of the grpc sock created by the device plugin can be A_gpu, and the naming is self-defined, and the path is / var / lib / kubelet / device-plugins / A_gpu.sock; then the device plugin can send a device registration request to the node agent component through the grpc sock interface address of the node agent component / var / lib / kubelet / device-plugins / kubelet.sock, and the Endpoint field exists in the device registration request, which is the naming of the grpc sock created by the device plugin, and thereafter the node agent component can find the sock of the device plugin through the field for subsequent calling.

[0079] In order to realize the simulation of the device plugin registration interface, the grpc sock interface address of the node agent component configured at the device plugin / var / lib / kubelet / device-plugins / kubelet.sock can be modified to the address of the simulated device plugin registration interface of the intermediate agent component, so that the intermediate agent component can obtain the first resource registration information reported by the device plugin, and after converting the first name in the first resource registration information into a second name to obtain second resource registration information, report the second resource registration information to the node agent component based on the grpc sock interface address of the node agent component / var / lib / kubelet / device-plugins / kubelet.sock.

[0080] In the method provided in the embodiment of the application, only the configuration address at the device plugin needs to be modified, so as to realize the communication between the device plugin and the intermediate agent component, so that the intermediate agent component can quickly adapt to device plugins and computing devices of various manufacturers, thereby reducing the implementation difficulty of the resource management method.

[0081] Based on the above embodiment, in step 210, the first resource information reported by the device plugin of the node is obtained, including:

[0082] Based on the simulated Pod resource interface, the first resource allocation information reported by the device plugin of the node is obtained, and the configuration address of the Pod resource interface in the device plugin is the address of the simulated Pod resource interface.

[0083] Specifically, the Pod resource interface exists in the node agent component. In the related art, the device plugin can directly report the resource allocation information through the Pod resource interface of the node agent component, thereby realizing the reporting of the resource allocation information of the computing device at the node.

[0084] In the embodiment of the application, in order to convert the vendor-defined resource name in the resource allocation information into a unified resource name before the resource allocation information, it is necessary to set a simulated Pod resource interface at the intermediate agent component. It can be understood that the simulated Pod resource interface is an interface set for simulating the Pod resource interface at the node agent component.

[0085] The address of the Pod resource interface exists in the device plugin, so the device plugin can transmit the resource allocation information to the Pod resource interface.

[0086] In order to enable the device plugin to transmit the resource allocation information originally transmitted to the Pod resource interface at the node agent component to the simulated Pod resource interface of the intermediate agent component, the device plugin can be configured, specifically the address of the Pod resource interface in the device plugin is modified to the address of the simulated Pod resource interface. Here, the address field reserved for the Pod resource interface in the device plugin is recorded as a configuration address, and in the embodiment of the application, the configuration address can be modified, so as to set the configuration address as the address of the simulated Pod resource interface, thereby the device plugin transmits the resource allocation information to the simulated Pod resource interface.

[0087] Correspondingly, the intermediate agent component can obtain the resource allocation information reported by the device plugin based on the simulated Pod resource interface. Since the resource name in the resource allocation information directly reported by the device plugin is the first name, the resource allocation information is recorded as the first resource allocation information here. The first resource allocation information can include the first name of the computing device, and can also include whether the computing device is occupied by a Pod, and the Pod occupying the computing device, etc.

[0088] On this basis, the intermediate agent component can convert the first name in the first resource allocation information into a second name, thereby obtaining second resource allocation information, and then report the second allocation information to the node agent component through the Pod resource interface of the node agent component, and report the second resource allocation information to the cluster end by the node agent component.

[0089] For example, the pod resource interface of the node agent component, that is, the Pod resource interface of the node agent component, and the address of the pod resource interface of the node agent component can be / var / lib / kubelet / pod-resources / kubelet.sock. In order to realize the simulation of the Pod resource interface, the address of the Pod resource interface of the node agent component configured at the device plugin, / var / lib / kubelet / pod-resources / kubelet.sock, can be modified to the address of the simulated Pod resource interface of the intermediate agent component. Thus, the intermediate agent component can obtain the first resource allocation information reported by the device plugin, and after converting the first name in the first resource allocation information into a second name to obtain second resource allocation information, report the second resource allocation information to the node agent component based on the address of the Pod resource interface of the node agent component, / var / lib / kubelet / pod-resources / kubelet.sock.

[0090] In the method provided in the embodiments of the application, only the configuration address at the device plugin needs to be modified, so as to realize the communication between the device plugin and the intermediate agent component. Thus, the intermediate agent component can quickly adapt to device plugins and computing devices of various manufacturers, thereby reducing the implementation difficulty of the resource management method.

[0091] Based on the above embodiments, in step 210, the first resource information reported by the device plugin of the node is obtained, including:

[0092] Based on the simulated device plugin registration interface, the first resource registration information reported by the device plugin of the node is obtained, and the configuration address of the device plugin registration interface in the device plugin is the address of the simulated device plugin registration interface.

[0093] Based on the simulated Pod resource interface, the first resource allocation information reported by the device plugin of the node is obtained, and the configuration address of the Pod resource interface in the device plugin is the address of the simulated Pod resource interface.

[0094] Specifically, the specific implementation manner of obtaining the first resource registration information based on the simulation device plugin registration interface and the specific implementation manner of obtaining the first resource allocation information based on the simulation Pod resource interface have been described in the above embodiments, and will not be repeated here. The obtaining of the first resource allocation information based on the simulation Pod resource interface can be performed after the obtaining of the first resource registration information based on the simulation device plugin registration interface. That is, the communication between the device plugin and the intermediate agent component can be realized through the simulation device plugin registration interface and the simulation Pod resource interface, thereby realizing the obtaining of the reporting information of the device plugin, and realizing the conversion of the first name to the second name in the reporting information.

[0095] According to any of the above embodiments, the address of the simulation device plugin registration interface and the address of the simulation Pod resource interface are the same.

[0096] Specifically, when the address configuration is performed for the device plugin, the configuration address of the device plugin registration interface and the configuration address of the Pod resource interface in the device plugin can be configured as the same address, that is, the address of the simulation device plugin registration interface and the address of the simulation Pod resource interface can be the same. Setting the same address for the simulation device plugin registration interface and the simulation Pod resource interface makes the deployment of the intermediate agent component more simple and convenient, and can effectively improve the deployment efficiency of the intermediate agent component.

[0097] For example, when the device plugin is deployed, it is usually necessary to mount the directory of the node agent component of the node in the manifest yaml of the K8S cluster to the pod of the device plugin, so that the device plugin in the pod can access the socket under the directory. Therefore, when the intermediate agent component is deployed on the node, the interface address needs to be set in the configuration of the intermediate agent component, for example, / var / lib / device-plugin-shim is mounted to the pod of the shim, and the intermediate agent component creates a sock file in it to realize the simulation device plugin registration interface and the simulation Pod resource interface, so as to communicate with the outside world. Subsequently, the configuration address of the device plugin registration interface and the configuration address of the Pod resource interface mounted by the real device plugin before the modification, that is, / var / lib / kubelet / device-plugins and / var / lib / kubelet / pod-resources, are both modified to the newly created address / var / lib / device-plugin-shim. It can be understood that in this example, the simulation device plugin registration interface and the simulation Pod resource interface can be the same address.

[0098] In addition, the address of the simulation device plugin registration interface and the address of the simulation Pod resource interface can also be two different addresses.

[0099] Based on any of the above embodiments, the method further includes:

[0100] obtaining a second resource allocation request sent by the node agent component, the second resource allocation request including a second name of the requested computing device;

[0101] converting the second name in the second resource allocation request into the first name to obtain a first resource allocation request;

[0102] sending the first resource allocation request to the device plugin.

[0103] Specifically, in a resource management scenario, the user end can send a resource management request to the cluster end. Here, the user end is used to implement the interaction between the user and the heterogeneous cluster, and the user end can interact with the cluster end, for example, the user end can interact with the API server in the cluster end to realize functions such as querying the cluster state and managing the cluster resources, and then realize the utilization of the computing resources provided by the computing devices at each node through the cluster end.

[0104] The resource management request here can be a Pod creation request, that is, a request for creating a Pod and configuring computing devices for the created Pod. The resource management request often carries the requirements of the user for the computing devices expected to be configured for the created Pod, such as the number and manufacturer of the computing devices to be configured. Therefore, after receiving the resource management request, the cluster end can create a corresponding Pod based on the resource management request, and configure corresponding computing devices for the created Pod based on the requirements for the computing devices in the resource management request and the second resource information reported by each node.

[0105] In addition, the node agent component at the node can also listen to the above-mentioned resource management request. And in the case of determining that the resource management request is listened to, the node agent component can query the Pod corresponding to the resource management request, and thus can query the computing devices configured for the Pod. That is, the node agent component can determine the computing devices deployed at the node that need to be bound with the Pod created based on the resource management request by listening to the resource management request.

[0106] In the related art, after listening to the resource management request, the node agent component can send a resource allocation request to the device plugin to request the device plugin to allocate computing devices to meet the needs of the resource management request.

[0107] Specifically in the embodiments of the present application, the cluster end is configured with the computing device for the Pod based on the second resource information reported by each node, and the resource name of the computing device in the second resource information reported by each node is a unified second name. This makes the resource name of the computing device contained in the resource allocation request sent by the node agent component also a unified second name. For ease of description, in the embodiments of the present application, the resource allocation request sent by the node agent component is recorded as a second resource allocation request.

[0108] Since the device plug-in customizes the resource name of the computing device as a first name, if the second resource allocation request carrying the second name is directly sent to the device plug-in, the device plug-in cannot allocate the computing device based on the second resource allocation request. Therefore, the intermediate agent component can receive the second resource allocation request sent by the node agent component. In this case, the second name in the second resource allocation request can be converted into the first name, and the resource allocation request obtained by completing the conversion of the first name is recorded as a first resource allocation request. Subsequently, the intermediate agent component can send the first resource allocation request to the device plug-in, so that the device plug-in can allocate the computing device to the Pod based on the first resource allocation request.

[0109] In the method provided in the embodiments of the present application, the second name in the second resource allocation request issued by the node agent component is converted into the first name by the intermediate agent component, so that the resource management under the unified resource type at the cluster end can be implemented at each node, thereby ensuring the reliability of the resource management.

[0110] Based on any of the above embodiments, the second resource allocation request sent by the node agent component is obtained, including:

[0111] Based on the simulated device plug-in interface, the second resource allocation request sent by the node agent component is obtained, and the configuration address of the device plug-in interface in the node agent component is the address of the simulated device plug-in interface.

[0112] Specifically, the device plug-in interface exists in the device plug-in. In the related art, the node agent component can send the resource allocation request to the device plug-in through the device plug-in interface, thereby realizing the resource allocation of the computing device at the node.

[0113] In the embodiments of the present application, in order to convert the second name in the second resource allocation request into the first name customized by the device plug-in, a simulated device plug-in interface needs to be set at the intermediate agent component. It can be understood that the simulated device plug-in interface is an interface set for the device plug-in interface at the device plug-in.

[0114] The address of the device plugin interface exists in the node agent component, so that the node agent component can transmit the resource allocation request to the device plugin interface.

[0115] In order to enable the node agent component to transmit the resource allocation request originally transmitted to the device plugin interface at the device plugin to the simulated device plugin interface of the intermediate agent component, the address of the device plugin interface in the node agent component can be configured, specifically, the address of the device plugin interface in the node agent component is modified to the address of the simulated device plugin interface. Here, the address field reserved in the node agent component for the device plugin interface is denoted as a configuration address, and in the embodiment of the application, the configuration address can be modified, so as to set the configuration address as the address of the simulated device plugin interface, so that the node agent component transmits the resource allocation request to the simulated device plugin interface.

[0116] Correspondingly, the intermediate agent component can obtain the second resource allocation request sent by the node agent component based on the simulated device plugin interface. Then the intermediate agent component can convert the second name in the second resource allocation request into the first name, thereby obtaining the first resource allocation request, and send the first resource allocation request to the device plugin, so that the device plugin can allocate the computing device to the Pod based on the first resource allocation request.

[0117] For example, the device plugin interface can be an Endpoint.sock interface. The intermediate agent component can establish a connection with the node agent component through a grpc sock as a legitimate device plugin, and when registering, the intermediate agent component can write the name of the grpc sock created by itself into the Endpoint field, thereby realizing the communication between the node agent component and the intermediate agent component.

[0118] In the method provided in the embodiment of the application, only the configuration address at the node agent component needs to be modified, so as to realize the communication between the node agent component and the intermediate agent component, so that the intermediate agent component can quickly adapt to device plugins and computing devices of various manufacturers, thereby reducing the implementation difficulty of the resource management method.

[0119] Based on any of the above embodiments, the method further comprises:

[0120] Determine the general device model of the node based on the device information of the node, and call the node resource interface of the cluster end to update the node label of the node to the general device model.

[0121] Specifically, the intermediate agent component can determine the general device model of the node based on the device information of the node. Here, the general device model is a general device model of all computing devices of the node as a whole, and can be a device model commonly used for display to the user or a device model commonly used by the user. The general device model can be the device model in the device information itself, or can be obtained by converting the device model in the device information, and the present embodiment is not limited in this regard.

[0122] It can be understood that the general device model of the node can intuitively and easily display the device model of the computing device of the node to the user, and the user can intuitively know the device model of the computing device on the node through the general device model.

[0123] After determining the general device model of the node, the intermediate agent component can update the node label of the node to the general device model based on the cluster end, so as to set the general device model as the node label of the node. Here, updating the node label of the node to the general device model based on the cluster end can be updating a field representing the node label of the node in the database of the cluster end to the general device model by calling the API server of the cluster end.

[0124] Thus, when the user inputs a Pod creation request through the user end, the user can directly know the general device model of the computing device of each node through the node label of each node of the cluster end, and then specify the node to which the Pod is assigned or the node corresponding to the node label assigned to the Pod, so that in cluster management, not only the number of required computing devices can be specified, but also the specific device model can be specified.

[0125] In the method provided by the present embodiment, the general device model is configured as the node label of the node, so that in resource management, the device information of the node can be reflected through the node label, thereby providing a condition for the user to specify the specific model when inputting the Pod creation request.

[0126] Based on any of the above embodiments, the method further includes:

[0127] scanning the PCI device of the node to obtain the device model of the PCI device;

[0128] determining the device information of the node based on the device model of the PCI device.

[0129] Specifically, the computing devices of various vendors need to be connected with the node through a PCI (Peripheral Component Interconnect) bus, where the PCI device refers to the computing device connected through the PCI bus. Thus, the intermediate agent component can obtain all the computing devices deployed at the node by scanning the PCI devices at the node.

[0130] By scanning the PCI device, the device model of the PCI device can be obtained, which can include, for example, a Vendor ID (vendor identifier) and a Device ID (device identifier) of the PCI device. It can be understood that in the device model of the PCI device, the Vendor ID can reflect the vendor of the computing device, and the Device ID can reflect the model of the computing device. For example, the device model is [10de:2503], where 10de is the Vendor ID representing a vendor, and 2503 is the device number under the vendor; 1ee0 in [1ee0:0003] represents another vendor, and 0003 represents the device number under the vendor. Thus, after obtaining the device model of the PCI device, the vendor and the model of the computing device corresponding to the PCI device can be determined based on the device information of the PCI device.

[0131] In the method provided in the embodiments of the present application, the device information of the computing devices of various vendors deployed at the node is uniformly obtained by scanning the PCI devices at the node, which greatly improves the convenience of resource management.

[0132] Based on any of the above embodiments, the device information of the computing device corresponding to the PCI device is determined based on the device model of the PCI device, including:

[0133] The device model of the computing device corresponding to the PCI device is determined based on the device model of the PCI device.

[0134] The general device model corresponding to the device model of the computing device is determined based on the correspondence between the general device model and the subdivided device model, and the device information is determined based on the general device model.

[0135] Specifically, in the device model of the PCI device, the Device ID corresponds to the device model of the computing device. For example, in the case of the device model of the PCI device being [10de:2503], 2503 is the Device ID, and the device model of the corresponding computing device can be determined based on 2503; in the case of the device model of the PCI device being [1ee0:0003], 0003 is the Device ID, and the device model of the corresponding computing device can be determined based on 0003. Thus, after obtaining the device model of the PCI device, the device model of the corresponding computing device can be obtained.

[0136] In actual applications, a manufacturer can have multiple models of computing devices in the same series, and the models of these computing devices are different and have slight differences in performance parameters, but they are all considered as a type of computing device for resource allocation and management.

[0137] In order to facilitate the unified management of similar computing devices, a correspondence between a general device model and a subdivided device model can be constructed in advance. The general device model is a device model that is commonly used to display to users or that is used by users, such as a series number or a shortened model number of a type of computing device. The subdivided device model is a detailed and unshortened device model of a computing device.

[0138] It can be understood that the device model of the computing device obtained based on the device model of the PCI device is usually a subdivided device model, and thus the device model of the computing device can be mapped to a corresponding general device model based on the correspondence between the general device model and the subdivided device model, and the device information of the computing device can be determined based on the general device model. Thus, for the cluster side, the intermediate agent component can update the field of the node tag of the node in the database of the cluster side to the general device model, that is, the general device model can be used as the node tag, so that the user can more conveniently specify the model of the computing device for the Pod.

[0139] Figure 3 is a flowchart of the resource management method provided by the application. As shown in Figure 3 the method is applied to a user side, and the user side is used to realize the interaction between a user and a heterogeneous cluster. The user side can interact with a cluster side. The method comprises the following steps:

[0140] In step 310, a Pod creation request is obtained, and the Pod creation request comprises a second name of an allocated computing device for a created Pod.

[0141] In step 320, the Pod creation request is sent to the cluster side.

[0142] The second name is a first name in the first resource information reported by the device plug-in and converted by the intermediate agent component at the node.

[0143] Specifically, the user can input a Pod creation request through the user end. Here, the Pod creation request is a request for creating a Pod and configuring computing devices for the created Pod. The Pod creation request often carries the requirements of the user for the computing devices configured for the created Pod, such as the number and manufacturer of the required computing devices, and the type of the required computing devices. In the related art, different manufacturers in a heterogeneous cluster each define a first name of the computing devices produced by the manufacturer, and the cluster end regards the computing devices with different first names as different types of computing devices. Therefore, the user must be familiar with the first names of the computing devices of each manufacturer when inputting the Pod creation request, so as to accurately write the correct type of computing device in the Pod creation request, and thus ensure that the created Pod can be configured to the computing devices of a certain manufacturer.

[0144] In the embodiment of the application, the intermediate agent component is arranged at each node, which can convert the first name in the first resource information reported by the device plug-in into a second name, and report the second resource information after the conversion of the second name to the cluster end through the node agent component. Therefore, the second resource information of each node obtained by the cluster end has a unified second name for the resource name of the computing device. The unified second name enables the cluster end to regard the computing devices reported by different nodes as the same type of resource, so as to perform resource application and scheduling according to a unified resource type.

[0145] Therefore, when the user inputs the Pod creation request through the user end, the user does not need to think about the first names of the computing devices defined by different manufacturers, but only needs to take the uniformly defined second name as the only type of computing device required for the created Pod, so as to ignore the differences between the computing devices of different manufacturers or different models on different nodes, and regard all the computing devices in the heterogeneous cluster as a type of execution call. That is, in the Pod creation request, it is not necessary to input the individualized first name of any computing device, but only to input the universal and unified second name of all computing devices, so as to trigger the Pod creation and resource allocation.

[0146] After the user end obtains the Pod creation request, the user end only needs to send the Pod creation request to the cluster end, so as to trigger the Pod creation and resource allocation operation of the cluster end based on the Pod creation request, and thus realize the resource management for the heterogeneous cluster.

[0147] In the method provided in the embodiments of the present application, by adding an intermediate agent component on the node, the first name in the first resource information reported by the device plug-in is converted into a second name by the intermediate agent component, thereby realizing the unification of the resource names of the computing devices under different manufacturers and different models, and the second name only needs to be carried in the Pod creation request, without the need to separately distinguish different first names of different computing devices, thereby greatly reducing the difficulty of resource management under a heterogeneous cluster and optimizing the user experience.

[0148] Based on any of the above embodiments, the Pod creation request further includes a node label of a node for creating a Pod, and the node label is a general device model of the node determined by the intermediate agent component based on the device information of the node.

[0149] Specifically, the intermediate agent component can determine the general device model of the node based on the device information of the node. Here, the general device model is a general device model of all computing devices of the node as a whole, and can be a device model commonly used to display to a user or a device model usually used by the user. The general device model can be the device model in the device information itself, or can be obtained by converting the device model in the device information, and the embodiments of the present application do not make a specific limitation.

[0150] It can be understood that the general device model of the node can intuitively and easily display the device model of the computing device of the node to the user, and the user can intuitively know the device model of the computing device of the node through the general device model.

[0151] After the intermediate agent component determines the general device model of the node, the node label of the node can be updated to the general device model based on the cluster end, thereby setting the general device model as the node label of the node. Here, updating the node label of the node to the general device model based on the cluster end can specifically be updating a field representing the node label of the node in the database of the cluster end to the general device model by calling the API server of the cluster end.

[0152] Therefore, when the user inputs the Pod creation request through the user end, the user can directly understand the device information of the computing device of each node through the node label of each node of the cluster end, and then specify the node allocated to the Pod or the node corresponding to the node label allocated to the Pod. Further, the user can write the node label of the node allocated to the Pod in the Pod creation request.

[0153] Correspondingly, after the cluster end obtains the Pod creation request, the computing device on the node corresponding to the node label carried in the Pod creation request can be allocated to the created Pod.

[0154] For example, a Pod creation request can be expressed as:

[0155] nodeSelector:

[0156] k8s.com / gpu:A888a

[0157] requests:

[0158] example.com / fakedevice:2

[0159] Wherein, the nodeSelector represents the requirement for node selection, the k8s.com / gpu:A888a is an example of node label, which represents that the node is deployed with the GPU of model 888a produced by manufacturer A; the requests represents the requirement for computing device selection, the example.com / fakedevice is a uniform second name, and the 2 represents that two computing devices are needed.

[0160] In the method provided by the embodiment of the application, the general device model is configured as the node label of the node, so that the device information of the node can be reflected through the node label in the resource management, and the condition for the user to specify the specific model when inputting the Pod creation request is provided.

[0161] Based on any of the above embodiments, Figure 4 is a third flowchart of the resource management method provided by the application, as shown in Figure 4 , it is assumed that there are two nodes, node 1 and node 2, 8 GPUs produced by manufacturer A are deployed on the node 1, and the GPU model is 888a; 8 GPUs produced by manufacturer B are deployed on the node 2, and the GPU model is Q999. Figure 4 The dashed line in the figure represents the interaction between the cluster side and the node, and the solid line represents the interaction inside the node.

[0162] Under this heterogeneous cluster, the resource management method comprises the following steps:

[0163] Step 1, the intermediate agent component of each node can obtain the device model of the PCI device by scanning the PCI device at the node, and determine the manufacturer, model and other device information of the computing device corresponding to the PCI device. On this basis, the intermediate agent component can unify the subdivided device models that are similar in the device information into a general device model based on a pre-configured configuration file. Here, the configuration file can store the correspondence between the general device model and the subdivided device model. The intermediate agent component of each node can configure the general device model at each node as the node tag of each node through the API server. Assuming that the device information of node 1 specifically includes the identification of manufacturer A, and the general device model 888a, based on this, the intermediate agent component of node 1 can call the API server to update the node tag of node 1 in the cluster-side database to A888a; assuming that the device information of node B specifically includes the identification of manufacturer B, and the general device model Q999, based on this, the intermediate agent component of node 2 can call the API server to update the node tag of node 2 in the cluster-side database to Q999.

[0164] Step 2.1, the device plug-in of each node reports first resource registration information to the registration port of the simulation device plug-in of the intermediate agent component, and the first resource registration information contains the first name of the computing device defined by the manufacturer. For example, the first resource registration information in node 1 can include A.com / gpu:8, indicating that there are 8 computing devices with the first name A.com / gpu in node 1; the first resource registration information in node 2 can include B.com / gpu:8, indicating that there are 8 computing devices with the first name B.com / gpu in node 2. Then, the intermediate agent component of each node converts the first name in the first resource registration information into a unified second name to obtain second resource registration information.

[0165] Step 2.2, the intermediate agent component of each node reports the second resource registration information to the device plug-in registration interface of the node agent component. For example, the second name can be example.com / fakedevice, and the second resource registration information in node 1 can include example.com / fakedevice:8, and the second resource registration information in node 2 can include example.com / fakedevice:8. Then, the node agent component reports the second resource registration information to the cluster side.

[0166] Step 3.1, the device plugin of each node reports first resource allocation information to the simulated Pod resource port of the intermediate agent component, and the first resource allocation information contains the first name of the computing device defined by the manufacturer. For example, the first resource allocation information in node 1 can include the first name A.com / gpu; the first resource allocation information in node 2 can include the first name B.com / gpu. Then, the intermediate agent component of each node converts the first name in the first resource allocation information into a unified second name to obtain second resource allocation information.

[0167] Step 3.2, the intermediate agent component of each node reports the second resource allocation information to the Pod resource interface of the node agent component. For example, the second name can be example.com / fakedevice, and the same second name example.com / fakedevice is included in the second resource allocation information of node 1 and the second resource registration information of node 2. Then, the node agent component reports the second resource allocation information to the cluster end.

[0168] Step 4, the API server receives the Pod creation request sent by the user through the user end. The Pod creation request can include node labels, second names and the number of computing devices, for example:

[0169] nodeSelector:

[0170] k8s.com / gpu:A888a

[0171] requests:

[0172] example.com / fakedevice:2

[0173] Wherein, nodeSelector represents the requirement for node selection, k8s.com / gpu:A888a is the node label of node 1; requests represents the requirement for computing device selection, example.com / fakedevice is the unified second name, and 2 represents that two computing devices are needed.

[0174] Step 5, the K8S scheduler selects the scheduled node based on the Pod creation request. For example, for the above-mentioned Pod creation request, node 1 is selected to allocate resources for the Pod.

[0175] Step 6, the node agent component of the scheduled node sends a second resource allocation request to the simulation device plugin interface of the intermediate agent component, and the second resource allocation request contains a second name. For example, when the scheduled node is node 1, the second resource allocation request includes example.com / fakedevice:2, indicating that two computing devices with the second name example.com / fakedevice need to be allocated. Subsequently, the intermediate agent component converts the second name in the second resource allocation request into a first name, thereby obtaining a first resource allocation request.

[0176] Step 7, the intermediate agent component sends the first resource allocation request to the device plugin interface of the device plugin, and the device plugin allocates computing devices based on the first resource allocation request. For example, the first resource allocation request includes A.com / gpu:2, indicating that two computing devices with the first name A.com / gpu need to be allocated.

[0177] The resource management device provided by the application is described below. The resource management device described below can be referred to in correspondence with the resource management method described above.

[0178] Figure 5 is one of the structural diagrams of the resource management device provided by the application, as Figure 5 shown, the device is applied to an intermediate agent component of a node, and the device includes:

[0179] The obtaining unit 510 is configured to obtain first resource information reported by a device plugin of the node, wherein the first resource information includes first names of computing devices of the node, and the computing devices of different device information correspond to different first names.

[0180] The conversion unit 520 is configured to convert the first names in the first resource information into second names to obtain second resource information, and the computing devices of different device information correspond to the same second name.

[0181] The sending unit 530 is configured to report the second resource information to a cluster end through a node agent component of the node.

[0182] In the resource management device provided in the embodiments of the application, by adding an intermediate agent component on the node, the intermediate agent component converts the first names in the first resource information reported by the device plugin into second names, thereby realizing the unification of the resource names of the computing devices under different manufacturers and different models, and greatly reducing the difficulty of resource management under a heterogeneous cluster.

[0183] Based on any of the above embodiments, the obtaining unit is specifically configured to perform at least one of the following:

[0184] The first resource registration information reported by the device plugin of the node is acquired based on a simulation device plugin registration interface, and a configuration address of a device plugin registration interface in the device plugin is an address of the simulation device plugin registration interface.

[0185] The first resource allocation information reported by the device plugin of the node is acquired based on a simulation Pod resource interface, and a configuration address of a Pod resource interface in the device plugin is an address of the simulation Pod resource interface.

[0186] Based on any one of the above embodiments, the address of the simulation device plugin registration interface and the address of the simulation Pod resource interface are the same.

[0187] Based on any one of the above embodiments, the acquisition unit is further configured to:

[0188] The second resource allocation request sent by the node agent component is acquired, and the second resource allocation request includes a second name of a requested computing device.

[0189] The conversion unit is further configured to:

[0190] The second name in the second resource allocation request is converted into a first name to obtain a first resource allocation request.

[0191] The sending unit is further configured to:

[0192] The first resource allocation request is sent to the device plugin.

[0193] Based on any one of the above embodiments, the acquisition unit is specifically configured to:

[0194] The second resource allocation request sent by the node agent component is acquired based on a simulation device plugin interface, and a configuration address of a device plugin interface in the node agent component is an address of the simulation device plugin interface.

[0195] Based on any one of the above embodiments, the sending unit is further configured to:

[0196] The general device model of the node is determined based on device information of the node, and the node tag of the node is updated to the general device model based on the cluster side.

[0197] Figure 6 is a structural diagram of a resource management device provided by the application, as shown in Figure 6 The device is applied to a user side, and the device includes:

[0198] The request unit 610 is configured to acquire a Pod creation request, and the Pod creation request includes a second name of a computing device allocated for a created Pod.

[0199] The management unit 620 is configured to send the Pod creation request to the cluster side;

[0200] The second name is obtained by converting the first name in the first resource information reported by the device plug-in on the node by the intermediate agent component, different computing devices with different device information correspond to different first names, and different computing devices with different device information correspond to the same second name.

[0201] In the device provided in the embodiment of the application, the intermediate agent component is additionally arranged on the node, the first name in the first resource information reported by the device plug-in is converted into the second name by the intermediate agent component, thereby realizing the unification of the resource names of the computing devices under different manufacturers and different models, and the second name only needs to be carried in the Pod creation request, and it is not necessary to separately distinguish different first names of different computing devices, so that the difficulty of resource management under the heterogeneous cluster is greatly reduced, and the user experience is optimized.

[0202] Based on any of the above embodiments, the Pod creation request further includes a node label of a node for creating a Pod, and the node label is a general device model of the node determined by the intermediate agent component based on device information of the node.

[0203] Figure 7 An example of an entity structure diagram of an electronic device is shown in Figure 7 As shown, the electronic device can include a processor (processor) 710, a communication interface (Communications Interface) 720, a memory (memory) 730 and a communication bus 740, wherein the processor 710, the communication interface 720, the memory 730 complete mutual communication through the communication bus 740. The processor 710 can call the logical instructions in the memory 730 to execute the resource management method, which includes:

[0204] Obtaining first resource information reported by a device plug-in of the node, the first resource information including a first name of a computing device of the node, different computing devices with different device information corresponding to different first names;

[0205] Converting the first name in the first resource information into a second name to obtain second resource information, different computing devices with different device information corresponding to the same second name;

[0206] Reporting the second resource information to the cluster side through a node agent component of the node.

[0207] Or,

[0208] Obtaining a Pod creation request, the Pod creation request including a second name of a computing device for creating a Pod;

[0209] send the Pod creation request to the cluster side;

[0210] The second name is obtained by converting the first name in the first resource information reported by the device plug-in at the intermediate agent component of the node, and different computing devices with different device information correspond to different first names, and different computing devices with different device information correspond to the same second name.

[0211] In addition, the logic instructions in the memory 730 described above can be implemented in the form of a software function unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that contribute to the related art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0212] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program is executed by a processor, and the computer can execute the resource management method provided by the above-mentioned method, which comprises:

[0213] Obtain the first resource information reported by the device plug-in of the node, and the first resource information includes the first name of the computing device of the node, and different computing devices with different device information correspond to different first names;

[0214] Convert the first name in the first resource information into a second name to obtain second resource information, and different computing devices with different device information correspond to the same second name;

[0215] Report the second resource information to the cluster side through the node agent component of the node.

[0216] Or,

[0217] Obtain a Pod creation request, and the Pod creation request includes a second name of a computing device allocated for a created Pod;

[0218] Send the Pod creation request to the cluster side;

[0219] The second name is obtained by converting the first name in the first resource information reported by the device plug-in at the node through the intermediate agent component at the node, different computing devices with different device information correspond to different first names, and different computing devices with different device information correspond to the same second name.

[0220] In another aspect, the present application also provides a non-transitory computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the resource management method provided by the above method, the method comprising:

[0221] Obtaining first resource information reported by a device plug-in of the node, the first resource information comprising a first name of a computing device of the node, different computing devices with different device information corresponding to different first names;

[0222] Converting the first name in the first resource information into a second name to obtain second resource information, different computing devices with different device information corresponding to the same second name;

[0223] Reporting the second resource information to the cluster end through a node agent component of the node.

[0224] Alternatively,

[0225] Obtaining a Pod creation request, the Pod creation request comprising a second name of a computing device allocated for a created Pod;

[0226] Sending the Pod creation request to the cluster end;

[0227] The second name is obtained by converting the first name in the first resource information reported by the device plug-in at the node through the intermediate agent component at the node, different computing devices with different device information correspond to different first names, and different computing devices with different device information correspond to the same second name.

[0228] The device embodiments described above are only schematic, wherein the units shown as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place or distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment scheme. Those skilled in the art can understand and implement without creative labor.

[0229] Those skilled in the art can clearly understand the implementation of the various embodiments by means of software and the necessary general hardware platform from the above description of the embodiments, and of course, the embodiments can also be implemented by hardware. Based on such understanding, the above technical solutions or the part that contributes to the related art can be embodied in the form of a software product, and the computer software product can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in the various embodiments or some parts of the embodiments.

[0230] Finally, it should be noted that: the above examples are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing examples, or make equivalent replacement for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A resource management method characterized by, The method is applied to an intermediate proxy component of a node, the intermediate proxy component being a component that relays information between a device plugin and a node agent component Kubelet, and the method comprises: obtaining first resource information reported by a device plugin of the node, the first resource information comprising a first name of a computing device of the node, different computing devices of different device information corresponding to different first names, and the first name being defined by the device plugin of different manufacturers; converting the first name in the first resource information into a second name to obtain second resource information, different computing devices of different device information corresponding to the same second name; reporting the second resource information to a cluster side through a node agent component of the node; Further comprising: scanning a PCI device of the node to obtain a device model of the PCI device; determining a device model of a computing device corresponding to the PCI device based on the device model of the PCI device; determining a general device model corresponding to the device model of the computing device based on a corresponding relationship between the general device model and a subdivided device model, and updating a node label of the node to the general device model based on the cluster side, the node label being used to specify a node assigned to a Pod in a Pod creation request; Further comprising: obtaining a second resource allocation request sent by the node agent component, the second resource allocation request comprising a second name of a requested computing device; converting the second name in the second resource allocation request into a first name to obtain a first resource allocation request; sending the first resource allocation request to the device plugin.

2. The resource management method of claim 1, wherein, The obtaining of the first resource information reported by the device plugin of the node comprises at least one of the following: based on a simulated device plugin registration interface, obtaining first resource registration information reported by the device plugin of the node, a configuration address of a device plugin registration interface in the device plugin being an address of the simulated device plugin registration interface; based on a simulated Pod resource interface, obtaining first resource allocation information reported by the device plugin of the node, a configuration address of a Pod resource interface in the device plugin being an address of the simulated Pod resource interface.

3. The resource management method of claim 2, wherein, The address of the simulated device plugin registration interface and the address of the simulated Pod resource interface are the same.

4. The resource management method of claim 1, wherein, The obtaining of the second resource allocation request sent by the node agent component comprises: based on a simulated device plugin interface, obtaining the second resource allocation request sent by the node agent component; a configuration address of a device plugin interface in the node agent component being an address of the simulated device plugin interface.

5. A resource management method characterized by, The method is applied to a user side, and the method comprises: obtaining a Pod creation request, the Pod creation request comprising a second name of a computing device assigned to a created Pod; sending the Pod creation request to a cluster side; The second name is obtained by converting the first name in the first resource information reported by the device plugin on the intermediate agent component at the node, different computing devices of different device information correspond to different first names, the first name is defined by the device plugin of different manufacturers, different computing devices of different device information correspond to the same second name, the intermediate agent component is a component for information transfer between the device plugin and the node agent component Kubelet; The Pod creation request further includes a node label for allocating a node for the created Pod, the node label is a general device model corresponding to a device model of the computing device determined by the intermediate agent component based on a correspondence between the general device model and the subdivided device model, the device model of the computing device is determined by the intermediate agent component based on scanning the PCI device of the node; The Pod creation request is used to trigger the cluster side to select and schedule a node based on the Pod creation request, the node agent component of the node sends a second resource allocation request to the intermediate agent component, the intermediate agent component converts the second name of the requested computing device included in the second resource allocation request into the first name to obtain a first resource allocation request, and sends the first resource allocation request to the device plugin of the node.

6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, The processor executes the computer program to implement the resource management method of any one of claims 1 to 5.

7. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the resource management method of any one of claims 1 to 5.

8. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the resource management method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Resource allocation method and device, computer equipment and storage medium

    CN113110938A

  • Kubernetes cluster-oriented equipment resource unified management system and method

    CN118535280A

  • Resource management method, electronic equipment and storage medium

    CN119690594A