Multi-microservice multi-environment deployment method, device, equipment, medium and product

By creating continuous integration and continuous deployment pipelines for microservice collections, the automated deployment of multiple microservices and multiple environments is solved, and the problem of multiple environment deployment is solved, and the development and operation and maintenance efficiency is improved.

CN119556944APending Publication Date: 2025-03-04AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411709130.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the microservice architecture, multi-environment deployment leads to a large number of configuration items and a long time-consuming construction and deployment process, which brings management challenges to operation and maintenance personnel and affects development and operation and maintenance efficiency.

Method used

By creating a continuous integration pipeline and a continuous deployment pipeline for the microservice collection, after building an application image, it automatically deploys the image to different environments based on the deployment file, and realizes automatic deployment of multiple microservices and multiple environments.

Benefits of technology

It realizes automatic generation of multi-environment deployment files and automatic deployment of multi-microservices and multi-environment pipelines, reducing configuration item management costs, improving deployment efficiency, and solving the problem of time-consuming construction and deployment processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119556944A_ABST
    Figure CN119556944A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-microservice multi-environment deployment method, device and equipment, a medium and a product. The method comprises the following steps: creating a continuous integration assembly line and a continuous deployment assembly line for a micro-service set; and after the continuous integration assembly line constructs the application mirror image corresponding to each micro-service in the micro-service set, the continuous deployment assembly line deploys the application mirror image corresponding to each micro-service to different deployment environments based on a deployment file so as to realize multi-micro-service multi-environment deployment. Through the technical scheme of the invention, a set of one-key automatic deployment system which is high in universality, low in management cost and high in efficiency can be established, and automatic generation of multi-environment deployment files and automatic deployment of multi-micro-service multi-environment assembly lines are realized; the problems that in daily development and operation and maintenance, configuration items are numerous, and construction and deployment processes on the whole cloud consume long time are solved, and the development and operation and maintenance efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of cloud deployment of microservice architecture, and in particular, to a multi-microservice multi-environment deployment method, device, equipment, medium and product. Background Art

[0002] Microservices (or microservice architecture) is an architectural pattern that divides a single application into a group of small services. Each service runs in its own independent process and uses lightweight communication mechanisms (usually HTTP-based APIs) to communicate and coordinate with each other to provide greater throughput. This architectural pattern allows services to be built around business capabilities and can be deployed and updated independently, thereby improving the scalability and flexibility of the system.

[0003] In the microservice architecture, each service is a relatively independent individual. Services interact with each other in a loosely coupled form. Each service can choose the technology suitable for itself and can be deployed independently. But at the same time, when microservices are subdivided, the need for continuous deployment in multiple environments is superimposed, resulting in a large number of system configuration items and a long construction and deployment process on the entire cloud. For example, a certain system is divided into 7 microservices and needs to be deployed to 10 environments. The number of deployment files and the number of pipeline runs are 70 (7*10). System operation and maintenance personnel are troubled by the management of complex deployment files and frequently and mechanically deploy multiple sets of microservices in various environments every day.

[0004] DevOps is a software development and delivery model that closely combines development and operations. It combines people, processes, and technology, combines and automates the work of software development and IT operations teams, emphasizes collaboration and communication between development and operations teams, and accelerates product delivery speed and quality through automated tools and processes. At the same time, DevOps also stipulates the transformation of software development processes and organizational culture, so that previously isolated roles (development, IT operations, quality engineering, and security) can coordinate and collaborate to produce better and more reliable products. By adopting DevOps culture, practices, and tools, teams can better respond to customer needs, increase confidence in the applications they build, and achieve business goals faster. In the existing multi-microservice multi-environment deployment method based on DevOps theory, first of all, each microservice needs to prepare a corresponding deployment script (yaml file) when deployed to different application environments. When a system containing 7 microservices is deployed to 10 environments, 70 yaml files need to be written, which will result in a large number of deployment files, bringing huge challenges to the management of configuration items. Secondly, it is necessary to create a continuous integration (CI) and continuous deployment (CD) pipeline for each microservice module in each environment. When a system of 7 microservices needs to be deployed to 10 environments, the pipeline needs to be run 70 times, which will cause the entire build and deployment process to take a long time. It also brings huge challenges to the configuration items and pipeline management, affecting the development and operation efficiency. Summary of the invention

