CN116775061A - Deployment method, device, equipment and storage medium of micro-service application - Google Patents

Deployment method, device, equipment and storage medium of micro-service application Download PDF

Info

Publication number
CN116775061A
CN116775061A CN202310906561.7A CN202310906561A CN116775061A CN 116775061 A CN116775061 A CN 116775061A CN 202310906561 A CN202310906561 A CN 202310906561A CN 116775061 A CN116775061 A CN 116775061A
Authority
CN
China
Prior art keywords
application
target application
deployment
middleware
container
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310906561.7A
Other languages
Chinese (zh)
Inventor
鄂东启
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202310906561.7A priority Critical patent/CN116775061A/en
Publication of CN116775061A publication Critical patent/CN116775061A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application provides a deployment method, device and equipment of micro-service application and a storage medium. Relates to the field of cloud services. The method comprises the following steps: in response to receiving the indication information for indicating the deployment of the target application, obtaining the use information of the target application using the middleware to limit the resources; in response to there being no restricted resource in use and in common with the target application, determining whether the target application is launched; responding to the starting of the target application, acquiring the code of the target application according to a pre-configured code address, and compiling the code of the target application by adopting a pre-configured compiling language and compiling parameters to obtain a program package of the target application; determining a container mirror image of the target application according to a preconfigured mirror image construction file and a program package; operating the container mirror image by adopting a preconfigured K8s configuration file to obtain an application container; the target application is deployed in an application container. The aim of improving the deployment efficiency of the micro-service application is fulfilled.

Description

