Application processing method, device, electronic device and storage medium
By building and deploying images with Dockerfile on the cloud platform, the compatibility problem between the cloud platform and incompatible software architecture applications is solved, achieving higher application expansion capabilities and a simple deployment process.
Patent Information
- Application Number
- CN202110832741.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-22
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-07-22
AI Technical Summary
The existing cloud computing platform's cloud-based solutions packaged based on container technology may not be compatible with applications of certain software frameworks, limiting the application's expansion capabilities.
By sending a mirror build request to the cloud platform, carrying the Dockerfile of the target application, including the path information of the target file and the startup script, building the image, and using the startup script to start the application package during deployment, achieving compatibility with applications that are incompatible with software architectures sex.
Improves the compatibility of the cloud platform, improves the scalability of applications, simplifies the application deployment process, and reduces the requirements for deployment personnel.
Smart Images

Figure CN113687907B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an application processing method, device, electronic device and storage medium. Background Art
[0002] Cloud computing platform, also known as cloud platform, is a service based on hardware resources and software resources, providing computing, network and storage capabilities. One type of cloud platform in related technologies is a one-stop cloud solution based on container technology (such as Docker) for various application scenarios. Docker is an open source application container engine that allows developers to package their applications and dependent packages into a portable image and then deploy them to a machine, and can also implement virtualized containers. However, the cloud platform may not be compatible with the application of certain software frameworks, limiting application expansion. Summary of the invention
[0003] The embodiments of the present invention provide an application processing method, device, electronic device and storage medium to solve the problems in the related art.
[0004] The objective of the present invention is achieved through the following technical solutions:
[0005] In a first aspect, an embodiment of the present invention provides an application processing method, including:
[0006] In response to an image building operation for a target application, an image building request is sent to a cloud platform, wherein the image building request carries a Dockerfile corresponding to the target application, wherein the Dockerfile includes path information of multiple target files that need to be packaged into images, and wherein the multiple target files include an application package of the target application and a startup script for starting the application package, so that the cloud platform responds to the image building request and builds an image including the multiple target files by running the Dockerfile.
[0007] In a possible implementation, the method further includes: in response to the image deployment operation for the target application, sending an image deployment request to the cloud platform, so that the cloud platform responds to the image deployment request and starts the application package through the startup script to perform image deployment.
[0008] In a possible implementation manner, the application package includes a code package from a third party.
[0009] In a possible implementation, the multiple target files further include a preprocessing file; the preprocessing file is used to deduplicate the code package in the application package.
[0010] In a possible implementation, the version of the target application is a new version, the image deployment request carries an identifier of a first node group, and the first node group includes at least one first node for deploying the image of the target application;
[0011] The method further comprises:
[0012] After the cloud platform has responded to the image deployment request and, based on the identifier of the first node group, has completed the image deployment of the target application to the first node in the first node group, an offline request is sent to the cloud platform, wherein the offline request carries the identifier of the second node group, and the second node group includes at least one second node on which an old version corresponding to the target application has been deployed, so that the cloud platform responds to the offline request and, based on the identifier of the second node group, takes offline the old version corresponding to the target application deployed by the second node in the second node group.
[0013] In a possible implementation, it further includes:
[0014] In response to the capacity expansion operation for the first node group, it is determined that the cloud platform has completed the image deployment of the target application for the first node in the first node group and the resources of the first node group meet a first preset condition, and a capacity expansion request is sent to the cloud platform, so that the cloud platform responds to the capacity expansion request and increases the number of the first nodes in the first node group to expand the capacity.
[0015] In a possible implementation, it further includes:
[0016] In response to a rollback operation for the target application, a rollback request is sent to the cloud platform, so that the cloud platform responds to the rollback request, brings the old version corresponding to the target application deployed on the second node in the second node group back online, and takes the target application deployed on the first node in the first node group offline.
[0017] In a second aspect, an embodiment of the present invention provides an application processing device, including:
[0018] The first sending module is used to send an image building request to the cloud platform in response to an image building operation for a target application, wherein the image building request carries a Dockerfile corresponding to the target application, wherein the Dockerfile contains path information of multiple target files that need to be packaged into images, and wherein the multiple target files contain an application package of the target application and a startup script for starting the application package, so that the cloud platform responds to the image building request and builds an image containing the multiple target files by running the Dockerfile.
[0019] In a possible implementation, it further includes:
[0020] The second sending module is used to: in response to the image deployment operation for the target application, send an image deployment request to the cloud platform, so that the cloud platform responds to the image deployment request and starts the application package through the startup script to perform image deployment.
[0021] In a possible implementation manner, the application package includes a code package from a third party.
[0022] In a possible implementation, the multiple target files further include a preprocessing file; the preprocessing file is used to deduplicate the code package in the application package.
[0023] In a possible implementation, the version of the target application is a new version, the image deployment request carries an identifier of a first node group, and the first node group includes at least one first node for deploying the image of the target application;
[0024] The device also includes:
[0025] A third sending module is used to send an offline request to the cloud platform after the cloud platform has responded to the image deployment request and, based on the identifier of the first node group, has completed the image deployment of the target application to the first node in the first node group, wherein the offline request carries the identifier of the second node group, and the second node group includes at least one second node on which an old version corresponding to the target application has been deployed, so that the cloud platform responds to the offline request and, based on the identifier of the second node group, takes offline the old version corresponding to the target application deployed by the second node in the second node group.
[0026] In a possible implementation, it further includes:
[0027] A fourth sending module is used to respond to the expansion operation for the first node group, determine that the cloud platform has completed the image deployment of the target application for the first node in the first node group and the resources of the first node group meet the first preset condition, and send an expansion request to the cloud platform so that the cloud platform responds to the expansion request and increases the number of the first nodes in the first node group to expand the capacity.
[0028] In a possible implementation, it further includes:
[0029] The fifth sending module is used to send a rollback request to the cloud platform in response to the rollback operation for the target application, so that the cloud platform responds to the rollback request, puts the old version corresponding to the target application deployed by the second node in the second node group back online, and takes the target application deployed by the first node in the first node group offline.
[0030] In a third aspect, an embodiment of the present invention provides an application processing system, including a deployment platform and a cloud platform;
[0031] The deployment platform is used to send an image building request to the cloud platform in response to an image building operation for a target application, wherein the image building request carries a Dockerfile corresponding to the target application, wherein the Dockerfile contains path information of multiple target files that need to be packaged into images, and wherein the multiple target files contain an application package of the target application and a startup script for starting the application package;
[0032] The cloud platform is used to build an image including the multiple target files by running the Dockerfile in response to the image building request.
[0033] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of any application processing method in the first aspect are implemented.
[0034] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any application processing method in the first aspect are implemented.
[0035] The advantages or beneficial effects of the above technical solution include at least:
[0036] After detecting the image building operation, an image building request can be sent to the cloud platform. The image building request carries the Dockerfile of the target application. The Dockerfile contains path information of multiple target files that need to be packaged into the image. The multiple target files contain the application package of the target application and a startup script for starting the application package. In this way, the cloud platform whose software architecture is incompatible with the target application has the image building logic based on the Dockerfile and the startup logic of the application package based on the startup script, thereby achieving compatibility with the target application, improving the compatibility of the cloud platform, and improving the application expansion capability.
[0037] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present invention will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is an exemplary system architecture diagram in an embodiment of the present invention;
[0039] Figure 2 is a flowchart of an exemplary application processing method provided by an embodiment of the present invention;
[0040] Figure 3 is an exemplary system architecture diagram in an embodiment of the present invention;
[0041] Figure 4 is a structural diagram of an exemplary application processing device provided by an embodiment of the present invention;
[0042] Figure 5 is a structural diagram of an exemplary electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] Cloud computing platform, also known as cloud platform, is a service based on hardware resources and software resources, providing computing, network and storage capabilities. One type of cloud platform in related technologies is a one-stop cloud solution based on container technology (such as Docker) for various application scenarios. Docker is an open source application container engine that allows developers to package their applications and dependent packages into a portable image and then deploy them to a machine, and can also implement virtualized containers. However, the cloud platform may not be compatible with the application of certain software frameworks, limiting application expansion.
[0045] For example, a cloud platform in the related art can support the application deployment of Java Web and Remote Procedure Call (RPC) software frameworks, but does not support the application deployment of Spring Boot software framework, which limits the expansion of more applications.
[0046] In order to solve the above technical problems, an embodiment of the present invention provides an application processing method.
[0047] Figure 1 is an exemplary system architecture diagram provided by an embodiment of the present invention. An application processing method provided by an embodiment of the present invention can be applied to Figure 1 As shown in the system architecture diagram. Figure 1 As shown, the system includes a terminal 101 and a server 102, and the server 102 is provided with a cloud platform 112 and a deployment platform 122. In actual applications, the server can provide an operation page for the terminal 101 through the deployment platform 122. When the software framework of the application that the user needs to deploy is not compatible with the cloud platform 112, the operation can be performed through the operation page of the terminal 101. Correspondingly, the server can execute the application processing method provided by the embodiment of the present invention through the deployment platform 122, and the method includes: in response to the image building operation for the target application, sending an image building request to the cloud platform, the image building request carries the Dockerfile corresponding to the target application, the Dockerfile contains the path information of multiple target files that need to be packaged, and the multiple target files contain the application package of the target application and the startup script for starting the application package, so that the cloud platform responds to the image building request and builds an image containing multiple target files by running the Dockerfile. The application processing method provided by the embodiment of the present invention is described in detail below.
[0048] Figure 2 FIG. 1 is a flowchart of an exemplary application processing method provided by an embodiment of the present invention. Figure 2 As shown, this embodiment provides an application processing method, which includes at least the following steps:
[0049] Step 201, the deployment platform responds to the image building operation for the target application and sends an image building request to the cloud platform. The image building request carries the Dockerfile corresponding to the target application. The Dockerfile contains the path information of multiple target files that need to be packaged into the image. The multiple target files include the application package of the target application and a startup script for starting the application package.
[0050] Step 202: In response to the image building request, the cloud platform builds an image including multiple target files by running the Dockerfile.
[0051] The target application here is the application to be processed, and the software architecture of the target application is incompatible with the software architecture of the cloud platform itself.
[0052] Dockerfile is a text file used to build an image. The text content contains the instructions and instructions required to build the image. The instructions include importing the basic image, specifying the working directory, deleting all the content files in the specified directory, copying to the root, decompressing the files, removing the redundant compressed files, and specifying the working directory. Among them, copying to the root is the COPY instruction. The command format can be: COPY <src> <dest>The COPY instruction copies the file or directory pointed to and adds it to the new image. The path of the copied file or directory in the image is <dest> 。 <src>There can be multiple sources specified. The path information of the target file here is the specified source. In actual applications, the target file can be stored in the preset location of the cloud platform in advance, and the path information of the target file can be obtained. Then, the Dockerfile of the target application is built and saved.
[0053] In response to the image building request, the cloud platform runs the Dockerfile through the Docker engine to build an image containing multiple target files. During the building process, multiple target files of the target application can be obtained based on the path information of the target files.
[0054] In this embodiment, after the image building operation is detected, an image building request can be sent to the cloud platform. The image building request carries the Dockerfile of the target application. The Dockerfile contains path information of multiple target files that need to be packaged into the image. The multiple target files contain the application package of the target application and a startup script for starting the application package. In this way, the cloud platform whose software architecture is incompatible with the target application has the image building logic based on the Dockerfile and the startup logic of the application package based on the startup script, thereby achieving compatibility with the target application, improving the compatibility of the cloud platform, and improving the application expansion capability.
[0055] In an exemplary embodiment, the above method may further include: in response to an image deployment operation for a target application, sending an image deployment request to a cloud platform; accordingly, the cloud platform responds to the image deployment request by starting the application package through a startup script to perform image deployment.
[0056] In actual applications, the cloud platform responds to image deployment requests and performs image deployment. During the image deployment process, since the built image contains a startup script, the cloud platform can start the application package through the startup logic of the startup script, thereby completing the application image deployment, improving the compatibility of the cloud platform and improving the application expansion capability.
[0057] In addition, application deployment on the cloud platform can be completed through simple user operations, which makes deployment simple and convenient and reduces the requirements for deployment personnel.
[0058] In an exemplary embodiment, the above application package may include a code package from a third party.
[0059] In the related art, various applications are provided based on the cloud platform. These applications are implemented in code packages developed in the internal format of the cloud platform. However, some functional applications may need to rely on third-party code packages, which will limit the expansion of cloud platform applications.
[0060] The code package here can be a jar package. In this embodiment, since the Dockerfile and startup script of the target application are additionally provided to the cloud platform, these Dockerfiles and startup scripts match the application package of the target application. Therefore, even if the application package contains a code package from a third party, the cloud platform can run normally through the Dockerfile and startup script, so that the cloud platform has the ability to support third-party code packages.
[0061] In actual applications, you can select the required third-party code package through the above operation page.
[0062] In an exemplary embodiment, the above-mentioned multiple target files may also include a preprocessing file; the preprocessing file is used to deduplicate the code package in the application package.
[0063] Since the application package contains code packages from a third party, there may be some duplication with the code packages developed by the user. If there is duplication, the application startup will fail. In this embodiment, a preprocessing file is pre-set in at least one target file to deduplicate the code packages in the application package, thereby reducing the risk of application startup failure.
[0064] In practical applications, the object used to deploy an application can be called a node. The number of nodes can be one or more. A collection of multiple nodes can be called a cluster. Multiple nodes in the cluster can be grouped to obtain multiple node groups.
[0065] In actual applications, node operations can be performed, such as restarting, shutting down, starting, passing (i.e., passing the mirror test of the node), etc. Group operations can also be performed, which are operations performed on the node groups of the cluster, such as deployment, expansion, rollback, and online completion of node groups.
[0066] For an application, the application can be deployed in one node group, in which the required version of the application is deployed. The application can also be deployed in two node groups, one of which is used to deploy the new version of the application and the other is used to deploy the old version of the application. The resources of each node in the node group can deploy one version of the application to save resources.
[0067] In an exemplary embodiment, the version of the target application may be a new version, and the image deployment request carries the identifier of the first node group, and the first node group includes at least one first node for deploying the target application. Accordingly, the method may further include: after the cloud platform has responded to the image deployment request and, based on the identifier of the first node group, has completed the image deployment of the target application to the first node in the first node group, a logoff request is sent to the cloud platform, and the logoff request carries the identifier of the second node group, and the second node group includes at least one second node of an old version corresponding to the deployed target application, and accordingly, the cloud platform responds to the logoff request and, based on the identifier of the second node group, logs off the old version of the target application deployed by the second node in the second node group.
[0068] The identifier of the first node group is the identity identifier of the first node group, and the identifier of the second node group is the identity identifier of the second node group.
[0069] In actual applications, when the old version of the application of the second node group needs to be offline, the new version of the application can be deployed to the first node group first, and then the old version of the application of the second node group can be offline. In this embodiment, the user only needs to perform an image deployment operation once. In response to the image deployment operation, a mirror deployment request carrying the identifier of the first node group is first sent to the cloud platform. After monitoring that the cloud platform has completed the response to the mirror deployment request, there is no need for the user to perform the offline operation again. An offline request carrying the identifier of the second node group can be automatically sent to the cloud platform to offline the old version of the application of the second node group, thereby speeding up the deployment speed.
[0070] It is understandable that after it is determined that the image deployment of the target application is completed, it can be put online. Specifically, the state of the node grouping where the target application is deployed can be modified to be online (ONLINE).
[0071] If there is one node group for deploying the application, then in response to the online completion operation, an online completion request is directly sent to the cloud platform. Correspondingly, the cloud platform responds to the online completion request and launches the target application deployed in the node group targeted by the online completion operation.
[0072] If there are two node groups for deploying the application, in response to the online completion operation, it is determined that the node group targeted by the online completion operation meets the second preset condition, and an online completion request is sent to the cloud platform. Accordingly, the cloud platform responds to the online completion request and launches the target application deployed by the node group targeted by the online completion operation. The second preset condition may be that there are available nodes in the node group targeted by the online completion operation, the number of nodes in the node group targeted by the online completion operation is not less than the number of nodes in another node group, and the other node group has been successfully offline. Alternatively, the second preset condition may be that there are no available nodes in the above-mentioned other node group and there are available nodes in the node group targeted by the online completion operation.
[0073] Expansion can be to increase the number of nodes used to deploy applications for a node group. Exemplarily, the above-mentioned application processing method may also include: in response to the expansion operation for the first node group, determining that the cloud platform has completed the image deployment of the target application for the first node in the first node group and the resources of the first node group meet the first preset condition, sending a capacity expansion request to the cloud platform, and accordingly, the cloud platform responds to the capacity expansion request and increases the number of the first nodes in the first node group to expand the capacity.
[0074] The number of nodes to be added can be input in the capacity expansion operation. The first preset condition is that the number of CPU cores and memory of the remaining resources of the node group targeted by the capacity expansion operation meet the requirements of the number of CPU cores and memory of the number of nodes to be added.
[0075] Rollback is to restore the application to the previous version, that is, the old version. If there is only one node group for deploying the application, when the new version of the application does not meet the requirements, the rollback can be performed as follows: in response to the rollback operation for the target application, a rollback request is sent to the cloud platform. In response to the rollback request, the cloud platform takes the target application in the node group targeted by the rollback operation offline, and then puts the old version corresponding to the target application back online.
[0076] If there are two node groups for deploying applications, such as the first group node and the second group node mentioned above, when the new version of the application that is online does not meet the requirements, it can be rolled back in the following manner: in response to the rollback operation for the target application, a rollback request is sent to the cloud platform. Correspondingly, the cloud platform responds to the rollback request by re-online the old version corresponding to the target application deployed by the second node in the second node group, and offline the target application deployed by the first node in the first node group. In this process, through the two node groups, one version of the application can be maintained in an online state at all times to avoid affecting user use.
[0077] Since the application is deployed based on Docker, the above-mentioned available node refers to the Docker instance corresponding to the node being started and the status in the registration center being available (UP).
[0078] The registration center is an institution in the network that can verify the user's digital certification request and then tell the certification center to issue the certification. The status of the registration center is unavailable, marked as DOWN, and the status of the registration center is available, marked as UP.
[0079] In actual applications, users can perform the above operations according to their needs and complete application deployment very conveniently.
[0080] In an exemplary embodiment, a request corresponding to the operation is sent to a target interface provided by the cloud platform.
[0081] In actual applications, the target interface provided by the cloud platform may be an image query interface, an image operation interface, a cluster query interface, a cluster operation interface or other interfaces.
[0082] Among them, the image query interface is an interface for querying the completion status of the image build. After the user performs the image build operation, the image query operation can also be performed. When the image query operation is detected, an image query request can be sent to the image query interface provided by the cloud platform, so that the cloud platform responds to the image query request and queries the completion status of the image build. The completion status of the image build is obtained and sent to the terminal so that the terminal displays the completion status of the image build. In this way, the user can easily understand the status of the image build.
[0083] The image operation interface is an interface for image building. When detecting an image building operation, an image building request can be sent to the image operation interface provided by the cloud platform.
[0084] The cluster query interface is an interface for querying the cluster ID and the corresponding cluster basic information such as resources and environment variables. A mapping relationship can be established between the cluster ID and the cluster service type targeted by the user operation. The cluster ID corresponding to the user operation can be determined based on the mapping relationship. A cluster query request can be sent to the cluster query interface provided by the cloud platform so that the cloud platform returns the cluster basic information in response to the cluster query request.
[0085] The cluster operation interface is an interface for image deployment, expansion, rollback, online completion, etc. When an image deployment operation, expansion operation, rollback operation, or online completion operation is detected, a request corresponding to the operation can be sent to the cluster operation interface provided by the cloud platform.
[0086] In this way, the deployment of applications of incompatible software frameworks can be done directly based on the cloud platform's own interface, making it simpler and more convenient.
[0087] The following takes a specific application scenario as an example to illustrate an application processing method provided by an embodiment of the present invention in more detail.
[0088] In this embodiment, a cloud platform in the server that can support software frameworks such as Java Web and RPC but does not support the Spring Boot software framework is taken as an example for introduction. In order to realize the application deployment of the Spring Boot software framework based on the cloud platform, the server also provides a deployment platform. The deployment platform is the middleware between the terminal for user operations and the cloud platform, connecting user operations and the cloud platform, and based on the interfaces provided by the cloud platform (such as image query interface, image operation interface, cluster query interface, cluster operation interface and other interfaces), it provides users with convenient application deployment of the SpringBoot software framework, and provides users with operations such as building images, image deployment, expansion, rollback, and online completion. The overall system architecture adopted includes a deployment platform, MySQL database, configuration center, cloud platform file management, and remote dictionary service (Redis, Remote Dictionary Server) cluster. See. Figure 2 , which illustrates the specific system architecture.
[0089] The container type accessed by the deployment platform is also the supported cluster service type, which can support different cluster service types, such as cluster service types A, B, C, D, and E. The target application can target one of the cluster service types.
[0090] The deployment platform can be set up with instance application deployment management module, image management module, cluster management module, and log module. The image management module can be used to send image build requests to the image operation interface of the cloud platform, or to send image query requests to the image query interface of the cloud platform. The instance application deployment management module can be used to send image deployment requests, expansion requests, rollback requests, and online completion requests to the cluster operation interface of the cloud platform. The cluster management module can be used to send cluster query requests to the cluster query interface of the cloud platform. The log module can be used to print the operation log of the deployment platform.
[0091] Among them, the MySQL database can store cluster basic information, images, application packages (such as jar packages), etc.
[0092] The configuration center, represented by Wconfig, can store Dockerfile, etc.
[0093] Cloud platform file management can store pre-processing scripts, startup scripts, etc.
[0094] Redis cluster is a cache database that can implement distributed locks and asynchronous refresh tasks.
[0095] Based on this, each stage of application deployment is explained below.
[0096] 1. Image building: Store the Dockerfile file required for image building in Wconfig, store the custom preprocessing script and startup script in the cloud platform file management, and store the required jar package in the MySQL database. Users can select the appropriate jar package version on the operation page (third-party jar packages are optional), and click the build control to perform the image building operation. After the deployment platform detects the image building operation, it can send an image building request to the image operation interface of the cloud platform, and the image building request carries the Dockerfile. After the cloud platform receives the image building request, it can parse the Dockerfile from the image building request and run the Dockerfile to build an image containing the jar package, the custom preprocessing script, and the startup script.
[0097] 2. Image deployment: Users can click the deployment control on the operation page to perform image deployment operations. After the deployment platform detects the image deployment operation, it sends an image deployment request to the cluster operation interface of the cloud platform. After the cloud platform receives the image deployment request, it starts the jar package through the startup script to perform image deployment.
[0098] User operations can be group operations or node operations. Group operations are mainly about node group deployment, expansion, rollback, and online completion. Node operations are mainly about node restart, shutdown, startup, and pass (i.e., the node mirror test passes).
[0099] If the image deployment operation is an operation for the first node in the first node group, the deployment platform can send an image deployment request for the first node in the first node group to the cloud platform; after the cloud platform has responded to the image deployment request and performed image deployment on the first node in the first node group, the deployment platform sends a request to the cloud platform to take down the old version of the application for the second node in the second node group. In response to the downline request, the cloud platform takes down the old version of the application for the second node in the second node group. In this way, the user does not need to perform the downline operation again, and the downline request for the old version of the application in the second node group can be automatically sent to the cloud platform, which speeds up the deployment.
[0100] 3. Capacity expansion: The prerequisite for capacity expansion is that the node group that needs to be expanded has been deployed and the remaining resources of the group are sufficient (for example, the number of CPU cores and the number of memories meet the needs of the nodes to be expanded). After capacity expansion, the number of nodes in the node group that needs to be expanded will be increased.
[0101] In addition, the process of rolling back and going online can refer to the above related embodiments, which will not be described in detail here.
[0102] The effects that can be achieved through the solution provided by this embodiment are as follows:
[0103] A simple and convenient platform is built based on the interface provided by the cloud platform to provide users with convenient application deployment operations of the SpringBoot software framework, and support third-party personnel to deploy their own jar packages.
[0104] Figure 4 FIG. 1 is a structural diagram of an exemplary application processing device provided by an embodiment of the present invention. Figure 4 As shown, an embodiment of the present invention provides an application processing device 400, including:
[0105] The first sending module 401 is used to send an image building request to the cloud platform in response to the image building operation for the target application. The image building request carries the Dockerfile corresponding to the target application. The Dockerfile contains the path information of multiple target files that need to be packaged into images. The multiple target files include the application package of the target application and the startup script for starting the application package, so that the cloud platform responds to the image building request and builds an image containing multiple target files by running the Dockerfile.
[0106] In a possible implementation, it further includes:
[0107] The second sending module 402 is used to: in response to the image deployment operation for the target application, send an image deployment request to the cloud platform, so that the cloud platform responds to the image deployment request and starts the application package through the startup script to perform image deployment.
[0108] In a possible implementation, the application package includes a code package from a third party.
[0109] In a possible implementation, the multiple target files further include a preprocessing file; the preprocessing file is used to deduplicate the code packages in the application package.
[0110] In a possible implementation, the version of the target application is a new version, the image deployment request carries an identifier of a first node group, and the first node group includes at least one first node for deploying the image of the target application;
[0111] The above device also includes:
[0112] The third sending module 403 is used to send an offline request to the cloud platform after the cloud platform has responded to the image deployment request and, based on the identifier of the first node group, has completed the image deployment of the target application for the first node in the first node group, the offline request carries the identifier of the second node group, and the second node group includes at least one second node with an old version corresponding to the deployed target application, so that the cloud platform responds to the offline request and, based on the identifier of the second node group, takes offline the old version of the target application deployed by the second node in the second node group.
[0113] In a possible implementation manner, the above device further includes:
[0114] The fourth sending module 404 is used to respond to the expansion operation for the first node group, determine that the cloud platform has completed the image deployment of the target application for the first node in the first node group and the resources of the first node group meet the first preset condition, and send an expansion request to the cloud platform so that the cloud platform responds to the expansion request and increases the number of first nodes in the first node group to expand the capacity.
[0115] In a possible implementation manner, the above device further includes:
[0116] The fifth sending module 405 is used to send a rollback request to the cloud platform in response to a rollback operation on the target application, so that the cloud platform responds to the rollback request, puts the old version corresponding to the target application deployed on the second node in the second node group back online, and takes the target application deployed on the first node in the first node group offline.
[0117] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0118] The embodiment of the present invention also provides an application deployment system, including a deployment platform and a cloud platform;
[0119] The deployment platform is used to respond to the image building operation for the target application and send an image building request to the cloud platform. The image building request carries the Dockerfile corresponding to the target application. The Dockerfile contains the path information of multiple target files that need to be packaged into images. The multiple target files contain the application package of the target application and the startup script for starting the application package.
[0120] The cloud platform is used to respond to an image building request and build an image containing multiple target files by running a Dockerfile.
[0121] Regarding each platform in the above embodiment, the specific manner of performing operations therein has been described in detail in the embodiment of the method, and will not be elaborated here.
[0122] An electronic device provided by an embodiment of the present invention includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the application processing method in any of the above embodiments are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0123] Figure 5 FIG. 1 is a schematic diagram of the structure of an exemplary electronic device provided by an embodiment of the present invention. Figure 5 As shown, the electronic device may include: a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other via the communication bus 504. The processor 501 may call a computer program in the memory 503 to execute the application processing method in any of the above embodiments.
[0124] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the application processing method in any of the above embodiments are implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0125] It should be noted that, in this article, the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of various embodiments of the present invention.
[0127] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
[0128] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0129] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0130] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0131] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0133] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0134] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.< / src> < / dest> < / dest> < / src>
Claims
1. An application processing method, characterized in that: include: In response to an image building operation for a target application, an image building request is sent to a cloud platform, wherein the image building request carries a Dockerfile corresponding to the target application, wherein the Dockerfile contains path information of multiple target files that need to be packaged into an image, wherein the multiple target files contain an application package of the target application and a startup script for starting the application package, so that the cloud platform builds an image containing the multiple target files by running the Dockerfile in response to the image building request; The method further comprises: In response to the image deployment operation for the target application, an image deployment request is sent to the cloud platform, so that the cloud platform responds to the image deployment request and starts the application package through the startup script to perform image deployment; the version of the target application is a new version, and the image deployment request carries an identifier of a first node group, and the first node group includes at least one first node for deploying the image of the target application; After the cloud platform has responded to the image deployment request and, based on the identifier of the first node group, has completed the image deployment of the target application to the first node in the first node group, an offline request is sent to the cloud platform, wherein the offline request carries the identifier of the second node group, and the second node group includes at least one second node on which an old version corresponding to the target application has been deployed, so that the cloud platform responds to the offline request and, based on the identifier of the second node group, takes offline the old version corresponding to the target application deployed by the second node in the second node group.
2. The method according to claim 1, characterized in that The application package includes a code package from a third party.
3. The method according to claim 2, characterized in that The multiple target files also include a preprocessing file; the preprocessing file is used to deduplicate the code package in the application package.
4. The method according to claim 1, characterized in that Also includes: In response to the capacity expansion operation for the first node group, it is determined that the cloud platform has completed the image deployment of the target application for the first node in the first node group and the resources of the first node group meet a first preset condition, and a capacity expansion request is sent to the cloud platform, so that the cloud platform responds to the capacity expansion request and increases the number of the first nodes in the first node group to expand the capacity.
5. The method according to claim 1, characterized in that Also includes: In response to a rollback operation for the target application, a rollback request is sent to the cloud platform, so that the cloud platform responds to the rollback request, brings the old version corresponding to the target application deployed on the second node in the second node group back online, and takes the target application deployed on the first node in the first node group offline.
6. An application processing device, characterized in that: include: A first sending module, configured to send an image building request to a cloud platform in response to an image building operation for a target application, wherein the image building request carries a Dockerfile corresponding to the target application, wherein the Dockerfile contains path information of multiple target files that need to be packaged into an image, and wherein the multiple target files contain an application package of the target application and a startup script for starting the application package, so that the cloud platform builds an image containing the multiple target files by running the Dockerfile in response to the image building request; The device also includes: A second sending module is used to: in response to the image deployment operation for the target application, send an image deployment request to the cloud platform, so that the cloud platform responds to the image deployment request and starts the application package through the startup script to perform image deployment; the version of the target application is a new version, and the image deployment request carries an identifier of a first node group, and the first node group includes at least one first node for deploying the image of the target application; A third sending module is used to send an offline request to the cloud platform after the cloud platform has responded to the image deployment request and, based on the identifier of the first node group, has completed the image deployment of the target application to the first node in the first node group, wherein the offline request carries the identifier of the second node group, and the second node group includes at least one second node on which an old version corresponding to the target application has been deployed, so that the cloud platform responds to the offline request and, based on the identifier of the second node group, takes offline the old version corresponding to the target application deployed by the second node in the second node group.
7. An application processing system, characterized in that: Including deployment platform and cloud platform; The deployment platform is used to send an image building request to the cloud platform in response to an image building operation for a target application, wherein the image building request carries a Dockerfile corresponding to the target application, wherein the Dockerfile contains path information of multiple target files that need to be packaged into images, and wherein the multiple target files contain an application package of the target application and a startup script for starting the application package; The cloud platform is used to build an image including the multiple target files by running the Dockerfile in response to the image building request; The deployment platform is further configured to send an image deployment request to the cloud platform in response to an image deployment operation for the target application; The cloud platform is further used to start the application package through the startup script in response to the image deployment request to perform image deployment; the version of the target application is a new version, the image deployment request carries an identifier of a first node group, and the first node group includes at least one first node for deploying the image of the target application; The deployment platform is further configured to send a logoff request to the cloud platform after the cloud platform has responded to the image deployment request and, based on the identifier of the first node group, has completed the image deployment of the target application on the first node in the first node group, wherein the logoff request carries the identifier of the second node group, and the second node group includes at least one second node on which an old version corresponding to the target application has been deployed; The cloud platform is further configured to, in response to the offline request, offline an old version corresponding to the target application deployed by the second node in the second node group based on an identifier of the second node group.
8. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the application processing method according to any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the application processing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Application deployment method and cloud computing system
CN105468362A
Automatic honeypot deployment method and device
CN111506316A