[0005] The embodiments of the present invention provide a multi-microservice multi-environment deployment method, device, equipment, medium and product to achieve the establishment of a one-key automatic deployment system with strong versatility, low management cost and high efficiency, realize automatic generation of multi-environment deployment files and automatic deployment of multi-microservice multi-environment pipelines, solve the pain points encountered in daily development and operation and maintenance, such as numerous configuration items and time-consuming construction and deployment processes on the entire cloud, and improve development and operation and maintenance efficiency.

[0006] According to one aspect of the present invention, a multi-microservice multi-environment deployment method is provided, comprising:

[0007] Create continuous integration pipelines and continuous deployment pipelines for microservice collections;

[0008] After the continuous integration pipeline builds the application image corresponding to each microservice in the microservice set, the continuous deployment pipeline deploys the application image corresponding to each microservice to different deployment environments based on the deployment file to achieve multi-microservice multi-environment deployment.

[0009] According to another aspect of the present invention, a multi-microservice multi-environment deployment device is provided, the device comprising:

[0010] Create modules for creating continuous integration pipelines and continuous deployment pipelines for a collection of microservices;

[0011] The deployment module is used to deploy the application image corresponding to each microservice in the microservice set to different deployment environments based on the deployment file after the continuous integration pipeline builds the application image corresponding to each microservice in the microservice set, so as to realize multi-microservice multi-environment deployment.

[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-microservice multi-environment deployment method described in any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the multi-microservice multi-environment deployment method described in any embodiment of the present invention when executed.

[0017] According to another aspect of the present invention, an embodiment of the present invention further provides a computer program product, the computer program product including a computer program, and when the computer program is executed by a processor, the multi-microservice multi-environment deployment method described in any embodiment of the present invention is implemented.

[0018] The embodiment of the present invention creates a continuous integration pipeline and a continuous deployment pipeline for a microservice set. After the continuous integration pipeline builds the application image corresponding to each microservice in the microservice set, the continuous deployment pipeline deploys the application image corresponding to each microservice to different deployment environments based on the deployment file to achieve multi-microservice multi-environment deployment. Through the technical solution of the present invention, a one-click automatic deployment system with strong versatility, low management cost and high efficiency can be established to achieve automatic generation of multi-environment deployment files and automatic deployment of multi-microservice multi-environment pipelines, solve the pain points encountered in daily development and operation and maintenance, such as numerous configuration items and long time-consuming construction and deployment processes on the entire cloud, and improve development and operation efficiency.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a flowchart of a multi-microservice multi-environment deployment method in an embodiment of the present invention;

[0022] Figure 2 It is a structural schematic diagram of a multi-microservice multi-environment deployment device in an embodiment of the present invention;

[0023] Figure 3 It is a structural schematic diagram of an electronic device for implementing the multi-microservice multi-environment deployment method of an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and their meanings are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0027] Embodiment 1

[0028] Figure 1 is a flowchart of a multi-microservice multi-environment deployment method in an embodiment of the present invention. This embodiment is applicable to the case of multi-microservice multi-environment cloud deployment. The method can be executed by a multi-microservice multi-environment deployment device in an embodiment of the present invention. The device can be implemented in software and / or hardware, such as Figure 1 As shown, the method specifically comprises the following steps:

[0029] S101. Create continuous integration pipelines and continuous deployment pipelines for microservice collections.

[0030] In this embodiment, the microservice set may be a set of all microservices in the application.

[0031] It is known that Continuous Integration (CI) is a software development practice. Its core idea is to frequently integrate code into a shared trunk branch during the software development process. When the developer submits the code, the continuous integration system will automatically trigger the build process to compile, package, and deploy the code, and verify the quality and correctness of the code through automated testing. Continuous Deployment (CD) is a core concept in DevOps culture. Its core idea is to ensure the quality and stability of software products through automated build and test processes after the code is submitted. Once the build and test pass, the software product can be deployed to the production environment to quickly provide new features and fixes to users. This automated deployment process can greatly improve the speed and efficiency of software delivery. At the same time, it also reduces the possibility of human intervention.

