Application deployment method and device, storage medium and electronic equipment
By creating a process queue in the container orchestration system and dynamically adjusting the number of WASM adaptation processes, parallel cold start of WASM adaptation processes is achieved, solving the problem of large time overhead during WASM application deployment and improving deployment efficiency.
Patent Information
- Application Number
- CN202411586742.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-28
AI Technical Summary
In the container orchestration system Kubernetes, when deploying WASM applications, each WASM sandbox is created, a WASM adaptation process needs to be cold-started, resulting in high time overhead and limiting the ability to deploy WASM applications on a large scale quickly.
By creating a process queue and maintaining the first number of WASM adaptation processes running, dynamically adjust the number of WASM adaptation processes according to WASM task requests, and start the WASM adaptation process in parallel to create a WASM sandbox.
The parallel cold start of WASM adaptation process is realized, which greatly reduces the cold start time when deploying WASM applications on a large scale, reduces the time overhead, and improves the deployment efficiency of WASM applications.
Smart Images

Figure CN119536749A_ABST
Abstract
Description
Background Art
[0002] With the rapid development of cloud computing and microservice architecture, the container orchestration system Kubernetes has become the de facto standard in the field of container orchestration, which greatly simplifies the deployment and management of distributed applications. However, with the increasing complexity of services, problems such as large container image size and security have gradually emerged. At the same time, the virtual instruction set architecture WASM (WebAssembly), as a lightweight, high-performance, cross-platform emerging technology, provides security isolation through a sandbox execution environment, and is gradually showing its potential in the cloud native field.
[0003] In the current solution of deploying WASM applications through the container orchestration system Kubernetes, each WASM sandbox needs to be cold-started with a WASM adaptation process, and this process is serial, which will incur a large time overhead. In scenarios such as edge computing and Serverless that require large-scale deployment of WASM applications, this time overhead is an important factor restricting the large-scale and rapid deployment of WASM applications.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The present disclosure provides an application deployment method and device, a storage medium, and an electronic device, which can overcome the problem of excessive time overhead at least to a certain extent.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to one aspect of the present disclosure, there is provided an application deployment method, comprising:
[0008] Creating a process queue; a first number of virtual instruction set architecture WASM adaptation processes are running in the process queue;
[0009] According to the WASM task request, the target creation quantity of the WASM sandbox is determined to be the second quantity;
[0010] Adjusting in parallel the number of WASM adaptation processes in the process queue from the first number to the second number;
[0011] According to the second number of WASM adaptation processes, a second number of WASM sandboxes are created and WASM applications are deployed in the WASM sandboxes.
[0012] In some embodiments, creating a process queue includes:
[0013] Adding a queue module in the container orchestration system; the queue module is communicatively connected with the container runtime of the container orchestration system;
[0014] A process queue is created by using the queue module, and a first number of WASM adaptation processes are started and maintained in the process queue.
[0015] In some embodiments, the container orchestration system further includes: a WASM master node and a proxy service;
[0016] According to the WASM task request, the target creation quantity of the WASM sandbox is determined to be the second quantity, including:
[0017] Creating a sandbox task module in the container orchestration system;
[0018] The WASM master node sends a task request to the proxy service; the master node and the proxy service belong to the container orchestration system;
[0019] The proxy service receives the task request and forwards it to the sandbox task module;
[0020] The sandbox task module determines whether the task request is a WASM task request;
[0021] If the task request is a WASM task request, the WASM task request is parsed to determine that the target creation quantity of the WASM sandbox corresponding to the WASM task request is the second quantity.
[0022] In some embodiments, it also includes:
[0023] If the task request is not a WASM task request, the task request is sent to the container runtime, so that the container runtime creates a corresponding container according to the task request.
[0024] In some embodiments, adjusting the number of WASM adaptation processes in the process queue from the first number to the second number in parallel includes:
[0025] comparing the second amount to the first amount;
[0026] If the second number is greater than the first number, creating a third number of parallel threads in the process queue; the third number is the difference between the second number and the first number;
[0027] Based on the third number of parallel threads, a third number of WASM adaptation processes are started in parallel and added to the process queue, so that the number of WASM adaptation processes in the process queue is adjusted to the second number.
[0028] In some embodiments, based on the third number of parallel threads, starting a third number of WASM adaptation processes in parallel includes:
[0029] In each of the third number of parallel threads, a corresponding WASM adaptation process is created and cold-started to start the third number of WASM adaptation processes in parallel.
[0030] In some embodiments, if the second number is not greater than the first number, the number of WASM-adapted processes in the process queue is not adjusted.
[0031] In some embodiments, according to the second number of WASM adaptation processes, creating a second number of WASM sandboxes and deploying WASM applications in the WASM sandboxes includes:
[0032] The sandbox task module communicates with the queue module and takes out a second number of WASM adaptation processes from the process queue;
[0033] Creating a second number of WASM sandboxes using a second number of WASM adapter processes;
[0034] Launching the WASM runtime in the WASM sandbox;
[0035] Based on the started WASM runtime, a corresponding container is created in the WASM sandbox, and a WASM application is deployed and run in the container.
[0036] According to another aspect of the present disclosure, there is also provided an application deployment device, including:
[0037] A process queue creation module, used to create a process queue; a first number of virtual instruction set architecture WASM adaptation processes are running in the process queue;
[0038] A WASM sandbox creation quantity determination module, used to determine, according to a WASM task request, that a target creation quantity of WASM sandboxes is a second quantity;
[0039] A WASM adaptation process adjustment module, configured to adjust the number of WASM adaptation processes in the process queue from the first number to the second number in parallel;
[0040] An application deployment module is used to create a second number of WASM sandboxes according to the second number of WASM adaptation processes and deploy WASM applications in the WASM sandboxes.
[0041] According to another aspect of the present disclosure, an electronic device is also provided, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned application deployment methods by executing the executable instructions.
[0042] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the application deployment method described in any one of the above is implemented.
[0043] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, any one of the above-mentioned application deployment methods is implemented.
[0044] The application deployment method and device, storage medium and electronic device provided in the embodiments of the present disclosure include: creating a process queue; a first number of virtual instruction set architecture WASM adaptation processes are running in the process queue; according to the WASM task request, determining the target creation number of the WASM sandbox to be a second number; adjusting the number of WASM adaptation processes in the process queue from the first number to the second number in parallel; according to the second number of WASM adaptation processes, creating a second number of WASM sandboxes and deploying WASM applications in the WASM sandbox. The present disclosure creates a process queue and maintains a first number of WASM adaptation processes running in the process queue, and adjusts the WASM adaptation processes in the process queue in parallel according to the number of WASM sandboxes required by the WASM task request, thereby realizing the parallel cold start of the WASM adaptation process. Compared with the serial cold start of the WASM adaptation process, the parallel cold start of the WASM adaptation process can greatly reduce the cold start time when the WASM application is deployed on a large scale, reduce time overhead, and thus realize efficient deployment of the WASM application.
[0045] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0047] Figure 1 A schematic diagram showing the system structure of an application deployment method in an embodiment of the present disclosure.
[0048] Figure 2 A schematic diagram of an application deployment method in an embodiment of the present disclosure is shown.
[0049] Figure 3 A basic container orchestration system framework diagram in an embodiment of the present disclosure is shown.
[0050] Figure 4 A schematic diagram of a process queue creation process of an application deployment method in an embodiment of the present disclosure is shown.
[0051] Figure 5 A schematic diagram of a process of determining a target creation quantity of WASM sandboxes as a second quantity in an application deployment method according to an embodiment of the present disclosure is shown.
[0052] Figure 6 A framework diagram of an enhanced container orchestration system in an embodiment of the present disclosure is shown.
[0053] Figure 7 A schematic diagram of a process for dynamically adjusting the number of WASM adaptation processes in an application deployment method in an embodiment of the present disclosure is shown.
[0054] Figure 8 A schematic diagram of a WASM application deployment process of an application deployment method in an embodiment of the present disclosure is shown.
[0055] Fig. 9 A functional module diagram of an application deployment method in an embodiment of the present disclosure is shown.
[0056] Fig.10 A flow chart of an application deployment method in an embodiment of the present disclosure is shown.
[0057] Fig.11 A schematic diagram of an application deployment device in an embodiment of the present disclosure is shown.
[0058] Fig.12 A structural block diagram of a computer device for an application deployment method in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0059] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0060] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0061] For ease of understanding, before introducing the embodiments of the present disclosure, several terms involved in the embodiments of the present disclosure are first explained as follows:
[0062] Container orchestration system (Kubernetes, K8s) is an open source container management system for automatically deploying, scaling and managing containerized applications. It provides an efficient way to manage large-scale distributed systems, especially in cloud computing environments. The main functions include: container orchestration, self-healing mechanism, horizontal expansion, load balancing and networking, storage orchestration, secret and configuration management, and batch processing. Kubernetes is widely used in large-scale production-level application deployment.
[0063] WebAssembly (WASM) is a low-level bytecode format that runs in modern web browsers. The overall architecture includes core ISA definition, binary encoding, definition and execution of program semantics, and application programming interfaces for different embedded environments. It is a compilation target format that aims to provide a high-performance execution environment for modern web applications. It is a binary format that can be compiled from various programming languages and can run on multiple platforms, including browsers and servers.
[0064] Container runtime refers to a set of software components that are responsible for creating, starting, and stopping container instances on a computer. Container runtime is the core part of container technology. It provides the necessary tools and services to package applications and their dependencies and run them in the form of containers. Common container runtimes include: Docker, rkt, containerd, CRI-O, Podman.
[0065] WASM runtime refers to a software environment that can load, compile and execute WebAssembly code. Its main responsibility is to execute WebAssembly code in a secure sandbox environment. This sandbox environment limits the access rights of WebAssembly code to the underlying system, thereby protecting the host system from malicious or erroneous code.
[0066] Serverless is a cloud computing deployment model that allows developers to write and deploy applications without having to worry about the management and operation of the underlying servers. In the Serverless architecture, cloud service providers are responsible for managing the servers and operating environment, allowing developers to focus on writing business logic code. WebAssembly (Wasm) plays an increasingly important role in Serverless computing. Due to its lightweight, high-performance, and language-independent characteristics, WebAssembly has become an ideal choice for executing Serverless functions.
[0067] Containerd is a highly portable open source container runtime. It is an independent, lightweight daemon that manages the life cycle of containers. Containerd is designed to provide a simple, robust, and pluggable container runtime environment that allows containers to run on different operating systems and environments.
[0068] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.
[0069] Figure 1 FIG. 1 shows an exemplary application system architecture diagram to which the application deployment method in the embodiment of the present disclosure can be applied. Figure 1 As shown, the system architecture may include a terminal device 101 , a network 102 and a server 103 .
[0070] The network 102 is a medium for providing a communication link between the terminal device 101 and the server 103, and can be a wired network or a wireless network.
[0071] Optionally, the wireless network or wired network described above uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network). In some embodiments, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent data exchanged through the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.
[0072] The terminal device 101 can be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, wearable devices, augmented reality devices, virtual reality devices, etc.
[0073] Optionally, the client of the application installed in different terminal devices 101 is the same, or the client of the same type of application based on different operating systems. Based on the different terminal platforms, the specific form of the client of the application can also be different, for example, the application client can be a mobile client, a PC client, etc.
[0074] The server 103 may be a server that provides various services, such as a background management server that provides support for the device operated by the user using the terminal device 101. The background management server may analyze and process the received request and other data, and feed back the processing results to the terminal device.
[0075] Optionally, the server can be an independent physical server, or a server cluster or distributed system composed 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 communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0076] Those skilled in the art will know that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration, and any number of terminal devices, networks and servers may be provided according to actual needs, and the embodiments of the present disclosure do not limit this.
[0077] Under the above system architecture, an application deployment method is provided in an embodiment of the present disclosure, and the method can be executed by any electronic device with computing and processing capabilities.
[0078] In some embodiments, the application deployment method provided in the embodiments of the present disclosure can be executed by a terminal device of the above-mentioned system architecture; in other embodiments, the application deployment method provided in the embodiments of the present disclosure can be executed by a server in the above-mentioned system architecture; in other embodiments, the application deployment method provided in the embodiments of the present disclosure can be implemented by the terminal device and the server in the above-mentioned system architecture through interaction.
[0079] Figure 2 A schematic diagram of an application deployment method in an embodiment of the present disclosure is shown. Figure 2 As shown, the application deployment method provided in the embodiment of the present disclosure includes the following steps:
[0080] Step S202: creating a process queue; a first number of virtual instruction set architecture WASM adaptation processes are running in the process queue;
[0081] Step S204: according to the WASM task request, determining that the target creation quantity of the WASM sandbox is a second quantity;
[0082] Step S206: adjusting the number of WASM adaptation processes in the process queue from the first number to the second number in parallel;
[0083] Step S208: According to the second number of WASM adaptation processes, create a second number of WASM sandboxes and deploy WASM applications in the WASM sandboxes.
[0084] The disclosed embodiment creates a process queue and maintains a first number of WASM adaptation processes running in the process queue, and adjusts the WASM adaptation processes in the process queue in parallel according to the number of WASM sandboxes required by the WASM task request, thereby achieving parallel cold start of the WASM adaptation processes. Compared with serial cold start of the WASM adaptation processes, the parallel cold start of the WASM adaptation processes can significantly reduce the cold start time during large-scale deployment of WASM applications, reduce time overhead, and thus achieve efficient deployment of WASM applications.
[0085] Figure 3 A basic container orchestration system framework diagram according to an embodiment of the present disclosure is shown as follows: Figure 3 As shown in the figure, in the basic container orchestration system Kubernetes, there are: master node (Master), proxy service (Kubelet), container runtime (Containerd), WASM adapter process (containerd-wasm-shim), WASM sandbox (WASM Sandbox), image repository, WASM image, WASM module; among them, there are three WASM runtime engines in the WASM sandbox: Wasmer, WasmEdge and Wasmtime; the master node is responsible for managing the status of the entire Kubernetes cluster. The proxy service runs on each node, communicates with the master node and executes its instructions. The container runtime is responsible for creating, starting and stopping containers. CRI API: ContainerRuntime Interface (Container Runtime Interface), which is used to integrate Kubernetes with different container runtimes. The WASM adapter process is a plug-in that allows Containerd to support WASM containers. The WASM sandbox environment provides a secure and isolated operating environment. The three WASM runtime engines all contain a "container", indicating that they can run as containers. The image repository is where container images are stored, including multiple container images image1, image2, and image3. WASM image, a container image containing WASM modules. WASM modules, actual WASM code files, can run in WASM sandboxes. In the basic container orchestration system, the container orchestration system Kubernetes needs to cold-start a WASM adaptation process each time it creates a WASM sandbox. This process is serial, and when WASM applications need to be created on a large scale, a lot of startup time overhead will be generated.
[0086] Figure 4 A schematic diagram of a process queue creation process of an application deployment method in an embodiment of the present disclosure is shown. Figure 4 As shown, in the embodiment, creating a process queue includes:
[0087] Step S402: Add a queue module to the container orchestration system; the queue module is communicatively connected to the container runtime of the container orchestration system;
[0088] Step S404: Create a process queue using the queue module, and start and maintain a first number of WASM adaptation processes in the process queue.
[0089] In the above-mentioned basic container orchestration system, since the cold start WASM adaptation process is serial, a large amount of startup time overhead will be generated. Therefore, this embodiment adds a queue module in the container orchestration system, and the queue module communicates with the container runtime; a process queue is created and maintained using the queue module, and a first number of WASM adaptation processes are started and maintained in the process queue. The first number of WASM adaptation processes maintained in the process queue is determined by the system performance of the container orchestration system and the historical WASM deployment records. Generally, a small number of WASM adaptation processes are maintained in the process queue, and the first number is maintained at about 10. The process queue has the ability to start WASM adaptation processes in parallel. The WASM adaptation processes in the process queue can dynamically adjust the number of WASM adaptation processes according to the deployment requirements of the WASM application, thereby realizing dynamic adjustment of the WASM adaptation process.
[0090] Figure 5 A schematic diagram of a process of determining a target creation quantity of WASM sandboxes as a second quantity in an application deployment method according to an embodiment of the present disclosure is shown. Figure 5 As shown, in the embodiment, the container orchestration system further includes: a WASM master node and a proxy service;
[0091] According to the WASM task request, the target creation quantity of the WASM sandbox is determined to be the second quantity, including:
[0092] Step S502: creating a sandbox task module in the container orchestration system;
[0093] Step S504: the WASM master node sends a task request to the proxy service; the master node and the proxy service belong to the container orchestration system;
[0094] Step S506: the proxy service receives the task request and forwards it to the sandbox task module;
[0095] Step S508: The sandbox task module determines whether the task request is a WASM task request;
[0096] Step S5010: If the task request is a WASM task request, the WASM task request is parsed to determine that the target creation quantity of the WASM sandbox corresponding to the WASM task request is the second quantity.
[0097] Based on the aforementioned basic container orchestration system, on the basis of adding a queue module in the container orchestration system, a sandbox task module is further created in the container orchestration system.
[0098] Figure 6 A framework diagram of an enhanced container orchestration system in an embodiment of the present disclosure is shown as follows: Figure 6 As shown, a queue module and a sandbox task module are newly added and created in the basic container orchestration system, and both the queue module and the sandbox task module are connected to the container runtime in communication; the queue module and the sandbox task module are also connected in communication. When deploying a WASM application, the WASM master node determines the task request according to the deployment requirements of the WASM application, and the WASM master node sends the task request to the proxy service, which receives the task request and forwards the task request to the sandbox task module. The sandbox task module receives the task request and determines whether the task request is a WASM task request; if the sandbox task module determines that the task request is a WASM task request, the WASM task request is parsed to determine that the target creation number of the WASM sandbox corresponding to the WASM task request is the second number. In an embodiment, if the task request is not a WASM task request, the task request is sent to the container runtime so that the container runtime creates a corresponding container according to the task request.
[0099] Since the original business in the basic container orchestration system is to process ordinary task requests, if the WASM task type is directly added to the original business, the WASM application also needs to be managed through container runtimes such as Containerd, which increases the load of the container runtime and may affect the original business. This embodiment processes WASM task requests by adding a sandbox task module to reduce the occupancy of container runtimes such as Containerd. On the basis of not affecting the original business, it realizes the processing of WASM task requests, interacts with the container runtime through the sandbox task module, is responsible for processing WASM tasks in Kubernetes and managing running WASM applications, and ordinary WASM task requests are sent to the container runtime, and the container runtime creates corresponding containers according to the task request to process the original business.
[0100] Figure 7 A schematic diagram of a process for dynamically adjusting the number of WASM adaptation processes in an application deployment method according to an embodiment of the present disclosure is shown. Figure 7 As shown, in the embodiment, adjusting the number of WASM adaptation processes in the process queue from a first number to a second number in parallel includes:
[0101] Step S702: Compare the second quantity with the first quantity;
[0102] Step S704: if the second number is greater than the first number, creating a third number of parallel threads in the process queue; the third number is the difference between the second number and the first number;
[0103] Step S706: Based on the third number of parallel threads, start a third number of WASM adaptation processes in parallel and add them to the process queue, so that the number of WASM adaptation processes in the process queue is adjusted to the second number.
[0104] Based on the first number of WASM adaptation processes maintained in the process queue, if the WASM adaptation processes in the process queue need to be adjusted, the second number is first compared with the first number. For example, the first number is 8 and the second number is 21. By comparison, it can be obtained that the second number 21> the first number 8, then a third number of parallel threads is created in the process queue; the third number is the difference between the second number 21 and the first number 8, that is, the third number is 21-8=13, that is, 13 parallel threads are created in the process queue; based on the 13 parallel threads, 13 WASM adaptation processes are started in parallel, and the started 13 WASM adaptation processes are added to the process queue, so that the number of WASM adaptation processes in the process queue is adjusted from 8 to 8+13=21, that is, the number of WASM adaptation processes in the process queue reaches the second number 21.
[0105] In this embodiment, the target number of WASM sandboxes to be created is the second number, and by creating parallel threads in the process queue and starting the WASM adaptation process in the parallel threads, the number of WASM adaptation processes in the process queue is dynamically adjusted. When facing large-scale deployment of WASM applications, by adding WASM adaptation processes in parallel, WASM adaptation processes can be prepared in a very short time to cope with the peak of WASM sandbox creation, thereby realizing fast and efficient deployment of WASM applications.
[0106] In the embodiment, if the second number is not greater than the first number, the number of WASM adaptation processes in the process queue is not adjusted. For example, when the second number is 5, and the first number of WASM adaptation processes in the process queue is 8, the second number 5 < the first number 8, then there is no need to adjust the number of WASM adaptation processes in the process queue, and the WASM adaptation processes in the process queue meet the creation requirements of the WASM sandbox.
[0107] In an embodiment, based on a third number of parallel threads, starting a third number of WASM adaptation processes in parallel includes: in each thread of the third number of parallel threads, creating and cold starting a corresponding WASM adaptation process to start the third number of WASM adaptation processes in parallel.
[0108] Based on the third number of parallel threads created in the process queue, a corresponding WASM adaptation process is created in each thread, and the WASM adaptation process is cold started in each thread. Since each thread runs in parallel, the creation and cold start of the WASM adaptation process are also run in parallel, that is, the time overhead of creating and cold starting a WASM adaptation process is almost the same as the time overhead of creating and cold starting the third number of WASM adaptation processes, thereby achieving efficient startup of the WASM adaptation process.
[0109] Figure 8 A schematic diagram of a WASM application deployment process of an application deployment method in an embodiment of the present disclosure is shown as follows: Figure 8 As shown, in the embodiment, according to the second number of WASM adaptation processes, a second number of WASM sandboxes are created and WASM applications are deployed in the WASM sandboxes, including:
[0110] Step S802: the sandbox task module communicates with the queue module and takes out a second number of WASM adaptation processes from the process queue;
[0111] Step S804: Create a second number of WASM sandboxes using a second number of WASM adaptation processes;
[0112] Step S806: Start the WASM runtime in the WASM sandbox;
[0113] Step S808: Based on the started WASM runtime, a corresponding container is created in the WASM sandbox, and the WASM application is deployed and run in the container.
[0114] Based on the fact that the number of WASM adaptation processes in the process queue has been adjusted to the second number, the sandbox task module communicates with the queue module and continuously takes out the second number of WASM adaptation processes from the process queue; in the process of the sandbox task module taking out the WASM adaptation processes from the process queue, if the number of WASM adaptation processes in the process queue is less than the first number, it is necessary to continuously create WASM adaptation processes to keep the number of WASM adaptation processes in the process queue at the first number; using the second number of WASM adaptation processes taken out from the process queue, respectively create corresponding WASM sandboxes to obtain the second number of WASM sandboxes. Start the WASM runtime in the WASM sandbox, create a corresponding container in the WASM sandbox based on the started WASM runtime, deploy and run the WASM application in the container, thereby achieving efficient deployment of WASM applications.
[0115] Fig. 9 A functional module diagram of an application deployment method according to an embodiment of the present disclosure is shown as follows: Fig. 9 As shown, in the embodiment, it includes:
[0116] 1. The queue module creates a process queue in which a small number of WASM adaptation processes (Containerd-wasm-shim) are continuously run. When the proxy service receives a Wasm task request, the number of Wasm sandboxes to be created is notified to the queue module through the sandbox task module, and the corresponding threads are created according to the number of Wasm sandboxes, and the WASM adaptation processes are started in parallel and added to the process queue.
[0117] 2. The sandbox task module communicates with the queue module and continuously takes out the WASM adaptation process in the queue.
[0118] 3. The corresponding Wasm sandbox is created through the out-of-queue WASM adapter process and managed by the sandbox task module.
[0119] 4. After the Wasm sandbox is created, start different Wasm runtimes in it.
[0120] 5. Create a container in the Wasm sandbox and run the Wasm application in it.
[0121] A new sandbox task module interacts with container runtimes such as containerd, and is responsible for processing Wasm tasks in Kubernetes and managing running Wasm applications. A new queue module maintains a process queue, in which a small number of WASM-adapted processes are pre-created, and the number of processes in the process queue is dynamically adjusted according to the load of Wasm task requests. When a request for large-scale deployment of Wasm applications is received, the number of WASM-adapted processes in the queue is increased in parallel to cope with the upcoming startup peak.
[0122] Fig.10 A flowchart of an application deployment method in an embodiment of the present disclosure is shown. Fig.10 As shown, in the embodiment, the process includes:
[0123] The proxy service receives the task request from the master node.
[0124] Determine the task type. If it is not a Wasm task request, notify the container runtime Containerd to create the container normally.
[0125] If it is a Wasm task request, the sandbox task module is notified, and the sandbox task module processes the Wasm task request.
[0126] Notify the queue module to create WASM adaptation processes in parallel and join the queue according to the number of Wasm sandboxes that need to be created.
[0127] The sandbox task module takes the WASM adaptation process from the process queue.
[0128] Create a Wasm sandbox through the WASM adapter process and start the Wasm runtime in it.
[0129] Create a container in the Wasm sandbox and run the Wasm application in it.
[0130] In the disclosed embodiment, a new sandbox task module interacts with container runtimes such as containerd and is responsible for processing Wasm tasks in Kubernetes. A new queue module is added to pre-create a small number of WASM adapter processes in the queue and dynamically adjust the number of processes in the queue according to the load requested by the Wasm task. By processing Wasm tasks through the new module, the occupancy of container runtimes such as containerd is reduced without affecting the original business. The startup time is reduced when deploying Wasm applications on a large scale.
[0131] It should be noted that the acquisition, storage, use, and processing of data in the technical solution disclosed in this disclosure are in compliance with the relevant provisions of national laws and regulations, and various types of data such as personal identity data, operation data, behavioral data, etc. related to individuals, customers, and groups obtained in the embodiments of this disclosure have all been authorized.
[0132] Based on the same inventive concept, the present disclosure also provides an application deployment device, as described in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0133] Fig.11 A schematic diagram of an application deployment device in an embodiment of the present disclosure is shown. Fig.11 As shown, the device comprises:
[0134] The process queue creation module 1101 is used to create a process queue; a first number of virtual instruction set architecture WASM adaptation processes are running in the process queue;
[0135] A WASM sandbox creation quantity determination module 1102 is used to determine, according to the WASM task request, that the target creation quantity of the WASM sandbox is a second quantity;
[0136] A WASM adaptation process adjustment module 1103, configured to adjust the number of WASM adaptation processes in the process queue from a first number to a second number in parallel;
[0137] The application deployment module 1104 is used to create a second number of WASM sandboxes according to the second number of WASM adaptation processes and deploy WASM applications in the WASM sandboxes.
[0138] It should be noted here that the above-mentioned process queue creation module 1101, WASM sandbox creation quantity determination module 1102, WASM adaptation process adjustment module 1103 and application deployment module 1104 correspond to S202 to S208 in the method embodiment, and the above-mentioned modules and the examples and application scenarios implemented by the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned method embodiment. It should be noted that the above-mentioned modules as part of the device can be executed in a computer system such as a set of computer executable instructions.
[0139] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0140] Refer to the following Fig.12 1200 according to this embodiment of the present disclosure is described. Fig.12 The electronic device 1200 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0141] like Fig.12 As shown, the electronic device 1200 is in the form of a general computing device. The components of the electronic device 1200 may include but are not limited to: at least one processing unit 1210, at least one storage unit 1220, and a bus 1230 connecting different system components (including the storage unit 1220 and the processing unit 1210).
[0142] Among them, the storage unit stores a program code, and the program code can be executed by the processing unit 1210, so that the processing unit 1210 performs the steps described in the above "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 1210 can perform the following steps of the above method embodiment: create a process queue; a first number of virtual instruction set architecture WASM adaptation processes are running in the process queue; according to the WASM task request, determine the target creation number of WASM sandboxes to be a second number; adjust the number of WASM adaptation processes in the process queue from the first number to the second number in parallel; according to the second number of WASM adaptation processes, create a second number of WASM sandboxes and deploy WASM applications in the WASM sandboxes.
[0143] The storage unit 1220 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 12201 and / or a cache storage unit 12202 , and may further include a read-only storage unit (ROM) 12203 .
[0144] The storage unit 1220 may also include a program / utility 12204 having a set (at least one) of program modules 12205, such program modules 12205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0145] Bus 1230 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0146] The electronic device 1200 may also communicate with one or more external devices 1240 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1200, and / or communicate with any device that enables the electronic device 1200 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1250. Furthermore, the electronic device 1200 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1260. As shown, the network adapter 1260 communicates with other modules of the electronic device 1200 via a bus 1230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0147] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0148] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer program product, which includes: a computer program, which implements the above application deployment method when executed by a processor.
[0149] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.
[0150] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0151] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0152] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0153] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0154] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0155] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0156] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0157] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. An application deployment method, characterized in that: include: Creating a process queue; a first number of virtual instruction set architecture WASM adaptation processes are running in the process queue; According to the WASM task request, the target creation quantity of the WASM sandbox is determined to be the second quantity; Adjusting in parallel the number of WASM adaptation processes in the process queue from the first number to the second number; According to the second number of WASM adaptation processes, a second number of WASM sandboxes are created and WASM applications are deployed in the WASM sandboxes.
2. The application deployment method according to claim 1, characterized in that: The step of creating a process queue comprises: Adding a queue module in the container orchestration system; the queue module is communicatively connected with the container runtime of the container orchestration system; A process queue is created by using the queue module, and a first number of WASM adaptation processes are started and maintained in the process queue.
3. The application deployment method according to claim 2, characterized in that: The container orchestration system further includes: a WASM master node and a proxy service; According to the WASM task request, the target creation quantity of the WASM sandbox is determined to be the second quantity, including: Creating a sandbox task module in the container orchestration system; The WASM master node sends a task request to the proxy service; the master node and the proxy service belong to the container orchestration system; The proxy service receives the task request and forwards it to the sandbox task module; The sandbox task module determines whether the task request is a WASM task request; If the task request is a WASM task request, the WASM task request is parsed to determine that the target creation quantity of the WASM sandbox corresponding to the WASM task request is the second quantity.
4. The application deployment method according to claim 3, characterized in that: Also includes: If the task request is not a WASM task request, the task request is sent to the container runtime, so that the container runtime creates a corresponding container according to the task request.
5. The application deployment method according to claim 3, characterized in that: Adjusting the number of WASM adaptation processes in the process queue from the first number to the second number in parallel includes: comparing the second amount to the first amount; If the second number is greater than the first number, creating a third number of parallel threads in the process queue; the third number is the difference between the second number and the first number; Based on the third number of parallel threads, a third number of WASM adaptation processes are started in parallel and added to the process queue, so that the number of WASM adaptation processes in the process queue is adjusted to the second number.
6. The application deployment method according to claim 5, characterized in that: Based on the third number of parallel threads, starting a third number of WASM adaptation processes in parallel includes: In each of the third number of parallel threads, a corresponding WASM adaptation process is created and cold-started to start the third number of WASM adaptation processes in parallel.
7. The application deployment method according to claim 5, characterized in that: If the second number is not greater than the first number, the number of WASM adaptation processes in the process queue is not adjusted.
8. The application deployment method according to claim 5, characterized in that: Creating a second number of WASM sandboxes according to the second number of WASM adaptation processes and deploying WASM applications in the WASM sandboxes includes: The sandbox task module communicates with the queue module and takes out a second number of WASM adaptation processes from the process queue; Creating a second number of WASM sandboxes using a second number of WASM adapter processes; Launching the WASM runtime in the WASM sandbox; Based on the started WASM runtime, a corresponding container is created in the WASM sandbox, and a WASM application is deployed and run in the container.
9. An application deployment device, characterized in that: include: A process queue creation module, used to create a process queue; a first number of virtual instruction set architecture WASM adaptation processes are running in the process queue; A WASM sandbox creation quantity determination module, used to determine, according to a WASM task request, that a target creation quantity of WASM sandboxes is a second quantity; A WASM adaptation process adjustment module, configured to adjust the number of WASM adaptation processes in the process queue from the first number to the second number in parallel; An application deployment module is used to create a second number of WASM sandboxes according to the second number of WASM adaptation processes and deploy WASM applications in the WASM sandboxes.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the application deployment method according to any one of claims 1 to 8 by executing the executable instructions.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the application deployment method according to any one of claims 1 to 8 is implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the application deployment method according to any one of claims 1 to 8 is implemented.