Deployment method, device, equipment and storage medium of micro-service application
Technical Field
The present application relates to the field of cloud services, and in particular, to a deployment method, apparatus, device and storage medium for a micro-service application.
Background
Micro-service architecture is a technology for deploying applications and services in the cloud, in which only required functions need to be added to a specific certain service, and the architecture of the whole process is not affected. With the development of the micro-service architecture, the internet micro-service application is greatly increased, and most of the micro-service applications are in high-load conditions of high concurrent request and large data volume operation, so that when new functions of the micro-service applications are online, the new functions can be released after non-functional test. Thus, the deployment environment of the micro-service application requires non-functional testing that supports the micro-service application.
In the related art, when implementing a deployment environment of a micro service application supporting a non-functional test, a container environment deployment scheme suitable for a micro service architecture is generally adopted, that is, a micro service application is deployed in a container mode. However, when the micro service application is deployed in a containerized manner, a large number of images need to be built, and the time required for building the large number of images is long, so that the problem of low deployment efficiency of the micro service application exists.
Thus, a solution that can improve the deployment efficiency of micro-service applications is needed.
Disclosure of Invention
The embodiment of the application provides a deployment method, device and equipment of a micro-service application and a storage medium, which are used for improving the deployment efficiency of the micro-service application.
In a first aspect, an embodiment of the present application provides a deployment method of a micro service application, applied to a server, where the deployment method of the micro service application includes: in response to receiving indication information for indicating the deployment of the target application, acquiring use information of limiting resources by using middleware by using the target application, wherein the middleware is used for storing data corresponding to the target application; in response to there being no restricted resource in use and in common with the target application, determining whether the target application is launched; responding to the starting of the target application, acquiring the code of the target application according to a pre-configured code address, and compiling the code of the target application by adopting a pre-configured compiling language and compiling parameters to obtain a program package of the target application; determining a container mirror image of the target application according to a preconfigured mirror image construction file and a program package; operating the container mirror image by adopting a preconfigured K8s configuration file to obtain an application container; the target application is deployed in an application container.
In one possible implementation manner, before the obtaining the usage information of the usage middleware limiting resource of the target application in response to receiving the indication information for indicating the deployment of the target application, the method further includes: establishing middleware in response to the target application being a micro-service application which is accessed to the server for the first time, and configuring data corresponding to the target application for the middleware; based on the middleware, adjusting parameters related to the middleware in a code or a code configuration file of the target application; in the database configuration file, usage information is recorded.
In one possible implementation manner, obtaining the usage information of the target application usage middleware limiting resource includes: in the database configuration file, the usage information is read.
In one possible embodiment, the method further comprises: in the application deployment configuration file, the code address of the target application, the compiling language and compiling parameters of the code of the target application, the mirror image construction file of the target application and the K8s configuration file of the target application are configured.
In one possible embodiment, the method further comprises: in response to the presence of a restricted resource in use or in common with the target application, a deployment failure message is output indicating a conflict of the restricted resource.
In one possible embodiment, the method further comprises: stopping the process of the middleware corresponding to the target application in response to the fact that the target application is not started; migrating the current use data of the middleware from a data file corresponding to the current use data to a target storage medium; and copying the historical data of the middleware into the data file to start the middleware.
In one possible embodiment, the method further comprises: acquiring state information used for indicating whether a target application is started or not in a database configuration file; and determining whether the target application is started or not according to the state information.
In one possible implementation, deploying the target application in the application container includes: acquiring inspection information of an application container pre-configured in an application deployment configuration file; based on the inspection information, inspecting the application container to determine whether the application container is started successfully; in response to the application container starting success, the target application is deployed in the application container.
In a second aspect, an embodiment of the present application provides a deployment apparatus for a micro service application, which is applied to a server, where the deployment apparatus for the micro service application includes: the acquisition module is used for responding to the received indication information for indicating the deployment of the target application, acquiring the use information of the target application for limiting resources by using middleware, wherein the middleware is used for storing data corresponding to the target application; a determining module for determining whether the target application is started in response to the absence of the restricted resource in use and shared with the target application; the compiling module is used for responding to the starting of the target application, acquiring the code of the target application according to the pre-configured code address, and compiling the code of the target application by adopting the pre-configured compiling language and the compiling parameters to obtain a program package of the target application; the second determining module is used for determining a container image of the target application according to the preconfigured image construction file and the program package; the running module is used for running the container mirror image by adopting a preconfigured K8s configuration file to obtain an application container; and the deployment module is used for deploying the target application in the application container.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory coupled to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the deployment method of the micro-service application as in the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program that, when executed, implements the deployment method of the micro service application of the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which when executed implements the deployment method of the micro service application of the first aspect.
According to the deployment method, the device, the equipment and the storage medium of the micro service application, provided by the embodiment of the application, through analyzing the use information of the limiting resources of the target application using middleware, whether the conflicting limiting resources exist or not is determined, if the conflicting limiting resources do not exist, after the target application is started, the code of the target application is pulled according to the pre-configured code address, the pulled code of the target application is compiled by adopting the pre-configured compiling language and the pre-configured compiling parameters to obtain a program package of the target application, then the file and the program package are constructed according to the pre-configured image, the container image of the target container is constructed, the container image is operated by adopting the pre-configured K8s configuration file, so that an application container is created, and the deployment of the target application in the application container can be completed. Because the code address, the compiling language and the compiling parameters of the target application, the mirror image construction file and the K8s configuration file are all preconfigured, the time consumption for creating the application container can be reduced, the efficiency for creating the application container is improved, and the deployment efficiency of the micro-service application can be further improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort to those skilled in the art.
FIG. 1 is a schematic diagram of a deployment system for a micro-service application according to an embodiment of the present application;
fig. 2 is a flowchart of a first embodiment of a deployment method of a micro service application according to an embodiment of the present application;
fig. 3 is a flowchart of a second embodiment of a deployment method of a micro service application according to the embodiment of the present application;
fig. 4 is a schematic structural diagram of a deployment device for micro service application according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which are made by a person skilled in the art based on the embodiments of the application in light of the present disclosure, are intended to be within the scope of the application.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the technical scheme of the application, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the information such as financial data or user data are in accordance with the regulations of related laws and regulations, and the public welfare is not violated. The user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of related data is required to comply with related laws and regulations and standards, and is provided with corresponding operation entries for the user to select authorization or rejection.
The terms involved in the present application will be explained first.
And (3) software deployment: the software deployment link refers to a process of collecting, packaging, installing, configuring and publishing software, including configuration files, user manuals, help documents and the like. May also be referred to as application deployment.
Compiling: a process of generating a target program from a source program written in a source language using a compiler.
In the related art provided in the background art, at least the following technical problems exist:
with the development of micro-service architecture, internet micro-service applications are greatly increased, and most of the micro-service applications are in high-load conditions of high concurrent request and large data volume operation due to the characteristics of micro-service usage scenarios (high concurrency, high performance and high availability), so that when new functions of the micro-service applications are online, the online functions can be released after non-functional tests. However, the update frequency of all micro-service applications is different, if a set of test environment resources for completely simulating the production environment is built, the resource consumption is huge, and some low-frequency updated micro-service applications occupy the server for a long time, which is more resource waste; if the data magnitude and the resource allocation magnitude are reduced, the test scenes of many micro service applications cannot be covered; if the test environment is built when the micro-service application is needed, the time and the labor are certainly wasted, and when the micro-service application is used, a large number of resources are difficult to find, so that the quick updating iteration of the micro-service application is not facilitated.
And when performing non-functional testing of micro-service applications, a clean testing environment is needed to remove interference from other factors, which requires adequate performance to support high concurrency requests, and a large number of database instances of application data. If the set of testing environment is stored for a long time, the waste of resources is undoubtedly caused when the non-functional test is not performed; in addition, the update frequency of each micro-service application is different, and the test environment of the low-frequency updated micro-service application is in a non-use state for a long time, so that the resource waste is further aggravated. If the test environment of the low-frequency application is not built, when the test environment needs nonfunctional test, the time and the effort are consumed for searching the coordination resource and building the test environment, and the time and the effort are consumed for creating huge database data.
In view of the above problems, the inventors have found that there are several related techniques at present:
one solution is to use a coding-like service, which is based on kubespher technology, supporting configuration flows from coding to deployment. However, the scheme needs to acquire the corresponding cloud manufacturer server, has high cost, can only run on line, has low code security, and lacks support in database manufacture number; the off-line physical machine is built in a full quantity, so that a large amount of labor cost and time cost are required to be consumed, the utilization rate is not high, and a large amount of resource waste exists.
Another solution is to use host single application deployment, that is, only one application can be deployed on one entity host or virtual host, and each application corresponds to one host. In this case, the method is well suited for resource isolation of micro-service applications for nonfunctional testing, and the testing environment is well configured when in use. For some micro-service applications that are not updated frequently, however, there is a significant waste of resources.
Another approach is host multi-application deployment, i.e., only one or more physical hosts or virtual hosts need be configured and multiple service instances run on each host, with each service instance running on ports on one or more hosts. The deployment mode is suitable for common test, when non-functional test is carried out on a plurality of micro-service applications together, the resource isolation of each micro-service application cannot be carried out, each micro-service application is mutually influenced, and the test result is inaccurate.
Another approach is containerized deployment, i.e., deployment of the micro-service application by containerization, but the underlying containerized deployment approach requires the construction and maintenance of a large number of images, which is time consuming; when the micro service application is updated, after the updated codes are uploaded, the images are compiled first and then the container is updated, and the time for compiling the images and updating the container is long, so that the problem of low deployment efficiency of the micro service application exists.
Therefore, the application provides a deployment method of the micro service application, and the deployment method of the micro service application is characterized in that the pipeline configuration is performed in advance, so that when the micro service application is deployed, an application container of the micro service application can be constructed by directly adopting an application deployment configuration file of the pipeline configuration, the time consumption for constructing the application container can be reduced, the efficiency for constructing the application container can be improved, and the deployment efficiency of the micro service application can be further improved.
In one embodiment, the deployment method of the micro service application may be applied in an application scenario. Fig. 1 is a schematic structural diagram of a deployment system of a micro service application according to an embodiment of the present application, as shown in fig. 1, in this scenario, the deployment system of the micro service application may include a new application access module, a pipeline configuration module, and an application deployment module.
In the above scenario, when a new micro-service application accesses a server, the new application access module may create a middleware data table and data corresponding to the micro-service application, so as to satisfy the service requirement of the micro-service application and the characteristic of large data request amount; and after the configuration of the related matters of the middleware is completed, modifying the related parameters of the middleware in the code or the code configuration file of the micro service application, and recording the use condition of the limited resources of the micro service application for using the middleware into the database configuration file.
In the above scenario, the pipeline configuration module may pre-select to perform pipeline configuration, that is, configure code addresses, for example, git addresses and code branches, configure compiling language, compiling parameters or packaging parameters, configure image build files, configure K8s configuration files, and configure inspection information of application containers in the application deployment configuration file.
In the above scenario, when deployment of the micro-service application is realized, the application deployment module may first read the usage condition of the limiting resource in the database configuration file, if there is no limiting resource that is in use and shared with the current micro-service application, pull the latest code according to the git address and the code branch in the application deployment configuration file after the current micro-service application is started, compile or package the pulled code by using the configured compiling language, compiling parameters or packaging parameters to obtain a program package, and add the program package to the configured mirror image construction file to construct a container mirror image of the micro-service application, and use the configured K8s configuration file to run and construct the obtained container mirror image to obtain an application container of the micro-service application; and then, checking the application container by adopting the configured checking information, and if the application container is successfully started, completing the deployment flow of the micro-service application.
In combination with the above scenario, the following describes in detail the technical solution of the deployment method of the micro service application provided by the present application through several specific embodiments.
The application provides a deployment method of a micro-service application, which is applied to a server. Fig. 2 is a flowchart of a first embodiment of a deployment method of a micro service application according to an embodiment of the present application, as shown in fig. 2, the method includes the following steps:
s201: and in response to receiving the indication information for indicating the deployment of the target application, acquiring the use information of the target application using the middleware to limit the resources.
In this step, the target application is a micro service application, and the middleware is used to store data corresponding to the target application, such as a distributed message system, a database, a remote dictionary service (Remote Dictionary Server, abbreviated as "dis"), and the like.
S202: in response to there being no restricted resource in use and in common with the target application, a determination is made as to whether the target application is launched.
In this step, there is no restricted resource that is in use and is common to the target application, it may be determined that there is no restricted resource that conflicts with the target application, and thus, it may be determined whether the code of the target application may be pulled by determining whether the target application is started.
S203: and responding to the starting of the target application, acquiring the code of the target application according to the pre-configured code address, and compiling the code of the target application by adopting a pre-configured compiling language and compiling parameters to obtain a program package of the target application.
In this step, whether the target application is started or not can be determined by the state information of the target application. If the target application is started, the code of the target application can be pulled according to the pre-configured code address, the pre-configured compiling language and the compiling parameters are adopted to compile the code of the target application, and the compiling result can be packaged through the pre-configured packaging parameters so as to obtain the program package of the target application.
Alternatively, the package may be a jar package or a war package.
S204: and determining the container image of the target application according to the preconfigured image construction file and the program package.
In this step, the image build file may be used as a basis for creating a container running image, and after obtaining the package, the package may be added to the image build file to package the container image of the target application.
Optionally, after obtaining the container image, the container image may be uploaded to a public repository of the server, e.g., a dock repository, so that the container image may be subsequently obtained directly from the public repository to create the application container.
S205: and running the container mirror image by adopting a preconfigured K8s configuration file to obtain an application container.
In this step, the K8s configuration file may be used to manage the application container, e.g., flag a start name, start address, start port, etc. of the application container, facilitate access to the application container, and determine the services of the application container.
In an alternative embodiment, since the container image is static, it is necessary to run the container image using a preconfigured K8s configuration file to present static files, static directories, etc. in the container image, and the presentation result is the application container, that is, the application container may be obtained by running the container image using a preconfigured K8s configuration file.
S206: the target application is deployed in an application container.
According to the deployment method of the micro service application, provided by the embodiment, through analyzing the use information of the target application using middleware limiting resources, whether conflicting limiting resources exist or not is determined, if the conflicting limiting resources do not exist, after the target application is started, codes of the target application are pulled according to the pre-configured code addresses, the pulled codes of the target application are compiled by adopting the pre-configured compiling language and the compiling parameters to obtain a program package of the target application, then a file and the program package are built according to the pre-configured image, a container image of the target container is built, a container image is operated by adopting the pre-configured K8s configuration file, so that an application container is created, and the deployment of the target application in the application container can be completed. Because the code address, the compiling language and the compiling parameters of the target application, the mirror image construction file and the K8s configuration file are all preconfigured, the time consumption for creating the application container can be reduced, the efficiency for creating the application container is improved, and the deployment efficiency of the micro-service application can be further improved.
In one embodiment, before the obtaining of the usage information of the target application usage middleware limiting resource in response to receiving the indication information for indicating the deployment of the target application, the method further includes: establishing middleware in response to the target application being a micro-service application which is accessed to the server for the first time, and configuring data corresponding to the target application for the middleware; based on the middleware, adjusting parameters related to the middleware in a code or a code configuration file of the target application; in the database configuration file, usage information is recorded.
In this scheme, whether the target application is a micro-service application of the first access server may be determined through identification information of the target application, and the identification information of the target application may include an application name, an application number, and the like of the target application. The method can be used for carrying out pipeline configuration aiming at the micro-service application of the first access server to obtain an application deployment configuration file, so that application deployment can be rapidly realized according to the application deployment configuration file, and the method can be used for carrying out application deployment directly according to the application deployment configuration file aiming at the micro-service application of the non-first access server, so that the efficiency of deploying the target application can be improved.
Specifically, when the non-functional test of the micro service application is performed, since the data volume is very large, middleware needs to be created to store data or a data table, when the server is newly accessed into the target application, middleware corresponding to the target application may be created, and the created middleware may be configured with the data or the data table corresponding to the target application, for example, a database table structure, database data, topic (topic) data of a kafka (kafka), and the like, so as to satisfy the service requirement of the target application and the characteristic of a large data request volume.
Optionally, the data or the data table corresponding to the target application may be configured manually, or the data table corresponding to the target application may be configured according to a pre-configured data configuration rule by a designed script, where the data configuration rule may be defined by a service side in a sorting manner, and is used to represent a mapping relationship between different data.
In an alternative embodiment, after the middleware is created and the data corresponding to the target application is configured for the middleware, the target application can be started, and if the code of the target application or the parameter related to the middleware in the code configuration file is abnormal, the abnormal parameter can be modified, so that the failure of the deployment of the target application due to the abnormal parameter is avoided.
In an alternative embodiment, during non-functional testing of the micro service application, because the data volume is very large, configuration resources of the middleware are tense, so that usage information of limiting resources of the target application using the middleware, for example, an address of the middleware, configuration information of the middleware, and the like, can be recorded in a database configuration file, so that when the target application deployment is subsequently realized, whether the target application deployment can be realized or not can be determined by using the usage information of limiting resources of the target application using the middleware, so that application deployment failure caused by conflict of limiting resources is avoided, and the success rate of the target application deployment can be improved.
In one embodiment, obtaining usage information of a target application usage middleware limiting resource includes: in the database configuration file, the usage information is read.
In the scheme, the use information of the target application use middleware limiting resources can be recorded in the database configuration file, so that when the target application deployment is carried out, the use information of the target application use middleware limiting resources needs to be read in the database configuration file at first to determine whether conflicting limiting resources exist or not, and accordingly whether the target application deployment can be achieved or not is determined, application deployment failure caused by the fact that the limiting resources conflict is avoided, and further the success rate of the target application deployment can be improved.
In one embodiment, further comprising: in the application deployment configuration file, the code address of the target application, the compiling language and compiling parameters of the code of the target application, the mirror image construction file of the target application and the K8s configuration file of the target application are configured.
In this scenario, the application deployment configuration file may be obtained through a pipeline configuration. That is, the code address of the target application, the compiling language and compiling parameters of the code of the target application, the image construction file Dockerfile of the target application, the K8s (kubernetes) configuration file of the target application and other information are stored in the application deployment configuration file in advance. Therefore, when the target application deployment is required, the target application deployment can be completed directly through the information stored in the application deployment configuration file, so that the target application deployment efficiency is improved.
Alternatively, the code address of the target application may be used to pull the code of the target application, e.g., the address of the git tool and the code branches; the compiling language of the code of the target application can be used for representing the basic environment of the selected compiling code, and the application deployment configuration file can be further configured with the packaging parameters of the code of the target application; the mirror image construction file of the target application can be used as a basis for creating a container running mirror image; the K8s configuration file may include configuration related to container startup. The application deployment configuration file may be a yaml file.
In an alternative embodiment, the code address of the target application, the compiling language and compiling parameters of the code of the target application, the image construction file of the target application, and the K8s configuration file of the target application may be stored in an application deployment configuration file; the code address of the target application can be stored in one file separately, the compiling language and the compiling parameters of the code of the target application are stored in one file separately, and then the two files and the mirror image construction file and the K8s configuration file are collectively called as an application deployment configuration file.
In one embodiment, further comprising: in response to the presence of a restricted resource in use or in common with the target application, a deployment failure message is output indicating a conflict of the restricted resource.
In this scheme, if the limiting resource currently stored in the use middleware is determined after the use information of the limiting resource used by the target application is read from the database configuration file, or the limiting resource shared by the target application exists, it may be determined that the limiting resource conflicts with the target application exists, and therefore, the deployment of the target application cannot be achieved, and thus, a message indicating the conflict of the limiting resource may be output to indicate that the deployment of the target application resource fails, and the deployment of the target application is ended. The relevant personnel can timely adopt corresponding strategies through the output deployment failure message.
Alternatively, the deployment failure message may be output by text, audio, image, or the like.
In one embodiment, further comprising: stopping the process of the middleware corresponding to the target application in response to the fact that the target application is not started; migrating the current use data of the middleware from a data file corresponding to the current use data to a target storage medium; and copying the historical data of the middleware into the data file to start the middleware.
In the scheme, if the target application is not started, the middleware corresponding to the target application is not started, so that the middleware can be started by recovering the limited resources of the middleware, so that the use information of the limited resources of the target application using the middleware can be determined, whether conflicting limited resources exist or not can be determined, whether the target application deployment can be realized is determined, the application deployment failure caused by the conflict of the limited resources is avoided, and the success rate of the target application deployment can be improved.
In an alternative embodiment, when the limited resource of the middleware is restored, the current process of the middleware corresponding to the target application may be stopped first, taking the database (such as Mysql) as an example, the current usage data of the database is stored in a data file (data file), and after the current process of the database corresponding to the target application is stopped, the current usage data of the middleware may be migrated, that is, the current usage data is compressed and packaged from the data file and decompressed into other target storage media with low performance, such as a disk; and then storing the historical data of the database into the data file, thereby realizing the resource recovery of the database, and starting the database.
Middleware may also be other data storage applications such as Redis and Kafka, etc. Similarly, middleware such as Redis and Kafka can also use a database-like (Mysql) manner to perform migration backup on middleware configuration and middleware storage data. When the data of the middleware needs to be recovered, the middleware configuration and the middleware storage data are migrated to recover the middleware service.
Optionally, in the process of starting the target application, determining which limited resource of the middleware needs to be called, so as to determine whether the limited resource needs to be called is online, and if not, starting the called limited resource is needed.
In one embodiment, further comprising: acquiring state information used for indicating whether a target application is started or not in a database configuration file; and determining whether the target application is started or not according to the state information.
In this scheme, status information indicating whether the target application is started may be preconfigured in the database configuration file. If the target application is started, the identification information can be modified to be in a starting state by adopting a script or an instruction, and if the target application is disconnected, the identification information can be modified to be in an un-starting state by adopting the script or the instruction.
Optionally, whether the middleware needs to be started or not can be determined by whether the target application is started or not, so that the target application can be determined to use the use information of the middleware limiting resources to determine whether conflicting limiting resources exist or not, and whether the target application deployment can be realized or not is determined, application deployment failure caused by the existence of the conflict of the limiting resources is avoided, and the success rate of the target application deployment can be improved.
Optionally, if the target application is not started, the middleware is considered to be not started, so that limited resources of the middleware need to be recovered to start the middleware, if the target application is started, the middleware is considered to be started, and application deployment can be directly performed through the application deployment configuration file.
In one embodiment, deploying a target application in an application container includes: acquiring inspection information of an application container pre-configured in an application deployment configuration file; based on the inspection information, inspecting the application container to determine whether the application container is started successfully; in response to the application container starting success, the target application is deployed in the application container.
In this approach, the application container also needs to be checked when the target application is deployed in the application container. Specifically, the application deployment configuration file is pre-configured with the inspection information of the application container, after the application container is created and started, the application container can be checked in a health state timing manner through the inspection information to determine whether the application container is started successfully, if the application container is started successfully, the application container is considered to be online, so that the target application can be deployed in the application container, and the deployment flow of the target application is completed.
Optionally, if the application container is not started successfully, the application container may be restarted for a certain number of times, and after a certain number of times, if the application container is still not started successfully, information indicating that the target application deployment fails may be output. By checking the application container, the failure of the target application deployment caused by the fact that the application container is not started can be avoided, and therefore the success rate of the target application deployment can be improved.
In one embodiment, the deployment method of the micro service application may also be as shown in fig. 3. Fig. 3 is a flow chart of a second embodiment of a deployment method of a micro service application according to an embodiment of the present application, and in fig. 3, the method may include the following steps:
s301: and reading the use information of the micro-service application use middleware limiting resources in the database configuration file.
S302: it is determined whether there is a conflict with the restricted resource.
Specifically, if there is no conflict in the limited resources, the process goes to step S303, and if there is a conflict in the limited resources, the process goes to step S311.
S303: it is determined whether a micro-service application is started.
Specifically, if the micro service application is not started, the process goes to step S304, and if the micro service application is started, the process goes to step S306.
S304: and migrating the current use data of the middleware.
S305: and carrying out data recovery on the middleware.
S306: and pulling codes of the micro-service application, and compiling and packaging the codes to obtain a program package.
S307: and determining the container mirror image according to the mirror image construction file and the program package.
S308: and running the container mirror image by adopting the K8s configuration file to obtain the application container.
S309: it is determined whether the application container is started.
Specifically, if the application container is started, the process goes to step S310, and if the application container is not started, the process goes to step S311.
S310: the micro-service application is deployed in an application container.
S311: information indicating that the deployment of the micro service application fails is output.
The deployment method of the micro service application can realize rapid establishment and deployment of the nonfunctional test environment under the conditions of uneven multi-application high-load update frequency and large data volume, improve the utilization rate of resources, reduce the deployment time of the manual intervention and the test environment, and accelerate the rapid test on-line of the requirements of the micro service application. Because the application deployment configuration file is preconfigured through the pipeline, the deployment of the micro-service application can be quickly realized through the application deployment configuration file, and therefore, for the micro-service application which is not frequently used or updated, the quick online and offline can be also realized; in addition, the configuration file of the application deployment is preconfigured through the pipeline, so that the influence of other micro-service applications on the middleware limiting resources during the non-functional test can be reduced from the source, and the accuracy of the non-functional test of the micro-service applications is improved.
The embodiment of the application also provides a deployment device of the micro-service application, which is applied to the server. Fig. 4 is a schematic structural diagram of a deployment device of a micro service application according to an embodiment of the present application, and as shown in fig. 4, a deployment device 400 of the micro service application includes:
An obtaining module 401, configured to obtain, in response to receiving indication information for indicating deployment of a target application, use information of resources limited by a middleware used by the target application, where the middleware is configured to store data corresponding to the target application;
a first determining module 402, configured to determine, in response to there being no restricted resource that is in use and is common to the target application, whether the target application is started;
the compiling module 403 is configured to respond to the start of the target application, obtain a code of the target application according to a pre-configured code address, and compile the code of the target application by using a pre-configured compiling language and compiling parameters to obtain a program package of the target application;
a second determining module 404, configured to determine a container image of the target application according to the preconfigured image building file and the program package;
an operation module 405, configured to operate the container image using a preconfigured K8s configuration file, to obtain an application container;
a deployment module 406 for deploying the target application in the application container.
Optionally, the deployment apparatus 400 of the micro service application further includes: a processing module (not shown) for creating middleware in response to the target application being a micro-service application that is first accessed to the server and configuring data corresponding to the target application for the middleware before acquiring the usage information of the target application for restricting the resources using the middleware in response to receiving the indication information for indicating the deployment of the target application; based on the middleware, adjusting parameters related to the middleware in a code or a code configuration file of the target application; in the database configuration file, usage information is recorded.
Optionally, the obtaining module 401 is specifically configured to, when obtaining the usage information of the target application usage middleware limiting resource: in the database configuration file, the usage information is read.
Optionally, the deployment apparatus 400 of the micro service application further includes: a configuration module (not shown) for configuring the code address of the target application, the compiling language and compiling parameters of the code of the target application, the image construction file of the target application, and the K8s configuration file of the target application in the application deployment configuration file.
Optionally, the deployment apparatus 400 of the micro service application further includes: an output module (not shown) for outputting a deployment failure message indicating a conflict of the limiting resources in response to the limiting resources being stored in use or shared with the target application.
Optionally, the processing module is further configured to stop a process of the middleware corresponding to the target application in response to the target application not being started; migrating the current use data of the middleware from a data file corresponding to the current use data to a target storage medium; and copying the historical data of the middleware into the data file to start the middleware.
Optionally, the processing module is further configured to obtain status information in the database configuration file, where the status information is used to indicate whether the target application is started; and determining whether the target application is started or not according to the state information.
Optionally, the deployment module 406 is specifically configured to, when deploying the target application in the application container: acquiring inspection information of an application container pre-configured in an application deployment configuration file; based on the inspection information, inspecting the application container to determine whether the application container is started successfully; in response to the application container starting success, the target application is deployed in the application container.
The deployment device for micro service application provided in this embodiment is configured to execute the technical scheme of the deployment method applied to micro service application in the foregoing method embodiment, and its implementation principle and technical effect are similar, and are not described herein again.
The embodiment of the application also provides electronic equipment. Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device may be provided as a computer, for example as the server above, for example. Referring to fig. 5, an electronic device 500 includes a processing component 501 that further includes one or more processors and memory resources represented by memory 502 for storing instructions, such as applications, executable by the processing component 501. The application program stored in memory 502 may include one or more modules each corresponding to a set of instructions. Further, the processing component 501 is configured to execute instructions to perform any of the method embodiments described above.
The electronic device 500 may further comprise a power supply component 503 configured to perform power management of the electronic device 500, a wired or wireless network interface 504 configured to connect the electronic device 500 to a network, and an input output interface 505, which input output interface 505 may also be referred to as I/O interface 505. The electronic device 500 may operate based on an operating system stored in the memory 502, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
The embodiment of the application also provides a computer readable storage medium, and the computer readable storage medium is stored with a computer program, and the computer program is used for realizing the technical scheme of the deployment method of the micro-service application provided in the method embodiment when being executed.
The embodiment of the application also provides a computer program product, which comprises a computer program, wherein the computer program is used for realizing the technical scheme of the deployment method of the micro-service application provided in the method embodiment when being executed.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, e.g., the division of modules is merely a logical function division, and there may be additional divisions of actual implementation, e.g., multiple modules may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or modules, which may be in electrical, mechanical, or other forms.
The modules illustrated as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
In addition, each functional module in the embodiments of the present application may be integrated in one processing unit, or each module may exist alone physically, or two or more modules may be integrated in one unit. The units formed by the modules can be realized in a form of hardware or a form of hardware and software functional units.
The integrated modules, which are implemented in the form of software functional modules, may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or processor to perform some of the steps of the methods of the various embodiments of the application.
It should be understood that the above processor may be a central processing unit (Central Processing Unit, abbreviated as CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, abbreviated as DSP), application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile memory NVM, such as at least one magnetic disk memory, and may also be a U-disk, a removable hard disk, a read-only memory, a magnetic disk or optical disk, etc.
If a bus is also present in the device or apparatus, the bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or to one type of bus.
The storage medium may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an application specific integrated circuit (Application Specific Integrated Circuits, ASIC for short). Of course, the processor and the storage medium may reside as discrete components in an electronic control unit or master control device.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.

