K8s-based AI component management method, device and equipment
Through the K8s cluster and Operator framework, monitor configuration file events, create DaemonSet, and realize automatic installation of AI components, solve the installation problem without turning on the SSH service environment, and improve installation efficiency and security.
Patent Information
- Application Number
- CN202510275415.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-07-11
AI Technical Summary
The existing automatic installation solution for AI components cannot be implemented in an environment without SSH services, resulting in inefficient installation.
Through the K8s cluster and Operator framework, listen for commit events of driver and non-driven component configuration files, create corresponding DaemonSets, and run driver installers and other component containers in the K8s cluster nodes to realize automatic installation of AI components and avoid relying on SSH services.
Without relying on SSH services, the automatic installation of AI components is realized, which expands the applicable scenarios of the solution and improves installation efficiency and security.
Smart Images

Figure CN120295641A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of AI (Artificial Intelligence) technology, and in particular, to a method, device, and equipment for managing AI components based on K8s. Background Art
[0002] AI components are the basic units for building and implementing artificial intelligence systems. Each component is responsible for different tasks, such as data processing, model training, inference, etc. By combining different AI components, developers can create powerful AI applications, which are widely used in various fields such as autonomous driving, speech recognition, image analysis, recommendation systems, etc.
[0003] Currently, in order to improve the installation efficiency of AI components, an automatic installation method is usually adopted to install AI components on nodes.
[0004] However, in the current AI component automatic installation solution, it is required that the node enables the SSHD (Secure Shell Daemon) service. For an environment without SSHD enabled, automatic installation cannot be achieved. Summary of the Invention
[0005] In view of this, this application provides a method, device, and equipment for managing AI components based on K8s.
[0006] According to the first aspect of the embodiments of this application, a method for managing AI components based on K8s is provided, including:
[0007] When a drive configuration file submission event is monitored, obtain target drive configuration information;
[0008] When it is determined according to the target drive configuration information that there is no drive daemon set (DaemonSet) whose corresponding configuration information is consistent with the target drive configuration information, create a corresponding target drive DaemonSet according to the target drive configuration information;
[0009] According to the target drive DaemonSet, create a first container for running a drive installer in each K8s cluster node, and run the drive installer in the created first container; wherein, the drive installer is used to perform drive installation processing in the K8s cluster node where it is located according to the target drive configuration information;
[0010] When a non-drive component configuration file submission event is monitored, obtain target non-drive component configuration information;
[0011] For any non-driving component, in the case where it is determined according to the target non-driving component configuration information corresponding to the non-driving component that there is no non-driving component DaemonSet with corresponding configuration information consistent with the target non-driving component configuration information, a corresponding non-driving component DaemonSet is created according to the target non-driving component configuration information, and corresponding non-driving component installation processing is performed on each K8s cluster node according to the non-driving component DaemonSet.
[0012] According to the second aspect of the embodiments of the present application, there is provided an AI component management device based on K8s, which is deployed on a K8s operator Operator. The device includes:
[0013] A listening unit, configured to listen for a driving configuration file submission event or a non-driving component configuration file submission event;
[0014] An obtaining unit, configured to obtain target driving configuration information when the listening unit listens for a driving configuration file submission event;
[0015] A creating unit, configured to create a corresponding target driving DaemonSet according to the target driving configuration information in the case where it is determined according to the target driving configuration information that there is no driving daemon set DaemonSet with corresponding configuration information consistent with the target driving configuration information;
[0016] The creating unit is further configured to, according to the target driving DaemonSet, create a first container for running a driving installer in each K8s cluster node, and run the driving installer in the created first container; wherein, the driving installer is used to perform driving installation processing in the K8s cluster node where it is located according to the target driving configuration information;
[0017] The obtaining unit is further configured to obtain target non-driving component configuration information when a non-driving component configuration file submission event is listened for;
[0018] The creating unit is further configured to, for any non-driving component, in the case where it is determined according to the target non-driving component configuration information corresponding to the non-driving component that there is no non-driving component DaemonSet with corresponding configuration information consistent with the target non-driving component configuration information, create a corresponding non-driving component DaemonSet according to the target non-driving component configuration information, and perform corresponding non-driving component installation processing on each K8s cluster node according to the non-driving component DaemonSet.
[0019] According to a third aspect of the embodiments of the present application, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0020] The memory is used to store a computer program;
[0021] When the processor is used to execute the program stored on the memory, it implements the method provided in the first aspect.
[0022] According to a fourth aspect of the embodiments of the present application, a non-temporary computer-readable storage medium is provided. The non-temporary computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the method provided in the first aspect.
[0023] The AI component management method based on K8s in the embodiments of the present application realizes AI component management through a K8s cluster and an Operator framework. By listening to the drive configuration file submission event and the non-drive component configuration file submission event, when the drive configuration file submission event is monitored, the target drive configuration information is obtained. When it is determined that there is no corresponding drive DaemonSet with configuration information consistent with the target drive configuration information according to the target drive configuration information, a corresponding target drive DaemonSet is created according to the target drive configuration information, and according to the target drive DaemonSet, a first container for running a drive installer is created in each K8s cluster node, and the drive installer is run in the created first container. The drive installer performs drive installation processing in the K8s cluster node where it is located according to the target drive configuration information; similarly, when the non-drive component configuration file submission event is monitored, the target non-drive component configuration information is obtained; for any non-drive component, when it is determined that there is no corresponding non-drive component DaemonSet with configuration information consistent with the target non-drive component configuration information according to the target non-drive component configuration information corresponding to the non-drive component, a corresponding non-drive component DaemonSet is created according to the target non-drive component configuration information, and according to the non-drive component DaemonSet, corresponding non-drive component installation processing is performed in each K8s cluster node. Thus, the automatic installation of AI components can be realized without relying on the SSH service of the node, and the applicable scenario of the solution is extended while ensuring security. Description of the Drawings
[0024] Figure 1 It is a schematic flowchart of an AI component management method based on K8s provided by the embodiments of the present application;
[0025] Figure 2It is a schematic architecture diagram of an AI component system based on a K8s cluster provided by an embodiment of the present application;
[0026] Figure 3 It is a schematic flowchart of an AI component management method based on K8s provided by an embodiment of the present application;
[0027] Figure 4 It is a schematic structural diagram of an AI component management device based on K8s provided by an embodiment of the present application;
[0028] Figure 5 It is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0029] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, some terms involved in the embodiments of the present application are described below.
[0030] Container: It is a technology for packaging an application program and all its dependencies together for transplantation and operation in different computing environments. A container provides an isolated running environment, enabling different application programs to run in independent file systems, networks, process spaces, etc., improving the convenience of application development, testing, and deployment management.
[0031] Kubernetes (abbreviated as K8s): It is an open-source portable and extensible orchestration system that can automate the deployment and management of container applications.
[0032] Pod: A group of containers defined in K8s that share some namespaces.
[0033] DaemonSet (daemon set): A type of workload in K8s used to ensure that one and only one application instance (running the application instance through a Pod) runs on all (or some) nodes. When a node joins the cluster, a new application instance will also be added to the new node. When a node is removed from the cluster, these application instances will also be recycled. Deleting a DaemonSet will delete all Pods it creates.
[0034] In order to make the above-mentioned objects, features, and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below with reference to the accompanying drawings.
[0035] It should be noted that the sequence numbers of the steps in the embodiments of the present application do not indicate the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0036] Please refer toFigure 1 , which is a schematic flowchart of an AI component management method based on K8s provided by an embodiment of this application. Among them, the AI component management method based on K8s can be applied to a K8s Operator (hereinafter referred to as Operator for short). Operator runs on the control plane of the K8s cluster. As Figure 1 shown, the AI component management method based on K8s may include the following steps:
[0037] Exemplarily, Operator is a controller that extends the capabilities of K8s, manages and listens to one or more CRDs, and takes CRD-specific operations to achieve the extension of K8s capabilities.
[0038] CRD (Custom Resource Definition) is a built-in resource type in K8s, which is used to extend K8s and allows users to create and manage custom resources.
[0039] Step S100: When a drive configuration file submission event is monitored, obtain target drive configuration information.
[0040] Exemplarily, users can submit a drive configuration file to the K8s cluster when initially creating a drive configuration file or when a drive configuration file needs to be updated.
[0041] Exemplarily, in the K8s cluster, configuration files are usually in YAML (YAML Ain't Markup Language) format.
[0042] Exemplarily, the drive configuration file belongs to a type of CRD resource.
[0043] Operator can monitor the drive configuration file submission event, and when the drive configuration file submission event is monitored, obtain the drive configuration information included in the drive configuration file (which can be called target drive configuration information).
[0044] Exemplarily, the drive configuration information may include but is not limited to drive version information and drive configuration parameter information, etc.
[0045] Step S110: When it is determined according to the target drive configuration information that there is no corresponding drive DaemonSet whose configuration information is consistent with the target drive configuration information, create a corresponding target drive DaemonSet according to the target drive configuration information.
[0046] In the embodiments of the present application, in order to enable the automatic installation of AI components on each K8s cluster node, the AI components in each K8s cluster node can be created and run in the form of a DaemonSet.
[0047] That is, for any AI component, when the Operator determines that it is necessary to create and run the AI component on a K8s cluster node, a DaemonSet of the AI component can be created, and the AI component can be created on the K8s cluster node according to the DaemonSet of the AI component.
[0048] Exemplarily, the AI component can include a driver or a non-driver component (AI component other than the driver).
[0049] Correspondingly, when the Operator obtains the target driver configuration information, it can query whether a driver DaemonSet (daemon set) has been created according to the obtained target driver configuration information.
[0050] When it is queried that the driver DaemonSet has been created, the target driver configuration information can be further compared with the configuration information corresponding to the driver DaemonSet to determine whether they are consistent.
[0051] When the driver DaemonSet has not been created, or the driver DaemonSet has been created but the driver configuration information corresponding to the created driver DaemonSet is inconsistent with the target driver configuration information, a corresponding driver DaemonSet (which can be called the target driver DaemonSet) can be created according to the target driver configuration information.
[0052] Step S120: Create a first container for running a driver installer in each K8s cluster node according to the target driver DaemonSet, and run the driver installer in the created first container; wherein, the driver installer is used to perform driver installation processing in the K8s cluster node where it is located according to the target driver configuration information.
[0053] In the embodiments of the present application, when the Operator creates the target driver DaemonSet, it can create a container (which can be called the first container) for running a driver installer (driver-installer) in each K8s cluster node according to the target driver DaemonSet, and run the driver installer in the created first container.
[0054] The driver installer can perform driver installation processing in the K8s cluster node where it is located according to the target driver configuration information.
[0055] Exemplarily, the driver installer can enter the node host namespace by using nsenter (a Linux command line tool) within the container to perform the driver installation process.
[0056] Exemplarily, for any K8s cluster node, the driver installer can determine whether the driver has been installed on the K8s cluster node.
[0057] In the case where the driver has not been installed on the K8s cluster node, the driver installer can install the driver on the K8s cluster node.
[0058] In the case where the driver has been installed on the K8s cluster node, the driver installer can compare the version information of the driver installed on the K8s cluster node with the driver version information included in the target driver configuration information (which can be referred to as the target driver version information).
[0059] In the case where the version information of the driver installed on the K8s cluster node is inconsistent with the target driver version information, the driver installer can perform a driver upgrade process on the K8s cluster node.
[0060] In the case where the version information of the driver installed on the K8s cluster node is consistent with the target driver version information, the driver installer can skip the driver installation process for the K8s cluster node.
[0061] It should be noted that in the embodiments of the present application, the driver configuration file may further include node affinity information, and the node affinity information can be used to indicate the node attributes required by the driver of a specified version, so that the operation of the driver of the specified version on which K8s cluster nodes can be controlled.
[0062] Exemplarily, node affinity can help the Operator decide which K8s cluster nodes to schedule the driver of a specified version by defining a set of rules.
[0063] For example, assuming that a certain version of the driver needs to be scheduled to nodes with solid state drives, during the process of scheduling the driver of this version, the Operator can obtain whether each K8s cluster node has a solid state drive; for the K8s cluster nodes with solid state drives, the driver of this version can be scheduled to the K8s cluster; for the K8s cluster nodes without solid state drives, scheduling the driver of this version to the K8s cluster is refused.
[0064] Step S130, in the case of monitoring a non-driver component configuration file submission event, obtain the target non-driver component configuration information.
[0065] Exemplarily, similar to the driver processing, the user can also create or update non-driver components in the K8s cluster nodes by submitting a non-driver component configuration file.
[0066] Exemplarily, the user can submit the non-driver component configuration file to the K8s cluster when initially creating the non-driver component configuration file or when the non-driver component configuration file needs to be updated.
[0067] Exemplarily, the non-driver component configuration file also belongs to a type of CRD resource.
[0068] The Operator can listen for the submission event of the non-driver component configuration file and, when the submission event of the non-driver component configuration file is detected, obtain the configuration information included in the non-driver component configuration file (which can be referred to as the target non-driver component configuration information).
[0069] Step S140: For any non-driver component, when it is determined, based on the target non-driver component configuration information corresponding to the non-driver component, that there is no non-driver component DaemonSet with corresponding configuration information consistent with the target non-driver component configuration information, create the corresponding non-driver component DaemonSet based on the target non-driver component configuration information, and perform the corresponding non-driver component installation processing on each K8s cluster node based on the non-driver component DaemonSet.
[0070] In the embodiment of the present application, for any non-driver component, when the Operator obtains the corresponding target non-driver component configuration information, it can query whether the corresponding non-driver component DaemonSet has been created based on the obtained target non-driver component configuration information.
[0071] When it is queried that the non-driver component DaemonSet has been created, the target non-driver component configuration information can be further compared with the configuration information corresponding to the non-driver component DaemonSet to determine whether they are consistent.
[0072] When the non-driver component DaemonSet has not been created, or when the non-driver component DaemonSet has been created but the corresponding driver configuration information of the created non-driver component DaemonSet is inconsistent with the target non-driver component configuration information, create the corresponding non-driver component DaemonSet based on the target non-driver component configuration information, and perform the corresponding non-driver component installation processing on each K8s cluster node based on the non-driver component DaemonSet.
[0073] It can be seen that in Figure 1In the method process shown, AI component management is implemented based on the K8s cluster and the Operator framework. By listening for the submission event of the driver configuration file and the submission event of the non-driver component configuration file, when the submission event of the driver configuration file is monitored, the target driver configuration information is obtained. When it is determined that there is no corresponding driver DaemonSet with configuration information consistent with the target driver configuration information based on the target driver configuration information, a corresponding target driver DaemonSet is created according to the target driver configuration information, and based on the target driver DaemonSet, a first container for running the driver installer is created in each K8s cluster node, and the driver installer is run in the created first container. The driver installer performs driver installation processing in the corresponding K8s cluster node according to the target driver configuration information. Similarly, when the submission event of the non-driver component configuration file is monitored, the target non-driver component configuration information is obtained. For any non-driver component, when it is determined that there is no corresponding non-driver component DaemonSet with configuration information consistent with the target non-driver component configuration information based on the target non-driver component configuration information corresponding to the non-driver component, a corresponding non-driver component DaemonSet is created according to the target non-driver component configuration information, and based on the non-driver component DaemonSet, corresponding non-driver component installation processing is performed in each K8s cluster node. Thus, the automatic installation of AI components can be realized without relying on the SSH service of the node, and the applicable scenario of the solution is extended while ensuring security.
[0074] In some embodiments, the non-driver component includes a container runtime; the non-driver component DaemonSet corresponding to the container runtime is a container toolkit DaemonSet.
[0075] The above-mentioned performing corresponding non-driver component installation processing in each K8s cluster node based on the non-driver component DaemonSet may include:
[0076] Based on the container toolkit DaemonSet, a second container for running the container toolkit is created in each K8s cluster node, and the container toolkit is run in the created second container; wherein, the container toolkit is used to perform container runtime installation processing according to the container engine of the corresponding K8s cluster node.
[0077] Exemplarily, the non-driver component may include a container runtime. The non-driver component DaemonSet corresponding to the container runtime is a container toolkit DaemonSet.
[0078] For a container runtime, in the case where, according to the corresponding target non-driver component configuration information, it is determined that there is no container toolkit DaemonSet with corresponding configuration information consistent with the target non-driver component configuration information, a corresponding container toolkit DaemonSet can be created according to the target non-driver component configuration information.
[0079] In the case where a container toolkit DaemonSet is created, according to the container toolkit DaemonSet, containers for running the container toolkit (which can be referred to as second containers) can be created in each K8s cluster node, and the container toolkit can be run in the created second containers.
[0080] The container toolkit can perform container runtime installation processing according to the container engine (such as Docker or Containerd, etc.) of the K8s cluster node where it is located.
[0081] In some embodiments, the non-driver component includes feature-discovery; the non-driver component DaemonSet corresponding to feature-discovery is the feature-discovery DaemonSet;
[0082] The above-mentioned corresponding non-driver component installation processing in each K8s cluster node according to the non-driver component DaemonSet may include:
[0083] According to the feature-discovery DaemonSet, third containers for running feature-discovery are created in each K8s cluster node, and feature-discovery is run in the created third containers; among them, feature discovery is used to collect the attributes of the AI acceleration cards (abbreviated as AI cards) of the K8s cluster nodes where it is located.
[0084] Exemplarily, the non-driver component may include feature-discovery (feature discovery), and the non-driver component DaemonSet corresponding to feature discovery is the feature-discovery DaemonSet.
[0085] For feature discovery, in the case where, according to the corresponding target non-driver component configuration information, it is determined that there is no feature-discovery DaemonSet with corresponding configuration information consistent with the target non-driver component configuration information, a corresponding feature-discovery DaemonSet can be created according to the target non-driver component configuration information.
[0086] In the case where the feature-discovery DaemonSet is created, containers for running feature-discovery (which can be referred to as third containers) can be created in each K8s cluster node based on the feature-discovery DaemonSet, and feature-discovery can be run in the created third containers.
[0087] Exemplarily, feature discovery can be used to collect the AI card attributes of the K8s cluster node where it is located.
[0088] Exemplarily, the AI card can include, but is not limited to, an NPU (Neural Processing Unit) card, a GPU (Graphics Processing Unit) or a DCU (Data Center Unit) card.
[0089] Exemplarily, the AI card attributes can include, but are not limited to, attributes such as the driver version and the card model.
[0090] Exemplarily, the Operator can configure the parameters of the device plugin according to the AI card attributes collected by feature discovery, such as the card model.
[0091] In some embodiments, the non-driver component includes the device-plugin; the non-driver component DaemonSet corresponding to the device-plugin is the device-plugin DaemonSet;
[0092] The above-mentioned installation process of the corresponding non-driver component in each K8s cluster node based on the non-driver component DaemonSet can include:
[0093] Based on the device-plugin DaemonSet, a fourth container for running the device-plugin is created in each K8s cluster node, and the device-plugin is run in the created fourth container; wherein, the device-plugin is used to report the number of AI cards of the K8s cluster node where it is located, and allocate AI cards to the containers that receive the control instruction to use the AI cards.
[0094] Exemplarily, the non-driver component can include the device-plugin (device plugin), and the non-driver component DaemonSet corresponding to the device-plugin is the device-plugin DaemonSet.
[0095] For a device-plugin, in the case where, according to the configuration information of the corresponding target non-driver component, it is determined that there is no device-plugin DaemonSet with corresponding configuration information identical to the configuration information of the target non-driver component, a corresponding device-plugin DaemonSet can be created according to the configuration information of the target non-driver component.
[0096] In the case where a device-plugin DaemonSet is created, containers for running the device-plugin (which can be referred to as the fourth containers) can be created in each K8s cluster node according to the device-plugin DaemonSet, and the device-plugin can be run in the created fourth containers.
[0097] In some embodiments, the non-driver component includes an Exporter; the non-driver component DaemonSet corresponding to the Exporter is the Exporter DaemonSet;
[0098] The above-mentioned installation process of the corresponding non-driver component in each K8s cluster node according to the non-driver component DaemonSet may include:
[0099] According to the Exporter DaemonSet, fifth containers for running the Exporter are created in each K8s cluster node, and the Exporter is run in the created fifth containers; wherein, the Exporter is used to provide monitoring data externally.
[0100] Exemplarily, the non-driver component may include an Exporter (metric provider). The non-driver component DaemonSet corresponding to the Exporter is the Exporter DaemonSet.
[0101] For the Exporter, in the case where, according to the configuration information of the corresponding target non-driver component, it is determined that there is no Exporter DaemonSet with corresponding configuration information identical to the configuration information of the target non-driver component, a corresponding Exporter DaemonSet can be created according to the configuration information of the target non-driver component.
[0102] In the case where an Exporter DaemonSet is created, containers for running the Exporter (which can be referred to as the fifth containers) can be created in each K8s cluster node according to the Exporter DaemonSet, and the Exporter is run in the created fifth containers.
[0103] Exemplarily, the Exporter can be used to externally provide monitoring data.
[0104] Exemplarily, in a K8s cluster, the monitoring system (Prometheus) can directly interface with the Exporter to achieve node monitoring; or, it can interface with the Exporter through a Service Monitor to achieve node monitoring.
[0105] Exemplarily, the Service Monitor can be used to monitor specified metrics of specified services of nodes in the K8s cluster where it is located.
[0106] Exemplarily, the Service Monitor defines the targets that Prometheus needs to scrape. By configuring information such as service selectors, endpoints, and namespace selectors in the Service Monitor, Prometheus can know which metrics (i.e., the above-specified metrics) to scrape from which ports of which services (i.e., the above-specified services).
[0107] In one example, the Exporter is responsible for exposing metrics. Each application or system to be monitored will run one or more Exporters, exposing their measurement data through an HTTP (HyperText Transfer Protocol) interface.
[0108] The ServiceMonitor is a tool used by Prometheus to automatically discover Exporters. It helps Prometheus discover and scrape these exposed metrics by defining service selectors and endpoints.
[0109] In some embodiments, the above-mentioned installation process of the non-driving component in each K8s cluster node according to the non-driving component DaemonSet may include:
[0110] Running an initialization container in each K8s cluster node according to the non-driving component DaemonSet; wherein, the initialization container is used to verify whether the dependencies of the non-driving component are ready;
[0111] For any K8s cluster node, when the initialization container in the K8s cluster node has finished running, perform the installation process of the non-driving component in the K8s cluster node according to the non-driving component DaemonSet; wherein, the completion of the initialization container running indicates that the dependencies of the non-driving component are ready.
[0112] Exemplarily, considering that different AI components have a certain startup dependency order, when an AI component starts up, it needs to wait for the AI components it depends on to run properly.
[0113] To ensure the normal startup of AI components, the dependencies of AI components can be verified through an InitContainer (initialization container).
[0114] Accordingly, during the installation process of non-driver components, for any non-driver component, an initialization container can be run in each K8s cluster node according to the DaemonSet of the non-driver component.
[0115] Exemplarily, the completion of the initialization container's operation indicates that the dependencies of the non-driver component are ready.
[0116] For any K8s cluster node, when the initialization container in the K8s cluster node has completed its operation, the installation process of the non-driver component is carried out in the K8s cluster node according to the DaemonSet of the non-driver component.
[0117] In some embodiments, when the event of the submission of the non-driver component configuration file is first detected, it may further include:
[0118] Create a validator DaemonSet;
[0119] According to the validator DaemonSet, a sixth container for running the validator is created in each K8s cluster node, and the validator is run in the created sixth container; wherein, the validator is used to verify whether the installed AI components are normal.
[0120] Exemplarily, to ensure the normal operation of the installed AI components (including the driver or any non-driver AI component), a validator can be introduced to verify the installation correctness of the installed AI components.
[0121] Considering that there is a corresponding installation correctness verification mechanism during the installation of the driver, therefore, it is not necessary to verify the installation correctness of the driver through the validator.
[0122] Accordingly, when the event of the submission of the non-driver component configuration file is first detected, a validator DaemonSet can be created, and according to the validator DaemonSet, a container for running the validator (which can be called the sixth container) is created for each K8s cluster node, and the validator is run in the sixth container to verify whether the installed components are normal by using it, for example, verifying whether the container runtime configuration is normal, etc., to further ensure that the application can use the AI card normally after the AI components are started.
[0123] Exemplarily, it is possible to determine which AI components the validator needs to perform installation correctness verification on according to which non-driving components are configured in the non-driving component configuration file.
[0124] Exemplarily, for any non-driving component, the initialization container of the non-driving component can determine whether the dependencies are ready according to the verification results of the dependencies by the validator. Furthermore, it is possible to determine whether to perform the installation process of the non-driving component according to whether the dependencies are ready.
[0125] In some embodiments, the target driver configuration information includes target driver version information;
[0126] The driver installer performs driver installation processing in the K8s cluster nodes where it is located according to the target driver configuration information, which may include:
[0127] For any K8s cluster node, in the case where a driver is installed in the K8s cluster node but the driver version information is inconsistent with the target driver version information, set the K8s cluster node to unschedulable;
[0128] Remove the containers using the AI card on the K8s cluster node;
[0129] Perform a driver upgrade on the K8s cluster node. In the case where the driver upgrade is successful, set the K8s cluster node to the schedulable state.
[0130] Exemplarily, in the case where the driver installer determines that a driver upgrade needs to be performed on the K8s cluster node where it is located, for example, the driver version of the K8s cluster node is lower than the driver version indicated by the target driver version information (which can be referred to as the target driver version), the K8s cluster node can be first set to unschedulable to prevent new containers from running on the K8s cluster node and affecting the driver upgrade.
[0131] In addition, considering that the driver cannot be upgraded when it is in use (i.e., the AI card is in use), therefore, in the case where the driver needs to be upgraded, the containers using the AI card on the K8s cluster node can also be removed.
[0132] In the case where the above preparatory work is completed, the K8s cluster node can be subjected to a driver upgrade.
[0133] In the case where the driver upgrade is completed, the upgraded driver can be verified to determine whether the driver upgrade is successful.
[0134] In the case where the driver upgrade is successful, the K8s cluster node can be reset to the schedulable state.
[0135] In some embodiments, the method for managing AI components based on K8s provided by the embodiments of the present application may further include:
[0136] Obtain the node information of each K8s cluster node;
[0137] For any K8s cluster node, when the K8s cluster node has an AI card and the specified label is not set, set the specified label for the K8s cluster node, and the specified label is used to identify that the K8s cluster node has an AI card;
[0138] When the K8s cluster node does not have an AI card and the specified label is set, delete the specified label of the target K8s cluster node.
[0139] The above-mentioned creating, according to the target-driven DaemonSet, a first container for running a driver installer in each K8s cluster node and running the driver installer in the created first container may include:
[0140] According to the target-driven DaemonSet, create a first container for running a driver installer in each K8s cluster node with the specified label, and run the driver installer in the created first container;
[0141] The above-mentioned performing corresponding non-driver component installation processing in each K8s cluster node according to the non-driver component DaemonSet may include:
[0142] According to the non-driver component DaemonSet, perform corresponding non-driver component installation processing in each K8s cluster node with the specified label.
[0143] Exemplarily, in order to implement automated management of AI components on K8s cluster nodes, the Operator may obtain the node information of each K8s cluster node.
[0144] In one example, the Operator may obtain the node information of each K8s cluster node when a node change event is detected.
[0145] Exemplarily, the node change event may include adding a node, a change in the AI card status of a node, etc.
[0146] In another example, the Operator may periodically obtain the node information of each K8s cluster node.
[0147] Exemplarily, a node information acquisition time may be preset, and the Operator may obtain the node information of each K8s cluster node when it is determined that the preset node information acquisition time is reached.
[0148] For example, obtain the node information of each K8s cluster node every ΔT time.
[0149] In another example, the Operator can obtain the node information of each K8s cluster node when it monitors a node change event or determines that the preset node information acquisition time has been reached.
[0150] The Operator can determine whether a K8s cluster node has an AI card based on the obtained node information of the K8s cluster node.
[0151] Exemplarily, the node information of a K8s cluster node can include a node label, which can be used to identify attributes useful to the system or user.
[0152] For example, in a K8s cluster, a collection program can be used to obtain the PCI (Peripheral Component Interconnect) devices of each node, and the control plane can set PCI device labels for the corresponding nodes to identify which PCI devices the nodes have.
[0153] Exemplarily, the PCI device includes an AI card. Thus, the Operator can determine whether a K8s cluster node has an AI card based on the PCI device label of the K8s cluster node.
[0154] Exemplarily, for any K8s cluster node, when it is determined that the K8s cluster node has an AI card and no specified label is set, a specified label is set for the K8s cluster node.
[0155] Exemplarily, the specified label is used to identify that the K8s cluster node has an AI card.
[0156] Exemplarily, for any K8s cluster node, when it is determined that the K8s cluster node does not have an AI card, it can be further determined whether the K8s cluster node is set with a specified label.
[0157] If the K8s cluster node is set with a specified label, that is, the AI card on the K8s cluster node is removed, in this case, the specified label of the K8s cluster node can be deleted.
[0158] Correspondingly, during the installation of the AI component, the AI component can be installed for the K8s cluster nodes set with the above-mentioned specified label (i.e., having an AI card).
[0159] Exemplarily, during the installation of the driver, based on the target driver DaemonSet, a first container for running the driver installer can be created in each K8s cluster node with a specified label, and the driver installer can be run in the created first container.
[0160] During the installation process of non-drive components, according to the non-drive component DaemonSet, the corresponding non-drive component installation process can be carried out in each K8s cluster node with specified labels.
[0161] In one example, the K8s-based AI component management method provided by the embodiments of the present application may further include:
[0162] For a newly added K8s cluster node with specified labels, according to the target driver DaemonSet, create the first container in the K8s cluster node, and run the driver installer in the created first container; and, according to the non-drive component DaemonSet, perform the corresponding non-drive component installation process in the K8s cluster node;
[0163] For any K8s cluster node, when the specified label of the K8s cluster node is deleted, perform AI component uninstallation processing on the K8s cluster node.
[0164] Exemplarily, considering that in the actual scenario, new nodes may be added to the K8s cluster. In addition, there may be cases where AI cards are added or removed from the K8s cluster nodes. To achieve automated management of AI components, the Operator can, according to the changes in the K8s cluster nodes and the changes in the AI labels of the K8s cluster nodes, automatically install or uninstall AI components on the corresponding nodes.
[0165] Correspondingly, for a newly added K8s cluster node with specified labels (including a K8s cluster node that newly joins the cluster and has specified labels, or a K8s cluster node that has joined the cluster but newly adds specified labels), AI component installation processing can be automatically performed. That is, according to the target driver DaemonSet, create the first container in the K8s cluster node, and run the driver installer in the created first container; and, according to the non-drive component DaemonSet, perform the corresponding non-drive component installation process in the K8s cluster node.
[0166] For any K8s cluster node, when the specified label of the K8s cluster node is deleted (such as when the AI card of the node is removed), AI component uninstallation processing can be performed on the K8s cluster node, that is, uninstall the driver and non-drive components installed on the K8s cluster node.
[0167] In some embodiments, the owner of the driver DaemonSet is the driver configuration file; the owner of the non-drive component DaemonSet is the non-drive component configuration file;
[0168] The K8s-based AI component management method provided by the embodiments of the present application may further include:
[0169] In the case of monitoring a drive configuration file deletion event, delete the target drive Dameonset, delete the first container in each K8s cluster node, and uninstall the drive installer and drive installed in each K8s cluster node;
[0170] In the case of monitoring a non-drive component configuration file deletion event, delete the non-drive component DaemonSet, delete the container used to run the non-drive component in each K8s cluster node, and uninstall the non-drive component installed in each K8s cluster node.
[0171] Exemplarily, in order to improve the uninstallation efficiency of the AI component, during the installation process of the AI component, in the case of creating the DaemonSet corresponding to the AI component, the owner setting can be performed for the DaemonSet.
[0172] Exemplarily, the owner of the drive DaemonSet is the drive configuration file; the owner of the non-drive component DaemonSet is the non-drive component configuration file.
[0173] Exemplarily, for any DaemonSet, in the case where the owner of the DaemonSet is deleted, automatically delete the DaemonSet and uninstall the corresponding AI component.
[0174] Correspondingly, in the case of monitoring a drive configuration file deletion event, delete the target drive Dameonset, delete the first container in each K8s cluster node, and uninstall the drive installer and drive installed in each K8s cluster node;
[0175] In the case of monitoring a non-drive component configuration file deletion event, delete the non-drive component DaemonSet, delete the container used to run the non-drive component in each K8s cluster node, and uninstall the non-drive component installed in each K8s cluster node.
[0176] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of the present application, the technical solutions provided in the embodiments of the present application will be described below in conjunction with specific examples.
[0177] Taking the AI card as an NPU card as an example, in this embodiment, an AI component system based on a K8s cluster is provided to reduce the complexity of using the NPU card for AI tasks and improve the work efficiency of operation and maintenance implementation.
[0178] In this embodiment, as Figure 2As shown, the AI component system based on the K8s cluster can be implemented using the Operator framework, including Operator, feature-discovery, container-toolkit, driver-installer, driver configuration file (CRD type), and non-driver component configuration file (CRD type). Among them:
[0179] Driver configuration file: Used to declare driver configuration information such as the NPU driver version.
[0180] Exemplarily, the driver configuration file supports the node affinity of K8s. Affinity allows nodes that meet the affinity requirements (i.e., K8s cluster nodes, the same below) to install and upgrade the specified NPU driver version.
[0181] Non-driver component configuration file: Supports defining the configuration information of other AI components except the driver, which may include but are not limited to: container runtime, device-plugin, exporter components, etc.
[0182] Driver installer: Runs on the nodes in the form of a DaemonSet to install the specified version of the NPU driver.
[0183] Container toolkit: Runs on the nodes in the form of a DaemonSet to install the corresponding container runtime software according to the different container engines used by the nodes (such as: Docker, Containerd).
[0184] Feature discovery: Runs on the nodes in the form of a DaemonSet to collect the attributes of the NPU cards on the nodes (including but not limited to: driver version, card model, etc.), which are used by the operator to configure the parameters of the device plugin according to information such as the model of the NPU card during the installation of the device plugin.
[0185] Device-plugin: Runs on the nodes in the form of a DaemonSet to report the NPU card resources of the nodes to K8s, enabling K8s to schedule containers and allocate NPU cards to containers according to the NPU card resources of the nodes.
[0186] operator-validator: Runs on the nodes in the form of a DaemonSet to verify whether the components related to the NPU cards on the nodes can be used normally.
[0187] The operator can monitor the changes of three types of resource objects, which can include: driver configuration files, non-driver component configuration files, and cluster nodes (node changes mainly include: scaling out (such as adding new nodes), node label changes, etc.). By monitoring the changes of these three types of resource objects, the operator automatically manages AI components.
[0188] Exemplarily, when the operator is started, it can monitor the changes of cluster nodes, identify the nodes with NPU cards in real time, and thus perform automatic management.
[0189] Exemplarily, nodes with NPU cards can be identified based on the node labels of the nodes (used to identify attributes useful for the system or users in the K8s cluster).
[0190] Exemplarily, in the K8s cluster, the PCI devices of each node can be obtained through a collection program, and PCI device labels can be set for the corresponding nodes through the control plane to identify which PCI devices the nodes have.
[0191] Exemplarily, the PCI devices include NPU cards. Thus, the Operator can determine whether the K8s cluster nodes have NPU cards based on the PCI device labels of the K8s cluster nodes.
[0192] When the Operator monitors a cluster node change event, it can determine whether a node has an NPU card based on the node label and set a label of npu.present = true (i.e., the above-specified label) for the nodes with NPU cards.
[0193] Exemplarily, for any node, when it is determined that the node does not have an NPU card, it can further determine whether the node is set with the specified label.
[0194] When the node is set with the specified label, that is, the NPU card on the node is removed. In this case, the specified label of the cluster node can be deleted, and an AI component deletion process can be performed on the node.
[0195] It can be seen that in this embodiment, the NPU cards of the nodes can be automatically identified without the intervention of operation and maintenance or R & D personnel. The AI components can be automatically installed / upgraded / uninstalled according to the node status and scale of the K8s cluster, reducing the operation and maintenance complexity and cost, especially in cloud environment and large-scale cluster scenarios.
[0196] The installation, upgrade, and uninstallation processes of the AI components will be described below respectively.
[0197] I. Installation process.
[0198] As Figure 3As shown, in this embodiment, the user can create the above-mentioned drive configuration file and non-drive component configuration file (YAML file). When the operator detects a configuration file submission event, it can enter the reconciliation process (the actual logic in the Operator framework of K8s to make the current resource object status reach the expected status). In this process, it can create DaemonSets of AI components such as drive installers, container toolkits, feature discovery, validators, device plugins, and metric exposers, and create and run corresponding AI components on each node based on the DaemonSets of AI components.
[0199] Exemplarily, for each DaemonSet managed by the operator, an ownerReferences (the owner attribute of the resource object) can be set, and this owner attribute of the resource object can declare who triggers the creation of the DaemonSet; for the DaemonSet, when its owner is deleted, the DaemonSet will also be deleted.
[0200] For example, for the drive Dameonset, its owner can be the drive configuration file; for the non-drive component Dameonset, its owner can be the non-drive component configuration file.
[0201] Exemplarily, for the installation of AI components such as NPU drivers and container runtimes, it is supported to obtain the corresponding files from S3 or an artifact repository conforming to the OCI (Open Container Initiative) format.
[0202] That is, in the solution provided by the embodiment of the present application, it is supported to save AI components in the OCI format to the artifact repository. During the installation process of AI components, the corresponding AI components can be obtained from the artifact repository, which better combines with the cloud native field.
[0203] Exemplarily, the operator can synchronously create multiple AI components, but since the AI components have a certain startup dependency order. Therefore, during the startup process of each AI component, it needs to wait for the AI components it depends on to run normally.
[0204] Exemplarily, it can be verified whether the dependencies are ready through the InitContainer (initialization container) in the AI component; when the dependencies are not ready, it is necessary to wait for the dependencies to be ready; when the dependencies are ready, the corresponding AI component software program can be started.
[0205] Exemplarily, to ensure the normal operation of the installed AI components, containers for running validators (such as the above-mentioned sixth container) can be created for each K8s cluster node, and the validator can be run in the sixth container to verify whether the installed components are normal by using it. For example, verify whether the driver installation is normal, whether the container runtime configuration is normal, etc., to further ensure that the application can use the NPU card normally after the AI components are started.
[0206] II. Upgrade process.
[0207] Exemplarily, when the user needs to upgrade the version of the corresponding component, the driver configuration file or the non-driver component configuration file can be updated.
[0208] When the user submits the updated driver configuration file or non-driver component configuration file, the Operator can monitor the submission event of the driver configuration file or non-driver component configuration file. If it is determined that there is no DaemonSet with the corresponding configuration information consistent with the configuration information in the configuration file, a new DaemonSet can be created, and the corresponding AI components in each node can be upgraded according to the new DaemonSet.
[0209] Taking the driver upgrade as an example, its implementation process is as follows:
[0210] 1. Set the node to be unschedulable to prevent new containers from running on the node and affecting the driver upgrade;
[0211] 2. Remove all containers using the NPU card on this node;
[0212] 3. Upgrade the driver. After the driver upgrade is completed, verify the upgraded driver;
[0213] 4. When the verification passes, set the node to the schedulable state again.
[0214] III. Uninstallation process.
[0215] When the user needs to uninstall the AI components on all nodes, the driver configuration file and non-driver component configuration file submitted in K8s can be deleted. Since the DaemonSet of the AI components is set with ownerReferences, when the driver configuration file or non-driver component configuration file is deleted, the corresponding DaemonSet will be automatically deleted by the garbage collection controller of K8s, thereby triggering the deletion of the containers of the corresponding components. Each corresponding component has a prestophook set for the lifecycle, which will be triggered during deletion, thereby executing the corresponding component uninstallation steps.
[0216] The method provided in this application has been described above. Next, the device provided in this application will be described:
[0217] Please refer to Figure 4 , which is a schematic structural diagram of an AI component management device based on K8s provided by an embodiment of the present application. As Figure 4 shown, the AI component management device based on K8s may include:
[0218] A monitoring unit, configured to monitor a driver configuration file submission event or a non-driver component configuration file submission event;
[0219] An obtaining unit, configured to obtain target driver configuration information when the monitoring unit monitors a driver configuration file submission event;
[0220] A creating unit, configured to create a corresponding target driver DaemonSet according to the target driver configuration information when it is determined that there is no driver DaemonSet with corresponding configuration information consistent with the target driver configuration information;
[0221] The creating unit is further configured to create a first container for running a driver installer in each K8s cluster node according to the target driver DaemonSet, and run the driver installer in the created first container; wherein, the driver installer is used to perform driver installation processing in the K8s cluster node where it is located according to the target driver configuration information;
[0222] The obtaining unit is further configured to obtain target non-driver component configuration information when a non-driver component configuration file submission event is monitored;
[0223] The creating unit is further configured to, for any non-driver component, create a corresponding non-driver component DaemonSet according to the target non-driver component configuration information of the non-driver component when it is determined that there is no non-driver component DaemonSet with corresponding configuration information consistent with the target non-driver component configuration information, and perform corresponding non-driver component installation processing in each K8s cluster node according to the non-driver component DaemonSet.
[0224] Exemplarily, the specific implementation manners of the monitoring unit, the obtaining unit, and the creating unit for implementing AI component management based on K8s may refer to the relevant descriptions in the above method embodiments, and the embodiments of the present application will not elaborate herein.
[0225] Please refer to Figure 5, is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present application. The electronic device may include a processor 501, a communication interface 502, a memory 503, and a communication bus 504. The processor 501, the communication interface 502, and the memory 503 complete communication with each other through the communication bus 504. Among them, a computer program is stored on the memory 503; the processor 501 can execute the program stored on the memory 503 to execute the above-described method for managing AI components based on K8s.
[0226] The memory 503 mentioned in this article can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, and so on. For example, the memory 503 can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
[0227] An embodiment of the present application also provides a non-transitory machine-readable storage medium storing a computer program, such as Figure 5 the memory 503 in Figure 5 The computer program can be executed by the processor 501 in the electronic device shown to implement the above-described method for managing AI components based on K8s.
[0228] An embodiment of the present application also provides a computer program stored in a non-transitory machine-readable storage medium, such as Figure 5 the memory 503 in And when the processor executes the computer program, it causes the processor 501 to execute the above-described method for managing AI components based on K8s.
Claims
1. An AI component management method based on K8s, characterized in that, Applied to the K8s operator, the method includes: Upon detecting a drive configuration file submission event, obtain the target drive configuration information; If it is determined based on the target drive configuration information that there is no corresponding drive daemon set (DaemonSet) with configuration information consistent with the target drive configuration information, create a corresponding target drive DaemonSet based on the target drive configuration information; Based on the target drive DaemonSet, create a first container for running the drive installer in each K8s cluster node, and run the drive installer in the created first container; wherein, the drive installer is used to perform drive installation processing in the K8s cluster node where it is located according to the target drive configuration information; Upon detecting a non-drive component configuration file submission event, obtain the target non-drive component configuration information; For any non-drive component, if it is determined based on the corresponding target non-drive component configuration information of the non-drive component that there is no corresponding non-drive component DaemonSet with configuration information consistent with the target non-drive component configuration information, create a corresponding non-drive component DaemonSet based on the target non-drive component configuration information, and based on the non-drive component DaemonSet, perform corresponding non-drive component installation processing in each K8s cluster node.
2. The method according to claim 1, wherein The non-drive components include a container runtime; the non-drive component DaemonSet corresponding to the container runtime is the container toolkit DaemonSet; The performing corresponding non-drive component installation processing in each K8s cluster node based on the non-drive component DaemonSet includes: Based on the container toolkit DaemonSet, create a second container for running the container toolkit in each K8s cluster node, and run the container toolkit in the created second container; wherein, the container toolkit is used to perform container runtime installation processing according to the container engine of the K8s cluster node where it is located; And / or The non-drive components include feature-discovery; the non-drive component DaemonSet corresponding to feature-discovery is the feature-discovery DaemonSet; The performing corresponding non-drive component installation processing in each K8s cluster node based on the non-drive component DaemonSet includes: Based on the feature-discovery DaemonSet, create a third container for running feature-discovery in each K8s cluster node, and run feature-discovery in the created third container; wherein, feature-discovery is used to collect the AI card attributes of the K8s cluster node where it is located; And / or The non-drive components include a device plugin; the non-drive component DaemonSet corresponding to the device plugin is the device-plugin DaemonSet; Based on the non-drive component DaemonSet, performing corresponding non-drive component installation processing on each K8s cluster node includes: Based on the device-plugin DaemonSet, creating a fourth container for running the device plugin on each K8s cluster node, and running the device plugin in the created fourth container; wherein, the device plugin is used to report the number of AI cards in the K8s cluster node where it is located, and allocate AI cards to the containers that receive control instructions to use AI cards; and / or The non-drive components include a metrics provider Exporter; the non-drive component DaemonSet corresponding to the Exporter is the Exporter DaemonSet; Based on the non-drive component DaemonSet, performing corresponding non-drive component installation processing on each K8s cluster node includes: Based on the Exporter DaemonSet, creating a fifth container for running the Exporter on each K8s cluster node, and running the Exporter in the created fifth container; wherein, the Exporter is used to provide monitoring data externally.
3. The method according to claim 1, wherein Based on the non-drive component DaemonSet, performing corresponding non-drive component installation processing on each K8s cluster node includes: Based on the non-drive component DaemonSet, running an initialization container on each K8s cluster node; wherein, the initialization container is used to verify whether the dependencies of the non-drive component are ready; For any K8s cluster node, when the initialization container in the K8s cluster node finishes running, based on the non-drive component DaemonSet, performing the non-drive component installation processing in the K8s cluster node; wherein, the completion of the initialization container running indicates that the dependencies of the non-drive component are ready.
4. The method according to claim 1, wherein When the non-drive component configuration file submission event is first monitored, the method further includes: Creating a validator DaemonSet; Based on the validator DaemonSet, creating a sixth container for running the validator on each K8s cluster node, and running the validator in the created sixth container; wherein, the validator is used to verify whether the installed AI components are normal.
5. The method according to claim 1, wherein The target driver configuration information includes target driver version information; The driver installer performs driver installation processing in the K8s cluster node where it is located based on the target driver configuration information, including: For any K8s cluster node, when a driver is installed in the K8s cluster node but the driver version information is inconsistent with the target driver version information, setting the K8s cluster node to be unschedulable; Removing the containers using AI cards on the K8s cluster node; Upgrade the driver of the K8s cluster node. When the driver upgrade is successful, set the K8s cluster node to a schedulable state.
6. The method according to claim 1, wherein The method further includes: Obtain the node information of each K8s cluster node; For any K8s cluster node, when the K8s cluster node has an AI card and the specified label is not set, set the specified label for the K8s cluster node, where the specified label is used to identify that the K8s cluster node has an AI card; When the K8s cluster node does not have an AI card and the specified label is set, delete the specified label of the K8s cluster node; The step of creating a first container for running the driver installer in each K8s cluster node according to the target driver DaemonSet and running the driver installer in the created first container includes: Create a first container for running the driver installer in each K8s cluster node with the specified label according to the target driver DaemonSet, and run the driver installer in the created first container; The step of performing corresponding non-driver component installation processing in each K8s cluster node according to the non-driver component DaemonSet includes: Perform corresponding non-driver component installation processing in each K8s cluster node with the specified label according to the non-driver component DaemonSet.
7. The method according to claim 6, wherein The method further includes: For a newly added K8s cluster node with the specified label, create the first container in the K8s cluster node according to the target driver DaemonSet, and run the driver installer in the created first container; and perform corresponding non-driver component installation processing in the K8s cluster node according to the non-driver component DaemonSet; For any K8s cluster node, when the specified label of the K8s cluster node is deleted, perform AI component uninstallation processing on the K8s cluster node.
8. The method according to claim 1, wherein The owner of the driver DaemonSet is the driver configuration file; the owner of the non-driver component DaemonSet is the non-driver component configuration file; The method further includes: When a driver configuration file deletion event is detected, delete the target driver Dameonset, delete the first container in each K8s cluster node, and uninstall the driver installer and driver installed in each K8s cluster node; When a non-driver component configuration file deletion event is detected, delete the non-driver component DaemonSet, delete the container for running the non-driver component in each K8s cluster node, and uninstall the non-driver component installed in each K8s cluster node.
9. An artificial intelligence AI component management device based on K8s, characterized in that, Deployed on the K8s operator Operator, the device includes: A monitoring unit configured to monitor a driver configuration file submission event or a non-driver component configuration file submission event; An obtaining unit configured to obtain target driver configuration information when the monitoring unit monitors a driver configuration file submission event; A creation unit, configured to create a corresponding target driver DaemonSet according to the target driver configuration information when it is determined according to the target driver configuration information that there is no set of driver daemon processes (DaemonSet) whose corresponding configuration information is consistent with the target driver configuration information; The creation unit is further configured to, according to the target driver DaemonSet, create a first container for running a driver installer in each K8s cluster node, and run the driver installer in the created first container; wherein, the driver installer is used to perform driver installation processing in the K8s cluster node where it is located according to the target driver configuration information; The acquisition unit is further configured to acquire target non-driver component configuration information when a non-driver component configuration file submission event is monitored; The creation unit is further configured that for any non-driver component, when it is determined according to the target non-driver component configuration information corresponding to the non-driver component that there is no non-driver component DaemonSet whose corresponding configuration information is consistent with the target non-driver component configuration information, create a corresponding non-driver component DaemonSet according to the target non-driver component configuration information, and perform corresponding non-driver component installation processing in each K8s cluster node according to the non-driver component DaemonSet.
10. An electronic device, characterized in that, It includes: A processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete mutual communication through the communication bus; The memory is used for storing a computer program; The processor is configured to implement the method according to any one of claims 1 to 8 when executing the program stored on the memory.