CN114461249A - Micro-service deployment method, device, code server and storage medium - Google Patents

Micro-service deployment method, device, code server and storage medium Download PDF

Info

Publication number
CN114461249A
CN114461249A CN202210125462.0A CN202210125462A CN114461249A CN 114461249 A CN114461249 A CN 114461249A CN 202210125462 A CN202210125462 A CN 202210125462A CN 114461249 A CN114461249 A CN 114461249A
Authority
CN
China
Prior art keywords
file
branch code
code
container
application
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
CN202210125462.0A
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.)
Jiqi Chengdu Technology Co ltd
Original Assignee
Jiqi Chengdu Technology 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 Jiqi Chengdu Technology Co ltd filed Critical Jiqi Chengdu Technology Co ltd
Priority to CN202210125462.0A priority Critical patent/CN114461249A/en
Publication of CN114461249A publication Critical patent/CN114461249A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Abstract

The embodiment of the invention provides a micro-service deployment method, a device, a code server and a storage medium, which relate to the field of application development, and the method comprises the following steps: receiving a branch code of a preset application pushed by a terminal device; in the process of executing the integrated task of the branch code, acquiring a configuration file of a preset application and an application environment data file corresponding to the branch code; sending a container deployment instruction to a container server, the container deployment instruction comprising: the container deployment instruction is used for enabling the container server to redeploy the microservices of the preset application according to the configuration file, and the microservices corresponding to the branch codes are updated according to the application environment data file. By adopting the method and the device, the isolation and parallel iteration among different development requirements are achieved, and the efficiency of deploying the micro-service is accelerated.

Description