[0032] The existing cloud build-deployment solution is to create a set of continuous integration (CI) and continuous deployment (CD) pipelines for each microservice module in each environment. After running the CI pipeline corresponding to a microservice module, the first step is to perform code compliance checks, unit tests and other quality built-in steps. After all pass, the application image is built and uploaded to the artifact library. After the CI pipeline is executed, the CD pipeline of the microservice module in a certain environment is triggered to execute. The output (artifact) of the CI pipeline is used as input, and the image and deployment script yaml file of the corresponding environment are downloaded to complete the deployment. However, when a system of m microservices needs to be deployed to n environments, the pipeline needs to be run m*n times, which will cause the entire build and deployment process to take a long time, and also bring huge challenges to the configuration items and pipeline management work, affecting the development and operation efficiency.

[0033] In the implementation process of the multi-microservice multi-environment deployment method of the embodiment of the present invention, the continuous integration (CI) and continuous deployment (CD) processes are split, and the various microservices of the entire application can realize the construction and deployment of multi-microservice multi-environment by sharing the same CI and CD pipelines. CI is responsible for making application images and uploading them to the product library, and CD is responsible for using deployment files to deploy the same product to different environments, thereby realizing the separation of application and configuration. Through the technical solution of the embodiment of the present invention, the number of pipelines and the number of times the pipelines are run are greatly reduced, and the development and operation efficiency are greatly improved.

[0034] S102. After the continuous integration pipeline builds the application image corresponding to each microservice in the microservice set, the continuous deployment pipeline deploys the application image corresponding to each microservice to different deployment environments based on the deployment file to achieve multi-microservice multi-environment deployment.

[0035] It is known that an application image refers to a software package that contains an application and its operating environment. In containerization technology, an application image usually refers to a lightweight, independent, executable software package that packages the application and all its dependencies to ensure that the application can run consistently in any compatible container runtime environment.

[0036] In this embodiment, the deployment file may be a deployment script yaml file. The deployment environment may refer to a specific environment or stage in which the software application is ready to be deployed and run.

[0037] In the implementation process, based on DevOps theory, a general continuous integration CI pipeline is designed for all microservices of the application. The pipeline mainly configures microservice build check, Maven build, artifact copying, application image creation, application image push to artifact library, image compilation information output, local image clearing and other task processes. At the same time, based on DevOps theory, a general continuous deployment CD pipeline is designed for all microservices of the application. After obtaining the program image that is independent of the environment through the CI pipeline, it only needs to generate the corresponding deployment file to deploy the program to different environments. Specifically, the deployment of each environment includes: an environment image promotion step plus multiple deployment group deployment steps. The image promotion step promotes the image to different artifact library directories according to the environment, and the deployment group step generates the corresponding deployment file and then deploys the application. When using the CD pipeline for release, you can flexibly select the deployment environment to achieve one-click deployment of multiple environments with a single pipeline.

[0038] The embodiment of the present invention creates a continuous integration pipeline and a continuous deployment pipeline for a microservice set. After the continuous integration pipeline builds the application image corresponding to each microservice in the microservice set, the continuous deployment pipeline deploys the application image corresponding to each microservice to different deployment environments based on the deployment file to achieve multi-microservice multi-environment deployment. Through the technical solution of the present invention, a one-click automatic deployment system with strong versatility, low management cost and high efficiency can be established to achieve automatic generation of multi-environment deployment files and automatic deployment of multi-microservice multi-environment pipelines, solve the pain points encountered in daily development and operation and maintenance, such as numerous configuration items and long time-consuming construction and deployment processes on the entire cloud, and improve development and operation efficiency.

[0039] Optionally, the deployment file is determined by:

[0040] Get the deployment file template corresponding to each microservice in the microservice collection.

[0041] In this embodiment, the deployment file template may be a deployment file template prepared for each microservice in the application.

[0042] Specifically, by observing and analyzing each microservice deployment file, common configuration items can be abstracted and summarized to obtain a microservice common deployment file template.

[0043] Get the configuration table.

[0044] In this embodiment, the configuration table may be a table including configuration item variables and all value conditions in the deployment file.

