Task execution method, apparatus and system based on multiple container orchestration clusters
By selecting the target container orchestration cluster and worker nodes from multiple container orchestration clusters, the problem of limited resources in a single container orchestration cluster is solved, improving task execution performance and reliability.
Patent Information
- Application Number
- CN202411548946.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-10-30
AI Technical Summary
In scenarios with massive tasks, task execution systems based on single-container orchestration clusters have limited CPU and memory resources due to the limited number of worker nodes, which restricts task execution performance and reliability.
The task execution method based on multiple container orchestration clusters is adopted. The task request is obtained through the master node, the instructions to be run are classified, and the target container orchestration cluster and worker node are selected from multiple container orchestration clusters to create an execution unit to run the task.
It improves the performance and reliability of the task execution system and breaks the limitations of CPU and memory resources.
Smart Images

Figure CN119512688B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a task execution method, apparatus and system based on multiple container orchestration clusters. Background Technology
[0002] Container orchestration clusters are open-source systems for automating the deployment, scaling, and management of containerized applications, enabling developers to easily deploy, run, and maintain applications within a cluster. Container orchestration clusters feature auto-scaling capabilities, meaning they can dynamically adjust the number of execution units, their CPUs, and memory based on application load requirements to handle traffic fluctuations. Task execution systems based on container orchestration clusters leverage this auto-scaling capability to dynamically allocate resources, such as CPU and memory, to tasks for execution.
[0003] The task execution systems provided by related technologies are all based on single-container orchestration clusters, employing a single-container orchestration cluster-based task execution method. However, in scenarios with massive tasks, the limited number of worker nodes in a single-container orchestration cluster leads to limited resources such as CPU and memory, thus restricting the task execution performance of the system and resulting in low task execution efficiency and reliability. Summary of the Invention
[0004] This application provides a task execution method, apparatus, and system based on multiple container orchestration clusters. This improves the task execution performance, efficiency, and reliability of the task execution system.
[0005] In a first aspect, embodiments of this application provide a task execution method based on multiple container orchestration clusters, comprising: acquiring multiple task execution requests; wherein each task execution request includes: an image file of an application for executing a corresponding task to be executed, indication information for indicating a dataset to be executed associated with the task to be executed, and instructions to be run associated with the task to be executed; classifying the instructions to be run included in each of the multiple task execution requests based on the image file and indication information included in each of the multiple task execution requests; selecting instructions to be run of a target category, and for the instructions to be run of the target category, selecting a target container orchestration cluster among the multiple container orchestration clusters, and selecting a target worker node in the target container orchestration cluster; sending the image file and indication information corresponding to the instructions to be run of the target category to the target container orchestration cluster, so that the target container orchestration cluster creates a target execution unit on the target worker node based on the image file and indication information corresponding to the instructions to be run of the target category; and injecting the instructions to be run of the target category into the target execution unit, so that the target execution unit runs the instructions to be run of the target category.
[0006] Secondly, embodiments of this application provide a task execution system based on multiple container orchestration clusters, including: a master node and multiple container orchestration clusters; wherein, the master node is used to: obtain multiple task execution requests; wherein, each task execution request includes: an image file of an application for executing a corresponding task to be executed, indication information for indicating the dataset to be executed associated with the task to be executed, and instructions to be run associated with the task to be executed; classify the instructions to be run included in each of the multiple task execution requests based on the image file and indication information included in each of the multiple task execution requests; select instructions to be run of a target category, and for the instructions to be run of the target category, select a target container orchestration cluster among the multiple container orchestration clusters, and select a target worker node in the target container orchestration cluster; send the image file and indication information corresponding to the instructions to be run of the target category to the target container orchestration cluster, so that the target container orchestration cluster creates a target execution unit on the target worker node based on the image file and indication information corresponding to the instructions to be run of the target category; inject the instructions to be run of the target category into the target execution unit, so that the target execution unit runs the instructions to be run of the target category.
[0007] Thirdly, embodiments of this application provide a task execution apparatus based on multiple container orchestration clusters, including: an acquisition module, a classification module, a selection module, a sending module, and an injection module; wherein, the acquisition module is used to acquire multiple task execution requests; wherein, each task execution request includes: an image file of an application for executing the corresponding task to be executed, indication information for indicating the dataset to be executed associated with the task to be executed, and instructions to be run associated with the task to be executed; the classification module is used to classify the instructions to be run included in each of the multiple task execution requests based on the image file and indication information included in each of the multiple task execution requests; the selection module is used to select instructions to be run of a target category, and for instructions to be run of a target category, select a target container orchestration cluster from the multiple container orchestration clusters, and select a target worker node from the target container orchestration cluster; the sending module is used to send the image file and indication information corresponding to the instructions to be run of the target category to the target container orchestration cluster, so that the target container orchestration cluster creates a target execution unit on the target worker node based on the image file and indication information corresponding to the instructions to be run of the target category; the injection module is used to inject instructions to be run of the target category into the target execution unit, so that the target execution unit runs instructions to be run of the target category.
[0008] In some implementations, the acquisition module is also used to: after the injection module injects the target category of instructions to be executed into the target execution unit so that the target execution unit runs the instructions to be executed of the target category, acquire the task execution result of each task associated with the instructions to be executed of the target category.
[0009] In some implementations, the acquisition module is specifically used to: receive the task execution results of each task associated with the target category's pending instruction sent by the second controller in the target container orchestration cluster; wherein the second controller acquires the task execution results of each task associated with the target category's pending instruction from the hook component in the target container orchestration cluster.
[0010] In some implementations, the task execution device further includes a triggering module, which, after the acquisition module obtains the task execution result of each task associated with the instruction to be run of the target category, if the task execution result of the target task is an execution exception, triggers the target container orchestration cluster to migrate the target task to other execution units.
[0011] In some implementations, the triggering module is also used to: after the acquisition module obtains the task execution result of each task associated with the instruction to be run of the target category, if the task execution result of the target task is an execution exception and the target task meets the preset conditions, then trigger the target container orchestration cluster to migrate the target task to other execution units.
[0012] In some implementations, after the acquisition module obtains the task execution results of each task associated with the execution instructions of the target category, the selection module is further configured to, if the task execution result of the target task is an execution exception, reselect a container orchestration cluster among multiple container orchestration clusters for the target task, and reselect a worker node in the reselected container orchestration cluster; the sending module is further configured to send the image file and indication information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster can rebuild the execution unit on the reselected worker node based on the image file and indication information corresponding to the target task; the injection module is further configured to inject the execution instructions of the target task into the reconstructed execution unit, so that the reconstructed execution unit can run the execution instructions of the target task.
[0013] In some implementations, after the acquisition module obtains the task execution results of each task associated with the execution instructions of the target category, if the task execution result of the target task is an execution exception and the target task meets the preset conditions, the selection module is further used to reselect a container orchestration cluster among multiple container orchestration clusters for the target task, and reselect a worker node in the reselected container orchestration cluster; the sending module is further used to send the image file and indication information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster can rebuild the execution unit on the reselected worker node based on the image file and indication information corresponding to the target task; the injection module is further used to inject the execution instructions of the target task into the reconstructed execution unit, so that the reconstructed execution unit can run the execution instructions of the target task.
[0014] In some possible implementations, the preset conditions include any of the following:
[0015] The target task is executed on the target execution unit a number of times greater than or equal to a preset number;
[0016] The runtime of the target task on the target execution unit is greater than or equal to the first preset duration;
[0017] The runtime of the target task on the target execution unit is less than or equal to the second preset duration;
[0018] The target execution unit lacks sufficient software resources;
[0019] The target execution unit lacks sufficient hardware resources.
[0020] In some implementations, the selection module is specifically used to: obtain the characteristic information of each of the multiple container orchestration clusters; and, for the target category of instructions to be executed, select the target container orchestration cluster from the multiple container orchestration clusters based on the characteristic information of each of the multiple container orchestration clusters.
[0021] In some implementations, the characteristic information of each container orchestration cluster includes at least one of the following: the price information of the container orchestration cluster; the priority information of the container orchestration cluster.
[0022] In some implementations, the acquisition module is specifically used to: acquire the characteristic information of each of the multiple container orchestration clusters through long-lived connections with their respective API service components in the multiple container orchestration clusters.
[0023] In some implementations, the selection module is specifically used to: obtain the characteristic information of each worker node in the target container orchestration cluster; and, based on the characteristic information of each worker node, select the target worker node in the target container orchestration cluster for the target category of instructions to be executed.
[0024] In some implementations, the characteristic information of each worker node in the target container orchestration cluster includes at least one of the following: the number of CPUs in the worker node; the available memory size of the worker node.
[0025] In some implementations, the acquisition module is specifically used to: obtain characteristic information of each worker node through a long-lived connection with the API service component in the target container orchestration cluster.
[0026] Fourthly, embodiments of this application provide an electronic device, including: a processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to perform the methods as described in the first aspect or its various implementations.
[0027] Fifthly, embodiments of this application provide a computer-readable storage medium for storing a computer program that causes a computer to perform the methods described in the first aspect or its various implementations.
[0028] In a sixth aspect, embodiments of this application provide a computer program product including computer program instructions that cause a computer to perform the methods as described in the first aspect or its various implementations.
[0029] In a seventh aspect, embodiments of this application provide a computer program that causes a computer to perform the methods described in the first aspect or its various implementations.
[0030] The technical solution provided in this application breaks the limitations of resources such as CPU and memory by including more worker nodes in multiple container orchestration clusters, thereby improving the task execution performance of the task execution system and enhancing task execution efficiency and reliability. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a schematic diagram of a Kubernetes cluster.
[0033] Figure 2 This is a diagram illustrating the deployment of an Nginx service based on a Kubernetes cluster.
[0034] Figure 3 This is a schematic diagram of a system architecture according to an embodiment of this application;
[0035] Figure 4 A flowchart illustrating a task execution method based on a multi-container orchestration cluster, provided in this application embodiment;
[0036] Figure 5 A schematic diagram illustrating the correspondence between resources and instructions to be executed provided in embodiments of this application;
[0037] Figure 6 A schematic diagram of an execution unit provided in an embodiment of this application;
[0038] Figure 7 A schematic diagram illustrating the acquisition of task execution results provided in an embodiment of this application;
[0039] Figure 8 A schematic diagram of to-do items and container orchestration clusters provided for embodiments of this application;
[0040] Figure 9 A schematic diagram of a task execution system 900 based on multiple container orchestration clusters provided in this application embodiment;
[0041] Figure 10 A schematic diagram of a task execution device 1000 based on multiple container orchestration clusters provided in this application embodiment;
[0042] Figure 11 This is a schematic block diagram of the electronic device 1100 provided in the embodiments of this application. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0045] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0046] Before introducing the technical solution of this application, the relevant knowledge of this application will be explained below:
[0047] I. Kubernetes (k8s):
[0048] Kubernetes is an open-source system for automating the deployment, scaling, and management of containerized applications, enabling developers to easily deploy, run, and maintain applications in clusters.
[0049] A Kubernetes cluster primarily consists of a master node and several worker nodes, each with different components installed. The master node is the control plane of the Kubernetes cluster, responsible for decision-making and management. The worker nodes are the data plane of the Kubernetes cluster, responsible for providing the runtime environment for containers.
[0050] Figure 1 A diagram illustrating a Kubernetes cluster, as shown below. Figure 1 As shown, the master node includes the following components: API service component (ApiServer, api), scheduling component (Scheduler, sched), controller management component (ControllerManager, cm), cloud-controller management component (Cloud-ControllerManager, ccm), and database (Etcd). Each worker node includes the following components: container maintenance component (Kubelet), and service discovery and load balancing component (KubeProxy, k-proxy).
[0051] Among them, ApiServer is the sole entry point for resource operations. It is used to receive commands input from objects and provides mechanisms such as authentication, authorization, application programming interface (API) registration and discovery.
[0052] The Scheduler is responsible for scheduling cluster resources, scheduling execution units (Pods) to the corresponding worker nodes according to a predefined scheduling strategy.
[0053] The ControllerManager is responsible for maintaining the state of the cluster, such as application deployment schedules, fault detection, auto-scaling, and rolling updates.
[0054] The Cloud-ControllerManager is responsible for maintaining the cloud provider's APIs, including retrieving datasets to be executed from cloud storage via the cloud provider's APIs.
[0055] Etcd is used to store information about various resource objects in the cluster.
[0056] Kubelet is responsible for maintaining the lifecycle of containers, that is, creating, updating, and destroying containers by controlling the containerization platform (Docker). Docker is mainly responsible for various operations on containers on worker nodes.
[0057] KubeProxy is responsible for providing service discovery and load balancing within the cluster.
[0058] The following example illustrates the calling relationships between various components in a Kubernetes cluster:
[0059] Figure 2 This is a diagram illustrating the deployment of an Nginx service based on a Kubernetes cluster, as shown below. Figure 2As shown, once the Kubernetes environment starts, both the master node and worker nodes store their information in the database (Etcd). Next, the Nginx service installation request is sent to the API service component (ApiServer) of the master node. The API service component (ApiServer) calls the scheduler component to determine which worker node the Nginx service should be installed on. The scheduler component reads information about each worker node from the Etcd database, selects a worker node according to a specific algorithm, and informs the API service component (ApiServer) of the selection result. Further, the API service component (ApiServer) calls the controller management component (ControllerManager) to send instructions to the selected worker node, such as... Figure 2 The container maintenance component (Kubelet) on worker node 1 sends a command to request the installation of the nginx service. Upon receiving this command, the Kubelet notifies the containerization platform (Docker) on worker node 1. The containerization platform (Docker) then starts an execution unit (pod) for the nginx service. The execution unit (pod) is the smallest operational unit in Kubernetes, containing one or more containers that share network and storage resources, allowing them to run within the execution unit (pod). At this point, the nginx service is running. If an object needs to access the nginx service, it can use the service discovery and load balancing component (KubeProxy) on worker node 1 to act as a proxy for accessing the execution unit (pod).
[0060] The following section introduces the basic concepts of the containerization platform (Docker):
[0061] 1. Containerization Technology: Containerization platforms (Docker) enable rapid deployment, portability, and scalability of applications by packaging them and all their dependencies into a single container. Containerization technology allows applications to run in an independent, closed environment, unaffected by the underlying operating system and hardware.
[0062] 2. Image: An image file is the foundation for running containers in a containerized platform (Docker). It contains all the file systems, code, and dependencies required to run a container, or in other words, it contains everything needed to run a container: code, environment variables, configuration files, etc.
[0063] 3. Container: A container is a running instance of an image; it is an independent, lightweight runtime environment. Containers are isolated from each other, and each container has its own file system, process space, and network interface.
[0064] II. Data Volume:
[0065] In the computer field, a data volume typically refers to a separate area on a storage device or medium used to store files and data. In virtualized storage or containerization technologies, a data volume also refers to a virtual directory or file system used for persistent data storage or to enable data sharing.
[0066] Data volumes have the following characteristics:
[0067] 1. Data volumes can be managed independently of other storage areas and have their own file system.
[0068] 2. Data in a data volume can be shared between different applications, containers, or systems.
[0069] 3. Data volumes typically support persistent storage of data, meaning that the data in the data volume is retained even if the container or application is deleted.
[0070] III. List and Watch Mechanism:
[0071] The List and Watch mechanism is a resource monitoring mechanism provided by the API service component (ApiServer) in Kubernetes. It allows clients to obtain resource objects, such as lists of worker nodes and pods, through the API service component (ApiServer) and monitor changes to these resource objects in real time by establishing long-lived connections (Watch). When a resource object is created, updated, or deleted, the API Server sends an event notification to clients that have subscribed to that resource object, achieving real-time resource synchronization and response.
[0072] Fourth, the pull model is a mechanism for data acquisition or message passing. In this model, data consumers actively pull data from data producers.
[0073] The technical problems to be solved, the inventive concept and the system architecture of the embodiments of this application will be described below:
[0074] As mentioned above, the task execution systems provided by related technologies are all based on single-container orchestration clusters, employing a single-container orchestration cluster-based task execution method. However, in scenarios with massive tasks, the limited number of worker nodes in a single-container orchestration cluster leads to limited resources such as CPU and memory, thereby restricting the task execution performance of the system and resulting in low task execution efficiency and reliability.
[0075] To address the aforementioned technical issues, this application proposes a task execution method based on multiple container orchestration clusters. Since multiple container orchestration clusters include more worker nodes, they break the limitations of resources such as CPU and memory, thereby improving the task execution performance of the task execution system and enhancing task execution efficiency and reliability.
[0076] In some possible implementations, the system architecture of embodiments of this application is as follows: Figure 3 As shown.
[0077] Figure 3 This is a schematic diagram of a system architecture according to an embodiment of this application. The system architecture involves network elements: terminal device 310 and backend server 310. The backend server 310 includes: master node 3101 and multiple container orchestration clusters 3102. The terminal device 310 and the backend server 310 can be directly or indirectly connected through wired or wireless communication. The master node 3101 and the multiple container orchestration clusters 3102 can be directly or indirectly connected through wireless communication. This application does not impose any limitations on this connection.
[0078] In some implementations, the terminal device 310 may be equipped with a task execution client, through which the object can send task execution requests to the master node 310; wherein each task execution request includes: an image file of the application for executing the corresponding task to be executed, indication information for indicating the dataset to be executed associated with the task to be executed, and instructions to be run associated with the task to be executed.
[0079] It should be understood that the task execution client refers to the client used to implement task execution. For example, this client is mainly used to send task execution requests to the master node 310.
[0080] The terminal device 310 is often equipped with a display device to obtain task execution requests from object input, and can also display task execution results, etc.
[0081] It should be understood that display devices are also called monitors, displays, touch screens, etc., and touch screens are also called touch screens, touch panels, etc.
[0082] In some possible implementations, the terminal device 310 may be a desktop computer, laptop computer, handheld computer, tablet computer, smartphone, smartwatch, virtual reality (VR), augmented reality (AR), etc., but is not limited to these.
[0083] In some implementations, the backend server 310 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0084] In some implementations, the master node 3101 and the multiple container orchestration clusters 3102 can be physical or logical units within the backend server 310, but are not limited thereto. For example, the master node 3101 can be a server module within the backend server 310. As another example, assuming the backend server 310 is a server cluster, the master node 3101 can be a physical device within that server cluster, and each container orchestration cluster 3102 can be a portion of that server cluster.
[0085] The master node 3101 can acquire multiple task execution requests. Each task execution request includes: an image file of the application to execute the corresponding task, indication information indicating the dataset associated with the task, and instructions to be run associated with the task. The master node 3101 categorizes the instructions to be run in each of the multiple task execution requests based on the image file and indication information. The master node 3101 selects the instructions to be run in the target category and, for the instructions to be run in the target category, selects a target container orchestration cluster from the multiple container orchestration clusters 3102, and selects a target worker node within the target container orchestration cluster. The master node 3101 sends the image file and indication information corresponding to the instructions to be run in the target category to the target container orchestration cluster, so that the target container orchestration cluster creates a target execution unit on the target worker node based on the image file and indication information corresponding to the instructions to be run in the target category. The master node 3101 injects the instructions to be run in the target category into the target execution unit, so that the target execution unit runs the instructions to be run in the target category.
[0086] In some implementations, the dataset to be executed can be stored in a database so that the container orchestration cluster 3102 can obtain the dataset to be executed from the database by means of indication information.
[0087] It should be noted that, Figure 3 This is merely a schematic diagram of a system architecture provided in this application embodiment; the system architecture involved in this application embodiment is not limited to... Figure 3 The system architecture shown, for example, Figure 3 The system architecture shown includes only one terminal device 310. In reality, it can include multiple terminal devices 310, or... Figure 3 Based on the system architecture shown, the system architecture involved in the embodiments of this application may also include other network elements, etc.
[0088] The technical solution of this application will be described in detail below:
[0089] Figure 4 A flowchart illustrating a task execution method based on a multi-container orchestration cluster is provided in this application embodiment. This method can be executed by a master node in a backend server. The master node can be... Figure 3 The primary node in the example is 3101, but it is not limited to this, such as... Figure 4 As shown, the method may include:
[0090] S410: Obtain multiple task execution requests; wherein each task execution request includes: an image file of the application used to execute the corresponding task to be executed, indication information for indicating the dataset to be executed associated with the task to be executed, and instructions to be run associated with the task to be executed;
[0091] It should be understood that each task execution request is used to request the execution of a task to be performed. For example, in the field of Artificial Intelligence (AI) + Medicine, a task execution request might be used to request the calculation of the IC50 value of a certain drug molecule. Here, IC50 refers to the concentration required for a drug or substance (inhibitor) to inhibit half of a certain biological process (or certain substances contained in this process, such as enzymes, cell receptors, or microorganisms).
[0092] It should be understood that there may be one or more applications used to perform the corresponding task. For example, a task execution request may be used to request the calculation of the IC50 value of a certain drug molecule, and the applications used to perform the corresponding task may include: an application for calculating the 3D structure of the drug molecule, and an application for calculating the IC50 value of the drug molecule based on the 3D structure of the drug.
[0093] In some implementations, the indication information used to indicate the dataset to be executed associated with the task to be executed may include at least one of the following, but is not limited to: the identifier of the dataset to be executed, the storage path, etc.
[0094] It should be understood that the dataset associated with the task to be executed refers to the dataset to which the data to be executed belongs. For example, if a task execution request is used to request the calculation of the IC50 value of a certain drug molecule, then the data to be executed may include: the drug molecule and the 3D structure corresponding to the drug molecule, and the associated dataset to be executed is the dataset that includes the drug molecule and the 3D structure corresponding to the drug molecule.
[0095] In some implementations, the dataset to be executed can be stored in a data volume, but this is not a limitation.
[0096] It should be understood that the pending instructions associated with the task to be executed are used to instruct the selection of an application (or tool) in the application image file of the task to be executed, and the corresponding pending data is processed by the selected application. The number of pending instructions associated with the task to be executed can be one or more.
[0097] For example, a task execution request may request the calculation of the IC50 value of a certain drug molecule formula. It may be associated with two pending instructions. One instruction instructs the selection of an application from the application image file of the task to be executed, specifically an application for calculating the 3D structure of the drug molecule formula. The selected application then processes the drug molecule formula A. Based on this, the 3D structure of the drug molecule formula A can be obtained by selecting an application from the application image file of the task to be executed, and the 3D structure of the drug molecule formula A can be obtained by processing the 3D structure of the drug molecule formula A. The other instruction instructs the selection of an application from the application image file of the task to be executed, specifically an application for calculating the IC50 value, and the 3D structure of the drug molecule formula A can be processed by this application. Again, the IC50 value of the drug molecule formula A can be obtained by selecting an application from the application image file of the task to be executed, and the 3D structure of the drug molecule formula A can be processed by this application.
[0098] S420: Based on the image files and instruction information included in each of the multiple task execution requests, classify the instructions to be run included in each of the multiple task execution requests;
[0099] In some possible implementations, the instructions to be run included in each of the multiple task execution requests are classified based on the image files and instruction information included in each of the multiple task execution requests. This includes classifying the instructions to be run corresponding to the same image file and the same instruction information into one category.
[0100] It should be understood that if any two task execution requests contain the same image file and instruction information, it means that the tasks to be executed associated with these two task execution requests can be executed by the same execution unit, which means that the instructions to be run contained in these two task execution requests can be executed by the same execution unit.
[0101] For example, one task execution request requests the calculation of the IC50 value of drug formula A, and another task execution request requests the calculation of the IC50 value of drug formula B. Both task execution requests contain image files for both applications: one for calculating the 3D structure of the drug formula and the other for calculating the IC50 value. Furthermore, the instructions in both task execution requests indicate the same dataset to be executed, which stores drug formula A, its corresponding 3D structure, drug formula B, and its corresponding 3D structure. Based on this, the master node can classify the pending instructions contained in these two task execution requests into one category.
[0102] In some possible implementations, the pending instructions included in each of the multiple task execution requests are classified based on the image files and instruction information included in each of the multiple task execution requests. This includes classifying pending instructions that correspond to the same instruction information as the image files included in the multiple task execution requests and have a greater than preset value of similarity.
[0103] In some possible implementations, the preset value can be 70%, 80%, 90%, etc., but is not limited to this.
[0104] It should be understood that if the similarity of the image files contained in any two task execution requests is greater than a preset value and the indication information is the same, it means that the pending task pages associated with these two task execution requests can be executed by the same execution unit. However, for any task execution request, there will be some redundant image files in the execution unit. That is, when executing the pending task associated with the task execution request, some image files will not be used. Based on this, in order to reduce the redundancy of image files, the above-mentioned preset value is set in this application embodiment.
[0105] It should be understood that the classification method of the execution instructions in this application embodiment is not limited.
[0106] It should be understood that, according to the classification method of the instructions to be executed, each category of instructions to be executed corresponds to a unique set of image files and a dataset to be executed. Assuming that each set of image files and datasets to be executed is referred to as a set of resources, then... Figure 5 As shown, each type of instruction to be executed corresponds to a unique set of resources.
[0107] S430: Select the target category of instructions to be executed, and for the target category of instructions to be executed, select the target container orchestration cluster from multiple container orchestration clusters, and select the target worker node in the target container orchestration cluster;
[0108] It should be understood that the pending instructions for the target category refer to the pending instructions for the category selected by the master node.
[0109] In the embodiments of this application, the master node can select the target category of instructions to be executed in any of the following possible ways, but is not limited thereto:
[0110] In some implementations, if all categories of instructions to be executed are stored in a queue, the master node selects one category of instructions to be executed from the queue according to the first-in-first-out principle, and the instructions to be executed in that category are called the instructions to be executed in the target category.
[0111] For example, suppose the current queue contains pending instructions of category 1, pending instructions of category 2, ..., pending instructions of category N from the front to the back of the queue. Then the master node can select the pending instruction of category 1 located at the front of the queue as the pending instruction of the target category.
[0112] In some implementations, the master node can randomly select one category of instructions to be executed from all categories of instructions to be executed, and refer to the instructions to be executed in that category as the instructions to be executed in the target category.
[0113] For example, suppose there are instructions to be executed in category 1, instructions to be executed in category 2, ..., instructions to be executed in category N. Then the master node can randomly select an instruction to be executed from these categories. Suppose the master node randomly selects an instruction to be executed in category 2. Then the master node can use the instruction to be executed in category 2 as the instruction to be executed in the target category.
[0114] In some implementations, the master node can select the instruction with the largest category index from all the instructions to be executed, and call the instruction to be executed in that category the instruction to be executed in the target category.
[0115] For example, assuming there are pending instructions in category 1, pending instructions in category 2, ..., pending instructions in category N, then the master node can select the pending instructions in category N from these pending instructions and use it as the pending instructions of the target category.
[0116] In some implementations, the master node can select the instruction with the smallest category index from all the instructions to be executed, and refer to the instructions to be executed in that category as the instructions to be executed in the target category.
[0117] For example, assuming there are pending instructions in category 1, pending instructions in category 2, ..., pending instructions in category N, then the master node can select the pending instructions in category 1 from these pending instructions and use it as the pending instructions of the target category.
[0118] It should be understood that a container orchestration cluster is an open-source system for automating the deployment, scaling, and management of containerized applications, enabling developers to easily deploy, run, and maintain applications within a cluster.
[0119] In some implementations, each of the plurality of container orchestration clusters may be Kubernetes, Docker Swarm, Apache Mesos, Karmada, or other container orchestration clusters with similar functionality to these container orchestration clusters; this application embodiment does not impose any limitations on this.
[0120] In the embodiments of this application, the master node can select a target container orchestration cluster from multiple container orchestration clusters for a target type of instruction to be executed in any of the following possible ways, but is not limited thereto:
[0121] In some implementation methods, for a target category of instructions to be executed, the master node selects a target container orchestration cluster from multiple container orchestration clusters, including: the master node obtaining the characteristic information of each of the multiple container orchestration clusters; and for the target category of instructions to be executed, selecting a target container orchestration cluster from the multiple container orchestration clusters based on the characteristic information of each of the multiple container orchestration clusters.
[0122] In some implementations, the characteristic information of each container orchestration cluster includes at least one of the following, but is not limited to: the price information of the container orchestration cluster; and the priority information of the container orchestration cluster.
[0123] In some implementations, if the characteristic information of each container orchestration cluster includes the price information of the container orchestration cluster, then the master node selects the target container orchestration cluster from the multiple container orchestration clusters based on the characteristic information of each of the multiple container orchestration clusters for the pending instructions of the target category. This includes the master node selecting the container orchestration cluster with the lowest price from the multiple container orchestration clusters for the pending instructions of the target category, and using that container orchestration cluster as the target container orchestration cluster.
[0124] For example, suppose there are three container orchestration clusters, namely container orchestration cluster A, container orchestration cluster B and container orchestration cluster C, with prices of 800 yuan, 1000 yuan and 1200 yuan respectively. Then the master node can select the container orchestration cluster A with the lowest price for the target category of instructions to be run.
[0125] In some implementations, if the characteristic information of each container orchestration cluster includes the priority information of the container orchestration cluster, then the master node selects the target container orchestration cluster from the multiple container orchestration clusters based on the characteristic information of each of the multiple container orchestration clusters for the pending instructions of the target category. This includes the master node selecting the container orchestration cluster with the highest priority from the multiple container orchestration clusters for the pending instructions of the target category, and using that container orchestration cluster as the target container orchestration cluster.
[0126] For example, suppose there are 3 container orchestration clusters, namely container orchestration cluster A, container orchestration cluster B and container orchestration cluster C, with priorities of 1, 2 and 3 respectively. Assuming that the smaller the priority index, the higher the priority level, then the master node can select the container orchestration cluster A with the highest priority for the target category of instructions to be executed.
[0127] In some implementations, if the characteristic information of each container orchestration cluster includes: the price information and the priority information of the container orchestration cluster, then the master node selects the target container orchestration cluster from the multiple container orchestration clusters based on the characteristic information of each of the multiple container orchestration clusters for the pending instructions of the target category. This includes: for the pending instructions of the target category, the master node first selects the container orchestration clusters with the highest and second highest priority from the multiple container orchestration clusters, and then selects the container orchestration cluster with the lowest price from the container orchestration clusters with the highest and second highest priority, and sets that container orchestration cluster as the target container orchestration cluster.
[0128] For example, suppose there are three container orchestration clusters: Container Orchestration Cluster A, Container Orchestration Cluster B, and Container Orchestration Cluster C. Their prices are 800 yuan, 1000 yuan, and 1200 yuan, respectively, and their priorities are 1, 2, and 3, respectively. Assuming that the smaller the priority index, the higher the priority level, then the master node first selects the container orchestration cluster with the highest and second highest priority, that is, selects Container Orchestration Cluster A and Container Orchestration Cluster B. Then, among Container Orchestration Cluster A and Container Orchestration Cluster B, it selects the container orchestration cluster with the lowest price, Container Orchestration Cluster A, and uses this container orchestration cluster as the target container orchestration cluster.
[0129] In this embodiment, the master node can select a suitable target container orchestration cluster from multiple container orchestration clusters based on their respective feature information, such as selecting the highest priority or the lowest price, or selecting a container orchestration cluster with a better combination of priority and price, thereby facilitating task execution.
[0130] In some implementations, the master node can initiate long connections to the respective API service components in multiple container orchestration clusters through a list and listening mechanism. Based on this, the master node can obtain the characteristic information of each container orchestration cluster through the long connections with the respective API service components in multiple container orchestration clusters.
[0131] In some implementations, for each container orchestration cluster across multiple container orchestration clusters, the corresponding list and listening mechanism is a resource monitoring mechanism provided by the API service component within that cluster. This allows the master node to obtain resource objects, such as lists of worker nodes and pods, through the API service component and to monitor changes to these resource objects in real time by establishing long-lived connections. When resource objects are created, updated, or deleted, the API service component sends event notifications to the master node, enabling real-time resource synchronization and response.
[0132] It should be understood that if each container orchestration cluster in multiple container orchestration clusters is Kubernetes, then the list and watch mechanism here is the same as the list and watch mechanism in Kubernetes.
[0133] It should be understood that the API service component is the sole entry point for resource operations, used to receive commands from object input and provide mechanisms such as authentication, authorization, API registration, and discovery. If each container orchestration cluster in multiple container orchestration clusters is Kubernetes, then this API service component is the ApiServer component in Kubernetes.
[0134] In some possible implementations, for the instruction to be executed in the target category, the master node selects the target container orchestration cluster from multiple container orchestration clusters, including: the master node randomly selects a container orchestration cluster from multiple container orchestration clusters and uses it as the target container orchestration cluster.
[0135] For example, suppose there are three container orchestration clusters: container orchestration cluster A, container orchestration cluster B, and container orchestration cluster C. The master node can randomly select one of these three container orchestration clusters for the target type of instruction to be executed. For example, if container orchestration cluster C is randomly selected, the master node will use container orchestration cluster C as the target container orchestration cluster.
[0136] In the embodiments of this application, the master node can select a target worker node in the target container orchestration cluster for the target type of instruction to be executed in any of the following possible ways, but is not limited to these:
[0137] In some implementation methods, for the instructions to be executed for the target category, the master node selects the target worker node in the target container orchestration cluster, including: the master node can obtain the characteristic information of each worker node in the target container orchestration cluster; and for the instructions to be executed for the target category, select the target worker node in the target container orchestration cluster based on the characteristic information of each worker node.
[0138] In some implementations, the characteristic information of each worker node in the target container orchestration cluster includes at least one of the following, but is not limited to: the number of CPUs of the worker node; the available memory size of the worker node.
[0139] In some implementations, if the characteristic information of each worker node in the target container orchestration cluster includes the number of CPUs of that worker node, then the master node selects the target worker node in the target container orchestration cluster based on the characteristic information of each worker node for the instructions to be run for the target category. This includes: for the instructions to be run for the target category, the master node selects the worker node with the most CPUs among all worker nodes in the target container orchestration cluster and uses that worker node as the target worker node.
[0140] For example, suppose the target container orchestration cluster has three worker nodes, namely worker node 1, worker node 2 and worker node 3, with 2, 4 and 8 CPUs respectively. Then the master node can select worker node 3 with the most CPUs for the instructions to be executed in the target category.
[0141] In some implementations, if the characteristic information of each worker node in the target container orchestration cluster includes the available memory size of the worker node, then the master node selects the target worker node in the target container orchestration cluster based on the characteristic information of each worker node for the instructions to be run in the target category. This includes: for the instructions to be run in the target category, the master node selects the worker node with the most available memory among all worker nodes in the target container orchestration cluster and uses that worker node as the target worker node.
[0142] For example, assuming the target container orchestration cluster has three worker nodes, namely worker node 1, worker node 2 and worker node 3, with available memory of 128G, 256G and 512G respectively, then the master node can select worker node 3 with the most available memory for the target category of instructions to be run.
[0143] In some implementations, if the characteristic information of each worker node in the target container orchestration cluster includes: the number of CPUs and the available memory size of the worker node, then the master node selects the target worker node in the target container orchestration cluster based on the characteristic information of each worker node for the instructions to be executed for the target category. This includes: for the instructions to be executed for the target category, the master node first selects the worker node with the most and second most CPUs in the target container orchestration cluster, and then selects the worker node with the most available memory from the worker nodes with the most and second most CPUs, and then selects the worker node with the most available memory as the target worker node.
[0144] For example, suppose the target container editing cluster has 3 worker nodes, namely worker node 1, worker node 2 and worker node 3, with 2, 4 and 8 CPUs respectively, and 128G, 256G and 512G of available memory respectively. Then the master node first selects the master node with the most and second most CPUs, that is, worker node 2 and worker node 3. Then, among worker node 2 and worker node 3, worker node 3 has the most available memory, and worker node 3 is selected as the target worker node.
[0145] In some implementations, if the characteristic information of each worker node in the target container orchestration cluster includes the number of CPUs and the available memory size of the worker node, then the master node selects the target worker node in the target container orchestration cluster based on the characteristic information of each worker node for the instructions to be executed for the target category. This includes: for the instructions to be executed for the target category, the master node first selects the worker node with the most and second most possible memory among all worker nodes in the target container orchestration cluster, and then selects the worker node with the most CPUs among the worker nodes with the most and second most possible memory, and sets that worker node as the target worker node.
[0146] For example, suppose the target container editing cluster has 3 worker nodes, namely worker node 1, worker node 2 and worker node 3, with 2, 4 and 8 CPUs respectively, and 128G, 256G and 512G of available memory respectively. Then the master node first selects the master node with the most and second most available memory, that is, worker node 2 and worker node 3. Then, among worker node 2 and worker node 3, worker node 3 has the most available CPUs, and worker node 3 is selected as the target worker node.
[0147] In this embodiment, the master node can select a suitable target worker node from all worker nodes in the target container orchestration cluster based on the characteristic information of each worker node in the cluster. For example, it can select the worker node with the most CPUs or the most available memory, or select the worker node with the best combination of CPUs and possible memory, thereby facilitating task execution.
[0148] In some implementations, the master node can initiate long connections to the respective API service components in multiple container orchestration clusters through a list and listening mechanism. Based on this, the master node can obtain the characteristic information of each worker node through the long connections with the API service components in the target container orchestration cluster.
[0149] In some implementations, for the instructions to be executed in the target category, the master node selects a target worker node in the target container orchestration cluster, including: the master node randomly selects a worker node from all worker nodes in the target container orchestration cluster and uses it as the target worker node.
[0150] For example, assuming the target container editing cluster has 3 worker nodes, namely worker node 1, worker node 2 and worker node 3, the master node can randomly select one of the three worker nodes for the target category of the instruction to be run. For example, if worker node 1 is randomly selected, the master node will use worker node 1 as the target worker node.
[0151] S440: Send the image file and instruction information corresponding to the target category of the instruction to be run to the target container orchestration cluster, so that the target container orchestration cluster can create the target execution unit on the target worker node based on the image file and instruction information corresponding to the target category of the instruction to be run.
[0152] In some implementations, before the master node sends the image file and instruction information corresponding to the target category's pending instructions to the target container orchestration cluster, so that the target container orchestration cluster creates the target execution unit on the target worker node based on the image file and instruction information corresponding to the target category's pending instructions, the method further includes: the master node receiving an execution unit creation request sent by the first controller in the target container orchestration cluster; the master node sending the image file and instruction information corresponding to the target category's pending instructions to the target container orchestration cluster, so that the target container orchestration cluster creates the target execution unit on the target worker node based on the image file and instruction information corresponding to the target category's pending instructions, includes: in response to the execution unit creation request, the master node sending the image file and instruction information corresponding to the target category's pending instructions to the first controller, so that the first controller sends the image file and instruction information corresponding to the target category's pending instructions to the API service component in the target container orchestration cluster, so that the API service component triggers the creation of the target execution unit on the target worker node based on the image file and instruction information corresponding to the target category's pending instructions.
[0153] In some implementations, the master node can listen for execution unit creation requests sent from the first controller.
[0154] It should be understood that the first controller is used to send execution unit creation requests. The first controller can be understood as a component.
[0155] In some implementations, the first controller can belong to the controller management component within the target container orchestration cluster. This controller management component is responsible for maintaining the cluster's state, such as application deployment scheduling, fault detection, auto-scaling, and rolling updates. Assuming the target container orchestration cluster is Kubernetes, then this controller management component is the ControllerManager within Kubernetes.
[0156] In some implementations, the English name for the first controller may be fold controller, but it is not limited to this.
[0157] It should be understood that the execution unit creation request is used to request the creation of an execution unit.
[0158] It should be understood that the execution unit in the target container orchestration cluster is the smallest operational unit within the target container orchestration cluster. An execution unit contains one or more containers that share network and storage resources, enabling these containers to run within that execution unit. Specifically, assuming the target container orchestration cluster is Kubernetes, then this execution unit can be a pod within Kubernetes.
[0159] In some implementations, the API service component triggers the creation of a target execution unit on the target worker node based on the image file and instruction information corresponding to the target category of the instruction to be run. This includes: the API service component can send an instruction to the container maintenance component in the target worker node to request the installation of the image file and to request binding of the dataset to be executed indicated by the instruction information. After receiving the instruction, the container maintenance component notifies the containerization platform in the target worker node, and then the containerization platform starts an execution unit corresponding to the image file and the dataset to be executed, i.e., the target execution unit, thus completing the creation of the target execution unit.
[0160] It should be understood that the container maintenance component is responsible for maintaining the lifecycle of containers, that is, creating, updating, and destroying containers by controlling the containerization platform. The containerization platform is mainly responsible for various operations of containers on worker nodes. Specifically, assuming the target container orchestration cluster is Kubernetes, then the container maintenance component could be Kubelet within Kubernetes, and the containerization platform could be Docker within Kubernetes.
[0161] It should be understood that the embodiments of this application do not limit the various components included in the target container orchestration cluster or the functions of each component. Based on this, the embodiments of this application do not limit the creation method of the target execution unit. For example, before the master node sends the image file and instruction information corresponding to the target category of the instruction to be run to the target container orchestration cluster, so that the target container orchestration cluster creates the target execution unit on the target worker node based on the image file and instruction information corresponding to the instruction to be run to the target category, the method further includes: the master node receiving the execution unit creation request sent by the API service component in the target container orchestration cluster; the master node sending the image file and instruction information corresponding to the target category of the instruction to be run to the target container orchestration cluster, so that the target container orchestration cluster creates the target execution unit on the target worker node based on the image file and instruction information corresponding to the instruction to be run to the target category, includes: the master node responding to the execution unit creation request sends the image file and instruction information corresponding to the target category of the instruction to be run to the API service component, so that the API service component triggers the creation of the target execution unit on the target worker node based on the image file and instruction information corresponding to the instruction to be run to the target category. Specifically, the API service component triggering the creation of a target execution unit on the target worker node based on the image file and instruction information corresponding to the instruction to be run based on the target category may include: the API service component may send an instruction to the containerization platform in the target worker node to request the installation of the image file and to request the binding of the dataset to be executed indicated by the instruction information. After receiving the instruction, the container maintenance component then starts an execution unit corresponding to the image file and the dataset to be executed, i.e., the target execution unit, thus completing the creation of the target execution unit.
[0162] S450: Inject the target type of instructions to be executed into the target execution unit so that the target execution unit can run the target type of instructions to be executed.
[0163] It should be understood that the target execution unit is equipped with the image file corresponding to the instruction to be run of the target category, and also loads the dataset to be executed corresponding to the instruction to be run of that category. It can run the instruction to be run of the target category to achieve task execution.
[0164] For example, Figure 6 A schematic diagram of an execution unit provided in an embodiment of this application, such as... Figure 6 As shown, the execution unit is equipped with an image file and loaded with a dataset to be executed. It can run the corresponding instructions to be executed in order to achieve task execution.
[0165] In some implementations, after the master node injects the target category of instructions to be executed into the target execution unit so that the target execution unit runs the instructions of the target category, the process further includes: the master node obtaining the task execution result of each task associated with the instructions of the target category.
[0166] It is worth mentioning that the pending instructions of the target category can be associated with one or more tasks, and the execution result of each task includes: execution success and execution exception.
[0167] It should be understood that execution exceptions include two situations: execution failure and execution timeout.
[0168] In some implementations, the master node obtains the task execution results of each task associated with the pending instructions of the target category, including: the master node receiving the task execution results of each task associated with the pending instructions of the target category sent by the second controller in the target container orchestration cluster; wherein, the second controller obtains the task execution results of each task associated with the pending instructions of the target category from the hook component in the target container orchestration cluster.
[0169] In some implementations, the second controller can periodically aggregate the task execution results of each task in the target container orchestration cluster and send these task execution results to the master node.
[0170] It should be understood that the second controller is used to obtain the task execution results of each task associated with the pending instructions of the target category from the hook component in the target container orchestration cluster, and to send the task execution results of each task to the master node. The second controller can be understood as a component.
[0171] In some implementations, the second controller may be the same controller as the first controller or it may be a different controller; the embodiments of this application do not impose any restrictions on this.
[0172] In some implementations, the English name for the second controller may be fold controller, but it is not limited to this.
[0173] In some implementations, the hook component can be deployed in the target worker node, but is not limited thereto.
[0174] Figure 7 This is a schematic diagram illustrating the acquisition of task execution results provided in an embodiment of this application, such as... Figure 7 As shown, the second controller obtains the task execution result from the hook component in worker node 1 of the container orchestration cluster A and returns the task execution result to the master node.
[0175] It should be noted that this application embodiment does not limit the various components included in the target container orchestration cluster or the functions of each component. Based on this, this application embodiment does not limit the method by which the master node obtains the task execution results. For example, the master node obtaining the task execution results of each task associated with the pending instructions of the target category includes: the master node receiving the task execution results of each task associated with the pending instructions of the target category sent by the API service component in the target container orchestration cluster; wherein, the API service component obtains the task execution results of each task associated with the pending instructions of the target category from the hook component in the target container orchestration cluster.
[0176] It should be understood that for each category of instructions to be executed, there is a corresponding container orchestration cluster. From the perspective of each container orchestration cluster, it can correspond to one or more categories of instructions to be executed. These instructions to be executed constitute the to-do items (TODO works) of that container orchestration cluster. For example, Figure 8 This is a schematic diagram of to-do items and container orchestration clusters provided in an embodiment of this application, as shown below. Figure 8 As shown, container orchestration clusters A, B, and C each correspond to a to-do item. These container orchestration clusters can use a pull mode to pull instructions to be run from their respective to-do items, and can also return the task execution results to the master node. The master node can record the task execution results. For example, if the task execution result is an execution exception, the master node can mark the task as ERROR; if the task execution result is a successful execution, the master node can mark the task as COMPLETE.
[0177] This application provides a task execution method based on multiple container orchestration clusters, comprising: a master node acquiring multiple task execution requests; wherein each task execution request includes: an image file of an application for executing a corresponding task to be executed, indication information indicating the dataset to be executed associated with the task to be executed, and instructions to be run associated with the task to be executed; the master node classifying the instructions to be run included in each of the multiple task execution requests based on the image file and indication information included in each of the multiple task execution requests; the master node selecting instructions to be run of a target category, and for the instructions to be run of the target category, selecting a target container orchestration cluster from the multiple container orchestration clusters, and selecting a target worker node from the target container orchestration cluster; the master node sending the image file and indication information corresponding to the instructions to be run of the target category to the target container orchestration cluster, so that the target container orchestration cluster creates a target execution unit on the target worker node based on the image file and indication information corresponding to the instructions to be run of the target category; and the master node injecting the instructions to be run of the target category into the target execution unit, so that the target execution unit runs the instructions to be run of the target category. Because multiple container orchestration clusters include more worker nodes, they break the limitations of resources such as CPU and memory, thereby improving the task execution performance of the task execution system and enhancing task execution efficiency and reliability.
[0178] Furthermore, in this embodiment, the first controller in the target container orchestration cluster can proactively send an execution unit creation request to the master node without requiring multiple interactions between the master node and the first controller in the target container orchestration cluster to create the target execution unit. Similarly, the second controller in the target container orchestration cluster can obtain task execution results through a hook component and proactively send an execution unit creation request to the master node without requiring multiple interactions between the master node and the second controller in the target container orchestration cluster to provide feedback on the task execution results. Moreover, each container orchestration cluster can use a pull mode to pull instructions to be run from its corresponding to-do list to execute the instructions, without requiring multiple interactions between the master node and each container orchestration cluster. This reduces the number of interactions between the master set and the container orchestration clusters, reduces network pressure, and allows the technical solution provided in this application to be applied to a larger number of container orchestration clusters.
[0179] To improve the robustness of the task execution system, this application also proposes fault migration in the event of an execution exception, which will be described in detail below:
[0180] One possible approach is that if the target task's execution result is an execution exception, the master node will trigger the target container orchestration cluster to migrate the target task to other execution units.
[0181] It should be understood that the other execution unit is the execution unit other than the target execution unit in the target container orchestration cluster.
[0182] In some implementations, the master node triggers the target container orchestration cluster to migrate the target task to other execution units, including: the master node sending the image file and instruction information corresponding to the target task to the first controller, so that the first controller sends the image file and instruction information corresponding to the target task to the API service component in the target container orchestration cluster, so that the API service component triggers the creation of the other execution unit on the target worker node based on the image file and instruction information corresponding to the target task, and after successful creation, the target task is migrated to the other execution unit.
[0183] In some implementation methods, the API service component triggers the creation of the other execution units on the target worker node based on the image file and instruction information corresponding to the target task. This includes: the API service component can send an instruction to the container maintenance component in the target worker node to request the installation of the image file and to request binding of the dataset to be executed indicated by the instruction information. After receiving the instruction, the container maintenance component notifies the containerization platform in the target worker node, and then the containerization platform starts an execution unit corresponding to the image file and the dataset to be executed, i.e., the other execution unit, thus completing the creation of the other execution unit.
[0184] It should be understood that the embodiments of this application do not limit the various components included in the target container orchestration cluster or the functions of each component. Based on this, the embodiments of this application do not limit the creation method of other execution units. For example, the master node triggers the target container orchestration cluster to migrate the target task to other execution units, including: the master node sends the image file and instruction information corresponding to the target task to the API service component, so that the API service component triggers the creation of the other execution unit on the target worker node based on the image file and instruction information corresponding to the target task, and after successful creation, the target task is migrated to the other execution unit. The API service component triggering the creation of the other execution unit on the target worker node based on the image file and instruction information corresponding to the target task may include: the API service component may send an instruction to the containerization platform in the target worker node to request the installation of the image file and to request binding of the dataset to be executed indicated by the instruction information. After receiving the instruction, the container maintenance component then starts an execution unit corresponding to the image file and the dataset to be executed, i.e., the other execution unit, to complete the creation of the other execution unit.
[0185] Alternatively, if the target task's execution result is an execution exception and the target task meets preset conditions, the master node will trigger the target container orchestration cluster to migrate the target task to other execution units.
[0186] In some implementations, if the target task does not meet the preset conditions, the master node will not trigger the target container orchestration cluster to migrate the target task to other execution units.
[0187] In some possible implementations, the preset conditions include, but are not limited to, any of the following:
[0188] The target task is executed on the target execution unit a number of times greater than or equal to a preset number;
[0189] The runtime of the target task on the target execution unit is greater than or equal to the first preset duration;
[0190] The runtime of the target task on the target execution unit is less than or equal to the second preset duration;
[0191] The target execution unit lacks sufficient software resources;
[0192] The target execution unit lacks sufficient hardware resources.
[0193] In some possible implementations, the preset number of times can be 3, 4, or 5, but is not limited to these.
[0194] In some possible implementations, the first preset duration can be 10ms, 20ms, or 30ms, but is not limited to these.
[0195] In some possible implementations, the second preset duration can be 1ms, 2ms, or 3ms, but is not limited to these.
[0196] In some implementations, the software resources include, but are not limited to, operating systems and applications.
[0197] In some implementations, the hardware resources include, but are not limited to, CPU, memory, and hard disk.
[0198] It should be noted that the difference between feasible method two and feasible method one is as follows: In feasible method one, if the target task's execution result is an execution exception, the master node directly triggers the target container orchestration cluster to migrate the target task to other execution units. However, in feasible method two, if the target task's execution result is an execution exception, a preset condition is first checked. If the target task meets the preset condition, the master node then triggers the target container orchestration cluster to migrate the target task to other execution units.
[0199] It should be understood that, regarding how the master node triggers the target container orchestration cluster to migrate the target task to other execution units, please refer to the explanation in the first implementation method, and this application embodiment will not repeat it here.
[0200] In the third possible implementation, if the target task's execution result is an execution exception, then for the target task, the master node reselects a container orchestration cluster from multiple container orchestration clusters, and reselects a worker node in the reselected container orchestration cluster; the master node sends the image file and instruction information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster rebuilds the execution unit on the reselected worker node based on the image file and instruction information corresponding to the target task; the master node injects the pending instructions of the target task into the reconstructed execution unit, so that the reconstructed execution unit runs the pending instructions of the target task.
[0201] It should be understood that the selection process for container orchestration clusters, the selection process for worker nodes, and the reconstruction process for execution units can be referred to above, and will not be repeated in the embodiments of this application.
[0202] It should be noted that the difference between feasible method three and feasible method one is as follows: In feasible method one, the master node does not need to reselect the container orchestration cluster and worker nodes; instead, it rebuilds the execution unit on the target worker node and migrates the target task to that execution unit. In feasible method three, the master node needs to reselect the container orchestration cluster and worker nodes, rebuild the execution unit on the reselected worker node, and migrate the target task to that execution unit.
[0203] Option 4 can be implemented as follows: If the execution result of the target task is an execution exception, and the target task meets the preset conditions, then for the target task, the master node reselects a container orchestration cluster from multiple container orchestration clusters, and reselects a worker node in the reselected container orchestration cluster; the master node sends the image file and instruction information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster rebuilds the execution unit on the reselected worker node based on the image file and instruction information corresponding to the target task; the master node injects the pending instructions of the target task into the reconstructed execution unit, so that the reconstructed execution unit runs the pending instructions of the target task.
[0204] It should be understood that the selection process for container orchestration clusters, the selection process for worker nodes, the reconstruction process for execution units, and the preset conditions can be referred to above, and will not be repeated in the embodiments of this application.
[0205] It should be noted that the difference between feasible method four and feasible method three is as follows: In feasible method three, if the execution result of the target task is an execution exception, the master node directly reselects a container orchestration cluster from multiple container orchestration clusters, and reselects worker nodes in the reselected container orchestration cluster; the master node sends the image file and instruction information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster can rebuild the execution unit on the reselected worker node based on the image file and instruction information corresponding to the target task; the master node injects the pending instructions of the target task into the reconstructed execution unit, so that the reconstructed execution unit runs the pending instructions of the target task. In the fourth possible implementation, if the target task's execution result is an execution exception, a preset condition is first checked. If the target task meets the preset condition, the master node reselects a container orchestration cluster from multiple container orchestration clusters, and then reselects a worker node in the reselected container orchestration cluster. The master node sends the image file and instruction information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster can rebuild the execution unit on the reselected worker node based on the image file and instruction information corresponding to the target task. The master node injects the pending instructions of the target task into the reconstructed execution unit, so that the reconstructed execution unit can run the pending instructions of the target task.
[0206] In the embodiments of this application, this application also proposes that fault migration can be performed when the task execution result is an execution exception, thereby improving the robustness of the task execution system.
[0207] The preferred embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solutions of this application, and these simple modifications all fall within the protection scope of this application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this application will not describe the various possible combinations separately. Furthermore, various different embodiments of this application can also be arbitrarily combined, as long as they do not violate the spirit of this application, they should also be considered as the content disclosed in this application.
[0208] It should also be understood that, in the various method embodiments of this application, the order of the above-mentioned processes does not imply 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 on the implementation process of the embodiments of this application.
[0209] The methods provided in the embodiments of this application have been described above. The task execution system and apparatus based on multiple container orchestration clusters provided in the embodiments of this application will be described below.
[0210] Figure 9 A schematic diagram of a task execution system 900 based on multiple container orchestration clusters provided in this application embodiment is shown below. Figure 9 As shown, the system includes: a master node 910 and multiple container orchestration clusters 920; wherein, the master node 910 is used to: obtain multiple task execution requests; wherein, each task execution request includes: an image file of an application for executing the corresponding task to be executed, indication information for indicating the dataset to be executed associated with the task to be executed, and instructions to be run associated with the task to be executed; classify the instructions to be run included in each of the multiple task execution requests based on the image file and indication information included in each of the multiple task execution requests; select the instructions to be run of the target category, and for the instructions to be run of the target category, select a target container orchestration cluster from the multiple container orchestration clusters, and select a target worker node from the target container orchestration cluster; send the image file and indication information corresponding to the instructions to be run of the target category to the target container orchestration cluster, so that the target container orchestration cluster creates a target execution unit on the target worker node based on the image file and indication information corresponding to the instructions to be run of the target category; inject the instructions to be run of the target category into the target execution unit, so that the target execution unit runs the instructions to be run of the target category.
[0211] In some implementations, before the master node 910 sends the image file and instruction information corresponding to the target category's pending instructions to the target container orchestration cluster, so that the target container orchestration cluster creates the target execution unit on the target worker node based on the image file and instruction information corresponding to the target category's pending instructions, the master node 910 is also used to receive an execution unit creation request sent by the first controller in the target container orchestration cluster. Accordingly, the master node 910 is specifically used to: in response to the execution unit creation request, send the image file and instruction information corresponding to the target category's pending instructions to the first controller, so that the first controller sends the image file and instruction information corresponding to the target category's pending instructions to the API service component in the target container orchestration cluster, so that the API service component triggers the creation of the target execution unit on the target worker node based on the image file and instruction information corresponding to the target category's pending instructions.
[0212] In some implementations, after the master node 910 injects the target category of instructions to be executed into the target execution unit so that the target execution unit runs the instructions to be executed into the target category, the master node 910 is also used to obtain the task execution result of each task associated with the instructions to be executed into the target category.
[0213] In some implementations, the master node 910 is specifically used to: receive the task execution results of each task associated with the target category's pending instruction sent by the second controller in the target container orchestration cluster; wherein the second controller obtains the task execution results of each task associated with the target category's pending instruction from the hook component in the target container orchestration cluster.
[0214] In some implementations, the master node 910 is specifically used to: if the execution result of the target task is an execution exception, trigger the target container orchestration cluster to migrate the target task to other execution units.
[0215] In some implementations, the master node 910 is also used to: after obtaining the task execution result of each task associated with the instruction to be run of the target category, if the task execution result of the target task is an execution exception and the target task meets the preset conditions, trigger the target container orchestration cluster to migrate the target task to other execution units.
[0216] In some implementations, the master node 910 is also configured to: after obtaining the task execution result of each task associated with the execution instruction of the target category, if the task execution result of the target task is an execution exception, then for the target task, reselect a container orchestration cluster among multiple container orchestration clusters, and reselect a worker node in the reselected container orchestration cluster; send the image file and indication information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster can rebuild the execution unit on the reselected worker node based on the image file and indication information corresponding to the target task; inject the execution instruction of the target task into the reconstructed execution unit, so that the reconstructed execution unit can run the execution instruction of the target task.
[0217] In some implementations, the master node 910 is further configured to: after obtaining the task execution result of each task associated with the pending instructions of the target category, if the task execution result of the target task is an execution exception and the target task meets preset conditions, then for the target task, reselect a container orchestration cluster among multiple container orchestration clusters, and reselect a worker node in the reselected container orchestration cluster; send the image file and indication information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster can rebuild the execution unit on the reselected worker node based on the image file and indication information corresponding to the target task; inject the pending instructions of the target task into the reconstructed execution unit, so that the reconstructed execution unit can run the pending instructions of the target task.
[0218] In some possible implementations, the preset conditions include any of the following:
[0219] The target task is executed on the target execution unit a number of times greater than or equal to a preset number;
[0220] The runtime of the target task on the target execution unit is greater than or equal to the first preset duration;
[0221] The runtime of the target task on the target execution unit is less than or equal to the second preset duration;
[0222] The target execution unit lacks sufficient software resources;
[0223] The target execution unit lacks sufficient hardware resources.
[0224] In some implementations, the master node 910 is specifically used to: obtain the characteristic information of each of the multiple container orchestration clusters; and, for the target category of instructions to be executed, select the target container orchestration cluster from among the multiple container orchestration clusters based on the characteristic information of each of the multiple container orchestration clusters.
[0225] In some implementations, the characteristic information of each container orchestration cluster includes at least one of the following:
[0226] Pricing information for container orchestration clusters;
[0227] Priority information for container orchestration clusters.
[0228] In some implementations, the master node 910 is specifically used to: obtain the characteristic information of each of the multiple container orchestration clusters through long-lived connections with their respective API service components in the multiple container orchestration clusters.
[0229] In some implementations, the master node 910 is specifically used to: obtain the characteristic information of each worker node in the target container orchestration cluster; and select the target worker node in the target container orchestration cluster based on the characteristic information of each worker node for the target category of the instruction to be executed.
[0230] In some implementations, the characteristic information of each worker node in the target container orchestration cluster includes at least one of the following: the number of CPUs in the worker node; the available memory size of the worker node.
[0231] In some implementations, the master node 910 is specifically used to: obtain characteristic information of each worker node through a long connection with the API service component in the target container orchestration cluster.
[0232] It should be understood that the task execution system provided in this application embodiment has the characteristics of easy deployment, large capacity, and high availability.
[0233] It should be understood that the system embodiments and method embodiments can correspond to each other, and similar descriptions can be found in the method embodiments. To avoid repetition, further details are omitted here. Specifically, Figure 9 The system 900 shown can execute Figure 4The corresponding method embodiments, and the foregoing and other operations and / or functions of each module in system 900 are respectively implemented for the purpose of... Figure 4 For the sake of brevity, the corresponding processes in each method are not described in detail here.
[0234] The system 900 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0235] Figure 10 A schematic diagram of a task execution device 1000 based on multiple container orchestration clusters provided in this application embodiment includes:
[0236] The acquisition module 1010 is used to acquire multiple task execution requests; wherein, each task execution request includes: an image file of the application used to execute the corresponding task to be executed, indication information used to indicate the dataset to be executed associated with the task to be executed, and the instructions to be run associated with the task to be executed;
[0237] The classification module 1020 is used to classify the instructions to be run in each of the multiple task execution requests based on the image files and indication information included in each of the multiple task execution requests.
[0238] The selection module 1030 is used to select the target category of instructions to be run, and for the target category of instructions to be run, select the target container orchestration cluster from multiple container orchestration clusters, and select the target worker node in the target container orchestration cluster;
[0239] The sending module 1040 is used to send the image file and instruction information corresponding to the target category of the instruction to be run to the target container orchestration cluster, so that the target container orchestration cluster can create the target execution unit on the target worker node based on the image file and instruction information corresponding to the target category of the instruction to be run.
[0240] The injection module 1050 is used to inject the target type of instructions to be executed into the target execution unit so that the target execution unit can run the instructions to be executed of the target type.
[0241] In some implementations, the acquisition module 1010 is further configured to: after the injection module 1050 injects the target category of the instructions to be executed into the target execution unit so that the target execution unit runs the instructions to be executed of the target category, acquire the task execution result of each task associated with the instructions to be executed of the target category.
[0242] In some implementations, the acquisition module 1010 is specifically used to: receive the task execution result of each task associated with the target category's pending instruction sent by the second controller in the target container orchestration cluster; wherein the second controller obtains the task execution result of each task associated with the target category's pending instruction from the hook component in the target container orchestration cluster.
[0243] In some implementations, the task execution device 1000 further includes a trigger module 1060, which, after the acquisition module 1010 acquires the task execution result of each task associated with the target category's instruction to be run, if the task execution result of the target task is an execution exception, triggers the target container orchestration cluster to migrate the target task to other execution units.
[0244] In some implementations, the triggering module 1060 is also used to: after the acquisition module 1010 acquires the task execution result of each task associated with the target category's instruction to be run, if the task execution result of the target task is an execution exception and the target task meets the preset conditions, then trigger the target container orchestration cluster to migrate the target task to other execution units.
[0245] In some implementations, after the acquisition module 1010 acquires the task execution result of each task associated with the execution instruction of the target category, the selection module 1030 is further configured to, if the task execution result of the target task is an execution exception, reselect a container orchestration cluster among multiple container orchestration clusters for the target task, and reselect a worker node in the reselected container orchestration cluster; the sending module 1040 is further configured to send the image file and indication information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster can rebuild the execution unit on the reselected worker node based on the image file and indication information corresponding to the target task; the injection module 1050 is further configured to inject the execution instruction of the target task into the reconstructed execution unit, so that the reconstructed execution unit can run the execution instruction of the target task.
[0246] In some implementations, after the acquisition module 1010 acquires the task execution result of each task associated with the execution instruction of the target category, if the task execution result of the target task is an execution exception and the target task meets the preset conditions, the selection module 1030 is further configured to reselect a container orchestration cluster among multiple container orchestration clusters for the target task, and reselect a worker node in the reselected container orchestration cluster; the sending module 1040 is further configured to send the image file and indication information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster can rebuild the execution unit on the reselected worker node based on the image file and indication information corresponding to the target task; the injection module 1050 is further configured to inject the execution instruction of the target task into the reconstructed execution unit, so that the reconstructed execution unit can run the execution instruction of the target task.
[0247] In some possible implementations, the preset conditions include any of the following:
[0248] The target task is executed on the target execution unit a number of times greater than or equal to a preset number;
[0249] The runtime of the target task on the target execution unit is greater than or equal to the first preset duration;
[0250] The runtime of the target task on the target execution unit is less than or equal to the second preset duration;
[0251] The target execution unit lacks sufficient software resources;
[0252] The target execution unit lacks sufficient hardware resources.
[0253] In some implementations, the selection module 1030 is specifically used to: obtain the characteristic information of each of the multiple container orchestration clusters; and, for the target category of the instruction to be run, select the target container orchestration cluster from the multiple container orchestration clusters based on the characteristic information of each of the multiple container orchestration clusters.
[0254] In some implementations, the characteristic information of each container orchestration cluster includes at least one of the following: the price information of the container orchestration cluster; the priority information of the container orchestration cluster.
[0255] In some implementations, the acquisition module 1010 is specifically used to: acquire the characteristic information of each of the multiple container orchestration clusters through long connections with their respective API service components in the multiple container orchestration clusters.
[0256] In some implementations, the selection module 1030 is specifically used to: obtain the characteristic information of each worker node in the target container orchestration cluster; and select the target worker node in the target container orchestration cluster based on the characteristic information of each worker node for the instruction to be executed of the target category.
[0257] In some implementations, the characteristic information of each worker node in the target container orchestration cluster includes at least one of the following: the number of CPUs in the worker node; the available memory size of the worker node.
[0258] In some implementations, the acquisition module 1010 is specifically used to: acquire characteristic information of each worker node through a long connection with the API service component in the target container orchestration cluster.
[0259] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 10 The device 1000 shown can perform Figure 4 The corresponding method embodiments, and the foregoing and other operations and / or functions of each module in the device 1000 are respectively for implementing Figure 4 For the sake of brevity, the corresponding processes in each method are not described in detail here.
[0260] The apparatus 1000 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0261] Figure 11 This is a schematic block diagram of the electronic device 1100 provided in an embodiment of this application. The electronic device 1100 can be the aforementioned master node or a backend server, but is not limited thereto. Figure 11 As shown, the electronic device 1100 may include:
[0262] The system includes a memory 1110 and a processor 1120. The memory 1110 stores a computer program 1130 and transfers the computer program 1130 to the processor 1120. In other words, the processor 1120 can retrieve and run the computer program 1130 from the memory 1110 to implement the methods described in the embodiments of this application.
[0263] For example, the processor 1120 can be used to execute the steps in the above method according to the instructions in the computer program 1130.
[0264] In some embodiments of this application, the processor 1120 may include, but is not limited to:
[0265] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0266] In some embodiments of this application, the memory 1110 includes, but is not limited to:
[0267] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0268] In some embodiments of this application, the computer program 1130 may be divided into one or more modules, which are stored in the memory 1110 and executed by the processor 1120 to complete the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 1130 in the electronic device.
[0269] like Figure 11 As shown, the electronic device 1100 may further include:
[0270] Transceiver 1140, which can be connected to processor 1120 or memory 1110.
[0271] The processor 1120 can control the transceiver 1140 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 1140 may include a transmitter and a receiver. The transceiver 1140 may further include antennas, and the number of antennas may be one or more.
[0272] It should be understood that the various components in the electronic device 1100 are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0273] According to one aspect of this application, a computer storage medium is provided that stores a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.
[0274] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method described in the above-described method embodiments.
[0275] In other words, when implemented using software, it can be implemented wholly or partially in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0276] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0277] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0278] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0279] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A task execution method based on a cluster of multiple container orchestrations, characterized in that, include: Obtain multiple task execution requests; wherein each task execution request includes: an image file of an application for executing the corresponding task to be executed, indication information for indicating the dataset to be executed associated with the task to be executed, and instructions to be run associated with the task to be executed; Based on the image files and instruction information included in each of the multiple task execution requests, the instructions to be executed included in each of the multiple task execution requests are classified. Select the instruction to be executed for the target category, and for the instruction to be executed for the target category, select the target container orchestration cluster from multiple container orchestration clusters, and select the target worker node in the target container orchestration cluster; Send the image file and instruction information corresponding to the target category of the instruction to be run to the target container orchestration cluster, so that the target container orchestration cluster can create a target execution unit on the target worker node based on the image file and instruction information corresponding to the target category of the instruction to be run; Inject the target category's pending instructions into the target execution unit so that the target execution unit executes the target category's pending instructions.
2. The method according to claim 1, characterized in that, Before sending the image file and indication information corresponding to the target category's pending instructions to the target container orchestration cluster, so that the target container orchestration cluster creates the target execution unit on the target worker node based on the image file and indication information corresponding to the target category's pending instructions, the method further includes: Receive an execution unit creation request sent by the first controller in the target container orchestration cluster; Sending the image file and indication information corresponding to the target category's pending instructions to the target container orchestration cluster, so that the target container orchestration cluster creates a target execution unit on the target worker node based on the image file and indication information corresponding to the target category's pending instructions, includes: In response to the execution unit creation request, the image file and indication information corresponding to the target category's pending instruction are sent to the first controller, so that the first controller sends the image file and indication information corresponding to the target category's pending instruction to the application programming interface (API) service component in the target container orchestration cluster, so that the API service component triggers the creation of the target execution unit on the target worker node based on the image file and indication information corresponding to the target category's pending instruction.
3. The method according to claim 1 or 2, characterized in that, After injecting the target category's execution instructions into the target execution unit so that the target execution unit executes the target category's execution instructions, the method further includes: Obtain the task execution result of each task associated with the instruction to be executed in the target category.
4. The method according to claim 3, characterized in that, The step of obtaining the task execution result of each task associated with the instruction to be executed of the target category includes: Receive the task execution results of each task associated with the pending execution instruction of the target category sent by the second controller in the target container orchestration cluster; The second controller obtains the task execution results of each task associated with the pending instructions of the target category from the hook component in the target container orchestration cluster.
5. The method according to claim 3, characterized in that, After obtaining the task execution result of each task associated with the instruction to be executed of the target category, the method further includes: If the execution result of the target task is an execution exception, the target container orchestration cluster will be triggered to migrate the target task to other execution units.
6. The method according to claim 3, characterized in that, After obtaining the task execution result of each task associated with the instruction to be executed of the target category, the method further includes: If the execution result of the target task is an execution exception, and the target task meets the preset conditions, then the target container orchestration cluster is triggered to migrate the target task to other execution units.
7. The method according to claim 3, characterized in that, After obtaining the task execution result of each task associated with the instruction to be executed of the target category, the method further includes: If the execution result of the target task is an execution exception, then for the target task, a new container orchestration cluster is selected from the multiple container orchestration clusters, and a new worker node is selected in the new container orchestration cluster. Send the image file and indication information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster can rebuild the execution unit on the reselected worker node based on the image file and indication information corresponding to the target task; The execution unit is injected with the pending instructions of the target task so that the reconstructed execution unit can run the pending instructions of the target task.
8. The method according to claim 3, characterized in that, After obtaining the task execution result of each task associated with the instruction to be executed of the target category, the method further includes: If the execution result of the target task is an execution exception, and the target task meets the preset conditions, then for the target task, a new container orchestration cluster is selected from the multiple container orchestration clusters, and a new worker node is selected from the new container orchestration cluster. Send the image file and indication information corresponding to the target task to the reselected container orchestration cluster, so that the reselected container orchestration cluster can rebuild the execution unit on the reselected worker node based on the image file and indication information corresponding to the target task; The execution unit is injected with the pending instructions of the target task so that the reconstructed execution unit can run the pending instructions of the target task.
9. The method according to claim 6 or 8, characterized in that, The preset conditions include any one of the following: The target task is run on the target execution unit a number greater than or equal to a preset number; The runtime of the target task on the target execution unit is greater than or equal to a first preset duration; The runtime of the target task on the target execution unit is less than or equal to the second preset duration; The target execution unit lacks sufficient software resources; The target execution unit has insufficient hardware resources.
10. The method according to claim 1 or 2, characterized in that, For the instructions to be executed in the target category, the target container orchestration cluster is selected from multiple container orchestration clusters, including: Obtain the characteristic information of each of the multiple container orchestration clusters; For the instruction to be executed in the target category, the target container orchestration cluster is selected from the multiple container orchestration clusters based on the characteristic information of each of the multiple container orchestration clusters.
11. The method according to claim 10, characterized in that, The characteristic information of each container orchestration cluster includes at least one of the following: The pricing information for the container orchestration cluster; The priority information of the container orchestration cluster.
12. The method according to claim 10, characterized in that, The step of obtaining the characteristic information of each of the multiple container orchestration clusters includes: The characteristic information of each of the multiple container orchestration clusters is obtained through long-lived connections with their respective API service components.
13. The method according to claim 1 or 2, characterized in that, For the instructions to be executed in the target category, the target worker node is selected in the target container orchestration cluster, including: Obtain the characteristic information of each worker node in the target container orchestration cluster; For the instructions to be executed in the target category, the target worker node is selected in the target container orchestration cluster based on the feature information of each worker node.
14. The method according to claim 13, characterized in that, The characteristic information of each worker node in the target container orchestration cluster includes at least one of the following: The number of central processing units (CPUs) of the working node; The available memory size of the worker node.
15. The method according to claim 13, characterized in that, The step of obtaining the characteristic information of each worker node in the target container orchestration cluster includes: The characteristic information of each worker node is obtained through a long connection with the API service component in the target container orchestration cluster.
16. A task execution system based on multiple container orchestration clusters, characterized in that, include: A master node and multiple container orchestration clusters; wherein, the master node is used for: Obtain multiple task execution requests; wherein each task execution request includes: an image file of an application for executing the corresponding task to be executed, indication information for indicating the dataset to be executed associated with the task to be executed, and instructions to be run associated with the task to be executed; Based on the image files and instruction information included in each of the multiple task execution requests, the instructions to be executed included in each of the multiple task execution requests are classified. Select the instruction to be executed for the target category, and for the instruction to be executed for the target category, select the target container orchestration cluster from multiple container orchestration clusters, and select the target worker node in the target container orchestration cluster; Send the image file and instruction information corresponding to the target category of the instruction to be run to the target container orchestration cluster, so that the target container orchestration cluster can create a target execution unit on the target worker node based on the image file and instruction information corresponding to the target category of the instruction to be run; Inject the target category's pending instructions into the target execution unit so that the target execution unit executes the target category's pending instructions.
17. A task execution device based on multiple container orchestration clusters, characterized in that, include: The acquisition module is used to acquire multiple task execution requests; wherein each task execution request includes: an image file of an application for executing the corresponding task to be executed, indication information for indicating the dataset to be executed associated with the task to be executed, and the instruction to be run associated with the task to be executed; The classification module is used to classify the instructions to be run in each of the multiple task execution requests based on the image files and indication information included in each of the multiple task execution requests. The selection module is used to select the target category of instructions to be run, and for the target category of instructions to be run, select the target container orchestration cluster from multiple container orchestration clusters, and select the target worker node in the target container orchestration cluster; The sending module is used to send the image file and indication information corresponding to the target category of the instruction to be run to the target container orchestration cluster, so that the target container orchestration cluster can create a target execution unit on the target worker node based on the image file and indication information corresponding to the target category of the instruction to be run; An injection module is used to inject the target category of instructions to be executed into the target execution unit, so that the target execution unit runs the target category of instructions to be executed.
18. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store a computer program, the processor being used to invoke and run the computer program stored in the memory to perform the method of any one of claims 1 to 15.
19. A computer-readable storage medium, characterized in that, Used to store a computer program that causes a computer to perform the method as described in any one of claims 1 to 15.
20. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method as described in any one of claims 1 to 15.
Citation Information
Patent Citations
Task scheduling method, device and system
CN116610422A
Software application container hosting
US20220374218A1