Micro-service deployment method, device, code server and storage medium
Technical Field
The present invention relates to the field of application development, and in particular, to a method and an apparatus for deploying a microservice, a code server, and a storage medium.
Background
With the development of the internet economy, the traditional software development mode cannot adapt to the rapid iteration requirement of the requirement, and particularly under the current micro-service application scene, the engineering involved is also multiple.
For developing a product, multiple development requirements are often parallel in actual operation, but due to different release times, a developer wants each requirement to run independently in the development process without influencing other requirements, which also has a certain requirement on resource isolation.
However, in the existing method for isolating application resources, a whole set of development environment still needs to be set during deployment, so that many resources are wasted and development efficiency is affected although isolation is achieved.
Disclosure of Invention
The embodiment of the invention provides a method and a device for deploying micro-services, a code server and a storage medium, which can achieve isolation and parallel iteration among different development requirements and accelerate the efficiency of deploying the micro-services.
In a first aspect, an embodiment of the present invention provides a method for deploying a micro service, where the method includes:
receiving a branch code of a preset application pushed by a terminal device;
acquiring a configuration file of the preset application and an application environment data file corresponding to the branch code in the process of executing the integrated task of the branch code;
sending container deployment instructions to a container server, the container deployment instructions comprising: the configuration file and the application environment data file, and the container deployment instruction is used for enabling the container server to redeploy the micro service of the preset application according to the configuration file, and updating the micro service corresponding to the branch code according to the application environment data file.
Optionally, the obtaining the application environment data file corresponding to the branch code includes:
identifying attribute parameters corresponding to the branch codes from the branch codes;
loading configuration variable data corresponding to the branch code from the configuration file;
and assembling the application environment data file according to the attribute parameters and the configuration variable data.
Optionally, the identifying, from the branch code, an attribute parameter corresponding to the branch code includes:
identifying a function name and an application version corresponding to the branch code from the branch code; the attribute parameters include: the function name and the application version;
the loading of the configuration variable data corresponding to the branch code from the configuration file includes:
and loading the configuration variable data from the configuration file according to the function name.
Optionally, the assembling the application environment data file according to the attribute parameters and the configuration variable data includes:
assembling a service rule file and an instance access file corresponding to the branch code according to the attribute parameters and the configuration variable data;
the application environment data file includes: the service rule file is used for defining rules for creating or updating the micro-service corresponding to the branch code, and the instance access file is used for defining an access instance and an instance access path of the micro-service corresponding to the branch code.
Optionally, the method further comprises:
assembling a load balancing file corresponding to the preset application according to the attribute parameters;
the container deployment instructions further comprise: the load balancing file; the load balancing file is used for enabling the container server to regenerate an access balancer of the preset application so as to perform load balancing on the received access request aiming at the preset application.
Optionally, the configuration variable data includes: a uniform resource access address of the branch code.
Optionally, the method further comprises:
and returning the pushing result of the branch code to the terminal equipment.
In a second aspect, an embodiment of the present invention further provides a microservice deployment apparatus, where the apparatus includes:
the receiving module is used for receiving a branch code of a preset application pushed by the terminal equipment;
the acquisition module is used for acquiring a configuration file of the preset application and an application environment data file corresponding to the branch code in the process of executing the integrated task of the branch code;
a processing module, configured to send a container deployment instruction to a container server, where the container deployment instruction includes: the configuration file and the application environment data file, and the container deployment instruction is used for enabling the container server to redeploy the micro service of the preset application according to the configuration file, and updating the micro service corresponding to the branch code according to the application environment data file.
In a third aspect, an embodiment of the present invention further provides a code server, where the code server includes: a processor, a memory and a bus, wherein the processor and the memory are connected by the bus, the memory stores program instructions executable by the processor, and when an application development system runs, the processor executes the program instructions to execute the steps of the micro-service deployment method according to any one of the first aspect.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the micro-service deployment method according to any one of the first aspect.
The invention provides a method, a device, a code server and a storage medium for deploying micro-services, which are characterized in that a configuration file of an application corresponding to a branch code and a data file of an application environment corresponding to the branch code are acquired in an integrated task corresponding to the branch code by receiving the branch code of a preset application needing iteration at this time, which is pushed by a terminal device; after the acquisition is finished, sending a data file with a configuration file and an application environment to a container server, so that the container server can redeploy the micro service of the preset application according to the configuration file, update the micro service corresponding to the iteration branch code according to the application environment file, in the process of updating iteration, loading the configuration file of the application according to the branch code applied according to the current requirement and obtaining the data file in the corresponding environment, so that the container server can deploy the micro service of the application according to the configuration file of the application, update the micro service through the newly assembled environment file, because the process of updating iteration is finished in the container server, and the corresponding file is loaded by the corresponding branch code to instruct the corresponding container, the updating iteration requirements of each application can be finished in parallel cooperation and independently under the condition of not being interfered by other requirements, in the process of each iteration, the whole environment does not need to be updated, and only the files corresponding to the corresponding new contents need to be modified, so that the waste of resources in the development process is greatly reduced, the efficiency of deploying micro-services is increased, and network congestion is avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a schematic diagram of an application deployment system provided by the present invention;
fig. 2 is a schematic flow chart of a method for deploying micro services according to the present invention;
FIG. 3 is a schematic flowchart of a method for acquiring application environment data files in microservice deployment according to the present invention;
FIG. 4 is a schematic flow chart illustrating another method for obtaining application environment data files in a microservice deployment according to the present invention;
fig. 5 is a schematic diagram of a microservice deployment apparatus provided by the present invention;
fig. 6 is a schematic diagram of a code server provided in the present invention.
Icon: 1, an application deployment system; 10, a terminal device; 20, a code server; 30, a container server; 1000, a receiving module; 2000, an obtaining module; 3000, a processing module; 21, a processor; 22, a memory; 23, a bus.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Before explaining the present invention in detail, an application scenario of the present invention will be described.
The embodiment of the present invention is implemented based on the related technologies such as a code warehouse and a container, and is described primarily here:
code repository: the method is used for code management of project development and multi-version control parallelism. Common code repositories are Gitlab, Gitee, Coding, Source, etc. In the embodiment of the present invention, Gitlab is used as a code repository to explain the corresponding steps of the embodiment, but the selection of the code repository of the present invention is not limited thereto.
GitLab: git-based code repository, Gitlab, provides basic Git services. Git is a free, open-source, popular distributed version control system, and can very conveniently and efficiently process the version management of various small, medium and large software systems. The GitLab integrated CI/CD function enables an enterprise to rapidly release codes, helps a team to automatically release applications, and shortens the life cycle of release.
Gitlab CI: the method belongs to a part of the GitLab, and mainly can support continuous integrated triggering of a Git warehouse, a corresponding pipeline (. GitLab-ci.yml) file is configured for each project, and the pipeline is triggered when each combination request or push of the code.
Gitlab-runner: yml scripts, a Gitlab-runner is a machine (or virtual machine) that is isolated from each other and is constructed based on the API of Gitlab-CI. Gitlab-Runner is divided into two types, Shared Runner and Specific Runner, which are all available for the project and can only serve the project as specified.
A container: an environment for running the application program independent of the operating system. It packages everything that an application needs together. Containers include all code, all kinds of dependencies and even operating systems, the presence of which allows applications to run almost anywhere. The container service is process-level virtualization morphological encapsulation, the container is started and deployed rapidly, deployment and scheduling can be performed rapidly according to resource requirements on an application level, and the life cycle change speed is high. A commonly used container is Docker. The Docker greatly improves the efficiency of deploying service and system operation and maintenance, and can realize seamless migration of a development environment to a production environment.
Docker: the application container engine is an open-source application container engine, so that developers can package their applications and dependence packages into a portable container and then distribute the portable container to any popular Linux machine, and virtualization can be realized. The containers are fully sandboxed without any interface between each other.
Docker mirror image: the Docker mirror is the basis for the operation of the item, and the Docker container is the operating state of the item. Therefore, the Docker mirror is a precondition for the operation of the Docker container, and all Docker containers are constructed by the Docker mirror. The Docker mirror image is similar to a special file system and provides resources, configuration and parameters required by the container in operation, the Docker mirror image does not contain any dynamic data, the Docker container can be regarded as operation processes of the system, and the operation processes can occupy CPU resources, memory, disks, networks and the like. In the Docker container starting process, the Docker engine analyzes the environmental information required by the operation of the Docker container according to the Docker mirror image file, and completes the whole Docker container creating process.
Docker is not enough, because thousands of containers need to be managed in development, a container scheduling tool such as K8S is provided, so that a developer can monitor the operation state of the containers and automatically restart some broken containers, namely, hot backup is performed. The container and container schedule are run to the cloud, so that the combined service is the cloud container.
Kubernetes (K8S): is a standard for container and cluster management. YAML files specify the containers and other resources needed to compose an application. K8S provides functions such as scheduling, scaling, service discovery, health check, ciphertext management, and configuration management.
In order to realize the function expansion and cluster interaction of K8S, a Rancher manages a plurality of K8S.
Rancher: is a container management platform created for companies that use containers. Rancher can create a cluster from a Kubernets hosting service provider, automatically create nodes and install the Kubernets cluster, or import any existing Kubernets cluster, and generally speaking, Rancher is a full-stack Kubernets container management platform and is a tool capable of successfully operating Kubernets anywhere.
Micro-service: microservice is a new software architecture style, and a large complex software application is usually composed of one or more microservices. The individual microservices in the system are loosely coupled and can be deployed independently. Each microservice need only focus on and perform one job excellently, where each job represents a small business capability. The design concept of the micro-service architecture is that the whole system in software engineering is regarded as an organic combination of a group of micro-service modules, each micro-service module is a subsystem which can independently run and provides a specific function, and the micro-service module has an independent data source and a service logic. The micro-service module can cooperate with other micro-service modules through a communication protocol and an interface, so that the function of the whole system is realized.
With the advent of the network era, development processes and business logic solutions of software projects have developed more and more mature and stable, but in order to construct a large-scale distributed, highly available, high-performance, highly concurrent and highly maintainable software system, repeated version update iteration is not necessarily required in the development process, and many developers are used to iterate different software versions in a way of copying the whole project environment, so that the maintenance, iteration and upgrade costs in development are increased. Particularly, when parallel iteration requirements occur, not only the whole project needs to be deployed for many times, so that the current resource waste is serious, but also the deployment environment is congested, and the whole project process is delayed.
Therefore, the present invention provides a method, an apparatus, a code server and a storage medium for deploying micro services, which can load a configuration file of an application according to a branch code required to be applied in a development process and obtain a data file in a corresponding environment, so that a container server can deploy the micro services of the application according to the configuration file of the application and update the micro services through a newly assembled environment file. The following embodiments of the invention may be implemented in an application deployment system, which is described below in conjunction with the following figures.
Fig. 1 is a schematic diagram of an application deployment system according to the present invention. As shown in fig. 1, the application deployment system 1 includes: the system comprises a terminal device 10, a code server 20 and a container server 30, wherein the terminal device 10 is in communication connection with the code server 20, and the code server 20 is in communication connection with the container server 30. In the system, the terminal equipment 10 is local equipment of a developer; the code server 20 is composed of GitLab and executes the CI/CD flow of the GitLab; the container server 30 is composed of Docker, and is managed by Rancher, Kubernetes. In the system, a developer may send an application code to the code server 20 at the terminal device 10, and the code server 20 may send a deployment instruction to the container server 30 according to the application code, so as to achieve content deployment corresponding to the application code through deployment interaction between the code server 20 and the container server 30. In a possible implementation manner, in order to avoid the problem of hardware resource waste caused by the operation of the traditional server cluster, a cloud container may be formed in the container server 30 by using a cloud service, and the cloud container may virtualize a plurality of independent hosts through a virtualization technology, so as to utilize hardware resources to the maximum extent and reduce hardware consumption as much as possible.
On the basis of the application deployment system provided in fig. 1, in order to explain the interaction process between the code server 20 and the container server, the present invention also provides a possible implementation manner of the micro-service deployment method. Fig. 2 is a schematic flow chart of a method for deploying micro services according to the present invention. As shown in fig. 2, a method of microservice deployment, performed by a code server 20, comprises:
s110, receiving a branch code of a preset application pushed by the terminal equipment.
Before deploying the micro-service, a CI/CD thread flow of a preset application corresponding item needs to be configured in advance, and Gitlab-runner creation is carried out. Gitlab provides a Docker-runner mirror image, and each microservice is made into a Docker mirror image and is deployed on a container cluster Kubernets.
After the configuration is completed, when there is an update iteration demand, the code server 20 may receive the branch code of the preset application pushed by the terminal device 10. The branch code is maintained by the code server 20 and eventually the branch code will merge into the backbone, integrating the latest version of the code.
Specifically, when the code server receives a new branch code, the GitLab notifies the Gitlab CI to automatically trigger the CI pipeline; and finding out the Gitlab-runner of the project corresponding to the branch code according to the token by the Gitlab CI, and informing the Gitlab-runner to deploy the Docker mirror image according to the branch code.
S120, in the process of executing the integrated task of the branch code, obtaining a configuration file of a preset application and an application environment data file corresponding to the branch code.
In the process of executing the integration task of the project corresponding to the branch code, the code server 20 needs to load a configuration file of a preset project corresponding to the application in the Docker image according to the branch code, and assemble an application environment data file corresponding to the Docker image according to the branch code.
S130, sending a container deployment instruction to the container server.
The container deployment instructions include: the container deployment instruction is used for enabling the container server to redeploy the microservices of the preset application according to the configuration file, and the microservices corresponding to the branch codes are updated according to the application environment data file.
After the code server 20 obtains the configuration file of the preset application and the application environment data file corresponding to the branch code, it needs to send a container deployment instruction to the container server 30. In the deployment instruction, the files obtained in S120 are sent to the container server 30, so that the container server 30 can redeploy the microservice of the preset application according to the configuration file, and update the microservice corresponding to the branch code according to the application environment data file.
Specifically, when the application deployment system 1 is used to execute the above-mentioned microservice deployment method, when a developer faces an iteration requirement, a requirement code may be sent to the code server 20 through the terminal device 10, the code server 20 triggers CI pipeline each time it receives a branch code, and the corresponding Gitlab-runner is searched for the Gitlab root to execute CI pipeline; meanwhile, after the code server 20 deploys the environment and loads the configuration file corresponding to the branch code, the gillab-runner sends a deployment instruction to the container server 30, and instructs the container server 30 to perform update iteration according to the environment deployed by the code server 20 and the configuration file.
In the process of updating iteration in this embodiment, the configuration file of the application is loaded according to the branch code of the application required this time and the data file in the corresponding environment is obtained, so that the container server can deploy the micro-service of the application according to the configuration file of the application, update the micro-service through the newly assembled environment file, since the process of updating iteration is completed in the container server, and the corresponding branch code loads the corresponding file to instruct the corresponding container, therefore, each application updating iteration requirement can be used for independently completing the deployment of the application micro-service in parallel in a coordinated manner without being interfered by other requirements, in the process of each iteration, the whole environment does not need to be updated, and only the files corresponding to the corresponding new contents need to be modified, so that the waste of resources in the development process is greatly reduced, the efficiency of deploying micro-services is increased, and network congestion is avoided.
On the basis of the method for deploying the micro-service provided by the above fig. 2, the present invention also provides a possible implementation manner of the method for acquiring the application environment data file in the micro-service deployment. Fig. 3 is a schematic flow chart of a method for acquiring an application environment data file in micro-service deployment according to the present invention. As shown in fig. 3, the obtaining of the application environment data file corresponding to the branch code in S120 includes:
s210, identifying attribute parameters corresponding to the branch codes from the branch codes.
Specifically, after the code server 20 receives the branch code of the preset application pushed by the terminal device 10, the Gitlab-runner identifies the corresponding attribute parameter from the branch code, and assembles the application environment data file corresponding to the branch code according to the attribute parameter.
S220, loading configuration variable data corresponding to the branch code from the configuration file.
Meanwhile, the configuration information corresponding to the branch code pushed this time needs to be loaded from the configuration file, and is used as new configuration variable data pushed this time. Optionally, the configuration variable data comprises: a uniform resource access address of the branch code. Specifically, a URL address used for interacting with other services may be configured in the branch code engineering in advance, a yaml file named by the current functional branch is newly added under the config directory of the Docker image, for example, in the form of [ project _ name ] - [ feature _ name ]. yml, and the content is the request address name of other services related to the current development requirement, and the format is key: value. The configured URL address in the config directory is read during the pipeline running process of the Gitlab-runner, and the loaded configmap.
And S230, assembling the application environment data file according to the attribute parameters and the configuration variable data.
And when the Gitlab-runner runs, assembling the Docker mirror image application environment data file according to the attribute parameters and the configuration variable data of the branch codes.
In this embodiment, the information corresponding to the branch code is used to assemble the application environment data file, so that the content corresponding to the push branch code of this time can be deployed and iterated in a separate environment.
On the basis of the method for acquiring the application environment data file in the micro-service deployment provided in fig. 3, the present invention also provides a possible implementation manner of the method for acquiring the application environment data file in the micro-service deployment. Fig. 4 is a schematic flowchart of another method for acquiring an application environment data file in a microservice deployment according to the present invention. As shown in fig. 4, in the step S210, identifying the attribute parameter corresponding to the branch code from the branch code includes:
s212, identifying the function name and the application version corresponding to the branch code from the branch code.
The attribute parameters include: function name and application version.
Specifically, to locate a specific application, the branch code may be identified from the branch code to push the corresponding function name and the iterated version data this time, and a new name of the Docker image may be composed.
In S220, loading the configuration variable data corresponding to the branch code from the configuration file includes:
s222, loading configuration variable data from the configuration file according to the function name.
And loading corresponding engineering variable data from the configuration file according to the function name of the iteration in the branch code attribute parameters.
Therefore, in this embodiment, the function name and the application version of this push iteration are read through the branch code, and corresponding data is loaded based on this, that is, in the deployment operation of this embodiment, other data that does not relate to this iteration is not affected, and only the content corresponding to the branch code is changed.
On the basis of the method for acquiring the application environment data file in the microservice deployment provided in the above fig. 3, in the above S230, assembling the application environment data file according to the attribute parameter and the configuration variable data includes:
and S232, assembling the service rule file and the instance access file corresponding to the branch code according to the attribute parameters and the configuration variable data.
The application environment data file includes: the system comprises a service rule file and an instance access file, wherein the service rule file is used for defining rules for creating or updating micro services corresponding to branch codes, and the instance access file is used for defining access instances and instance access paths of the micro services corresponding to the branch codes.
After the configuration variable data is loaded, a service rule file and an instance access file corresponding to the branch code can be assembled in the Docker mirror image according to the attribute parameters and the configuration variable data corresponding to the branch code. Yaml file, which may define rules for creating or updating the microservice corresponding to the branch code; it is also necessary to assemble a service.yaml file that defines access instances and instance access paths of the micro-service corresponding to the branch code, such as a single stable IP address and a corresponding DNS name carrier, but the service.yaml can only provide four-layer load balancing capability. When more layers of agents are needed for forwarding, in an optional manner of this embodiment, the ingress.yaml file may be assembled after the service.yaml file is assembled, where the file mainly defines a manner and a path for accessing the application cluster from the outside, and exposes the internal service to the outside, and the ingress.yaml file provides seven layers of load balancing capability, which brings better flexibility, more effectively utilizes resources, and accelerates use of resources, although performance consumption is high.
Optionally, after the assembly of the file is completed, a kubecect instruction may be sent to the container server 30, and when the Rancher-server of the container server 30 receives the instruction, the micro-service corresponding to the branch code may be updated according to the information of the file.
In this embodiment, a service rule file and an instance access file corresponding to a branch code are assembled in a code server, and data corresponding to the branch code is converted into a yaml file format required for deploying a Kubernetes object, so that the environment of a container server is configured in advance, configuration and delivery are completed according to a container deployment instruction, a container server receives a command sent by a front-end user, and a container in a cluster and related resources required for container operation are scheduled according to the command.
On the basis of the method for acquiring the application environment data file in the microservice deployment provided in fig. 3, the method further includes:
and S240, assembling the load balancing file corresponding to the preset application according to the attribute parameters.
The container deployment instructions further comprise: load balancing files; the load balancing file is used for enabling the container server to regenerate an access balancer of the preset application so as to perform load balancing on the received access request aiming at the preset application.
In one possible implementation, the code server 20 may further assemble a load balancing file of the preset application according to the corresponding attribute parameters of the branch code, for example, automatically generate a Haproxy external load balancer configuration file.
In the embodiment, the container server can better complete the work tasks in parallel by assembling the load balancing file, and the whole service cannot be influenced when a single node is processed.
On the basis of any one of the above embodiments, the present invention further includes:
and S140, returning the pushing result of the branch code to the terminal equipment.
After the iterative update is finished, the code server 20 returns the result of the iterative update according to the branch code pushed by the terminal device 10 to the terminal device, so that the terminal device can reply according to the push result, where the result may include the code data updated this time. In a possible implementation manner, after the deployment of the micro service is finished, the code server 20 deletes the data file generated by the branch code.
Fig. 5 is a schematic diagram of a micro-service deployment device provided in the present invention, and as shown in fig. 5, the micro-service deployment device includes:
the receiving module 1000 is configured to receive a branch code of a preset application pushed by a terminal device;
the obtaining module 2000 is configured to obtain a configuration file of a preset application and an application environment data file corresponding to a branch code in a process of executing an integration task of the branch code;
a processing module 3000, configured to send a container deployment instruction to a container server, where the container deployment instruction includes: the container deployment instruction is used for enabling the container server to redeploy the microservices of the preset application according to the configuration file, and the microservices corresponding to the branch codes are updated according to the application environment data file.
Optionally, the obtaining module 2000 is further configured to specifically identify an attribute parameter corresponding to the branch code from the branch code; loading configuration variable data corresponding to the branch codes from the configuration file; and assembling the application environment data file according to the attribute parameters and the configuration variable data.
Optionally, the obtaining module 2000 is specifically further configured to identify an attribute parameter corresponding to the branch code from the branch code, and includes: identifying a function name and an application version corresponding to the branch code from the branch code; the attribute parameters include: a function name and an application version; loading configuration variable data corresponding to the branch code from the configuration file, including: and loading configuration variable data from the configuration file according to the function name.
Optionally, the obtaining module 2000 is further configured to assemble a service rule file and an instance access file corresponding to the branch code according to the attribute parameter and the configuration variable data; the application environment data file includes: the system comprises a service rule file and an instance access file, wherein the service rule file is used for defining rules for creating or updating micro services corresponding to branch codes, and the instance access file is used for defining access instances and instance access paths of the micro services corresponding to the branch codes.
Optionally, the obtaining module 2000 is further configured to assemble a load balancing file corresponding to the preset application according to the attribute parameters; the container deployment instructions further comprise: load balancing files; the load balancing file is used for enabling the container server to regenerate an access balancer of the preset application so as to perform load balancing on the received access request aiming at the preset application.
Optionally, the obtaining module 2000 is specifically further configured to configure the variable data, and includes: a uniform resource access address of the branch code.
Optionally, the micro-service deployment apparatus further includes a pushing module, where the pushing module is configured to return a pushing result of the branch code to the terminal device.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 6 is a schematic diagram of a code server provided in the present invention. As shown in fig. 6, the code server 20 includes: a processor 21, a memory 22 and a bus 23, wherein the processor 21 and the memory 22 are connected via the bus 23, the memory 22 stores program instructions executable by the processor 21, and when the code server 20 runs, the processor 21 executes the program instructions to execute the above-mentioned method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the invention also provides a program product, for example a computer-readable storage medium, comprising a program which, when being executed by a processor, is adapted to carry out the above-mentioned method embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (in english: processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A method of micro-service deployment, the method comprising:
receiving a branch code of a preset application pushed by a terminal device;
acquiring a configuration file of the preset application and an application environment data file corresponding to the branch code in the process of executing the integrated task of the branch code;
sending container deployment instructions to a container server, the container deployment instructions comprising: the configuration file and the application environment data file, and the container deployment instruction is used for enabling the container server to redeploy the micro service of the preset application according to the configuration file, and updating the micro service corresponding to the branch code according to the application environment data file.
2. The method of claim 1, wherein obtaining the application environment data file corresponding to the branch code comprises:
identifying attribute parameters corresponding to the branch codes from the branch codes;
loading configuration variable data corresponding to the branch code from the configuration file;
and assembling the application environment data file according to the attribute parameters and the configuration variable data.
3. The method of claim 2, wherein the identifying the attribute parameters corresponding to the branch code from the branch code comprises:
identifying a function name and an application version corresponding to the branch code from the branch code; the attribute parameters include: the function name and the application version;
the loading of the configuration variable data corresponding to the branch code from the configuration file includes:
and loading the configuration variable data from the configuration file according to the function name.
4. The method of claim 2, wherein said assembling said application environment data file based on said attribute parameters and said configuration variable data comprises:
assembling a service rule file and an instance access file corresponding to the branch code according to the attribute parameters and the configuration variable data;
the application environment data file includes: the service rule file is used for defining rules for creating or updating the micro-service corresponding to the branch code, and the instance access file is used for defining an access instance and an instance access path of the micro-service corresponding to the branch code.
5. The method of claim 2, further comprising:
assembling a load balancing file corresponding to the preset application according to the attribute parameters;
the container deployment instructions further comprise: the load balancing file; the load balancing file is used for enabling the container server to regenerate an access balancer of the preset application so as to perform load balancing on the received access request aiming at the preset application.
6. The method of claim 2, wherein the configuration variable data comprises: a uniform resource access address of the branch code.
7. The method according to any one of claims 1-6, further comprising:
and returning the pushing result of the branch code to the terminal equipment.
8. A microservice deployment apparatus, the apparatus comprising:
the receiving module is used for receiving a branch code of a preset application pushed by the terminal equipment;
the acquisition module is used for acquiring a configuration file of the preset application and an application environment data file corresponding to the branch code in the process of executing the integrated task of the branch code;
a processing module, configured to send a container deployment instruction to a container server, where the container deployment instruction includes: the configuration file and the application environment data file, and the container deployment instruction is used for enabling the container server to redeploy the micro service of the preset application according to the configuration file, and updating the micro service corresponding to the branch code according to the application environment data file.
9. A code server, wherein the code server comprises: a processor, a memory and a bus, the processor and the memory being connected by the bus, the memory storing program instructions executable by the processor, the processor executing the program instructions to perform the steps of the micro-service deployment method as claimed in any one of claims 1 to 7 when the code server is running.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method of microservice deployment according to any one of claims 1 to 7.
CN202210125462.0A 2022-02-10 2022-02-10 Micro-service deployment method, device, code server and storage medium Pending CN114461249A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210125462.0A CN114461249A (en) 2022-02-10 2022-02-10 Micro-service deployment method, device, code server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210125462.0A CN114461249A (en) 2022-02-10 2022-02-10 Micro-service deployment method, device, code server and storage medium

Publications (1)

Publication Number Publication Date
CN114461249A true CN114461249A (en) 2022-05-10

Family

ID=81413390

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210125462.0A Pending CN114461249A (en) 2022-02-10 2022-02-10 Micro-service deployment method, device, code server and storage medium

Country Status (1)

Country Link
CN (1) CN114461249A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11792077B1 (en) * 2022-06-23 2023-10-17 Kong Inc. Configuration hash comparison

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11792077B1 (en) * 2022-06-23 2023-10-17 Kong Inc. Configuration hash comparison

Similar Documents

Publication Publication Date Title
CN107515776B (en) Method for upgrading service continuously, node to be upgraded and readable storage medium
US10452372B2 (en) Method and deployment module for managing a container to be deployed on a software platform
CN112416524A (en) Implementation method and device of cross-platform CI/CD (compact disc/compact disc) based on docker and kubernets offline
CN106371889B (en) Method and device for realizing high-performance cluster system of scheduling mirror image
KR20200004835A (en) Containerized deployment of microservices based on monolithic legacy applications
US20130297795A1 (en) Owner command execution in a multi-tenant cloud hosting environment
CN111897541B (en) Software interaction platform and method for automatically deploying resources in cloud environment
CN104750528A (en) Management method and device for components in Android program
CN111124286A (en) Libcloud-based multi-cloud management implementation method
CN112882738A (en) Configuration information updating method and device under micro-service architecture and electronic equipment
CN113190282A (en) Android operating environment construction method and device
CN115328529B (en) Application management method and related equipment
CN114461249A (en) Micro-service deployment method, device, code server and storage medium
CN112579049A (en) Customized software productization management method and device based on cloud platform
CN111522623B (en) Modularized software multi-process running system
Tang et al. Application centric lifecycle framework in cloud
CN115037757B (en) Multi-cluster service management system
US11755297B2 (en) Compiling monoglot function compositions into a single entity
CN116382713A (en) Method, system, device and storage medium for constructing application mirror image
CN115016862A (en) Kubernetes cluster-based software starting method, device, server and storage medium
CN110837394B (en) High-availability configuration version warehouse configuration method, terminal and readable medium
CN114356520A (en) Running method, device, equipment, storage medium and program product of micro application
Farhat et al. Safe Dynamic Reconfiguration of Concurrent Component-based Applications
CN112764825A (en) Service integration system, corresponding device and storage medium
US8706796B2 (en) Managing a cluster of computers

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