[0045] In actual operation, the configuration item variables and all value conditions in the deployment file template corresponding to each microservice can be placed in a configuration table in a specific format for unified management.

[0046] Determine the deployment file corresponding to each microservice based on the configuration table and the deployment file template corresponding to each microservice.

[0047] Specifically, based on the configuration table, the variables corresponding to the configuration items in the deployment file template corresponding to each microservice are accurately assigned values ​​to obtain the deployment file corresponding to each microservice.

[0048] Optionally, after obtaining the deployment file template corresponding to each microservice in the microservice set, the following is also included:

[0049] Define the resource objects contained in the deployment file template according to the attribute information of the microservice.

[0050] The resource object includes at least one of deployment, configuration mapping, service, entry and key.

[0051] In actual operation, when configuring the deployment file template of each microservice according to its attribute information, the main resource objects are defined, such as Deployment, ConfigMap, Service, Ingress, and Secret.

[0052] Deployment: Deployment is an API object in Kubernetes that describes the number of application replicas, the template of the replicas (usually a Pod template), and how to expand the application replicas. It maintains the number of Pod replicas through the Pod controller to ensure high availability of the application.

[0053] ConfigMap: ConfigMap is a Kubernetes resource used to store configuration data, such as configuration files, environment variables, etc. These configuration data can be mounted and used by Pod in the form of files or environment variables, thereby separating configuration from application code.

[0054] Service: Service defines a way to access Pods, which provides a unified access interface for a group of Pods that perform the same function. Service can be accessed through a fixed IP address (ClusterIP) or a domain name, and can be used in conjunction with an external load balancer or Ingress resource to provide services to the outside world.

[0055] Ingress: Ingress is a set of rules for managing external access to applications, which allows access to services within the cluster from external networks. The Ingress object allows you to manage HTTP and HTTPS traffic by defining URL routing and load balancing rules, usually used with SSL / TLS terminals, name base virtual hosts, etc.

[0056] Secret: A Secret is a Kubernetes object that contains a small amount of sensitive data (such as a password, token, or key) that can be stored and accessed in a secure manner. Pods can use the data in a Secret, for example, through environment variables or file mounts, to avoid exposing sensitive information in configuration files.

[0057] The above resource objects are the basic components for building and managing containerized applications. They work together to ensure the deployment, configuration, connection, and security of the application.

[0058] Replace the configuration item variables in the deployment file template with placeholders.

[0059] It should be noted that, in this embodiment, the configuration item variable may be a parameter value in a deployment file template that changes with different deployment environments.

[0060] It is known that in programming, a placeholder usually refers to a temporary variable name or value, which is used to temporarily save a location in the code until a specific value is determined or provided.

[0061] In actual operation, you can use placeholders to replace parameter values ​​in the deployment file template that change with different deployment environments. For example, the deployment package name (name) in the Deployment object can be expressed as @GROUP_ID@, and the deployment space (namespace) can be expressed as @NAMESPACE@, etc.

[0062] Optionally, configuration item variables include: system name, environment name, deployment location, unit, deployment group, microservice, and variable value.

[0063] Determine the deployment file corresponding to each microservice based on the configuration table and the deployment file template corresponding to each microservice, including:

[0064] According to the configuration table, assign values ​​to the placeholders corresponding to the configuration item variables in the deployment file template corresponding to each microservice to obtain the deployment file corresponding to each microservice.

[0065] In this embodiment, the configuration items in the deployment file may have different values ​​due to differences in "system name, environment name, deployment location, deployment unit, deployment group, and microservice". Therefore, the configuration item variables and all value conditions can be placed in a configuration table in a specific format for unified management. Exemplarily, the configuration format of each row in the configuration table can be: system name | environment name | deployment location | unit | deployment group | microservice | variable name = value. Among them, on the left side of the equation, "|" is used as a separator, the last column represents the variable corresponding to the configuration item, and the previous one represents the influencing factor; the right side of the equation represents the value of the variable under a specific influencing factor. For example: System A|prod|all|all|all|batch|cpuLimit='8', which means that the configuration item cpuLimit of the batch microservices of all deployment units and all deployment clusters in the production environment has a value of 8. Specifically, based on the configuration table, the variables corresponding to the configuration items are accurately assigned values.

