Network interface card configuration method and apparatus, and electronic device and storage medium
By identifying and configuring or mapping the network card types of container groups, the problem that the SR-IOV network card virtualization solution cannot meet the high-performance communication needs in Kubernetes, and efficient communication for deep learning tasks is achieved.
Patent Information
- Application Number
- PCT/CN2025/071068
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-30
- Filing Date
- 2025-01-07
- Publication Date
- 2025-08-07
AI Technical Summary
In Kubernetes, the virtualization configuration scheme of SR-IOV network cards cannot meet the task requirements of certain specific scenarios, resulting in the impact or failure of task execution. Especially in deep learning distributed training, virtual network cards cannot meet the high-performance communication requirements.
By identifying the type of target network card during the container group creation process, dynamically configure or map virtual network card to physical network card, ensure that the container group can successfully perform tasks in different scenarios.
Improve the communication efficiency between container groups, ensure efficient communication between deep learning tasks between multiple server nodes, and avoid task failure caused by insufficient network card functions.
Smart Images

Figure CN2025071068_07082025_PF_FP_ABST
Abstract
Description
Network card configuration method, device, electronic device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on January 30, 2024, with application number 2024101297201 and application name “Network Card Configuration Method, Device, Electronic Device and Storage Medium”, all contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to a network card configuration method, device, electronic device and storage medium. Background Art
[0004] Kubernetes is one of the most popular container orchestration and management platforms. SR-IOV (Single Root I / O Virtualization) technology is a crucial component for delivering high-performance networking capabilities in virtualized environments. Over the past few years, significant progress has been made in the development of SR-IOV technology within Kubernetes.
[0005] Generally, SR-IOV NIC virtualization configuration in Kubernetes is achieved through the collaboration of three components: multus-cni, sriov-cni, and sriov-device-plugin. The sriov-device-plugin identifies and registers the virtual NIC created by the SR-IOV NIC with the Kubernetes cluster. Multus-cni and sriov-cni then configure the virtual NIC into the network stack of the pod container when the pod is created. At this point, the pod can communicate with other pods using the virtual NIC.
[0006] However, NIC virtualization is merely a product of SR-IOV NIC virtualization. It inherits only some of the features of a NIC and does not possess all of its capabilities. In some specific scenarios, it cannot meet task requirements, potentially impacting task execution or even causing task failure. Summary of the Invention
[0007] According to an embodiment of the present application, in a first aspect, a network card configuration method is provided, the method comprising:
[0008] During the target container group generation process, the target network card identifier is associated with the target container group; wherein the target container group is the container group used to execute the deep learning task in the target server node;
[0009] Determine whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card; wherein the target virtual network card is obtained by virtualizing the target physical network card;
[0010] In response to the target network card corresponding to the target network card identifier being the target virtual network card, obtaining a first required accelerator card resource corresponding to the target container group; wherein the first required accelerator card resource is an accelerator card resource expected to be used when the target container group communicates with container groups on other server nodes when the target container group performs the deep learning task;
[0011] According to the first required accelerator card resources, a target virtual network card is configured for the target container group, or the target virtual network card is mapped to a target physical network card corresponding to the target virtual network card and a target physical network card corresponding to the target virtual network card is configured for the target container group.
[0012] According to an embodiment of the present application, in a second aspect, a network card configuration device is provided, the device comprising:
[0013] An allocation module is configured to associate a target network card identifier with a target container group during the target container group generation process; wherein the target container group is a container group in a target server node used to execute a deep learning task;
[0014] The first judgment module is used to judge whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card; wherein the target virtual network card is obtained by virtualizing the target physical network card;
[0015] A first acquisition module is configured to acquire, in response to the target network card corresponding to the target network card identifier being a target virtual network card, a first required accelerator card resource corresponding to the target container group; wherein the first required accelerator card resource is an accelerator card resource expected to be used when the target container group communicates with container groups on other server nodes when the target container group performs a deep learning task;
[0016] The first configuration module is used to configure the target virtual network card for the target container group, or map the target virtual network card to the target physical network card corresponding to the target virtual network card and configure the target physical network card corresponding to the target virtual network card for the target container group.
[0017] According to an embodiment of the present application, in a third aspect, an electronic device is provided, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the network card configuration method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0018] According to an embodiment of the present application, in a fourth aspect, a non-volatile computer-readable storage medium is provided, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the network card configuration method of the above-mentioned first aspect or any corresponding embodiment thereof.
[0019] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the specific implementation methods or the description of the prior art. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] FIG1 is a flow chart of a method for configuring a network card according to an embodiment of the present application;
[0022] FIG2 is a flow chart of another network card configuration method according to an embodiment of the present application;
[0023] FIG3 is a flow chart of another network card configuration method according to an embodiment of the present application;
[0024] FIG4 is a flow chart of yet another network card configuration method according to an embodiment of the present application;
[0025] FIG5 is an architectural diagram of a network card configuration method according to an embodiment of the present application;
[0026] FIG6 is a flowchart of creating a container group in a network card configuration method according to an embodiment of the present application;
[0027] 7 is a flowchart of deleting a container group in a network card configuration method according to an embodiment of the present application;
[0028] FIG8 is a structural block diagram of a network card configuration device according to an embodiment of the present application;
[0029] FIG9 is a structural block diagram of a network card configuration device according to an embodiment of the present application;
[0030] 10 is a structural block diagram of a network card configuration device according to an embodiment of the present application;
[0031] 11 is a structural block diagram of a network card configuration device according to an embodiment of the present application;
[0032] FIG12 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application;
[0033] FIG13 is a schematic structural diagram of a non-volatile computer-readable storage medium according to an embodiment of the present application. DETAILED DESCRIPTION
[0034] To make the purpose, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0035] Kubernetes is currently one of the most popular container orchestration and management platforms, and SR-IOV technology is a crucial component for delivering high-performance networking capabilities in virtualized environments. Over the past few years, Kubernetes has seen significant progress in the development of SR-IOV technology. By partitioning the functionality of a physical network interface card (NIC) into multiple virtual NICs, SR-IOV enables more granular control and allocation of network resources. This virtualization approach, implemented directly at the hardware level, allows containers to directly access the underlying hardware, bypassing the intermediate layers of traditional network virtualization and significantly improving network performance and throughput. The application of SR-IOV technology in Kubernetes offers numerous benefits. First, it provides lower network latency and higher bandwidth, accelerating application performance and making it particularly suitable for workloads with high network performance requirements. Second, SR-IOV technology offers enhanced isolation and security, ensuring network traffic between different containers is isolated from each other, preventing malicious attacks and data leaks. The development of SR-IOV technology in Kubernetes has brought higher network performance and improved security to containerized applications. With the support of hardware vendors and the continuous advancement of related technologies, we can expect to see more innovations and applications related to SR-IOV in the future development of Kubernetes.
[0036] Generally, SR-IOV NIC virtualization configuration in Kubernetes relies on the collaboration of three components: multus-cni, sriov-cni, and sriov-device-plugin. The sriov-device-plugin identifies and registers the virtual NIC created by the SR-IOV NIC with the Kubernetes cluster. Multus-cni and sriov-cni configure the virtual NIC into the network stack of the pod container when the pod is created. Pods can now communicate with other pods using the virtual NIC through the virtual NIC. However, the virtual NIC is merely a virtualization artifact of the SR-IOV NIC and inherits only some of its features, not its full functionality. In certain scenarios, such as distributed training of deep learning with TensorFlow in a Kubernetes cluster, different TensorFlow worker nodes must use the NCCL (NVIDIA Collective Communications Library) communication framework to configure GPU communication. Using the virtual NIC for communication within the worker nodes may prevent NCCL framework optimizations from working. In this scenario, the PF of the SR-IOV network card is used for communication between workers.
[0037] Therefore, an embodiment of the present application provides a network card configuration method, which allocates a target network card identifier to the target container group during the target container group creation process. Then, it is determined whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card. When the target network card corresponding to the target network card identifier is a target virtual network card, the target container group is configured with the target virtual network card or the target physical network card corresponding to the target virtual network card based on the first required accelerator card resources. This ensures that the target container group can successfully execute tasks in any scenario, avoiding the situation where the task requirements cannot be met for some specific scenarios. This may affect the execution of the task and even cause the task to fail.
[0038] Below, we provide an example of a practical application of this application in a distributed deep learning training scenario. Unlike InfiniBand network cards, RoCE (RDMA over Converged Ethernet) network cards allow for the implementation of RDMA (Remote Direct Memory Access) functionality on standard Ethernet infrastructure. RoCE network cards are considered a "low-cost solution" to InfiniBand network cards. Therefore, many deep learning trainings rely on the RDMA functionality of RoCE network cards to communicate between GPUs across server nodes. In addition, many RoCEs implement SR-IOV functionality, which allows a single physical PCIe device (such as a network adapter) to be virtualized into multiple independent virtual device VF (Virtual Function) network cards, which can be assigned to different objects. Since VF network cards are directly connected to physical hardware resources, they can provide performance close to that of physical device PF (Physical Function) network cards, but there is still some performance loss compared to PF network cards. Therefore, in some scenarios with higher performance requirements, the benefits of using PF network cards are greater than using VF network cards.
[0039] Distributed deep learning training requires performing deep learning tasks on multiple server nodes in a cluster. The GPUs (Graphics Processing Units) between different server nodes need to communicate through the RDMA protocol of the RoCE network card. In particular, for some large model training, all GPUs on the server nodes are often required for training. At this time, the server nodes have no remaining GPUs to handle other training tasks. Therefore, if the VF network card of the RoCE network card of the original technical solution is used for communication between GPUs, the effect achieved will definitely be worse than using the PF network card for communication.
[0040] The network card configuration method of the present application can quickly identify these special scenarios (for example, scenarios where all GPUs of the server node are used) through some specific algorithms. For example, the resource usage of the pod (container) used to train deep learning tasks can be retrieved from the kubernetes platform for adaptive judgment. More specifically, by comparing the available accelerator card resources of the server node hosting the pod and the expected required accelerator card resources for the pod training deep learning task, if the deep learning task does not have high performance requirements, a VF network card can be allocated to the pod corresponding to the deep learning task. In particular, if it is identified that the pod corresponding to the deep learning task requires higher communication efficiency, a PF network card can be automatically allocated to it, and the corresponding network segment IP and routing information can be configured for these PF network cards.
[0041] In this process: The resource reported to kubernetes by this solution is the VF network card. From the perspective of kubernetes, it allocates the VF network card resource to the pod (that is, it thinks that the pod is loaded with the VF network card). However, if it is a special scenario, this solution can map the VF network card to the PF network card, and actually load the PF network card into the pod, deceiving kubernetes (because the network card identifier is still the identifier corresponding to the virtual network card), making kubernetes think that the VF network card is loaded into the pod. If it is a general scenario, continue to configure the VF network card for the pod. In addition, this solution configures the network segment information that originally belonged to the VF network card for the PF network card, so that the PF network card can communicate through the existing network routing equipment.
[0042] Therefore, by adopting the solution of this embodiment, according to the different requirements for communication performance between deep learning tasks of server nodes, the corresponding VF network card can be loaded for the container group carrying the network card identifier of the virtual network card, or the corresponding VF network card can be mapped to the PF network card, and the PF network card can be loaded into the container group, thereby realizing different network card configurations under different performance requirements, and further, the communication efficiency between the container groups of multiple server nodes during the deep learning task training process can be improved.
[0043] According to an embodiment of the present application, an embodiment of a network card configuration method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0044] It should be noted that the execution subject of the network card configuration method provided in the embodiment of the present application can be a network card configuration device, and the network card configuration device can be implemented as part or all of an electronic device through software, hardware, or a combination of software and hardware, wherein the electronic device can be a server or a terminal, wherein the server in the embodiment of the present application can be a single server or a server cluster composed of multiple servers, and the terminal in the embodiment of the present application can be a smart phone, a personal computer, a tablet computer, a wearable device, an intelligent robot, and other intelligent hardware devices. In the following method embodiments, the execution subject is an electronic device as an example for explanation.
[0045] In this embodiment, a network card configuration method is provided. FIG1 is a flow chart of the network card configuration method according to an embodiment of the present application. As shown in FIG1 , the process includes the following steps:
[0046] Step S101: during the target container group creation process, a target network card identifier is allocated to the target container group.
[0047] Specifically, before assigning a target network card identifier to a target container group, the electronic device can parse the configuration file of the physical network card in the kubernetes cluster and query the SR-IOV PF network card information existing on each server node according to the configuration file. Then, check whether the server node corresponding to the target container group has virtualized the physical network card. If the physical network card has been virtualized, obtain the single virtual network card identifier corresponding to each virtual network card, splice the single virtual network card identifiers, generate a combined virtual network card identifier, and report each combined virtual network card identifier. If the physical network card has not been virtualized, obtain the single physical network card identifier corresponding to each physical network card, splice the single physical network card identifiers, generate a combined physical network card identifier, and report each combined physical network card identifier.
[0048] Therefore, during the target container group creation process, a target network card identifier is assigned to the target container group, where the target network card identifier may be a combination of physical network card identifiers or a combination of virtual network card identifiers.
[0049] Step S102: Determine whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card.
[0050] The target virtual network card is obtained by virtualizing the target physical network card.
[0051] Specifically, the electronic device may identify the target network card identifier, and determine whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card according to the identification result.
[0052] For example, assuming that a single physical network card is identified by uppercase letters A, B, C, D, etc., and a single virtual network card is identified by uppercase and lowercase letters a, b, c, d, etc., the electronic device can identify the target network card identifier and determine whether the target network card corresponding to the target network card identifier is the target virtual network card or the target physical network card based on the identification result.
[0053] Step S103: When the target network card corresponding to the target network card identifier is a target virtual network card, obtain the first required accelerator card resource corresponding to the target container group.
[0054] Specifically, when the target network card corresponding to the target network card identifier is a target virtual network card, the electronic device may read the container group information corresponding to the target container group to obtain the first required accelerator card resource corresponding to the target container group.
[0055] Step S104: According to the first required accelerator card resources, a target virtual network card or a target physical network card corresponding to the target virtual network card is configured for the target container group, so that the target container group is created successfully.
[0056] Specifically, the electronic device may compare the first required accelerator card resources with the preset accelerator card resources. When the first required accelerator card resources are equal to or greater than the preset accelerator card resources, the electronic device may configure a target physical network card corresponding to the target virtual network card for the target container group; and when the first required accelerator card resources are less than the preset accelerator card resources, the electronic device may configure the target virtual network card for the target container group.
[0057] This step will be described in detail below.
[0058] The network card configuration method provided in the embodiment of the present application assigns a target network card identifier to the target container group during the target container group creation process. Then, it is determined whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card, so that the type of target network card corresponding to the target network card identifier assigned to the target container group can be clearly determined. When the target network card corresponding to the target network card identifier is a target virtual network card, the first required acceleration card resource corresponding to the target container group is obtained; based on the first required acceleration card resource, the target virtual network card or the target physical network card corresponding to the target virtual network card is configured for the target container group, so that the accuracy of the target virtual network card or the target physical network card corresponding to the target virtual network card configured for the target container group can be guaranteed. In addition, it can be ensured that the target container group can successfully execute tasks in any scenario, avoiding the situation where the task requirements cannot be met for some specific scenarios. This may cause the task execution to be affected or even cause the task to fail.
[0059] In this embodiment, a network card configuration method is provided. FIG2 is a flow chart of the network card configuration method according to an embodiment of the present application. As shown in FIG2 , the flow chart includes the following steps:
[0060] Step S201: During the target container group creation process, a target network card identifier is allocated to the target container group.
[0061] For details about this step, please refer to the introduction of step S101 in FIG1 , which will not be described in detail here.
[0062] Step S202: Determine whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card.
[0063] The target virtual network card is obtained by virtualizing the target physical network card.
[0064] In an optional implementation of the present application, the above step S202 may include the following steps:
[0065] Step S2021: Obtain a directory of mainboard external hardware devices in the server node corresponding to the target network card.
[0066] Specifically, the electronic device can receive a directory of external hardware devices connected to the motherboard in the server node corresponding to the target network card input by a user, or can receive a directory of external hardware devices connected to the motherboard in the server node corresponding to the target network card sent by another device. The electronic device can also search the storage space for the directory of external hardware devices connected to the motherboard in the server node corresponding to the target network card. The embodiments of the present application do not specifically limit the manner in which the electronic device obtains the directory of external hardware devices connected to the motherboard in the server node corresponding to the target network card.
[0067] Step S2022: searching for device information corresponding to each mainboard external hardware device according to the mainboard external hardware device directory.
[0068] Specifically, after obtaining the mainboard external hardware device directory, the electronic device can search for device information corresponding to each mainboard external hardware device according to the mainboard external hardware device directory.
[0069] Step S2023 , searching the device information for virtualization marking information for virtualizing the target physical network card corresponding to the server node.
[0070] Specifically, the electronic device may identify the device information, and search the device information for virtualization marking information for virtualizing the target physical network card corresponding to the server node according to the identification result.
[0071] Step S2024: When virtualization mark information exists, determine that the target network card corresponding to the target network card identifier is the target virtual network card.
[0072] Specifically, when the virtualization mark information exists, it is determined that the target physical network card has been virtualized, and therefore, the target network card corresponding to the target network card identifier is determined to be the target virtual network card.
[0073] Step S2025: When the virtualization mark information does not exist, determine that the target network card corresponding to the target network card identifier is a target physical network card.
[0074] Specifically, when the virtualization mark information does not exist, it is determined that the target physical network card is not virtualized, and therefore, the target network card corresponding to the target network card identifier is determined to be the target physical network card.
[0075] Step S203: When the target network card corresponding to the target network card identifier is a target virtual network card, obtain the first required accelerator card resource corresponding to the target container group.
[0076] For details about this step, please refer to the introduction of step S103 in FIG1 , which will not be described in detail here.
[0077] Step S204: According to the first required accelerator card resources, a target virtual network card or a target physical network card corresponding to the target virtual network card is configured for the target container group, so that the target container group is created successfully.
[0078] Specifically, the above step S204 may include the following steps:
[0079] Step S2041: Obtain a first available accelerator card resource corresponding to the server node to which the target container group is scheduled.
[0080] Specifically, the electronic device may identify the server node to which the target container group is scheduled, and determine a first available accelerator card resource corresponding to the server node to which the target container group is scheduled.
[0081] Step S2042: Compare the first required accelerator card resources with the first available accelerator card resources.
[0082] Specifically, the electronic device may compare the first required accelerator card resources with the first available accelerator card resources.
[0083] Step S2043: According to the comparison result, a target virtual network card or a target physical network card corresponding to the target virtual network card is configured for the target container group.
[0084] Specifically, the above step S2043 may include the following steps:
[0085] Step a1: when the first required accelerator card resources are equal to the first available accelerator card resources, obtain a target physical network card corresponding to the target virtual network card.
[0086] Specifically, when the first required accelerator card resources are equal to the first available accelerator card resources, the electronic device determines that the first required accelerator card resources of the target container group are more, and the target virtual network card cannot meet the business needs of the target container group. Therefore, the target physical network card corresponding to the target virtual network card is obtained.
[0087] Step a2: Configure the target physical network card corresponding to the target virtual network card for the target container group.
[0088] Specifically, step a2 may include:
[0089] Step a21: Obtain the target physical network card identifier corresponding to the target physical network card.
[0090] Specifically, the electronic device may determine the target physical network card corresponding to the target virtual network card and determine the target physical network card identifier corresponding to the target physical network card according to the correspondence between the target virtual network card and the target physical network card.
[0091] Step a22: Write the target physical network card identifier into the acceleration configuration file corresponding to the target container group.
[0092] Specifically, the electronic device may write the target physical network card identifier into the acceleration configuration file corresponding to the target container group.
[0093] In step a23, the acceleration configuration file is mounted to the target container group, and the target physical network card is configured to the target container group.
[0094] Specifically, the electronic device may mount the acceleration configuration file to the target container group.
[0095] The step a23 of "configuring the target physical network card to the target container group" may include the following steps:
[0096] Step a231: Generate a first unique Internet Protocol address corresponding to the target physical network card according to the first network segment information corresponding to the target physical network card.
[0097] Specifically, the electronic device can receive the first network segment information corresponding to the target physical network card input by the user, or receive the first network segment information corresponding to the target physical network card sent by other devices, and can also obtain the first network segment information corresponding to the target physical network card in the storage space. The embodiment of the present application does not specifically limit the way in which the electronic device obtains the first network segment information corresponding to the target physical network card.
[0098] Then, the electronic device generates a first unique Internet Protocol address corresponding to the target physical network card according to the first network segment information corresponding to the target physical network card.
[0099] The first network segment information is used to represent the network segment interval of the first unique Internet Protocol address corresponding to the target physical network card.
[0100] The first unique Internet Protocol address is the first unique IP address corresponding to the target physical network card.
[0101] Step a232: Move the target physical network card from the initial network namespace to the container network namespace corresponding to the target container group.
[0102] Specifically, the electronic device may move the target physical network card from the initial network namespace to the container network namespace corresponding to the target container group.
[0103] Step a233: configure a first unique Internet Protocol address for the target physical network card and start the target physical network card.
[0104] Specifically, the electronic device may configure a first unique Internet Protocol address for the target physical network card and start the target physical network card.
[0105] Step a3: When the first required acceleration card resources are less than the first available acceleration card resources, the target network card identifier is written into the acceleration configuration file corresponding to the target container group.
[0106] Specifically, when the first required acceleration card resources are less than the first available acceleration card resources, the electronic device determines that the target virtual network card can meet the service requirements of the target container group, and therefore writes the target network card identifier into the acceleration configuration file corresponding to the target container group.
[0107] In step a4, the acceleration configuration file is mounted to the target container group, and the target virtual network card is configured to the target container group.
[0108] Specifically, the electronic device may mount the acceleration configuration file to the target container group.
[0109] Specifically, the "configuring the target virtual network card to the target container group" in step a4 above may include:
[0110] Step a41: query the first data link information corresponding to the target virtual network card according to the target network card identification information.
[0111] Specifically, the electronic device may query the first data link information corresponding to the target virtual network card according to the target network card identification information.
[0112] Step a42: Generate a second unique Internet Protocol address corresponding to the target virtual network card based on the second network segment information corresponding to the target virtual network card.
[0113] Specifically, the electronic device can receive the second network segment information corresponding to the target virtual network card input by the user, or receive the second network segment information corresponding to the target virtual network card sent by other devices, and can also obtain the second network segment information corresponding to the target virtual network card in the storage space. The embodiment of the present application does not specifically limit the way in which the electronic device obtains the second network segment information corresponding to the target virtual network card.
[0114] After acquiring the second network segment information corresponding to the target virtual network card, the electronic device can randomly generate a second unique Internet Protocol address corresponding to the target virtual network card based on the second network segment information corresponding to the target virtual network card.
[0115] Step a43: Generate a target physical address corresponding to the target virtual network card according to the second unique Internet Protocol address, and back up the first original physical address corresponding to the target virtual network card.
[0116] Specifically, the electronic device may generate a target physical address corresponding to the target virtual network card according to the second unique Internet Protocol address, and back up the first original physical address corresponding to the target virtual network card.
[0117] It should be noted that the target physical address corresponding to the target virtual network card is also unique.
[0118] Step a44: configure a target physical address for the target virtual network card according to the first data link information.
[0119] Specifically, the electronic device may configure a target physical address for the target virtual network card according to the first data link information.
[0120] Exemplarily, the electronic device may call the "ip link set $vf_link_name vf mac $mac_address" operation command to configure a target physical address for the target virtual network card.
[0121] Step a45: Move the target virtual network card from the initial network namespace to the container network namespace corresponding to the target container group.
[0122] Specifically, the electronic device may move the target virtual network card from the initial network namespace to the container network namespace corresponding to the target container group.
[0123] Step a46: configure a second unique Internet Protocol address for the target virtual network card according to the first data link information, and start the target virtual network card.
[0124] Specifically, the electronic device may configure a second unique Internet Protocol address for the target virtual network card according to the first data link information, and start the target virtual network card.
[0125] Exemplarily, the electronic device may call an "ip link set $link_name down" operation command to configure a second unique Internet Protocol address for the target virtual network card.
[0126] The network card configuration method provided in the embodiment of the present application obtains the mainboard external hardware device directory in the server node corresponding to the target network card, and searches for the device information corresponding to each mainboard external hardware device based on the mainboard external hardware device directory, thereby ensuring the accuracy of the device information corresponding to each mainboard external hardware device found. Search the device information to see if there is virtualization tag information for virtualizing the target physical network card corresponding to the server node; when the virtualization tag information exists, determine that the target network card corresponding to the target network card identifier is the target virtual network card, thereby ensuring the accuracy of the result that the target network card corresponding to the determined target network card identifier is the target virtual network card. When the virtualization tag information does not exist, determine that the target network card corresponding to the target network card identifier is the target physical network card, thereby ensuring the accuracy of the result that the target network card corresponding to the determined target network card identifier is the target physical network card.
[0127] In addition, the first available accelerator card resource corresponding to the server node scheduled by the target container group is obtained; the first required accelerator card resource is compared with the first available accelerator card resource. When the first required accelerator card resource is equal to the first available accelerator card resource, the target physical network card corresponding to the target virtual network card is obtained; the target physical network card identifier corresponding to the target physical network card is obtained; the target physical network card identifier is written into the acceleration configuration file corresponding to the target container group; and the acceleration configuration file is mounted to the target container group. Based on the first network segment information corresponding to the target physical network card, a first unique Internet Protocol address corresponding to the target physical network card is generated, ensuring the accuracy of the generated first unique Internet Protocol address corresponding to the target physical network card. The target physical network card is moved from the initial network namespace to the container network namespace corresponding to the target container group, thereby enabling the target container group to communicate based on the target physical network card in the corresponding container network namespace. The first unique Internet Protocol address is configured for the target physical network card, and the target physical network card is started. This allows the target container group to complete tasks in any scenario based on the target physical network card. This avoids configuring a target virtual network card for the target container group, which may not meet task requirements in some specific scenarios. This may affect the execution of the task or even cause the task to fail.
[0128] When the first required accelerator card resources are less than the first available accelerator card resources, the target network card identifier is written into the acceleration configuration file corresponding to the target container group, thereby enabling the target container group to locate the target virtual network card based on the acceleration configuration file. The first data link information corresponding to the target virtual network card is queried based on the target network card identifier information, thereby ensuring the accuracy of the queried first data link information. A second unique Internet Protocol address corresponding to the target virtual network card is generated based on the second network segment information corresponding to the target virtual network card, thereby ensuring the accuracy of the generated second unique Internet Protocol address. Based on the second unique Internet Protocol address, a target physical address corresponding to the target virtual network card is generated, and the first original physical address corresponding to the target virtual network card is backed up, thereby ensuring the accuracy of the generated target physical address corresponding to the target virtual network card and enabling the target virtual network card to be restored based on the first original physical address. A target physical address is configured for the target virtual network card based on the first data link information, thereby ensuring the accuracy of the target physical address configuration for the target virtual network card. The target virtual network card is moved from the initial network namespace to the container network namespace corresponding to the target container group, thereby enabling the target container group to communicate based on the target virtual network card in the corresponding container network namespace. Based on the first data link information, a second unique Internet Protocol address is configured for the target virtual network card, and the target virtual network card is started, so that the target container group can complete tasks in any scenario based on the target virtual network card. This also ensures that the target container group can complete tasks based on the target virtual network card, thereby conserving resources on the target physical network card.
[0129] In this embodiment, a network card configuration method is provided. FIG3 is a flow chart of the network card configuration method according to an embodiment of the present application. As shown in FIG3 , the flow chart includes the following steps:
[0130] Step S301: During the target container group creation process, a target network card identifier is allocated to the target container group.
[0131] For details about this step, please refer to step S201 in FIG2 , which will not be described in detail here.
[0132] Step S302: Determine whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card.
[0133] The target virtual network card is obtained by virtualizing the target physical network card.
[0134] For details about this step, please refer to step S202 in FIG2 , which will not be described in detail here.
[0135] Step S303: When the target network card corresponding to the target network card identifier is a target physical network card, the target network card identifier is written into an acceleration configuration file corresponding to the target container group.
[0136] Specifically, when the target network card corresponding to the target network card identifier is a target physical network card, the electronic device writes the target network card identifier into the acceleration configuration file corresponding to the target container group.
[0137] Step S304: Mount the acceleration configuration file to the target container group, and configure the target physical network card to the target container group.
[0138] Specifically, the electronic device generates a first unique Internet Protocol address corresponding to the target physical network card based on the first network segment information corresponding to the target physical network card; moves the target physical network card from the initial network namespace to the container network namespace corresponding to the target container group; configures the first unique Internet Protocol address for the target physical network card, and starts the target physical network card.
[0139] The network card configuration method provided by the embodiment of the present application, when the target network card corresponding to the target network card identifier is the target physical network card, writes the target network card identifier into the acceleration configuration file corresponding to the target container group; mounts the acceleration configuration file to the target container group, and configures the target physical network card to the target container group. This allows the target container group to find the target physical network card based on the acceleration configuration file, and enables the target container group to complete tasks in any scenario based on the target physical network card.
[0140] In this embodiment, a network card configuration method is provided. FIG4 is a flow chart of the network card configuration method according to an embodiment of the present application. As shown in FIG4 , the flow chart includes the following steps:
[0141] Step S401: Obtain the identifier of the network card to be deleted corresponding to the container group to be deleted.
[0142] Specifically, the electronic device may receive the container group to be deleted specified by the user, then identify the container group to be deleted, and determine the network card identifier to be deleted corresponding to the container group to be deleted.
[0143] Step S402 : determining whether the network card to be deleted corresponding to the network card to be deleted identifier is a virtual network card to be deleted or a physical network card to be deleted.
[0144] Specifically, the electronic device can obtain the mainboard external hardware device directory in the server node corresponding to the network card to be deleted; according to the mainboard external hardware device directory, search for the device information corresponding to each mainboard external hardware device; search whether there is virtualization tag information in the device information for virtualizing the physical network card to be deleted corresponding to the server node; when the virtualization tag information exists, determine that the network card to be deleted corresponding to the network card to be deleted identifier is the virtual network card to be deleted; when the virtualization tag information does not exist, determine that the network card to be deleted corresponding to the network card to be deleted identifier is the physical network card to be deleted.
[0145] Step S403: When the network card to be deleted is a physical network card to be deleted, the physical network card to be deleted is moved from the container network namespace corresponding to the container group to be deleted to the initial network namespace.
[0146] Specifically, when the network card to be deleted is a physical network card to be deleted, the physical network card to be deleted is moved from the container network namespace corresponding to the container group to be deleted to the initial network namespace.
[0147] Step S404: When the network card to be deleted is a virtual network card to be deleted, obtain a second required accelerator card resource corresponding to the container group to be deleted and a second available accelerator card resource corresponding to the server node to which the container group to be deleted is scheduled.
[0148] Specifically, when the network card to be deleted is a virtual network card to be deleted, a second required accelerator card resource corresponding to the container group to be deleted and a second available accelerator card resource corresponding to the server node to which the container group to be deleted is scheduled are obtained.
[0149] Step S405 : Compare the second required accelerator card resources with the second available accelerator card resources.
[0150] Specifically, the electronic device compares the second required acceleration card resources with the second available acceleration card resources.
[0151] Step S406: When the second required acceleration card resources are less than the second available acceleration card resources, query the second data link information corresponding to the virtual network card to be deleted according to the identifier of the network card to be deleted.
[0152] Specifically, when the second required accelerator card resources are less than the second available accelerator card resources, the electronic device determines that the container group to be deleted is configured with the virtual network card to be deleted. Therefore, the electronic device queries the second data link information corresponding to the virtual network card to be deleted according to the network card identifier to be deleted.
[0153] Step S407: Acquire the Internet Protocol address to be deleted corresponding to the virtual network card to be deleted, and delete the Internet Protocol address to be deleted according to the second data link information.
[0154] Specifically, the electronic device may identify the virtual network card to be deleted, determine the Internet Protocol address to be deleted corresponding to the virtual network card to be deleted, and then delete the Internet Protocol address to be deleted according to the second data link information.
[0155] Exemplarily, the electronic device may use the "ip link set $link_name down" operation instruction to delete the Internet Protocol address to be deleted.
[0156] Step S408: Obtain the second original physical address corresponding to the virtual network card to be deleted.
[0157] Specifically, the electronic device may search the storage space for the second original physical address corresponding to the virtual network card to be deleted according to the network card identifier to be deleted corresponding to the virtual network card to be deleted.
[0158] Step S409: Restore the second original physical address for the virtual network card to be deleted.
[0159] Specifically, the electronic device may delete the second original physical address corresponding to the virtual network card.
[0160] Step S410: Move the virtual network card to be deleted from the container network namespace corresponding to the container group to be deleted to the initial network namespace.
[0161] Specifically, the electronic device may move the to-be-deleted virtual network card from the container network namespace corresponding to the to-be-deleted container group to the initial network namespace.
[0162] Step S411: when the second required accelerator card resources are equal to the second available accelerator card resources, searching for a physical network card to be deleted corresponding to the virtual network card to be deleted according to the network card identifier to be deleted.
[0163] Specifically, when the second required accelerator card resources are equal to the second available accelerator card resources, the electronic device determines that the container group to be deleted is configured with a physical network card to be deleted, so the electronic device searches for the physical network card to be deleted corresponding to the virtual network card to be deleted according to the network card identifier to be deleted.
[0164] Step S412: Delete the Internet Protocol address to be deleted corresponding to the physical network card to be deleted, and move the physical network card to be deleted from the container network namespace corresponding to the container group to be deleted to the initial network namespace.
[0165] Specifically, the Internet Protocol address to be deleted corresponding to the physical network card to be deleted is electronically deleted, and the physical network card to be deleted is moved from the container network namespace corresponding to the container group to be deleted to the initial network namespace.
[0166] The network card configuration method provided in the embodiment of the present application obtains the identifier of the network card to be deleted corresponding to the container group to be deleted; determines whether the network card to be deleted corresponding to the identifier is a virtual network card to be deleted or a physical network card to be deleted; thereby, the network card to be deleted can be deleted according to the type of the network card to be deleted. When the network card to be deleted is a physical network card to be deleted, the physical network card to be deleted is moved from the container network namespace corresponding to the container group to be deleted to the initial network namespace, thereby deleting the physical network card to be deleted corresponding to the container group to be deleted, releasing the physical network card to be deleted, and then deleting the container group to be deleted.
[0167] If the network card to be deleted is a virtual network card to be deleted, the second required accelerator card resources corresponding to the container group to be deleted and the second available accelerator card resources corresponding to the server node to which the container group to be deleted is scheduled are obtained. The second required accelerator card resources are compared with the second available accelerator card resources. Based on the comparison result, the type of the network card to be deleted configured in the container group to be deleted is determined. The network card to be deleted is then deleted based on its type. If the second required accelerator card resources are less than the second available accelerator card resources, the network card to be deleted configured in the container group to be deleted is determined to be a virtual network card to be deleted. The second data link information corresponding to the virtual network card to be deleted is retrieved based on the identifier of the network card to be deleted, ensuring the accuracy of the second data link information retrieved for the virtual network card to be deleted. The Internet Protocol address to be deleted corresponding to the virtual network card to be deleted is obtained, and the Internet Protocol address to be deleted is deleted based on the second data link information, ensuring the accuracy of the deletion of the Internet Protocol address to be deleted. The second original physical address corresponding to the virtual network card to be deleted is obtained; the second original physical address is restored for the virtual network card to be deleted; and the virtual network card to be deleted is moved from the container network namespace corresponding to the container group to be deleted to the initial network namespace. This allows the virtual network card to be deleted in the container network namespace corresponding to the container group to be deleted to be released, thereby making the container group to be deleted unable to work and then deleting the container group to be deleted.
[0168] When the second required accelerator card resources equal the second available accelerator card resources, the physical network card corresponding to the virtual network card to be deleted is searched for based on the network card identifier to be deleted, ensuring the accuracy of the physical network card found. The Internet Protocol address corresponding to the physical network card to be deleted is deleted, and the physical network card to be deleted is moved from the container network namespace corresponding to the container group to be deleted to the initial network namespace. This allows the physical network card to be deleted corresponding to the container group to be deleted, freeing the physical network card to be deleted, and then deleting the container group to be deleted.
[0169] To better illustrate the network card configuration method provided by the embodiment of the present application, the overall architecture of the network card configuration method is provided in Figure 5. Through the device plug-in mechanism, when performing resource scanning and reporting, it adaptively determines whether the reliable input / output virtualized network card has been virtualized, identifies whether the network card is a virtual network card or a physical network card, and then reports it to the node agent.
[0170] When allocating network card resources through the device plug-in mechanism, the system adaptively determines whether the device plug-in has implemented virtualization. If the network card corresponding to the assigned target network card identifier is a physical network card, the name of the physical network card is written to the configuration file. If it is a virtual network card, and the required accelerator card resources corresponding to the container group are equal to the available accelerator card resources corresponding to the node agent, the physical network card corresponding to the virtual network card is obtained and the network card identifier of the physical network card is written to the configuration file. If the required accelerator card resources corresponding to the container group are less than the available accelerator card resources corresponding to the node agent, the network card identifier of the virtual network card is written to the configuration file.
[0171] In an optional embodiment of the present application, a flowchart for creating a container group is provided. As shown in Figure 6, when creating a container group, the multi-NIC control component creates the first network based on the container group creation request. The reliable input / output virtualization NIC control component generates the physical NIC's international protocol address. The international protocol allocation component returns the address, and the reliable input / output virtualization NIC control component moves the physical NIC to the container network namespace.
[0172] In an optional embodiment of the present application, a flowchart for deleting a container group is provided. As shown in Figure 7, when deleting a container group, the multi-NIC control component deletes the first network in response to the container group deletion request. The reliable input / output virtualized NIC control component reclaims the physical NIC's international protocol address. The international protocol allocation component returns the address, and the reliable input / output virtualized NIC control component removes the physical NIC from the container network namespace.
[0173] This embodiment also provides a network card configuration device for implementing the above-mentioned embodiments and preferred implementations. Details already described will not be repeated here. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0174] This embodiment provides a network card configuration device, as shown in FIG8 , including:
[0175] An allocation module 501 is configured to allocate a target network card identifier to a target container group during the target container group creation process.
[0176] The first determination module 502 is configured to determine whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card; wherein the target virtual network card is obtained by virtualizing the target physical network card;
[0177] A first acquisition module 503 is configured to acquire a first required accelerator card resource corresponding to the target container group when the target network card corresponding to the target network card identifier is a target virtual network card;
[0178] The first configuration module 504 is configured to configure a target virtual network card or a target physical network card corresponding to the target virtual network card for the target container group according to the first required accelerator card resources, so that the target container group is successfully created.
[0179] In some optional implementations, the first judgment module 502 is specifically used to obtain a directory of mainboard external hardware devices in the server node corresponding to the target network card; search for device information corresponding to each mainboard external hardware device based on the directory of mainboard external hardware devices; search for virtualization tag information for virtualizing the target physical network card corresponding to the server node in the device information; when virtualization tag information exists, determine that the target network card corresponding to the target network card identifier is the target virtual network card; when virtualization tag information does not exist, determine that the target network card corresponding to the target network card identifier is the target physical network card.
[0180] In some optional implementations, the first configuration module 504 is specifically used to obtain a first available accelerator card resource corresponding to the server node to which the target container group is scheduled; compare the first required accelerator card resource with the first available accelerator card resource; and configure a target virtual network card or a target physical network card corresponding to the target virtual network card for the target container group based on the comparison result.
[0181] In some optional implementations, the first configuration module 504 is specifically used to obtain the target physical network card corresponding to the target virtual network card when the first required accelerator card resources are equal to the first available accelerator card resources; and configure the target physical network card corresponding to the target virtual network card for the target container group.
[0182] In some optional implementations, the first configuration module 504 is specifically used to obtain a target physical network card identifier corresponding to the target physical network card; write the target physical network card identifier into an acceleration configuration file corresponding to the target container group; mount the acceleration configuration file to the target container group, and configure the target physical network card to the target container group.
[0183] In some optional implementations, the first configuration module 504 is specifically used to generate a first unique Internet Protocol address corresponding to the target physical network card based on the first network segment information corresponding to the target physical network card; move the target physical network card from the initial network namespace to the container network namespace corresponding to the target container group; configure the first unique Internet Protocol address for the target physical network card, and start the target physical network card.
[0184] In some optional implementations, the first configuration module 504 is specifically used to write the target network card identifier into the acceleration configuration file corresponding to the target container group when the first required acceleration card resources are less than the first available acceleration card resources; mount the acceleration configuration file to the target container group, and configure the target virtual network card to the target container group.
[0185] In some optional embodiments, the first configuration module 504 is specifically used to query the first data link information corresponding to the target virtual network card based on the target network card identification information; generate a second unique Internet Protocol address corresponding to the target virtual network card based on the second network segment information corresponding to the target virtual network card; generate a target physical address corresponding to the target virtual network card based on the second unique Internet Protocol address, and back up the first original physical address corresponding to the target virtual network card; configure the target physical address for the target virtual network card based on the first data link information; move the target virtual network card from the initial network namespace to the container network namespace corresponding to the target container group; configure the second unique Internet Protocol address for the target virtual network card based on the first data link information, and start the target virtual network card.
[0186] In some optional implementations, as shown in FIG9 , the network card configuration device further includes:
[0187] A writing module 505 is configured to write the target network card identifier into an acceleration configuration file corresponding to the target container group when the target network card corresponding to the target network card identifier is a target physical network card;
[0188] The second configuration module 506 is configured to mount the acceleration configuration file to the target container group and configure the target physical network card to the target container group.
[0189] In some optional implementations, as shown in FIG10 , the network card configuration device further includes:
[0190] The second acquisition module 507 is used to obtain the to-be-deleted network card identifier corresponding to the to-be-deleted container group;
[0191] The second judgment module 508 is used to judge whether the network card to be deleted corresponding to the network card to be deleted identifier is a virtual network card to be deleted or a physical network card to be deleted;
[0192] The first moving module 509 is configured to move the physical network card to be deleted from the container network namespace corresponding to the container group to be deleted to the initial network namespace when the network card to be deleted is a physical network card to be deleted.
[0193] In some optional implementations, as shown in FIG11 , the network card configuration device further includes:
[0194] The third acquisition module 510 is configured to, when the network card to be deleted is a virtual network card to be deleted, acquire a second required accelerator card resource corresponding to the container group to be deleted and a second available accelerator card resource corresponding to the server node to which the container group to be deleted is scheduled;
[0195] A comparison module 511 is configured to compare the second required accelerator card resources with the second available accelerator card resources;
[0196] A query module 512 is configured to query second data link information corresponding to the virtual network card to be deleted according to the identifier of the network card to be deleted when the second required accelerator card resources are less than the second available accelerator card resources;
[0197] A first deleting module 513 is configured to obtain an Internet Protocol address to be deleted corresponding to the virtual network card to be deleted, and delete the Internet Protocol address to be deleted according to the second data link information;
[0198] A fourth obtaining module 514 is configured to obtain a second original physical address corresponding to the virtual network card to be deleted;
[0199] Restoring module 515, configured to restore the second original physical address for the virtual network card to be deleted;
[0200] The second moving module 516 is used as a recovery module, and is used to move the virtual network card to be deleted from the container network namespace corresponding to the container group to be deleted to the initial network namespace.
[0201] The network card configuration device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0202] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0203] An embodiment of the present application also provides an electronic device having the network card configuration device shown in Figures 8 to 11 above.
[0204] Please refer to Figure 12, which is a structural diagram of an electronic device provided by an optional embodiment of the present application. As shown in Figure 12, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 12 takes a processor 10 as an example.
[0205] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0206] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.
[0207] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created based on the use of an electronic device presented by a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0208] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0209] The electronic device further includes a communication interface 30 for the electronic device to communicate with other devices or a communication network.
[0210] The embodiments of the present application also provide a non-volatile computer-readable storage medium. The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0211] Although the embodiments of the present application have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations shall fall within the scope defined by the appended claims.
Claims
1. A network card configuration method, characterized in that: The method comprises: During the target container group generation process, the target network card identifier is associated with the target container group; wherein the target container group is the container group used to execute the deep learning task in the current server node; Determine whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card; wherein the target virtual network card is obtained by virtualizing the target physical network card; In response to the target network card corresponding to the target network card identifier being the target virtual network card, obtaining a first required accelerator card resource corresponding to the target container group; wherein the first required accelerator card resource is an accelerator card resource expected to be used when the target container group on the current server node communicates with container groups on other server nodes when the target container group executes the deep learning task; and According to the first required accelerator card resources, the target virtual network card is configured for the target container group, or the target virtual network card is mapped to the target physical network card corresponding to the target virtual network card and the target physical network card corresponding to the target virtual network card is configured for the target container group.
2. The method according to claim 1, characterized in that The determining whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card includes: Obtain a directory of mainboard external hardware devices in the server node corresponding to the target network card; Read the device information corresponding to each mainboard external hardware device according to the mainboard external hardware device directory; Determining whether there is virtualization marking information for virtualizing the target physical network card corresponding to the server node in the device information; In response to the existence of the virtualization tag information, determining that the target network card corresponding to the target network card identifier is the target virtual network card; and In response to the virtualization tag information not existing, it is determined that the target network card corresponding to the target network card identifier is the target physical network card.
3. The method according to claim 1, characterized in that The configuring the target virtual network card for the target container group according to the first required accelerator card resources, or mapping the target virtual network card to the target physical network card corresponding to the target virtual network card and configuring the target physical network card corresponding to the target virtual network card for the target container group, includes: Obtaining a first available accelerator card resource corresponding to the server node where the target container group is scheduled; wherein the first available accelerator card resource is an accelerator card resource actually loaded in the current server node where the target container group is located; comparing the first required accelerator card resources with the first available accelerator card resources; and According to the comparison result, the target virtual network card is configured for the target container group, or the target virtual network card is mapped to the target physical network card corresponding to the target virtual network card and the target physical network card corresponding to the target virtual network card is configured for the target container group.
4. The method according to claim 3, characterized in that The configuring the target virtual network card for the target container group according to the comparison result, or mapping the target virtual network card to the target physical network card corresponding to the target virtual network card and configuring the target physical network card corresponding to the target virtual network card for the target container group, includes: In response to the first required accelerator card resources being equal to the first available accelerator card resources, obtaining the target physical network card corresponding to the target virtual network card; and The target virtual network card is mapped to the target physical network card corresponding to the target virtual network card, and the target physical network card corresponding to the target virtual network card is configured for the target container group.
5. The method according to claim 4, characterized in that The configuring the target physical network card corresponding to the target virtual network card for the target container group includes: Obtaining a target physical network card identifier corresponding to the target physical network card; Writing the target physical network card identifier into the acceleration configuration file corresponding to the target container group; and The acceleration configuration file is mounted to the target container group, and the target physical network card is configured to the target container group.
6. The method according to claim 5, characterized in that The configuring the target physical network card to the target container group includes: Generate a first unique Internet Protocol address corresponding to the target physical network card according to the first network segment information corresponding to the target physical network card; Moving the target physical network card from the initial network namespace to the container network namespace corresponding to the target container group; and The first unique Internet Protocol address is configured for the target physical network card, and the target physical network card is started.
7. The method according to claim 4, characterized in that The step of configuring the target virtual network card for the target container group according to the comparison result, or mapping the target virtual network card to the target physical network card corresponding to the target virtual network card and configuring the target physical network card corresponding to the target virtual network card for the target container group further includes: In response to the first required accelerator card resources being less than the first available accelerator card resources, writing the target network card identifier into an acceleration configuration file corresponding to the target container group; and The acceleration configuration file is mounted to the target container group, and the target virtual network card is configured to the target container group.
8. The method according to claim 7, characterized in that Configuring the target virtual network card to the target container group includes: Query the first data link information corresponding to the target virtual network card according to the target network card identification information; Generate a second unique Internet Protocol address corresponding to the target virtual network card based on the second network segment information corresponding to the target virtual network card; Generate a target physical address corresponding to the target virtual network card according to the second unique Internet Protocol address, and back up the first original physical address corresponding to the target virtual network card; configuring the target physical address for the target virtual network card according to the first data link information; Moving the target virtual network card from the initial network namespace to the container network namespace corresponding to the target container group; and According to the first data link information, the second unique Internet Protocol address is configured for the target virtual network card, and the target virtual network card is started.
9. The method according to claim 1, characterized in that The method further comprises: In response to the target network card corresponding to the target network card identifier being the target physical network card, writing the target network card identifier into the acceleration configuration file corresponding to the target container group; and The acceleration configuration file is mounted to the target container group, and the target physical network card is configured to the target container group.
10. The method according to claim 1, characterized in that The method further comprises: Get the ID of the network card to be deleted corresponding to the container group to be deleted; Determine whether the network card to be deleted corresponding to the network card to be deleted identifier is a virtual network card to be deleted or a physical network card to be deleted; and In response to the to-be-deleted network card being the to-be-deleted physical network card, the to-be-deleted physical network card is moved from the container network namespace corresponding to the to-be-deleted container group to the initial network namespace.
11. The method according to claim 10, characterized in that The method further comprises: In response to the to-be-deleted network card being the to-be-deleted virtual network card, obtaining a second required accelerator card resource corresponding to the to-be-deleted container group and a second available accelerator card resource corresponding to the server node to which the to-be-deleted container group is scheduled; comparing the second required accelerator card resources with the second available accelerator card resources; In response to the second required accelerator card resources being less than the second available accelerator card resources, querying second data link information corresponding to the to-be-deleted virtual network card according to the to-be-deleted network card identifier; Acquire the Internet Protocol address to be deleted corresponding to the virtual network card to be deleted, and delete the Internet Protocol address to be deleted according to the second data link information; Obtaining a second original physical address corresponding to the virtual network card to be deleted; Restoring the second original physical address for the virtual network card to be deleted; and Move the virtual network card to be deleted from the container network namespace corresponding to the container group to be deleted to the initial network namespace.
12. The method according to claim 11, characterized in that The method further comprises: In response to the second required accelerator card resources being equal to the second available accelerator card resources, searching for the physical network card to be deleted corresponding to the virtual network card to be deleted according to the network card identifier to be deleted; and The Internet Protocol address to be deleted corresponding to the physical network card to be deleted is deleted, and the physical network card to be deleted is moved from the container network namespace corresponding to the container group to be deleted to the initial network namespace.
13. The method according to claim 12, characterized in that The method further comprises: In response to the second required accelerator card resources being greater than the second available accelerator card resources, searching for the physical network card to be deleted corresponding to the virtual network card to be deleted according to the network card identifier to be deleted; and The Internet Protocol address to be deleted corresponding to the physical network card to be deleted is deleted, and the physical network card to be deleted is moved from the container network namespace corresponding to the container group to be deleted to the initial network namespace.
14. The method according to claim 11, characterized in that The second required accelerator card resources are accelerator card resources that are expected to be used when the container group to be deleted on the current server node communicates with container groups on other server nodes when the container group to be deleted executes the deep learning task.
15. The method according to claim 11, characterized in that The second available acceleration card resource is the acceleration card resource actually loaded in the current server node where the container group to be deleted is located.
16. The method according to claim 1, wherein Communication between container groups on multiple server nodes includes communication between GPUs corresponding to the container groups on the multiple server nodes.
17. The method according to claim 1, wherein The configuring the target virtual network card for the target container group according to the first required accelerator card resources, or mapping the target virtual network card to the target physical network card corresponding to the target virtual network card and configuring the target physical network card corresponding to the target virtual network card for the target container group, includes: Determining, based on the first required accelerator card resources, a communication performance requirement of the target container group corresponding to the deep learning task; In response to the communication performance requirement being less than a preset threshold, configuring the target virtual network card for the target container group; and In response to the communication performance requirement being greater than or equal to a preset threshold, the target virtual network card is mapped to the target physical network card corresponding to the target virtual network card, and the target physical network card corresponding to the target virtual network card is configured for the target container group.
18. A network card configuration device, characterized in that: The device comprises: An allocation module is configured to associate a target network card identifier with the target container group during the target container group generation process; wherein the target container group is a container group in the current server node used to execute the deep learning task; A first judgment module is configured to judge whether the target network card corresponding to the target network card identifier is a target virtual network card or a target physical network card; wherein the target virtual network card is obtained by virtualizing the target physical network card; a first acquisition module, configured to, in response to the target network card corresponding to the target network card identifier being the target virtual network card, acquire a first required accelerator card resource corresponding to the target container group; wherein the first required accelerator card resource is an accelerator card resource expected to be used when the target container group on the current server node communicates with container groups on other server nodes when the target container group executes the deep learning task; and The first configuration module is configured to configure the target virtual network card for the target container group, or map the target virtual network card to the target physical network card corresponding to the target virtual network card and configure the target physical network card corresponding to the target virtual network card for the target container group.
19. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the network card configuration method according to any one of claims 1 to 12 by executing the computer instructions.
20. A non-volatile computer-readable storage medium, characterized in that The non-volatile computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the network card configuration method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Data processing method, programmable network card equipment, physical server and storage medium
CN113821310A
Virtual network card resource configuration method and device, computer equipment and medium
CN114244717A
Accelerator card distributed storage access method and device, equipment and storage medium
CN115167757A
Network card configuration method and device, electronic equipment and storage medium
CN117692322A
Virtual network card resource configuration method and apparatus, computer device, and medium
WO2023160033A1