Claims (12)

1. A deployment method of a micro-service application, applied to a server, the deployment method comprising:
in response to receiving indication information for indicating the deployment of a target application, acquiring use information of limiting resources by using middleware by the target application, wherein the middleware is used for storing data corresponding to the target application;
determining whether the target application is launched in response to there being no restricted resource in use and in common with the target application;
responding to the starting of the target application, acquiring the code of the target application according to a pre-configured code address, and compiling the code of the target application by adopting a pre-configured compiling language and compiling parameters to obtain a program package of the target application;
determining a container image of the target application according to a preconfigured image construction file and the program package;
operating the container mirror image by adopting a preconfigured K8s configuration file to obtain an application container;
the target application is deployed in the application container.
2. The deployment method according to claim 1, wherein, in response to receiving the instruction information for instructing the deployment of the target application, before obtaining the usage information of the target application usage middleware-restricted resource, further comprising:
Responding to the target application as a micro-service application which is accessed to a server for the first time, creating the middleware, and configuring data corresponding to the target application for the middleware;
based on the middleware, adjusting parameters related to the middleware in a code or a code configuration file of the target application;
and recording the use information in a database configuration file.
3. The deployment method according to claim 2, wherein the obtaining the usage information of the target application usage middleware limiting resource includes:
and reading the use information in the database configuration file.
4. The deployment method of claim 1, further comprising:
and configuring the code address of the target application, the compiling language and the compiling parameters of the code of the target application, the mirror image construction file of the target application and the K8s configuration file of the target application in the application deployment configuration file.
5. The deployment method of any one of claims 1 to 4, further comprising:
in response to the presence of a restricted resource in use or in common with the target application, a deployment failure message is output indicating a conflict of restricted resources.
6. The deployment method of any one of claims 1 to 4, further comprising:
stopping the process of the middleware corresponding to the target application in response to the fact that the target application is not started;
migrating the current use data of the middleware from a data file corresponding to the current use data to a target storage medium;
and copying the historical data of the middleware into the data file to start the middleware.
7. The deployment method of claim 6, further comprising:
acquiring state information used for indicating whether the target application is started or not in a database configuration file;
and determining whether the target application is started or not according to the state information.
8. The deployment method of any of claims 1-4, wherein the deploying the target application in the application container comprises:
acquiring inspection information of the application container pre-configured in an application deployment configuration file;
based on the inspection information, inspecting the application container to determine whether the application container is started successfully;
and in response to the application container starting success, deploying the target application in the application container.
9. A deployment apparatus for a micro-service application, the deployment apparatus being applied to a server, the deployment apparatus comprising:
the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring the use information of the resources limited by the middleware used by the target application in response to receiving the indication information for indicating the deployment of the target application, and the middleware is used for storing data corresponding to the target application;
a first determining module for determining whether the target application is started in response to there being no restricted resource in use and in common with the target application;
the compiling module is used for responding to the starting of the target application, acquiring the code of the target application according to a pre-configured code address, and compiling the code of the target application by adopting a pre-configured compiling language and compiling parameters to obtain a program package of the target application;
the second determining module is used for determining a container image of the target application according to a preconfigured image construction file and the program package;
the running module is used for running the container mirror image by adopting a preconfigured K8s configuration file to obtain an application container;
and the deployment module is used for deploying the target application in the application container.
10. An electronic device, comprising: a processor, and a memory coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory to implement the deployment method of a micro service application as claimed in any one of claims 1 to 8.
11. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed implements the deployment method of a micro service application according to any of claims 1 to 8.
12. A computer program product comprising a computer program which when executed implements the deployment method of a micro service application according to any one of claims 1 to 8.
CN202310906561.7A 2023-07-21 2023-07-21 Deployment method, device, equipment and storage medium of micro-service application Pending CN116775061A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310906561.7A CN116775061A (en) 2023-07-21 2023-07-21 Deployment method, device, equipment and storage medium of micro-service application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310906561.7A CN116775061A (en) 2023-07-21 2023-07-21 Deployment method, device, equipment and storage medium of micro-service application