[0066] The technical solution of the embodiment of the present invention is that when the continuous deployment (CD) process deploys the application image to a specific environment, the deployment files corresponding to different environments are automatically rendered based on the deployment template corresponding to the current microservice using the configuration table. Under the premise of satisfying a single product, the multi-environment deployment file is automatically generated without the need to prepare deployment files for different microservices in different environments in advance.

[0067] Optionally, the configuration table includes a set of values ​​of configuration item variables corresponding to the deployment file template.

[0068] It should be noted that the value set of the configuration item variable may be all value situations of the configuration item variable.

[0069] According to the configuration table, assign values ​​to the placeholders corresponding to the configuration item variables in the deployment file template corresponding to each microservice to obtain the deployment file corresponding to each microservice, including:

[0070] Based on the target matching algorithm, the priority corresponding to each variable value in the value set of each configuration item variable is calculated.

[0071] In this embodiment, the target matching algorithm can be an algorithm designed by the user according to actual needs to calculate the priority of all value conditions of the configuration item variables in the configuration table. Preferably, the target matching algorithm can also be called the best matching algorithm. Specifically, the principle of the best matching algorithm is as follows:

[0072] For a configuration item variable, calculate the priority of all value situations of the variable in the configuration table, and use the value with the highest priority as the final configuration used by the variable. Specifically, the calculation rule can be: traverse the influencing factors from left to right, and the influencing factor is a11, which means that all situations of the influencing factor are wildcarded. At this time, the priority remains unchanged (priority + 0): the influencing factor is a predefined specific value. If the match is successful, the priority is + 1, otherwise the priority is set to -1 and it is directly excluded.

[0073] For example, take the configuration item of the number of replicas in the deployment file as an example, where replica is the variable name of the configuration item. Now, the per microservice needs to be deployed to the pt environment under system A. The process of using the configuration table to match the best value for the variable is as follows. Among them, Table 1 shows the values ​​of various influencing factors when the per microservice is deployed to the pt environment under system A; Table 2 is the configuration table; and Table 3 is the priority analysis results of the four configuration items.

[0074] Table 1

[0075] System Name Environment Name Deployment Location unit Deployment Group Microservices System A pt / / / per

[0076] Table 2

[0077] Configuration items related to the replica variable in the configuration table System A|all|all|all|all|all|replica=1 all|(test,pub,uat)|all|all|all|coin|replica=3 all|pt|all|all|all|all|replica=12 all|pt|all|all|all|per|replica=4

[0078] Table 3

[0079] System Name Environment Name Deployment Location unit Deployment Group Microservices Priority +1 0 0 0 0 0 1 0 -1 / / / / -1 0 +1 0 0 0 0 1 0 +1 0 0 0 +1 2

[0080] From the above results, we can see that the optimal value of the replica variable is 4.

[0081] Determine the deployment file corresponding to each microservice based on the priority of each variable value in the numerical set of each configuration item variable.

[0082] In this embodiment, the deployment file rendering is based on the basic deployment file template, configuration table and pipeline environment information, and the optimal matching algorithm is used to calculate the value of the configuration item variable in the template. Finally, the data can be bound to the configuration items in the template through the SpringTemplateEngine engine to generate a cloud deployment yaml file.

[0083] In an embodiment of the present invention, a method for automatically generating multi-environment deployment files is based on a deployment template corresponding to a microservice and utilizes a configuration table to automatically render deployment files corresponding to different environments, thereby achieving an exponential reduction in the number of deployment files in an application.

[0084] Optionally, the method further includes:

[0085] Create a trigger pipeline for each microservice.

[0086] Among them, the trigger pipeline passes the program packaging parameters of the microservice to the continuous integration pipeline in the form of a target and triggers the continuous integration pipeline to run.

[0087] In this embodiment, the target format may be, for example, variable name: variable value.

[0088] Specifically, based on DevOps theory, a simple trigger pipeline is created for each microservice. The pipeline only defines the trigger and passes the program packaging parameters of the microservice in the form of "variable name: variable value" to the continuous integration CI pipeline and triggers its operation.

[0089] In the actual operation process, a trigger (pipeline) is configured for each microservice to start CI to build the image of the corresponding microservice. When the CI pipeline is executed, it will automatically trigger the execution of CD, and use the characteristics of the variable group in the pipeline to complete the release, realizing a single pipeline with one-click deployment of multiple services and multiple environments in the cloud cluster.

[0090] The technical solution of the embodiment of the present invention provides a multi-environment multi-microservice cloud rapid deployment method based on DevOps, including a multi-environment deployment file automatic generation process and a multi-microservice multi-environment pipeline automatic deployment process. Specifically, the multi-environment deployment file automatic generation process includes writing a deployment script (yaml file) for each microservice, and writing a rendering plug-in to replace all placeholders in the template with specific values ​​through the best matching algorithm. The multi-microservice multi-environment pipeline automatic deployment process includes designing a continuous integration (CI) and continuous deployment (CD) pipeline for all microservices of the entire system based on DevOps theory, and configuring an independent trigger (pipeline) for each microservice. The technical solution of the embodiment of the present invention has established a one-key automatic deployment system with strong versatility, low management cost and high efficiency, which can realize the automatic generation of multi-environment deployment files and the automatic deployment of multi-microservice multi-environment pipelines, thereby improving development and operation efficiency.

[0091] Embodiment 2

[0092] Figure 2 Schematic diagram of the structure of a multi-microservice multi-environment deployment device in an embodiment of the present invention. This embodiment is applicable to the case of multi-microservice multi-environment cloud deployment. The device can be implemented in software and / or hardware. The device can be integrated in any device that provides the function of multi-microservice multi-environment deployment, such as Figure 2 As shown, the multi-microservice multi-environment deployment device specifically includes: a creation module 201 and a deployment module 202.

[0093] Wherein, the creation module 201 is used to create a continuous integration pipeline and a continuous deployment pipeline for the microservice set;

[0094] The deployment module 202 is used to deploy the application image corresponding to each microservice in the microservice set to different deployment environments based on the deployment file after the continuous integration pipeline builds the application image corresponding to each microservice in the microservice set, so as to realize multi-microservice multi-environment deployment.

[0095] Optionally, the deployment module 202 includes:

[0096] A first acquisition unit is used to acquire a deployment file template corresponding to each microservice in the microservice set;

[0097] A second acquisition unit, used to acquire a configuration table;

[0098] The determination unit is used to determine the deployment file corresponding to each microservice according to the configuration table and the deployment file template corresponding to each microservice.

[0099] Optionally, the device further comprises:

[0100] A definition unit, configured to define a resource object included in the deployment file template according to the attribute information of the microservice, wherein the resource object includes at least one of: a deployment, a configuration map, a service, an entry, and a key;

[0101] The replacement unit is used to replace the configuration item variables in the deployment file template with placeholders.

[0102] Optionally, the configuration item variables include: system name, environment name, deployment location, unit, deployment group, microservice, and variable value;

[0103] The determining unit comprises:

[0104] The assignment subunit is used to assign values ​​to the placeholders corresponding to the configuration item variables in the deployment file template corresponding to each microservice according to the configuration table to obtain the deployment file corresponding to each microservice.

[0105] Optionally, the configuration table includes a set of values ​​of configuration item variables corresponding to the deployment file template;

[0106] The assignment subunit is specifically used for:

[0107] Based on the target matching algorithm, the priority corresponding to each variable value in the value set of each configuration item variable is calculated;

[0108] Determine the deployment file corresponding to each microservice according to the priority corresponding to each variable value in the numerical value set of each configuration item variable.

[0109] Optionally, the device is further specifically used for:

[0110] A trigger pipeline is created for each of the microservices, and the trigger pipeline passes the program packaging parameters of the microservice to the continuous integration pipeline in a target form and triggers the continuous integration pipeline to run.

[0111] The above-mentioned product can execute the multi-microservice multi-environment deployment method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0112] Embodiment 3

[0113] Figure 3 A schematic diagram of the structure of an electronic device 30 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0114] like Figure 3 As shown, the electronic device 30 includes at least one processor 31, and a memory connected to the at least one processor 31, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 31 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 32 or the computer program loaded from the storage unit 38 to the random access memory (RAM) 33. In the RAM 33, various programs and data required for the operation of the electronic device 30 can also be stored. The processor 31, the ROM 32, and the RAM 33 are connected to each other through a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.

[0115] A number of components in the electronic device 30 are connected to the I / O interface 35, including: an input unit 36, such as a keyboard, a mouse, etc.; an output unit 37, such as various types of displays, speakers, etc.; a storage unit 38, such as a disk, an optical disk, etc.; and a communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0116] The processor 31 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 31 executes the various methods and processes described above, such as the multi-microservice multi-environment deployment method:

[0117] Create continuous integration pipelines and continuous deployment pipelines for microservice collections;

[0118] After the continuous integration pipeline builds the application image corresponding to each microservice in the microservice set, the continuous deployment pipeline deploys the application image corresponding to each microservice to different deployment environments based on the deployment file to achieve multi-microservice multi-environment deployment.

[0119] In some embodiments, the multi-microservice multi-environment deployment method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the multi-microservice multi-environment deployment method described above may be performed. Alternatively, in other embodiments, the processor 31 may be configured to execute the multi-microservice multi-environment deployment method in any other appropriate manner (e.g., by means of firmware).

[0120] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0121] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0122] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0123] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0124] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0125] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0126] In one embodiment, the embodiment of the present invention also includes a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, it implements the multi-microservice multi-environment deployment method of any embodiment of the present invention.

[0127] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0128] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0129] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A multi-microservice multi-environment deployment method, characterized in that: include: Create continuous integration pipelines and continuous deployment pipelines for microservice collections; After the continuous integration pipeline builds the application image corresponding to each microservice in the microservice set, the continuous deployment pipeline deploys the application image corresponding to each microservice to different deployment environments based on the deployment file to achieve multi-microservice multi-environment deployment.

2. The method according to claim 1, characterized in that The deployment file is determined in the following manner: Obtain a deployment file template corresponding to each microservice in the microservice set; Get the configuration table; Determine the deployment file corresponding to each microservice according to the configuration table and the deployment file template corresponding to each microservice.

3. The method according to claim 2, characterized in that After obtaining the deployment file template corresponding to each microservice in the microservice set, it also includes: Defining a resource object included in the deployment file template according to the attribute information of the microservice, wherein the resource object includes at least one of: deployment, configuration mapping, service, entry, and key; The configuration item variables in the deployment file template are replaced with placeholders.

4. The method according to claim 3, characterized in that The configuration item variables include: system name, environment name, deployment location, unit, deployment group, microservice and variable value; Determine the deployment file corresponding to each microservice according to the configuration table and the deployment file template corresponding to each microservice, including: According to the configuration table, the placeholders corresponding to the configuration item variables in the deployment file template corresponding to each microservice are assigned values ​​to obtain the deployment file corresponding to each microservice.

5. The method according to claim 4, characterized in that The configuration table includes a set of values ​​of configuration item variables corresponding to the deployment file template; According to the configuration table, the placeholders corresponding to the configuration item variables in the deployment file template corresponding to each microservice are assigned values ​​to obtain the deployment file corresponding to each microservice, including: Based on the target matching algorithm, the priority corresponding to each variable value in the value set of each configuration item variable is calculated; Determine the deployment file corresponding to each microservice according to the priority corresponding to each variable value in the numerical value set of each configuration item variable.

6. The method according to claim 1, characterized in that Also includes: A trigger pipeline is created for each of the microservices, and the trigger pipeline passes the program packaging parameters of the microservice to the continuous integration pipeline in a target form and triggers the continuous integration pipeline to run.

7. A multi-microservice multi-environment deployment device, characterized in that: include: Create modules for creating continuous integration pipelines and continuous deployment pipelines for a collection of microservices; The deployment module is used to deploy the application image corresponding to each microservice in the microservice set to different deployment environments based on the deployment file after the continuous integration pipeline builds the application image corresponding to each microservice in the microservice set, so as to realize multi-microservice multi-environment deployment.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-microservice multi-environment deployment method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the multi-microservice multi-environment deployment method according to any one of claims 1 to 6 when executed.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the multi-microservice multi-environment deployment method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Method and device for processing general release task, equipment and storage medium

    CN121050794A