Application deployment method, related equipment and computer readable medium
By obtaining the latest business configuration data in the container startup script and building application instances, the problem of frequent updates of containerized application business configuration data is solved, reducing update costs and improving efficiency.
Patent Information
- Application Number
- CN202311478692.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-07
- Publication Date
- 2025-05-09
AI Technical Summary
The frequent update of business configuration data of containerized applications leads to frequent rebuilding and deployment of images, increasing time and labor costs, and reducing update efficiency.
By configuring the script identifier of the container startup script in the run resource description file, obtain the application's executable file and recently updated business configuration data, and build application instances based on the target image, executable file and business configuration data, and deploy it to the cloud server.
This avoids frequent construction and deployment of application instances caused by frequent update of business configuration data, reduces update costs and improves update efficiency.
Smart Images

Figure CN119960772A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer and communication technology, and in particular, to an application deployment method, an application deployment device, an electronic device, a computer-readable medium, and a computer program product. Background Art
[0002] Container technology, represented by Docker (an open source application container engine that allows developers to package their applications and dependent packages into a portable image and then publish it to any device), has become an important part of modern application development. Its core idea is to encapsulate the application and all its dependencies in an independent container so that the application runs consistently and efficiently in different environments. Applications encapsulated by container technology can also be called containerized applications.
[0003] The normal operation of containerized applications depends on the corresponding image (which provides the container's file system and all dependencies for the application to run). The image contains the executable files and business configuration data corresponding to the containerized application. Among them, the business configuration data is updated frequently, and each update of the business configuration data requires rebuilding the image to release the corresponding container, which increases the time, labor and other costs while the update efficiency is not high. Therefore, how to reduce the update cost of the business configuration data of containerized applications and improve the update efficiency is a problem that needs to be solved urgently. Summary of the invention
[0004] Embodiments of the present application provide an application deployment method, an application deployment device, an electronic device, a computer-readable medium, and a computer program product, which can reduce the update cost of business configuration data of containerized applications and improve the update efficiency.
[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0006] In a first aspect, an embodiment of the present application provides an application deployment method, including:
[0007] Obtaining a running resource description file and an application deployment description file of the application; wherein the running resource description file includes a script identifier of a container startup script of the application, and the application deployment description file includes an image identifier of an image required for running the application;
[0008] Obtaining a target image that matches the image identifier in the application deployment description file;
[0009] Calling the container startup script of the application indicated by the script identifier to obtain the executable file of the application and the most recently updated service configuration data of the application;
[0010] An application instance of the application is constructed according to the target image, the executable file and the business configuration data, and the application instance is deployed to a cloud server.
[0011] In a second aspect, an embodiment of the present application provides an application deployment device, the device comprising an acquisition unit, a processing unit, and a construction and deployment unit, wherein:
[0012] The acquisition unit is used to acquire the running resource description file and the application deployment description file of the application; wherein the running resource description file includes the script identifier of the container startup script of the application, and the application deployment description file includes the image identifier of the image required for the application to run;
[0013] The processing unit is used to obtain a target image that matches the image identifier in the application deployment description file;
[0014] The processing unit is further configured to call the container startup script of the application indicated by the script identifier to obtain the executable file of the application and the most recently updated service configuration data of the application;
[0015] The construction and deployment unit is further used to construct an application instance of the application according to the target image, the executable file and the business configuration data, and deploy the application instance to the cloud server.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising one or more processors; a storage device for storing one or more computer programs, so that when the one or more computer programs are executed by the one or more processors, the electronic device implements the application deployment method as described above.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor of an electronic device, the electronic device executes the application deployment method as described above.
[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, wherein the computer program is stored in a computer-readable medium, and a processor of an electronic device reads and executes the computer program from the computer-readable medium, so that the electronic device executes the application deployment method as described above.
[0019] In the technical solution provided in the embodiment of the present application, the container startup script of the application can be called through the script identifier in the running resource description file, and each call of the container startup script can obtain the most recently updated business configuration data of the application. In other words, the embodiment of the present application can decouple the acquisition process of business configuration data from the stage of container startup or restarting through the container startup script in the running resource description file configured before the application is deployed; therefore, after the application is deployed, the most recently updated business configuration data of the application can be obtained by restarting the application instance deployed in the cloud server. It can be seen that the frequent construction and deployment of application instances caused by frequent updates of business configuration data can be avoided through the embodiment of the present application, which is conducive to reducing the update cost of business configuration data of containerized applications and improving update efficiency.
[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0022] Figure 1 It is a structural diagram of an application deployment system provided in an embodiment of the present application;
[0023] Figure 2 It is a flowchart of an application deployment method provided in an embodiment of the present application;
[0024] Figure 3 This is a script schematic diagram of a general startup script provided in an embodiment of the present application;
[0025] Figure 4 This is a script schematic diagram of a container startup script provided in an embodiment of the present application;
[0026] Figure 5 It is a script schematic diagram of a general detection script provided in an embodiment of the present application;
[0027] Figure 6 This is a schematic diagram of a standardized Dockerfile file provided in an embodiment of the present application;
[0028] Figure 7 This is a schematic diagram of an application deployment process provided by an embodiment of the present application;
[0029] Figure 8 It is a flowchart of another application deployment method provided in an embodiment of the present application;
[0030] Fig. 9 This is a schematic diagram of a deployment process of a process container in a cloud gaming scenario provided by an embodiment of the present application;
[0031] Fig.10 This is a schematic diagram of a deployment process provided by an embodiment of the present application;
[0032] Fig.11 This is a schematic diagram of a capacity expansion process of a cloud server provided in an embodiment of the present application;
[0033] Fig.12 This is a schematic diagram of another cloud server expansion process provided by an embodiment of the present application;
[0034] Fig.13 This is a schematic diagram comparing the time consumption of a traditional solution and a cloud solution provided in an embodiment of the present application;
[0035] Fig.14 It is a comparative schematic diagram of node resource ratios provided in an embodiment of the present application;
[0036] Fig.15 is a structural block diagram of an application deployment device provided in an embodiment of the present application;
[0037] Fig.16 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0038] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0039] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0040] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all contents and operations, nor must they be executed in the order described. For example, some operations may be decomposed, while some operations may be combined or partially combined, so the actual execution order may change according to actual conditions.
[0041] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.
[0042] Container technology, represented by Docker, has become an important part of modern application development. Docker is an open source application container engine used to develop, deliver and run applications, allowing developers to package their applications and dependent packages into a portable image (image, which provides the container's file system and all dependencies for application operation), and then publish it to any machine, and can also achieve virtualization.
[0043] Docker also usually refers to a container (a sandbox process on a machine, isolated from all other processes), which is used to represent a standardized application that can be deployed to any server regardless of infrastructure differences. The application of container technology on cloud servers makes application development and deployment more flexible and efficient.
[0044] In related technologies, the application's business configuration data, executable files, container file systems, etc. are usually packaged into an image and then published to the server. Among them, the business configuration data includes the data displayed in the application interface, the activity data inside the application, etc., and the update frequency is high. Each update of the business configuration data requires rebuilding the image to publish the corresponding container, which increases the time, labor and other costs while the update efficiency is not high.
[0045] Based on this, the embodiment of the present application provides an application deployment solution, which enables the container startup script of the application to obtain the most recently updated business configuration data of the application when constructing the container startup script in the running resource description file of the application. Therefore, by calling the container startup script in the running resource description file of the application, the executable file of the application and the most recently updated business configuration data of the application can be obtained; and through the image identifier in the application deployment description file of the application, the target image required for the application to run can be obtained. Finally, the application instance of the application can be constructed based on the above-obtained information, and the application instance can be deployed to the cloud server.
[0046] The application may specifically be a cloud application (i.e., cloud application), which refers to an application that interacts between a terminal device and a cloud server (also referred to as the cloud). The operations received by the terminal device running the cloud application will be synchronized to the cloud, which will respond to the operation and obtain the resources or images indicated by the operation. Therefore, the cloud application is essentially a transit station, responsible for sending operations to the cloud server, and receiving and displaying resources or images sent by the cloud server. In other words, a cloud application is a new type of application that uses a cloud server (or remote server) connected by a cloud application to complete business logic or computing tasks that traditional applications need to complete locally.
[0047] The running resource description file contains the identifiers of all resources required for the application to run. In a specific implementation, the running resource description file can be a dockerfile file; dockerfile is a text file that contains the image identifier and various instruction parameters of the image required for the container to run. You can use the dockerfile file to define the image, and then run the image to start the container.
[0048] In this solution, the running resource description file of the application may include a script identifier of a container startup script of the application. The container startup script is a script that is called whenever the container needs to be started and is used to start the container.
[0049] In addition, the application deployment description file contains instructions and parameters related to application deployment. In a specific implementation, the application deployment description file can be a chart package, which contains one or more yaml files (a highly readable format for expressing data serialization). In container technology, the yaml file is configured with the image identifier of the image required for container operation, as well as other deployment-related instructions and parameters.
[0050] It is not difficult to see that this solution can call the application's container startup script by running the script identifier in the resource description file, and each call to the container startup script can obtain the application's most recently updated business configuration data. In other words, the container startup script in the running resource description file configured by this solution before the application is deployed enables the application's most recently updated business configuration data to be obtained by restarting the application instance deployed in the cloud server after the application is deployed. The above method avoids the process of rebuilding the application instance, which is conducive to reducing the update cost of the business configuration data of the containerized application and improving the update efficiency.
[0051] Based on the above application deployment solution, the present application embodiment provides an application deployment system, which can be seen in Figure 1 , Figure 1The application deployment system shown may include multiple terminal devices 101 and multiple cloud servers 102. Among them, a communication connection is established between any terminal device and any cloud server. For example, the terminal device 101 may include any one or more of a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart car, and a smart wearable device. An application deployment platform is running in the terminal device 101, and a multimedia playback client, a social client, a browser client, an information stream client, an education client, etc. may also be running. The cloud server 102 may be a 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, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. Any terminal device 101 and any cloud server 102 can be directly or indirectly connected in communication via wired or wireless communication, and this application is not limited here.
[0052] In some embodiments, the above application deployment method can be performed by only Figure 1 The cloud server 102 in the application deployment system shown is executed, and the specific execution process is as follows: the cloud server 102 can obtain the running resource description file and the application deployment description file of the application. Then, the cloud server 102 can call the container startup script of the application indicated by the script identifier to obtain the executable file of the application and the business configuration data recently updated by the application. After that, the cloud server 102 can obtain the target image that matches the image identifier in the application deployment description file. Finally, the cloud server 102 can build an application instance of the application based on the target image, executable file and business configuration data, and deploy the application instance to the cloud server 102.
[0053] In other embodiments, the above application deployment method may be run in an application deployment system, which may include a terminal device and a cloud server. Figure 1The application deployment system shown is jointly completed by the terminal device 101 and the cloud server 102, and the specific execution process is as follows: the terminal device 101 can obtain the running resource description file and the application deployment description file of the application. Then, the terminal device 101 can call the container startup script of the application indicated by the script identifier to obtain the executable file of the application and the business configuration data most recently updated by the application. At the same time, the terminal device 101 can obtain the target image that matches the image identifier in the application deployment description file. Afterwards, the terminal device 101 can send the target image, executable file and business configuration data to the cloud server 102; the cloud server 102 can build an application instance of the application based on the target image, executable file and business configuration data, and deploy the application instance in the cloud server 102.
[0054] It should be noted that the embodiments of the present application can be used for the release and deployment of applications in various environments such as test environments and formal environments, and can be applied to various scenarios, including but not limited to cloud technology, AI (Artificial Intelligence), smart transportation and other scenarios, and can also be used for various applications such as game applications, video applications, payment applications, etc., without limitation.
[0055] In the specific implementation of this application, if information or data such as application deployment description files and business configuration data are related to objects, when the embodiments of this application are applied to specific products or technologies, it is necessary to obtain the permission or consent of the object, and the collection, use and processing of relevant information or data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0056] The following is a detailed description of various implementation details of the technical solution of the embodiment of the present application:
[0057] like Figure 2 As shown, Figure 2 is a flow chart of an application deployment method shown in an embodiment of the present application, which can be applied to Figure 1 The application deployment system shown in the figure, the method can be executed by the terminal device or the cloud server, or can be executed by the terminal device and the cloud server together. In the embodiment of the present application, the method is executed by the cloud server as an example for explanation, wherein the application deployment method may include S201 to S204, which are described in detail as follows:
[0058] S201. Obtain an application's running resource description file and an application deployment description file.
[0059] In an embodiment of the present application, the running resource description file may include a script identifier of a container startup script of an application, and the application deployment description file may include an image identifier of an image required for running the application.
[0060] In a specific implementation, the running resource description file may be a Dockerfile file. The application deployment description file may be a chart package, which may contain one or more YAML files.
[0061] In one embodiment, an application usually needs to implement one or more application functions, and the application functions are implemented by executing the corresponding service processes in the application. Therefore, the application includes one or more service processes; accordingly, the application instance constructed subsequently will include the process container of one or more service processes.
[0062] It can be seen that the process of building an application instance is the process of building a process container for one or more service processes; and building any container requires corresponding container resource description files and container deployment description files.
[0063] Therefore, the application's running resource description file may include the running resource description files corresponding to each service process, and the application deployment description file may include the process deployment description files of each service process, so as to build the process container of each service process through the running resource description files corresponding to each service process and the process deployment description files of each service process.
[0064] The running resource description file corresponding to each service process includes the script identifier of the container startup script corresponding to each service process, and the process deployment description file of each service process includes the image identifier of the image required for the process container of each service process to run.
[0065] In a specific implementation, the running resource description file of the application may include a dockerfile file corresponding to each service process included in the application; the application deployment description file may be a chart package, which includes a yaml file of each service process.
[0066] S202: Obtain a target image that matches the image identifier in the application deployment description file.
[0067] In the embodiment of the present application, the image identifier may be the name, number, etc. of the image, which is not limited here. Then, the image that matches the image identifier may be the image whose identification information such as the name, number, etc. of the image is the same as the image identifier.
[0068] Specifically, the target image that matches the image identifier in the application deployment description file can be obtained from the image warehouse. Among them, the image warehouse stores multiple images. The cloud server can determine the image required for deploying the application in advance based on the image identifier in the application deployment description file; and then pre-store the determined image in the image warehouse.
[0069] In a possible implementation, the process deployment description file of each service process mentioned in step S201 contains the image identifier of the image required for the process container of each service process to run, and the image finally used to build the process container is realized by caching and reusing multiple layers of images. In other words, the construction of each layer of image will depend on the previous layer of image.
[0070] Among them, the image indicated by the image identifier contained in the process deployment description file of each service process also needs to rely on the corresponding base image. Therefore, the running resource description file corresponding to each service process can also contain the image identifier of the base image that the image required for the operation of each service process depends on during the construction process, so that the base image required by each service process can be obtained through the running resource description file corresponding to each service process, so that the image required for the operation of the process container of each service process can be established later.
[0071] Optionally, in order to improve the deployment efficiency of the application, the automatic construction of the running resource description file corresponding to each service process can be achieved through a standardized script.
[0072] Among them, the construction process of the running resource description file corresponding to any service process may include: first, obtaining a general resource description file; wherein the general resource description file contains a base image identification field and a script identification field. Then, for any service process, according to the process deployment description file of any service process, determine the image identification of the base image that the image required for the operation of any service process depends on during the construction process. Finally, based on the determined image identification and the script identification of the container startup script of any service process, the base image identification field and the script identification field in the general resource description file are updated respectively to obtain the running resource description file corresponding to any service process.
[0073] S203: Call the container startup script of the application indicated by the script identifier to obtain the executable file of the application and the most recently updated service configuration data of the application.
[0074] In the embodiment of the present application, the container startup script is a collection of code segments for starting the container that are called whenever the container needs to be started. The application's container startup script can obtain the application's most recently updated business configuration data; that is, as long as the container is started or restarted once through the above container startup script, the most recently updated business configuration data can be obtained.
[0075] For example, developers can update business configuration data on a separate business configuration platform. The container startup script can include information that can identify the business configuration platform, such as the network address of the business configuration platform, so that the latest updated business configuration data in the business configuration platform can be obtained by executing the relevant code in the container startup script.
[0076] In one embodiment, the application instance mentioned in step S201 may include process containers of one or more service processes; therefore, the container startup script of the application may include container startup scripts of one or more service processes.
[0077] Accordingly, different service processes provide different application functions, so the business configuration data that needs to be loaded may also be different; therefore, the application business configuration data can include the process configuration data of each service process. Further, the container startup script of each service process can be used to obtain the most recently updated process configuration data of each service process.
[0078] Similarly, the executable file of the application is compiled from binary files composed of code segments for implementing different server processes, so the executable file of the application may include process execution files of each service process.
[0079] In a possible implementation, since each service process included in the application needs to build a corresponding container startup script, in order to improve the deployment efficiency of the application, the container startup script of each service process can be automatically built through a standardized script.
[0080] Specifically, a general startup script may be obtained, wherein the general startup script includes an execution file acquisition code segment and a business configuration acquisition code segment. Then, based on the file address of the process execution file of each service process and the data address of the process configuration data of each service process, the execution file acquisition code segment and the business configuration acquisition code segment in the general startup script are updated respectively to obtain the container startup script of each service process.
[0081] Among them, the general startup script can be written by developers for the startup process of the application, or it can be written by an artificial intelligence code writing model based on the startup logic of the application, which is not limited here.
[0082] Furthermore, the general startup script may also include a check code segment for application startup check and a startup code segment for starting the application. The startup code segment may specifically include a process code segment for starting each service process in the application.
[0083] In one embodiment, the application deployment description file mentioned in step S201 may include process deployment description files of each service process; wherein different process deployment description files are configured with startup commands of corresponding service processes, and different startup commands are used to instruct execution of different process code segments in the startup code segment.
[0084] Therefore, the container startup script of each service process may include a check code segment and a startup code segment. When subsequently building the process container of each service process, the corresponding process code segment contained in the startup code segment in the container startup script can be called according to the startup command in the process deployment description file of each service process to start the corresponding service process, thereby building the corresponding process container.
[0085] Optionally, according to the startup command in the process deployment description file of each service process, the code segments contained in the startup code segments of the container startup script of each service process except the process code segments executed by the startup command can be deleted to obtain a new container startup script for each service process.
[0086] It should be noted that the inspection code segment may also include a code segment for inspecting each service process in the application. For the inspection code segment in the container startup script of each service process, please refer to the above description of the startup code segment, which will not be repeated here.
[0087] In actual application, please refer to the attached Figure 3 , shows a script schematic diagram of a general startup script. Figure 3 As shown in the general startup script 301 in the example, the general startup script 301 mainly includes four parts. The first part is the functiongen_conf function (the internal code of the function is omitted with ellipsis and will not be described in detail later), which is used to pull the executable file; that is, lines 2 to 4 in the general startup script 301 are equivalent to the executable file acquisition code segment. The second part is the functiongen_bin function, which is used to obtain the most recently updated business configuration data; that is, lines 6 to 8 in the general startup script 301 are equivalent to the business configuration acquisition code segment.
[0088] The third part is the functionstart_check function, which is used for application startup check; that is, lines 10 to 12 in the general startup script 301 are equivalent to the check code segment. The fourth part is the functionstart function, which is used to start the application; as shown in lines 14 to 26 in the general startup script 301, the cd command is used to quickly enter the specified file path, and then multiple files in the file path are opened. Finally, the exec command is used to start the background process.
[0089] In a possible implementation, a service process may have multiple process containers corresponding to it, and different process containers are used to implement different process functions of the corresponding service process. Specifically, multiple process containers of a service process may constitute a service instance corresponding to the service process.
[0090] In a specific implementation, in addition to the process container for executing the service function of the corresponding service process, the process container of the service process may include a sidecar container for executing sidecar tasks such as log persistence storage and disk cleanup. Therefore, the container startup script of the service process may also include a startup code segment of the sidecar container.
[0091] In actual application, please refer to the attached Figure 4 , shows a script schematic diagram of a container startup script. Figure 4 As shown, the function start_jobs in the container startup script 401 is used to start executing the three sidecar tasks of pulling ds scripts, log storage, and disk cleaning.
[0092] Among them, ds in the container startup script 401 refers to the business configuration database used to store business configuration data. The task of pulling the ds script is used to periodically detect whether the business configuration data in the business configuration database is updated. If there is an update, the updated business configuration data in the business configuration database is obtained to update the process container by restarting the process container of the corresponding service process.
[0093] As shown in lines 10 to 12 in the container startup script 401, the three commands check_ds_update, check_upload_cos, and check_clean_disk can be used to respectively detect whether the three sidecar tasks of pulling ds scripts, log storage, and cleaning disks exist.
[0094] As shown in lines 13 to 17 of the container startup script 401, this part of the code segment indicates that if it is detected that the sidecar task of the ds pull script does not exist, it is necessary to restart the service instance of the corresponding service process. As shown in lines 18 to 22 of the container startup script 401, this part of the code segment indicates that if it is detected that the sidecar task of uploading logs for storage every five minutes does not exist, it is necessary to restart the service instance of the corresponding service process. As shown in lines 23 to 27 of the container startup script 401, this part of the code segment indicates that if it is detected that the sidecar task of regularly cleaning the disk does not exist, it is necessary to restart the service instance of the corresponding service process.
[0095] Furthermore, the successful startup of the application instance depends on the successful operation of the corresponding multiple process containers; and the startup of service processes may have a sequential dependency, such as a service process must be started before the next service process can be started.
[0096] Therefore, the running resource description file corresponding to each service process can also include the script identifier of the startup detection script; among them, the startup detection script is a script executed after the process container is started, which is used to detect the execution status of the process container. Only after the process container runs successfully will the subsequent process container be started, thereby ensuring the startup order dependency between containers.
[0097] It should be noted that the startup detection script contained in the running resource description file corresponding to each service process can be obtained based on the general detection script. For the specific implementation method of obtaining the startup detection script corresponding to each service process based on the general detection script, please refer to the above-mentioned specific implementation method of the general startup script, which will not be repeated here.
[0098] For specific implementation, please refer to the attached Figure 5 , shows a script schematic diagram of a general detection script. Figure 5 As shown, the general detection script 501 includes a function ds_resource_poststart function (used to detect whether the database resources have been pulled), a function check_proc function (used to check whether the program is running), and a function svr_poststart function (used to detect whether the service configuration data has been pulled).
[0099] The execution logic of function ds_resource_poststart mainly includes: first determine the ds to be pulled and the path of ds through the ds_base_dir instruction and failed_ds_path instruction. Then check the version of ds to be pulled through the input_ds_ver instruction and ds_ver_list instruction in lines 6 to 7, and wait until all versions of ds are pulled.
[0100] In addition, the function check_proc is mainly used to perform survival detection on the started service process. Its execution logic mainly includes: according to the pid file (a file ending with ".pid" and required for process start and stop) written when the current service process is successfully started, check whether there is a corresponding process directory in the proc file system (a pseudo file system, which only exists in memory and does not occupy external memory space). Among them, each service process currently running in the Linux system has a corresponding directory under proc, with the process pid number as the directory name, which are interfaces for reading process information.
[0101] If the process directory corresponding to the current service process is checked, the value "0" can be returned to indicate that the current service process is running normally; if the process directory corresponding to the current service process is not checked, the value "1" can be returned to indicate that the current service process is not running normally. Finally, decide whether to restart the current service process based on the return value of function check_proc; generally, restart is required when the return value is "1".
[0102] In the specific implementation, based on the contents of the container startup script, startup detection script, and automated construction and operation resource description file mentioned in steps S202 to S203, please refer to the attached Figure 6 , shows a schematic diagram of a standardized Dockerfile file. Figure 6 As shown in the dockerfile file 601 in the figure, the dockerfile file 601 mainly includes two parts. One part is used to specify the base image, as shown in lines 1 to 2 in the dockerfile file 601, the base image identification field (i.e., image identification_1) is included after the ARG command, so the base image corresponding to the dependency of the building service process can be set through the ARG command; and the image that depends on the above base image can be clearly indicated through FROM (i.e., image identification_2).
[0103] Then, as shown in lines 3 to 6 in the dockerfile file 601, a file M can be created through the RUN command, and the container startup script "boot.sh", the startup detection script "poststart.sh" corresponding to the service process, and the resource data "uaresource" such as the database required for the container operation are copied into the file M through the subsequent COPY command. Therefore, the dockerfile file 601 contains the information of the resources required for building the process container of the service process, so that the resources required for building the process container can be pulled through the dockerfile file 601. Since the USER command and the ENTRYPOINT command are well known to those skilled in the art, they are not described here.
[0104] S204: Build an application instance of the application according to the target image, executable file and business configuration data, and deploy the application instance to the cloud server.
[0105] In the embodiment of the present application, the application instance includes a process container of one or more service processes in the application. Among them, the loading and execution of the executable file can realize the application function of the application, the target image can provide the file system, resource environment, etc. required for the loading and execution of the executable file, and the business configuration data can provide the business-related data that needs to be loaded for the application to run. Therefore, an application instance can be constructed through the target image, executable file and business configuration data.
[0106] In a specific implementation, the executable file and the business configuration data can constitute an installation release image (similar to an installation package), and the target image includes the database and other related resources required for the operation of the installation release image. Therefore, an application instance can be constructed based on the installation release image and the target image.
[0107] In one embodiment, since it is mentioned in steps S201 to S203 that the application includes multiple service processes, and each service process has its corresponding container startup script, after the application instance is deployed to the cloud server, when a startup operation for any service process is detected, the container startup script corresponding to any service process can be called to obtain the process execution file of any service process and the process configuration data of any service process; then, based on the process execution file and process configuration data of any service process, the process container of any service process is started.
[0108] For specific implementation, please refer to the attached Figure 7 , which shows a schematic diagram of the application deployment process. Figure 7 As shown in the figure, the application deployment process is mainly divided into two parts: building and publishing.
[0109] The construction process is as follows:
[0110] 1) The pipeline platform 701 responds to the deployment request for the target application and pulls the binary file 702 of the target application from the code repository.
[0111] The deployment request may be initiated by a developer, and the deployment request may carry the application identifier of the target application. For example, when the application function of the target application needs to be updated, the developer will modify or add the corresponding function code segment to obtain the binary file of the updated version of the target application. Then, in order to deploy the updated version of the target application, the developer can initiate a deployment request for the target application on the pipeline platform 701.
[0112] In addition, the code repository can be created through GitHub (a hosting platform for open source and private software projects). The pipeline platform 701 is a platform that executes corresponding tasks in a step-by-step sequence. Developers can pre-set the specific steps for application deployment in the pipeline platform 701; no matter which application needs to be deployed, the developer only needs to initiate a deployment request for the application to the pipeline platform 701, and the pipeline platform 701 can be used to realize the automatic deployment of the application.
[0113] 2) The pipeline platform 701 sends the binary file 702 to the build server 705, so that the build server 705 compiles the binary file 702 to obtain an executable file of the target application.
[0114] 3) The pipeline platform 701 obtains the yaml file 703 and the dockerfile file 704 corresponding to the target application.
[0115] In one embodiment, the developer can associate and store the application identifier, yaml file and dockerfile file in the deployment file database. Then, the pipeline platform 701 can obtain the yaml file 703 and dockerfile file 704 corresponding to the application identifier of the target application from the deployment file database through the application identifier of the target application carried in the deployment request.
[0116] Among them, the yaml files corresponding to each application stored in the deployment file database can be configured in advance by developers for each application; and the dockerfile files corresponding to each application can be written in advance by developers for each application, or can be automatically constructed based on the general resource description file mentioned in the previous steps.
[0117] In another embodiment, after obtaining the yaml file 703, the developer can package the yaml file 703 into a chart package 707, and associate the chart package 707 with the application identifier of the target application and store it in the Helm repository 706 (Helm is a package manager for Kubernetes (k8s for short, an open source platform for managing containers)), so that when the target application needs to be redeployed, the chart package 707 can be directly pulled from the Helm repository 706.
[0118] Optionally, the developer may configure different yaml files for different versions of the target application. In this case, the chart package obtained by packaging the version identifier, application identifier and corresponding yaml file of the target application can be stored in the Helm repository 706 to facilitate subsequent developer tracing and version updates.
[0119] In another embodiment, the developer may pre-package the yaml file 703 corresponding to the target application into a chart package 707 and store it in the Helm warehouse 706. Then, the pipeline platform 701 obtains the yaml file 703 corresponding to the target application, which actually means pulling the chart package 707 from the Helm warehouse 706.
[0120] The main process of the release process is as follows:
[0121] 4) The pipeline platform 701 pulls out the application image 709 of the target application from the image repository 708 according to the yaml file 703 and the image identifier of the base image included in the dockerfile file.
[0122] 5) The pipeline platform 701 constructs an installation and release image based on the executable file of the target application and the Dockerfile file.
[0123] 6) The pipeline platform 701 runs the application image 709 of the target application in the cloud server 710, and deploys the installation release image in the application image 709 to obtain an application instance.
[0124] In an embodiment of the present application, the application's container startup script can be called through the script identifier in the running resource description file, and each call of the container startup script can obtain the application's most recently updated business configuration data. In other words, the embodiment of the present application can decouple the acquisition process of business configuration data from the container startup or restart stage through the container startup script in the running resource description file configured before the application is deployed, so that after the application is deployed, the application's most recently updated business configuration data can be obtained by restarting the application instance deployed in the cloud server. It can be seen that the frequent construction and deployment of application instances caused by frequent updates of business configuration data can be avoided through the embodiment of the present application, which is conducive to reducing the update cost of business configuration data of containerized applications and improving update efficiency.
[0125] In addition, the container startup script and the running resource description file in the embodiment of the present application can be automatically constructed through the general startup script and the general resource description file, respectively, which is conducive to simplifying the construction process of the application instance, and reducing the time, manpower and other costs, thereby improving the deployment efficiency of the application instance. In addition, in the embodiment of the present application, the automatic deployment of the application instance can also be realized through the pipeline platform, which is conducive to reducing the deployment complexity of the application instance, thereby reducing the operation and maintenance cost, and further improving the deployment efficiency of the application instance.
[0126] In one embodiment of the present application, another application deployment method is provided, which can be applied to Figure 1The application deployment system shown in the figure, the method can be executed by the terminal device or the cloud server, and can also be executed by the terminal device and the cloud server together. In the embodiment of the present application, the method is executed by the cloud server as an example for explanation. Figure 8 FIG. 1 is a flow chart showing another application deployment method. Figure 2 This paper expands on the method shown in .
[0127] Among them, S801 to S807 are described in detail as follows:
[0128] S801. Obtain an application's running resource description file and an application deployment description file.
[0129] In the embodiment of the present application, the application deployment description file mentioned in steps S201 to S204 may include process deployment description files of each service process. Specifically, a cloud server may include multiple server nodes, and since different service processes have different requirements for node resources such as memory and disk space when running, the process deployment description file may include server parameters to configure different node resources for process containers of different service processes through server parameters.
[0130] In the process of constructing the process deployment description file of each service process, when the process usage scenario of any service process is the first scenario, the server parameter corresponding to any service process can be updated to the first parameter; wherein the first parameter is used to indicate that the process container of other service processes is deployed on the server node where the process container of any service process is deployed.
[0131] When the process usage scenario of any service process is the second scenario, the server parameter corresponding to any service process can be updated to the second parameter; wherein the second parameter is used to indicate that the process container of any service process is deployed on the server node where the process container of any service process is deployed without deploying the process container of other service processes.
[0132] The first scenario may be an application scenario with low node resource requirements, such as a lobby game scenario, etc. The second scenario may be an application scenario with high node resource requirements, such as a game scenario, etc.
[0133] For specific implementation, please refer to the attached Fig. 9 , shows a schematic diagram of the deployment process of a process container in a cloud gaming scenario. The application may be a cloud gaming application that is deployed using container technology, such as Fig. 9 As shown, the application instance corresponding to the cloud gaming application is deployed in the cloud server 901.
[0134] like Fig. 9As shown, when a target game player logs in to the cloud game application through a terminal device 902, the terminal device 902 sends a login request to the cloud server 901. After receiving the login request, the cloud server 901 can create a process container 905 of the initial game process corresponding to the target game player in the server node 903 where other process containers are deployed, thereby providing a game lobby service for the target game player.
[0135] It should be noted that the process usage scenario of the initial game process is the lobby game scenario (equivalent to the game lobby interface being displayed first after a general game player logs into the game). Therefore, the server parameter of the initial game process is the first parameter, and the initial game process can be deployed in a server node where other process containers are deployed.
[0136] Afterwards, if Fig. 9 As shown, if the target game player initiates a game request through the terminal device 902, the cloud server 901 will first determine the game players who join the current game after receiving the game request, and then create a process container 906 of the game process in the server node 904 where no process container is deployed, so as to provide game services for each game player in the current game. Fig. 9 The color of the process container 905 turns black, indicating that the process container 905 stops providing the game lobby service for the target game player, and the process container 906 provides the game service for the target game player who joins the current game.
[0137] It should be noted that the process usage scenario of the game round process is the game round scenario, so the server parameter of the game round process is the second parameter, and the game round process needs to be deployed in the server node where other process containers are not deployed.
[0138] Finally, after the current game session ends, each game player who previously joined the current game session will return to their respective initial game processes, and the cloud server will terminate the process container 906 of the game session process. Fig. 9 The color of the process container 905 turns white, indicating that the process container 905 resumes providing game lobby services to the target game player, while the process container 906 deployed in the server node 904 has been revoked.
[0139] It should be noted that the specific implementation of step S801 can also refer to the specific implementation of step S201 in the above embodiment, which will not be repeated here.
[0140] S802: Obtain a target image that matches the image identifier in the application deployment description file.
[0141] In the embodiment of the present application, the specific implementation of step S802 can also refer to the specific implementation of step S202 in the above embodiment, which will not be repeated here.
[0142] S803: Call the container startup script of the application indicated by the script identifier to obtain the executable file of the application and the most recently updated service configuration data of the application.
[0143] In the embodiment of the present application, the specific implementation of step S803 can also refer to the specific implementation of step S203 in the above embodiment, which will not be repeated here.
[0144] S804: Build an application instance of the application according to the target image, executable file and business configuration data.
[0145] In the embodiment of the present application, the specific implementation of step S804 can also refer to the specific implementation of step S204 in the above embodiment, which will not be repeated here.
[0146] S805: Obtain the deployment type of the application instance from the application deployment description file.
[0147] In the embodiment of the present application, the application deployment description file may include a deployment type parameter, and different deployment type parameters are used to indicate different deployment types. Therefore, the deployment type of the application instance can be determined by the deployment type parameter in the application deployment description file.
[0148] Specifically, the deployment types of application instances include stop deployment, update deployment, or redeployment. Stop deployment means stopping the running of the application instance in the cloud server, and update deployment means that the application instance can be updated in the cloud server without stopping the running application instance, similar to the installation process of the incremental installation package. Redeployment means that the application instance can be updated only after it is stopped, similar to the installation process of the full installation package.
[0149] Optionally, since the subsequent deployment of the cloud server will involve configuration of one or more aspects of the cloud server's expansion and contraction, network construction, and storage resources. Therefore, the application deployment description file may also include one or more configuration information about the cloud server, such as network configuration information, storage resource configuration information, and expansion and contraction parameters. Specifically, the network configuration information may include the domain name mapping of the server node, the configuration address of the network plug-in, etc. The storage resource configuration information may include the storage volume source (spec.volume), the mount point (spec.containers.volumeMounts), etc. The expansion and contraction parameters may include the memory resource occupancy of the process container in the cloud server (i.e., CPU occupancy), the disk occupancy of the process container in the cloud server (i.e., memory occupancy), the resource amount of the available memory resources of the server node, the disk space of the server node, etc. The configuration information of the cloud server in terms of expansion and contraction, network construction, and storage resources is not limited here.
[0150] It should be noted that the application deployment description file may also include other configuration information about the application instance and the cloud server, which is not limited here.
[0151] S806: Obtain the file version of the application deployment description file.
[0152] In the embodiment of the present application, since the example in step S204 mentions that the target application may have version updates, and different versions of the target application may have corresponding versions of the application deployment description file, the file version of the application deployment description file may also represent the application version of the target application.
[0153] S807. Deploy the application instance in the cloud server based on the deployment type and file version.
[0154] In the embodiment of the present application, the specific process of deploying the application instance based on the deployment type and file version may include: detecting whether the application instance corresponding to the application is deployed in the cloud server, and obtaining the detection result. If the deployment type includes stopping the deployment, then stopping the application instance currently deployed in the cloud server.
[0155] If the deployment type includes update deployment, and the detection result indicates that an application instance corresponding to the application is deployed in the cloud server, then the update content of the application instance is determined based on the version of the application deployment description file corresponding to the application instance currently deployed in the cloud server, and the aforementioned file version; based on the determined update content of the application instance, the currently deployed application instance is updated to obtain an updated application instance; if the deployment type includes update deployment, and the detection result indicates that an application instance corresponding to the application is not deployed in the cloud server, then the application instance is directly installed and deployed in the cloud server based on the application deployment description file corresponding to the aforementioned file version.
[0156] If the deployment type includes redeployment, stop running the application instance currently deployed in the cloud server; and further check the detection result. If the detection result indicates that an application instance corresponding to the application is deployed in the cloud server, determine the update content of the application instance based on the version of the application deployment description file corresponding to the application instance currently deployed in the cloud server and the aforementioned file version; based on the determined update content of the application instance, update the currently deployed application instance to obtain an updated application instance; if the deployment type includes update deployment, and the detection result indicates that an application instance corresponding to the application is not deployed in the cloud server, directly install and deploy the application instance in the cloud server according to the application deployment description file corresponding to the aforementioned file version.
[0157] For specific implementation, please refer to the attached Fig.10 , showing a schematic diagram of a deployment process. Fig.10 The example shown is for Figure 7 An extension of the example. Figure 7 As can be seen from the example, the yaml file can be packaged into a chart package (i.e., application deployment description file) and stored in the helm repository. Fig.10 As shown in step 1001, the cloud server can first obtain the file version of the chart package to be deployed corresponding to the target application in the helm warehouse.
[0158] Afterwards, if Fig.10 As shown in step 1002, it is possible to detect whether an application instance of the target application is deployed in the cloud server and obtain a detection result.
[0159] Then, if Fig.10 As shown in step 1003, the subsequent deployment steps can be determined according to the deployment type contained in the chart package to be deployed. As shown in step 1004, if the deployment type is to stop deployment, the cloud server can stop running the application instance currently running in the cloud server.
[0160] As shown in steps 1005 to 1007, if the deployment type is update deployment, the cloud server can further determine whether the detection result obtained in step 1002 indicates that an application instance of the target application is deployed in the cloud server. If the detection result indicates that an application instance of the target application is deployed in the cloud server, the update content can be determined based on the file version of the chart package to be deployed and the file version of the chart package corresponding to the application instance deployed in the server; finally, based on the determined update content, the application instance of the target application deployed in the current cloud server is updated. If the detection result indicates that the application instance of the target application is not deployed in the cloud server, the application instance of the target application can be directly deployed in the cloud server based on the chart package to be deployed.
[0161] As shown in step 1008, if the deployment type is redeployment, the cloud server needs to stop running the application instance of the target application in the cloud server before executing steps 1005 to 1007. Optionally, if the deployment type is redeployment, step 1008 may be executed after the detection result in step 1005 indicates that the application of the target application is deployed in the cloud server, and finally step 1007 is executed.
[0162] In one possible implementation, after the application instance is deployed in the cloud server, the container load parameters of the target process container deployed in the cloud server can be obtained in real time for the target process container of the service process belonging to the same service type; then, the container load parameters obtained within a preset time period from the current time are fused to obtain the target load parameters; finally, if the target load parameter is greater than or equal to the preset parameter threshold, a new target process container is deployed in the cloud server.
[0163] The service type may be the business to which the service process belongs. For example, if both the photo taking and code scanning recognition service processes belong to the payment business, then it can be determined that the service types of both the photo taking and code scanning recognition service processes are payment. Optionally, the service type may also be the application function corresponding to the service process; for example, step 801 mentions that different initial game processes can be created for different game players, but the application function corresponding to each initial game process actually provides lobby game services for the corresponding game players; therefore, it can be determined that the service types of the initial game processes of multiple game players are the same.
[0164] In addition, the container load parameters may include the target process container's memory resource usage (i.e., CPU usage), disk usage (i.e., memory usage), etc. The preset parameter threshold may be manually set, or may be set by the terminal device or cloud server in the above application deployment system, which is not limited here.
[0165] The fusion processing process can specifically be to calculate the average value of the container load parameters obtained within a preset time period from the current time; or, determine the weight of each container load parameter based on the length of time from the acquisition time point of each container load parameter to the current time; then, based on the weight of each container load parameter, perform weighted addition of the obtained container load parameters.
[0166] Optionally, a specific method for deploying a new target process container in a cloud server may include: obtaining node load parameters of each server node in the cloud server, and the container affinity of each server node to the target process container; based on the node load parameters and container affinity of each server node, determining a target server node from the cloud server that meets the container deployment conditions of the target process container; and deploying the new target process container to the target server node.
[0167] The node load parameters of each server node may specifically be the amount of available memory resources, disk space, etc. of each server node. At the same time, the container affinity is determined based on the process containers historically deployed by each server node; specifically, the higher the matching degree between the service type corresponding to the process container historically deployed by a server node and the service type corresponding to the target process container, the higher the container affinity of the server node to the target process container.
[0168] In addition, if the node load parameter of any server node is greater than the preset node threshold, and the container affinity of any server node is greater than the preset affinity, it can be determined that any server node meets the container deployment condition of the target process container. Optionally, if the node load parameter of any server node is greater than the preset node threshold, and the container affinity of any server node is greater than the preset affinity, either of these two conditions is met, it can be determined that any server node meets the container deployment condition of the target process container.
[0169] Optionally, if the sum of the node load parameter and container affinity of any server node is greater than the preset total value, it can be determined that any server node meets the container deployment conditions of the target process container, which is not limited here. Among them, the preset node threshold, preset affinity, and preset total value can be set manually, or can be set by the terminal device or cloud server in the above application deployment system, which is not limited here.
[0170] Furthermore, if there is no target server node in the cloud server that meets the container deployment conditions of the target process container, a node request is sent to the server resource pool to apply for a new server node to join the cloud server; and the new target process container is deployed to the new server node.
[0171] In the specific implementation, the cloud server can be a server cluster managed by k8s, and the cloud server can be automatically expanded or reduced according to the container load parameters and node load parameters through the HPA in k8s (i.e., horizontal automatic scaling of pods, which is a tool component in k8s; it can automatically scale pods according to resource utilization or custom indicators; Pod is the smallest operating unit of k8s, used to manage and control containers).
[0172] Please see attached Fig.11 , which shows a schematic diagram of the expansion process of a cloud server. Fig.11 As shown, the server cluster 1101 managed by k8s includes server node 1102 and server node 1103, wherein server node 1102 includes two process containers, and server node 1103 includes one process container.
[0173] When HPA component 1104 detects that the container load parameter of a process container of a service type in server cluster 1101 is greater than or equal to the preset parameter threshold, HPA component 1104 will add a process container 1105 of the corresponding service type. At this time, process container 1105 is in a suspended state (i.e., pending). Then, k8s integrates the node load parameters of each server node in server cluster 1101, the affinity to process container 1105 and other information to determine that server node 1103 meets the container deployment conditions of process container 1105. Finally, as Fig.11 As shown, k8s deploys the process container 1105 to the server node 1103.
[0174] Please see attached Fig.12 , shows another schematic diagram of the expansion process of a cloud server. Fig.12 As shown, the server cluster 1201 managed by k8s includes server node 1202 and server node 1203, and both server nodes include two process containers.
[0175] When HPA component 1204 detects that the container load parameter of a process container of a service type in server cluster 1201 is greater than or equal to the preset parameter threshold, HPA component 1204 will add a process container 1205 of the corresponding service type. At this time, process container 1205 is in a suspended state (i.e., pending). Then, k8s integrates the node load parameters of each server node in server cluster 1201, the affinity to process container 1205 and other information to determine that no server node in server cluster 1201 meets the container deployment conditions of process container 1205. Finally, as Fig.12 As shown, k8s will apply for a new server node 1206 from the server resource pool and deploy the process container 1205 to the server node 1206.
[0176] Similarly, if the HPA component detects that a server node in the server cluster is in an idle state (specifically, whether the server node is in an idle state can be determined based on the node load parameters of the server node), the server node can be returned to the server resource pool to achieve automatic scaling down of the server cluster.
[0177] In actual applications, the traditional solution of deploying application instances in a server cluster requires manual initialization of the deployment environment and deployment of related components, resulting in high deployment costs and low deployment efficiency. In addition, the traditional solution cannot flexibly scale the server nodes in the server cluster, but requires developers to estimate the maximum number of concurrent online players of the application and apply for sufficient server node resources to deploy the service process. While lacking flexibility, it also consumes a lot of time and manpower costs due to the need for manual scaling. At the same time, the traditional solution cannot scale in a timely and flexible manner, which will cause a waste of node resources.
[0178] Please see attached Fig.13 , shows a schematic diagram of the time consumption comparison between a traditional solution and a cloud solution. Among them, the cloud solution is based on Figure 2 and Figure 8 The embodiments shown in the figure achieve the following: automated deployment of applications and automatic expansion and contraction of k8s. Fig.13 Column 1301 represents the time taken to deploy applications using the traditional solution, column 1302 represents the time taken to deploy applications using the cloud solution, column 1303 represents the time taken to scale up and down using the traditional solution, and column 1304 represents the time taken to scale up and down using the cloud solution.
[0179] like Fig.13 As shown in the figure, the time required for deploying applications has been reduced from about 30 minutes to about 5 minutes (or even faster) with the cloud solution compared to the traditional solution; the time required for scaling has been reduced from 2 hours for manual scaling to about 20 minutes for fully automatic scaling compared to the traditional solution. It can be seen that the cloud solution can greatly reduce the time required for application deployment and the time required for scaling server clusters, thereby improving deployment efficiency, increasing the flexibility of scaling, and saving costs.
[0180] For further information, please see the attached Fig.14 , showing a comparative diagram of node resource ratio. Among them, the broken line 1401 is the node resource ratio of the traditional solution in 7 days, and the broken line 1402 is the node resource ratio of the cloud solution in 7 days, among which there is a small expansion from the 3rd to the 5th day. Fig.14 It can be seen that when running the same number of service processes, the cloud solution saves more than 30% of node resources compared to the traditional solution, thus achieving the purpose of saving resources.
[0181] In the embodiment of the present application, the deployment type in the application deployment description file can be used to flexibly deploy the application instance in a variety of ways. Among them, by updating the deployment method, the bad user experience caused by the frequent shutdown of the application instance can be avoided. In addition, the embodiment of the present application can containerize the application and deploy it on the cloud server by running the resource description file and the application deployment description file; and the expansion and contraction of the cloud server is more flexible, which is conducive to saving the time, manpower and other costs of application deployment and expansion and contraction.
[0182] Here, the device embodiment of the present application is introduced, which can be used to execute the application deployment system method in the above embodiment of the present application. For details not disclosed in the device embodiment of the present application, please refer to the above embodiment of the application deployment system method of the present application.
[0183] The present application embodiment provides an application deployment device, such as Fig.15 As shown, the device includes an acquisition unit 1501, a processing unit 1502 and a construction and deployment unit 1503:
[0184] The acquisition unit 1501 is used to acquire an application running resource description file and an application deployment description file; wherein the running resource description file includes a script identifier of a container startup script of the application, and the application deployment description file includes an image identifier of an image required for application running;
[0185] The processing unit 1502 is used to obtain a target image that matches the image identifier in the application deployment description file;
[0186] The processing unit 1502 is further configured to call a container startup script of the application indicated by the script identifier, and obtain an executable file of the application and the most recently updated service configuration data of the application;
[0187] The construction and deployment unit 1503 is further used to construct an application instance of the application according to the target image, executable file and business configuration data, and deploy the application instance to the cloud server.
[0188] In one embodiment of the present application, an application instance includes process containers of multiple service processes, each of the process containers of the multiple service processes corresponds to a different container startup script, the executable file includes the process execution file of each service process, and the business configuration data of the application includes the process configuration data of each service process; based on the aforementioned scheme, the construction and deployment unit 1503 can also be used to: when a startup operation on any service process is detected, call the container startup script corresponding to any service process, obtain the process execution file of any service process and the process configuration data of any service process; based on the process execution file and process configuration data of any service process, start the process container of any service process.
[0189] In one embodiment of the present application, based on the aforementioned scheme, when acquiring the running resource description file of the application, the acquisition unit 1501 can be specifically used to: acquire a general startup script; wherein the general startup script includes an execution file acquisition code segment and a business configuration acquisition code segment; based on the file address of the process execution file of each service process and the data address of the process configuration data of each service process, the execution file acquisition code segment and the business configuration acquisition code segment in the general startup script are updated respectively to obtain the container startup script of each service process; based on the script identifier of the container startup script of each service process, the running resource description file of the application is obtained.
[0190] In one embodiment of the present application, the application deployment description file includes a process deployment description file for each service process; based on the aforementioned scheme, when the processing unit 1502 obtains the running resource description file of the application based on the script identifier of the container startup script of each service process, it can be specifically used to: obtain a general resource description file; wherein the general resource description file includes a base image identification field and a script identification field; for any service process, according to the process deployment description file of any service process, determine the image identifier of the base image on which the image required for the operation of any service process depends during the construction process; based on the determined image identifier and the script identifier of the container startup script of any service process, respectively update the base image identification field and the script identification field in the general resource description file to obtain the running resource description file corresponding to any service process.
[0191] In one embodiment of the present application, an application instance includes process containers of multiple service processes, an application deployment description file includes process deployment description files of each service process, the process deployment description file includes server parameters, and a cloud server includes multiple server nodes; based on the aforementioned scheme, the acquisition unit 1501 can also be used for: when the process usage scenario of any service process is the first scenario, the server parameter corresponding to any service process is updated to the first parameter; wherein the first parameter is used to indicate that the process container of other service processes is deployed on the server node where the process container of any service process is deployed; when the process usage scenario of any service process is the second scenario, the server parameter corresponding to any service process is updated to the second parameter; wherein the second parameter is used to indicate that the process container of other service processes is not deployed on the server node where the process container of any service process is deployed.
[0192] In one embodiment of the present application, based on the aforementioned scheme, constructing the deployment unit 1503 can also be used to: for the target process container of the service process belonging to the same service type, obtain in real time the container load parameters of the target process container deployed in the cloud server; fuse the container load parameters obtained within a preset time period from the current time to obtain the target load parameters; if the target load parameter is greater than or equal to the preset parameter threshold, deploy a new target process container in the cloud server.
[0193] In one embodiment of the present application, based on the aforementioned scheme, when constructing a deployment unit 1503 to deploy a new target process container in a cloud server, it can be specifically used to: obtain the node load parameters of each server node in the cloud server, and the container affinity of each server node to the target process container; wherein the container affinity is determined based on the process containers historically deployed by each server node; based on the node load parameters and container affinity of each server node, determine the target server node that meets the container deployment conditions of the target process container from the cloud server; and deploy the new target process container to the target server node.
[0194] In one embodiment of the present application, based on the aforementioned scheme, the construction deployment unit 1503 can also be used to: if there is no target server node in the cloud server that meets the container deployment conditions of the target process container, send a node request to the server resource pool to apply for a new server node to join the cloud server; deploy the new target process container to the new server node.
[0195] In one embodiment of the present application, based on the aforementioned scheme, when deploying an application instance to a cloud server, constructing a deployment unit 1503 can be specifically used to: obtain the deployment type of the application instance from the application deployment description file; wherein the deployment type includes stopping deployment, updating deployment, or redeploying; obtain the file version of the application deployment description file; and deploy the application instance in the cloud server based on the deployment type and the file version.
[0196] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0197] According to another embodiment of the present application, the program can be executed on a general computing device such as a computer device including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 or Figure 8 A computer program (including program code) for each step of the method shown in FIG. Fig.15The application deployment device shown in the figure implements the application deployment method of the embodiment of the present application. The computer program can be recorded on a computer storage medium, for example, and loaded into the above-mentioned computer device through the computer storage medium and run therein.
[0198] The device provided in the above-mentioned embodiment can be arranged in a terminal device or in a server. The device provided in the embodiment of the present application identifies the segment length of each multimedia segment in the multimedia data to be detected, so that the corresponding object identification sequence can be obtained according to multiple segment lengths subsequently, thereby achieving the purpose of accurately identifying the object that transmits the multimedia data to be detected.
[0199] An embodiment of the present application also provides an electronic device, comprising one or more processors and a storage device, wherein the storage device is used to store one or more computer programs, and when the one or more computer programs are executed by one or more processors, the electronic device implements the above application deployment method.
[0200] Fig.16 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0201] It should be noted that Fig.16 The computer system 1600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0202] like Fig.16 As shown, the computer system 1600 includes a processor (Central Processing Unit, CPU) 1601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (Read-Only Memory, ROM) 1602 or the program loaded from the storage part 1608 to the random access memory (Random Access Memory, RAM) 1603, such as executing the method in the above embodiment. In RAM 1603, various programs and data required for system operation are also stored. CPU 1601, ROM 1602 and RAM 1603 are connected to each other through bus 1604. Input / output (Input / Output, I / O) interface 1605 is also connected to bus 1604.
[0203] In some embodiments, the following components are connected to the I / O interface 1605: an input section 1606 including a keyboard, a mouse, etc.; an output section 1607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 1608 including a hard disk, etc.; and a communication section 1609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1609 performs communication processing via a network such as the Internet. A drive 1610 is also connected to the I / O interface 1605 as needed. A removable medium 1611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1610 as needed, so that a computer program read therefrom is installed into the storage section 1608 as needed.
[0204] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1609, and / or installed from a removable medium 1611. When the computer program is executed by a processor (CPU) 1601, various functions defined in the system of the present application are executed.
[0205] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (Erasable Programmable Read Only Memory), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer-readable signal medium provided in the above-mentioned various embodiments for the data acquisition method as described above may also be any computer-readable medium other than a computer-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. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0206] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the devices, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and a computer program.
[0207] The units or modules involved in the embodiments described in this application may be implemented by software or hardware, and the units or modules described may also be set in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.
[0208] Another aspect of the present application also provides a computer-readable medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned application deployment method is implemented. The computer-readable medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0209] The embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the above-mentioned Figure 2 and Figure 8 The computer-readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0210] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, 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 being embodied by multiple modules or units.
[0211] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0212] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person of ordinary skill in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. An application deployment method, characterized in that: include: Obtaining a running resource description file and an application deployment description file of the application; wherein the running resource description file of the application includes a script identifier of a container startup script of the application, and the application deployment description file includes an image identifier of an image required for running the application; Obtaining a target image that matches the image identifier in the application deployment description file; Calling the container startup script of the application indicated by the script identifier to obtain the executable file of the application and the most recently updated service configuration data of the application; An application instance of the application is constructed according to the target image, the executable file and the business configuration data, and the application instance is deployed to a cloud server.
2. The method according to claim 1, characterized in that: The application instance includes process containers of multiple service processes, each of the process containers of the multiple service processes corresponds to a different container startup script, the executable file includes a process execution file of each service process, and the business configuration data of the application includes process configuration data of each service process; the method further includes: When a startup operation on any service process is detected, a container startup script corresponding to any service process is called to obtain a process execution file of any service process and process configuration data of any service process; Based on the process execution file and process configuration data of any service process, the process container of any service process is started.
3. The method according to claim 2, characterized in that The obtaining of the running resource description file of the application includes: Obtain a general startup script; wherein the general startup script includes an execution file acquisition code segment and a service configuration acquisition code segment; Based on the file address of the process execution file of each service process and the data address of the process configuration data of each service process, the execution file acquisition code segment and the business configuration acquisition code segment in the general startup script are updated respectively to obtain the container startup script of each service process; Based on the script identifier of the container startup script of each service process, the running resource description file of the application is obtained.
4. The method according to claim 3, characterized in that: The application deployment description file includes a process deployment description file of each service process; the script identifier of the container startup script based on each service process is used to obtain the running resource description file of the application, including: Obtain a general resource description file; wherein the general resource description file includes a base image identification field and a script identification field; For any service process, according to the process deployment description file of any service process, determine the image identifier of the base image that the image required for running any service process depends on during the construction process; Based on the determined image identifier and the script identifier of the container startup script of any service process, the basic image identifier field and the script identifier field in the general resource description file are updated respectively to obtain the running resource description file corresponding to any service process.
5. The method according to claim 1, characterized in that: The application instance includes a process container of multiple service processes, the application deployment description file includes a process deployment description file of each service process, the process deployment description file includes server parameters, and the cloud server includes multiple server nodes; the method further includes: When the process usage scenario of any service process is the first scenario, the server parameter corresponding to any service process is updated to the first parameter; wherein the first parameter is used to indicate that the process container of other service processes is deployed on the server node where the process container of any service process is deployed; When the process usage scenario of any service process is the second scenario, the server parameter corresponding to the any service process is updated to the second parameter; wherein the second parameter is used to indicate that the process container of other service processes is not deployed on the server node where the process container of any service process is deployed.
6. The method according to any one of claims 2 to 5, characterized in that The method further comprises: For a target process container of a service process belonging to the same service type, obtaining in real time a container load parameter of the target process container deployed in the cloud server; The container load parameters acquired within a preset time period from the current time are integrated to obtain the target load parameters; If the target load parameter is greater than or equal to a preset parameter threshold, a new target process container is deployed in the cloud server.
7. The method according to claim 6, characterized in that The deploying a new target process container in the cloud server includes: Obtaining node load parameters of each server node in the cloud server and container affinity of each server node to the target process container; wherein the container affinity is determined based on the process containers historically deployed by each server node; Based on the node load parameters and container affinity of each server node, determining a target server node from the cloud server that meets the container deployment condition of the target process container; Deploy the new target process container to the target server node.
8. The method according to claim 7, characterized in that The method further comprises: If there is no target server node in the cloud server that meets the container deployment condition of the target process container, sending a node request to a server resource pool to apply for a new server node to join the cloud server; Deploy the new target process container to the new server node.
9. The method according to any one of claims 1 to 5, characterized in that: The deploying the application instance to the cloud server includes: Obtaining the deployment type of the application instance from the application deployment description file; wherein the deployment type includes stop deployment, update deployment or redeploy; Obtaining a file version of the application deployment description file; Based on the deployment type and the file version, the application instance is deployed in the cloud server.
10. An application deployment device, characterized in that: It includes acquisition unit, processing unit and construction deployment unit, among which: The acquisition unit is used to acquire the running resource description file and the application deployment description file of the application; wherein the running resource description file of the application includes the script identifier of the container startup script of the application, and the application deployment description file includes the image identifier of the image required for the application to run; The processing unit is used to obtain a target image that matches the image identifier in the application deployment description file; The processing unit is further configured to call the container startup script of the application indicated by the script identifier to obtain the executable file of the application and the most recently updated service configuration data of the application; The construction and deployment unit is further used to construct an application instance of the application according to the target image, the executable file and the business configuration data, and deploy the application instance to the cloud server.
11. A computer readable 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 9 is implemented.
12. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the application deployment method as described in any one of claims 1 to 9.