Publications (1)

Publication Number Publication Date
CN116775061A true CN116775061A (en) 2023-09-19

Family

ID=88009997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310906561.7A Pending CN116775061A (en) 2023-07-21 2023-07-21 Deployment method, device, equipment and storage medium of micro-service application

Country Status (1)

Country Link
CN (1) CN116775061A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117785266A (en) * 2023-12-26 2024-03-29 无锡雪浪数制科技有限公司 Automatic release method of application program, scheduling server and low-code platform

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117785266A (en) * 2023-12-26 2024-03-29 无锡雪浪数制科技有限公司 Automatic release method of application program, scheduling server and low-code platform

Similar Documents

Publication Publication Date Title
US10908887B2 (en) Dynamic container deployment with parallel conditional layers
CN109358858B (en) Automatic deployment method, device, medium and electronic equipment
CN107193607B (en) Method and apparatus for updating code file, storage medium, processor, and terminal
US20200341752A1 (en) Electronic apparatus and method for controlling thereof
JP2022504030A (en) How, systems, and programs to detect security risks associated with software components
CN110716845B (en) Log information reading method of Android system
US9542173B2 (en) Dependency handling for software extensions
CN116775061A (en) Deployment method, device, equipment and storage medium of micro-service application
US20190303172A1 (en) Information processing apparatus, device assignment method, and computer readable medium
CN115291946A (en) Hongmong system transplanting method, device, electronic equipment and readable medium
CN113760306A (en) Method and device for installing software, electronic equipment and storage medium
US11422917B2 (en) Deriving software application dependency trees for white-box testing
CN113377586B (en) Automatic detection method and device for server and storage medium
US9760364B2 (en) Checks for software extensions
CN116880877A (en) Virtual machine enhancement tool upgrading method and device, computer equipment and storage medium
CN110471828B (en) Operating system testing method, device and equipment thereof
US11755309B2 (en) Tagging packages in an application ecosystem
US11334419B1 (en) Information handling system fault analysis with remote remediation file system
CN104317645A (en) Method and device of monitoring port by virtue of application program embodiment
Ayres et al. Virtualisation as a means for dynamic software update within the automotive E/E architecture
US9477447B1 (en) Semantic representations of software extensions
CN115543227B (en) Cross-system data migration method, system, electronic device and storage medium
CN111949278B (en) Method, system, terminal and storage medium for automatically installing MCS system
US20220398126A1 (en) Dynamically assigning applications to workspaces based on context
CN116302543A (en) Continuous integrated job processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination