CN116107688A - Method, device, equipment and medium for deploying application - Google Patents

Method, device, equipment and medium for deploying application Download PDF

Info

Publication number
CN116107688A
CN116107688A CN202111321924.8A CN202111321924A CN116107688A CN 116107688 A CN116107688 A CN 116107688A CN 202111321924 A CN202111321924 A CN 202111321924A CN 116107688 A CN116107688 A CN 116107688A
Authority
CN
China
Prior art keywords
environment
configuration information
application
target
image file
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
CN202111321924.8A
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.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding 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 Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202111321924.8A priority Critical patent/CN116107688A/en
Publication of CN116107688A publication Critical patent/CN116107688A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the invention relates to a method, a device, equipment and a medium for deploying an application, wherein the method for deploying the application comprises the following steps: receiving a deployment instruction for deploying an application in a target environment, acquiring basic configuration information of the application, and constructing an application package according to the basic configuration information of the application, wherein the basic configuration information comprises default environment configuration information; generating an image file of the application package through an image making tool; acquiring environment configuration information of the target environment, and replacing default environment configuration information in the mirror image file with environment configuration information of the target environment; and starting the image file in a container to finish the deployment of the application.

Description

Method, device, equipment and medium for deploying application
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for deploying an application.
Background
With development of cloud computing technology, a cloud computing service PaaS (Platform as a Service, platform, i.e. service) adopts K8S (Kubernetes) as a management platform and a management framework of cloud computing resources, where the K8S can be used as a container arranging tool to arrange, manage and schedule a container engine and a container, and can also be used as an application management tool to create, deploy and the like. When an application running in a certain environment is deployed based on K8S, an application package containing such an environment configuration is generally constructed, and then an image file is made and deployed to a container to run the application.
In the process of realizing the inventive concept, the inventor finds that at least the following technical problems exist in the related art: when the application needs to run in another different environment, an application package containing another environment configuration is to be reconstructed, made into another image file and deployed, the application can only be run in a single environment after being deployed once, the deployment requirements of different environments can not be supported, the different environments can not be deployed, and the applicable environments can not be flexibly supported according to the requirements before the application is run.
Disclosure of Invention
In a first aspect, an embodiment of the present invention provides a method for deploying an application, where the method includes: receiving a deployment instruction for deploying the application in a target environment, acquiring basic configuration information of the application, and constructing an application package according to the basic configuration information of the application, wherein the basic configuration information comprises default environment configuration information; generating an image file of the application package through an image making tool; acquiring the environment configuration information of the target environment, and replacing the default environment configuration information in the mirror image file with the environment configuration information of the target environment; and starting the image file in a container to finish the deployment of the application.
According to an embodiment of the present invention, the basic configuration information includes environment configuration information corresponding to a plurality of different environments, and the environment configuration information corresponding to one of the plurality of different environments is selected as the default environment configuration information.
According to an embodiment of the present invention, the obtaining the environment configuration information of the target environment, replacing the default environment configuration information in the image file with the environment configuration information of the target environment, includes: and if one environment in the plurality of different environments is determined to be the target environment, switching the default environment configuration information into the environment configuration information of the target environment through an environment switch file.
According to an embodiment of the present invention, the obtaining the environment configuration information of the target environment, replacing the default environment configuration information in the image file with the environment configuration information of the target environment, includes: and if the target environment does not belong to any one of the multiple different environments, acquiring environment configuration information of the target environment configured by a user, and replacing default environment configuration information in the image file with environment configuration information of the target environment.
According to an embodiment of the present invention, the plurality of different environments includes the target environment, and the method further includes: and if the mirror image files corresponding to the environments are respectively generated through a mirror image making tool, starting the mirror image files corresponding to the target environments in a container so as to complete the deployment of the application.
According to an embodiment of the present invention, the plurality of different environments includes the target environment, and the method further includes: if the application packages corresponding to the environments are respectively constructed according to the environment configuration information of the different environments, generating image files corresponding to the application packages through an image making tool, and starting the image files corresponding to the target environments in a plurality of containers so as to complete the deployment of the applications.
According to an embodiment of the present invention, the above-described environment includes at least one of the following environments: development environment, test environment, joint debugging environment and online environment.
In a second aspect, an embodiment of the present invention provides an apparatus for deploying an application, the apparatus comprising: the application construction module is used for receiving a deployment instruction for deploying the application in a target environment, acquiring basic configuration information of the application, and constructing an application package according to the basic configuration information of the application, wherein the basic configuration information comprises default environment configuration information; the mirror image making module is used for generating a mirror image file of the application package through a mirror image making tool; the environment replacement module is used for acquiring the environment configuration information of the target environment and replacing the default environment configuration information in the image file with the environment configuration information of the target environment; and the container starting module is used for starting the image file in the container so as to complete the deployment of the application.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; a memory for storing a computer program; and a processor for implementing the method as described above when executing the program stored on the memory.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method as described above.
Compared with the related art, the technical scheme provided by the embodiment of the invention has at least part or all of the following advantages:
by replacing the default environment configuration information in the image file with the environment configuration information of the target environment before the image file is started in the container, the technical problem that different environments cannot be supported is solved, and the applicable environments can be flexibly supported according to requirements before the application is run. In addition, the environment configuration information can be switched in various environment configuration information by controlling the environment switch file, and the environment to be deployed is selected, so that before the mirror image is started in the container, the application is prepared for being deployed in various environments, the supported environment can be flexibly switched according to the requirement, the operation of switching the environment configuration information is further simplified by using the environment switch file, the complexity is reduced, and the efficiency is further improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 schematically illustrates a system architecture of a method and apparatus for deploying an application, suitable for use in embodiments of the invention;
FIG. 2 schematically illustrates a flow chart of a method of deploying an application according to an embodiment of the invention;
FIG. 3 schematically illustrates a flow chart of a method of deploying an application according to another embodiment of the invention;
FIG. 4 schematically illustrates a flow chart of a method of deploying an application according to yet another embodiment of the invention;
FIG. 5 schematically illustrates a block diagram of an apparatus for deploying an application, according to an embodiment of the invention;
fig. 6 schematically shows a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
With the development of internet technology, more and more enterprises adopt Paas-based platforms (Platform as a Service, platforms, i.e. services) to provide computing platforms and solution services, based on which users do not need to install various platforms locally, users can create and develop application programs and deploy the application programs on related infrastructures by using Paas through programming languages, databases, services and development tools supported by providers, and using a container orchestration tool as Kubernetes (K8S for short) and a container engine as a Docker for example, and using K8S as a management system for managing, managing and scheduling various aspects of Docker and containers, the Paas-based platforms can deploy applications based on K8S.
In the related art, when an application running in a certain environment is deployed based on K8S, an application package containing such an environment configuration is generally constructed, and then an image file is made and deployed to a container to run the application. When the application needs to run in another different environment, an application package containing another environment configuration is to be reconstructed, made into another image file and deployed, the application can only be run in a single environment after being deployed once, and application deployment applicable to multiple different environments cannot be flexibly supported according to application deployment requirements of multiple different environments.
In software applications, there are typically development environments, testing environments, joint debugging environments, online environments, etc., where the network environment and the configuration of use of the machine in which the application is located are different. The database is used as, for example, the database account number and password of the development environment, the account number and password of the test environment and the account number and password of the online environment are all different. In addition, the users facing different environments will also be different, the users of the development environment are mainly developers, the users of the testing environment are mainly testers, the users of the online environment are users using the application, for example, for shopping class APP, the consumers using the shopping class APP may be users of the online environment of the application.
In view of this, an embodiment of the present invention provides an application deployment method, where the method includes: receiving a deployment instruction for deploying an application in a target environment, acquiring basic configuration information of the application, and constructing an application package according to the basic configuration information of the application, wherein the basic configuration information comprises default environment configuration information; generating an image file of the application package through an image making tool; acquiring environment configuration information of the target environment, and replacing default environment configuration information in the mirror image file with environment configuration information of the target environment; and starting the image file in a container to finish the deployment of the application.
According to the embodiment of the invention, before the image file is started in the container, the default environment configuration information in the image file is replaced with the environment configuration information of the target environment, so that the technical problem that different environments cannot be deployed is solved, and the applicable environments can be flexibly supported according to the requirements before the application is run. In addition, the embodiment of the invention realizes the switching of various environment configuration information through the environment switch file, so that before the mirror image is started in the container, the environment configuration information can be flexibly switched into the environment configuration information of the supported environment according to the requirement, the operation of switching the environment configuration information is simplified, the complexity is reduced, and the efficiency is further improved.
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 schematically illustrates a system architecture of a method and apparatus for deploying an application, suitable for use in an embodiment of the invention.
Referring to fig. 1, a system architecture 100 of a method and an apparatus for deploying an application according to an embodiment of the present invention includes: terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. The transmitted message may be query information and the received message may be a query result. Various types of communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices that display screens and support web browsing, such as electronic devices including, but not limited to, smartphones, tablets, notebooks, desktop computers, smartwatches, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing service support for data processing of web pages accessed by users using the terminal devices 101, 102, 103. The background management server may analyze and process the received data such as the access request, and feed back the processing result (e.g., a web page, information, or data acquired or generated according to the user request) to the terminal device.
It should be noted that, the method for deploying an application provided in the embodiment of the present invention may be generally executed by the server 105 or a terminal device having a certain computing capability. Accordingly, the device for deploying an application provided in the embodiment of the present invention may be generally set in the server 105 or the terminal device with a certain operation capability. The method of deploying an application provided by the embodiments of the present invention may also be performed by a server or a cluster of servers that are different from the server 105 and that are capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the apparatus for deploying an application provided by the embodiment of the present invention may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
A first exemplary embodiment of the present invention provides a method of deploying an application.
FIG. 2 schematically illustrates a flow chart of a method of deploying an application according to an embodiment of the invention.
Referring to fig. 2, the method for deploying an application provided by the embodiment of the present invention includes the following operations: s202, S204, S206, and S208. The operations S202 to S208 described above may be performed by a server or a terminal device having a certain arithmetic capability.
In operation S202, a deployment instruction for deploying an application in a target environment is received, basic configuration information of the application is obtained, and an application package is constructed according to the basic configuration information of the application, wherein the basic configuration information includes default environment configuration information.
Specifically, the deployment instruction for deploying the application in the target environment triggers the application to execute deployment, where the deployment instruction includes an environment where the application is to be deployed, and the environment may include at least one of the following environments: development environment, test environment, joint debugging environment and online environment. After receiving the deployment instruction, that is, after triggering the execution of deployment, basic configuration information of the application is acquired, where the basic configuration information may be pre-stored in various storage devices such as a server with a storage function. The basic configuration information may include application-related information such as application type, code base address, code branches, compilation tools, compilation parameters, packet-extraction path information, etc., and may also include basic information (e.g., basic images of specific configuration information), environment configuration information, etc., required for other application deployments.
According to the basic configuration information, an application package can be constructed, and an application construction tool, such as jenkins, can be used for constructing the application package, wherein jenkins is an open-source continuous integration tool for providing friendly operation interfaces and can be used for realizing software construction automation. For example, according to the basic configuration information, the source code of the code branch may be acquired first, the code may be pulled, and then compiled by a compiling tool (e.g., maven) to form an application package.
In operation S204, an image file of the application package is generated by an image creation tool, including but not limited to, an image creation path, a compiled package image creation, a standard image creation, and the like.
Specifically, after the application package is constructed in the above-mentioned operation S202, the application package and the basic configuration information are manufactured into a dock mirror image, for example, through a dock. The image file can be obtained through various ways, for example, the image of the compiling package is manufactured, the application package is built locally, and then the image file is generated, namely the compiling package image; standard mirror image creation, in which an application package is built by a system including the device for deploying an application according to the embodiment of the present invention, and then a mirror image file, that is, a standard mirror image, is generated, and in which, for example, an application package is built by an application package creation platform (creation tool), and then a mirror image file is generated.
In operation S206, the environment configuration information of the target environment is obtained, and the default environment configuration information in the image file is replaced with the environment configuration information of the target environment.
Specifically, after the image file is generated in the above operation S204, the environment configuration information included in the image file is default environment configuration information, and the default environment configuration information is replaced by the environment configuration information of the target environment by acquiring the environment configuration information of the target environment, so that the environment configuration information in the image file is the environment configuration information of the target environment. The default environment is a development environment, the target environment is a test environment, and the image file includes environment configuration information of the development environment, and in operation S206, the environment configuration information of the development environment is replaced with the environment configuration information of the test environment in K8S, so that the environment configuration information in the image file is the environment configuration information of the test environment, and preparation is made for deploying the application in the test environment, based on operations S202 to S204.
In operation S208, the image file is started in the container to complete the deployment of the application.
Specifically, based on the operations S202 to S206, the environment configuration information in the image file is the environment configuration information of the target environment, and the image file is started in the container, so as to complete the deployment of the application in the target environment. Taking the target environment as a test environment as an example, taking environment configuration information in the image file as environment configuration information of the test environment, and starting the image file in a container to finish deployment of the application in the test environment.
Based on the operations S202 to S208, the embodiment of the present invention solves the technical problem that different environments cannot be supported by the deployment, by replacing the default environment configuration information in the image file with the environment configuration information of the target environment before the image file is started in the container, so that the applicable environment can be flexibly supported as required before the application is run.
A second exemplary embodiment of the present invention provides a method of deploying an application.
Fig. 3 schematically shows a flow chart of a method of deploying an application according to another embodiment of the invention.
Referring to fig. 3, the method for deploying an application provided by the embodiment of the present invention further includes the following operation S301, where operation S206 may also be implemented as S206a.
In operation S301, the basic configuration information includes environment configuration information corresponding to a plurality of different environments, and the environment configuration information corresponding to one of the plurality of different environments is selected as the default environment configuration information.
In operation S206a, if it is determined that one of the multiple different environments is the target environment, the default environment configuration information is switched to the environment configuration information of the target environment through an environment switch file.
Specifically, the basic configuration information includes environment configuration information corresponding to a plurality of different environments, where the plurality of environments may include at least one of the following environments: development environment, test environment, joint debugging environment and online environment. Based on the above operations S202, S301, S204, the application package constructed according to the basic configuration information includes environment configuration information corresponding to a plurality of different environments, after the image file is generated, the image file includes environment configuration information corresponding to a plurality of different environments, the default environment is one of the plurality of different environments, and based on operation S206a, if one of the plurality of different environments is a target environment, that is, the image file already includes environment configuration information of the target environment, by using an environment switch file capable of implementing switching of the environment configuration information, the default environment configuration information is switched to the environment configuration information of the target environment, so as to prepare for deployment of the application in the target environment.
Taking a default environment as a development environment and a target environment as a test environment as an example, based on the operation, if one of a plurality of different environments is the test environment, the image file at least comprises a plurality of different environments such as the development environment and the test environment, the operation of switching the configuration information of the environment is executed through the environment switch file, and the configuration information of the default development environment is switched to the configuration information of the test environment, so that the deployment under the development environment is supported to the deployment under the test environment.
Based on the operation, the deployment supporting different environments of the user is realized, the preparation for deploying the application in various environments is further realized before the mirror image is started in the container, the defect that the operation can only be supported in a single environment in the related technology is overcome, the flexibility is greatly improved, and the application deployment efficiency is improved.
In this embodiment, different environment configuration information is switched by using an environment switch file, and the environment switch file can modify, configure, manage and the like a plurality of specific configuration information, where the plurality of specific configuration information together determine the configuration information of a certain environment, so that the environment configuration information can be switched by configuring the switch file, thereby achieving the effect of switching the applicable environments. For example, the specific configuration information corresponding to the test environment is four specific configuration files, if the environment configuration information of the test environment needs to be switched to the environment configuration information of the online environment, the configuration of the four files is needed, and by adopting the environment switch file, the switching of multiple environment configuration information can be realized by changing, for example, the value of one field in the switch file, and different values correspond to different configurations of the four configuration files, namely, different values of the field correspond to different environment configuration information.
In an exemplary embodiment, when the method for deploying an application according to the embodiment of the present invention is implemented, multiple environments for managing the application may be implemented through an environment management module, for example, the environment management module may include the above-mentioned environment switch file, the environment management module may implement environment switching and management through the environment switch file, and the environment management module may also maintain multiple environment configuration information, for example, when specific configuration information of multiple environments needs to be modified, updated, and other maintenance operations, maintenance of various environment configuration information may be implemented through the environment management module. Before the image file is started in the container, the container application services in different environments are replaced and switched according to the environment configuration information in the environment management module. For example, when application services covering a plurality of different environments in a plurality of containers are deployed simultaneously, before an image file is started in the container, environment configuration information of a target environment can be obtained from an environment management module, and environment configuration information is switched through an environment switch file, so that preparation is made for deploying an application in the target environment.
Based on the operation, the method and the device realize that the environment to be deployed is selected by controlling the environment switch file to switch among various environment configuration information, prepare for deploying the application in various environments before the mirror image is started in the container, flexibly switch the supported environments according to the requirements, further simplify the operation of switching the environment configuration information by using the environment switch file, reduce the complexity and further improve the efficiency.
A third exemplary embodiment of the present invention provides a method of deploying an application.
Fig. 4 schematically shows a flow chart of a method of deploying an application according to a further embodiment of the invention.
Referring to fig. 4, the method for deploying an application provided by the embodiment of the present invention further includes the following operation S301, where operation S206 may also be implemented as S206b.
In operation S301, the basic configuration information includes environment configuration information corresponding to a plurality of different environments, and the environment configuration information corresponding to one of the plurality of different environments is selected as the default environment configuration information.
In operation S206b, acquiring the environment configuration information of the target environment, replacing the default environment configuration information in the image file with the environment configuration information of the target environment, including: and if the target environment does not belong to any one of the multiple different environments, acquiring environment configuration information of the target environment configured by a user, and replacing default environment configuration information in the image file with environment configuration information of the target environment.
Specifically, the basic configuration information includes environment configuration information corresponding to a plurality of different environments, where the plurality of environments may include at least one of the following environments: development environment, test environment, joint debugging environment and online environment. Based on the operations S202, S301, and S204, the application package constructed according to the basic configuration information includes environment configuration information corresponding to a plurality of different environments, after the image file is generated, the image file includes environment configuration information corresponding to a plurality of different environments, and the default environment is one of the plurality of different environments, and based on the operation S206b, if the target environment does not belong to any one of the plurality of different environments, the image file does not include environment configuration information of the target environment, and it is necessary to obtain environment configuration information of the target environment configured by a user, and replace the default environment configuration information in the image file with environment configuration information of the target environment, so as to prepare for deploying the application in the target environment.
Taking the example that the basic configuration information comprises a development environment, an online environment, a target environment as a test environment and a default environment as the development environment, based on the operation, the test environment does not belong to any one of the plurality of different environments, the image file does not contain the environment configuration information of the test environment, and the configuration information of the default development environment is replaced by the configuration information of the test environment by acquiring the environment configuration information of the test environment configured by a user, so that the deployment under the development environment is supported to be switched to the deployment under the test environment.
Based on the above operation, the deployment supporting different environments of the user is realized, even when the target environment information is not included in the multiple environment configuration information in the basic configuration information, that is, the application package and the mirror image file do not include the target environment information, the application can be deployed in the target environment by replacing the default environment configuration information in the mirror image file with the environment configuration information of the target environment before the mirror image is started in the container, and meanwhile, compared with the application in the related art, when the application needs to be operated in another different environment, the application package including the other environment configuration is to be reconstructed, the application package or the mirror image is not required to be reconstructed for the different environments, so that the computing resource is effectively saved, the flexibility is greatly improved, and the application deployment efficiency is improved.
A fourth exemplary embodiment of the present invention provides a method of deploying an application. The method further comprises the following operations: and if the image files corresponding to the environments are respectively generated by an image making tool, starting the image files corresponding to the target environments in a container so as to complete the deployment of the application.
Specifically, the basic configuration information includes environment configuration information corresponding to a plurality of different environments, where the plurality of different environments include the target environment, and the method for deploying an application provided in the embodiment of the present invention may further include, if image files corresponding to each environment are generated by an image creation tool, that is, after an application package is built according to the basic configuration information including the environment configuration information corresponding to the plurality of different environments, respectively generating image files corresponding to each environment, starting the image files corresponding to the target environment in a container, so as to complete deployment of the application.
For example, before generating the image file, the environment management module for managing and maintaining the plurality of environment configuration information can be used for respectively generating the image files corresponding to the different environments according to the environment configuration information in the environment management module, and for the case of simultaneously deploying the application services covering the plurality of different environments in the plurality of containers, the image files of the different environments can be respectively implemented in the containers to be used for running the applications of the different environments, thereby improving the efficiency.
A fifth exemplary embodiment of the present invention provides a method of deploying an application. The method further comprises the following operations: and if the plurality of different environments comprise the target environment, respectively constructing application packages corresponding to the environments according to the environment configuration information of the plurality of different environments, generating image files corresponding to the application packages through an image making tool, and starting the image files corresponding to the target environment in a plurality of containers so as to finish the deployment of the application.
Specifically, the basic configuration information includes environment configuration information corresponding to a plurality of different environments, where the plurality of different environments include the target environment, and the method for deploying an application provided in the embodiment of the present invention may further include, if an application package corresponding to each environment is respectively built according to the environment configuration information of the plurality of different environments, that is, an application package corresponding to each environment is respectively built according to the basic configuration information including the environment configuration information corresponding to the plurality of different environments, respectively generating image files corresponding to each environment, generating image files corresponding to each application package through an image creation tool, and starting the image files corresponding to the target environment in a plurality of containers, so as to complete deployment of the application.
For example, before generating the build application package, the environment management module for managing and maintaining the configuration information of multiple environments can be used for serving the container applications of different environments, the application packages corresponding to the environments are respectively generated according to the configuration information of the environments in the environment management module, the image files corresponding to the environments are respectively generated, and for the case of deploying the application services covering multiple different environments in the multiple containers at the same time, the image files of the different environments can be respectively realized in the containers to be used for running the applications of the different environments, so that the efficiency is improved.
A sixth exemplary embodiment of the present invention provides an apparatus for deploying an application.
Fig. 5 schematically shows a block diagram of an apparatus for deploying an application according to yet another embodiment of the invention.
Referring to fig. 5, an apparatus 500 for deploying an application according to an embodiment of the present invention includes an application construction module 501, a mirror creation module 502, an environment replacement module 503, and a container start module 504.
The application construction module 501 is configured to receive a deployment instruction for deploying an application in a target environment, obtain basic configuration information of the application, and construct an application package according to the basic configuration information of the application, where the basic configuration information includes default environment configuration information.
The image creation module 502 is configured to create an image file of the application package through an image creation tool.
The above-mentioned environment replacement module 503 is configured to obtain the environment configuration information of the target environment, and replace the default environment configuration information in the image file with the environment configuration information of the target environment.
The container starting module 504 is configured to start the image file in a container, so as to complete deployment of an application.
Any of the application build module 501, the mirror creation module 502, the environment replacement module 503, and the container startup module 504 described above may be combined in one module to be implemented, or any of the modules may be split into a plurality of modules. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. At least one of the application build module 501, the mirror creation module 502, the environment replacement module 503, and the container launch module 504 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-a-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or by hardware or firmware in any other reasonable manner of integrating or packaging the circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, at least one of the application build module 501, the mirror creation module 502, the environment replacement module 503, and the container start module 504 may be at least partially implemented as computer program modules that, when executed, perform the corresponding functions.
A fourth exemplary embodiment of the present invention provides an electronic device.
Fig. 6 schematically shows a block diagram of an electronic device according to an embodiment of the present invention.
Referring to fig. 6, an electronic device 600 provided by an embodiment of the present invention includes a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete communication with each other through the communication bus 604; a memory 603 for storing a computer program; the processor 601 is configured to implement the method for deploying an application as described above when executing a program stored on the memory.
The fifth exemplary embodiment of the present invention also provides a computer-readable storage medium. The computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements a method of deploying an application as described above.
The computer-readable storage medium may be embodied in the apparatus/means described in the above embodiments; or may exist alone without being assembled into the apparatus/device. The computer-readable storage medium carries one or more programs that, when executed, implement methods of deploying an application according to embodiments of the invention.
According to embodiments of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
Relational terms such as "first" and "second", and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of deploying an application, comprising:
receiving a deployment instruction for deploying an application in a target environment, acquiring basic configuration information of the application, and constructing an application package according to the basic configuration information of the application, wherein the basic configuration information comprises default environment configuration information;
generating an image file of the application package through an image making tool;
acquiring environment configuration information of the target environment, and replacing default environment configuration information in the mirror image file with environment configuration information of the target environment;
and starting the image file in a container to finish the deployment of the application.
2. The method according to claim 1, wherein the method further comprises:
the basic configuration information comprises environment configuration information corresponding to a plurality of different environments, and the environment configuration information corresponding to one environment in the plurality of different environments is selected as the default environment configuration information.
3. The method of claim 2, wherein obtaining the environment configuration information of the target environment, replacing the default environment configuration information in the image file with the environment configuration information of the target environment, comprises:
and if one environment in the plurality of different environments is determined to be the target environment, switching the default environment configuration information into the environment configuration information of the target environment through an environment switch file.
4. The method of claim 2, wherein obtaining the environment configuration information of the target environment, replacing the default environment configuration information in the image file with the environment configuration information of the target environment, comprises:
and if the target environment does not belong to any one of the multiple different environments, acquiring environment configuration information of the target environment configured by a user, and replacing default environment configuration information in the image file with environment configuration information of the target environment.
5. The method of claim 2, wherein the plurality of different environments includes the target environment, the method further comprising:
and if the mirror image files corresponding to the environments are respectively generated through the mirror image making tool, starting the mirror image files corresponding to the target environments in the container so as to complete the deployment of the application.
6. The method of claim 2, wherein the plurality of different environments includes the target environment, the method further comprising:
if the application packages corresponding to the environments are respectively constructed according to the environment configuration information of the different environments, generating image files corresponding to the application packages through an image making tool, and starting the image files corresponding to the target environments in a plurality of containers so as to complete deployment of the applications.
7. The method according to any one of claims 1 to 6, wherein the environment comprises at least one of: development environment, test environment, joint debugging environment and online environment.
8. An apparatus for deploying an application, comprising:
the application construction module is used for receiving a deployment instruction for deploying the application in a target environment, acquiring basic configuration information of the application, and constructing an application package according to the basic configuration information of the application, wherein the basic configuration information comprises default environment configuration information;
the mirror image making module is used for generating a mirror image file of the application package through a mirror image making tool;
the environment replacement module is used for acquiring the environment configuration information of the target environment and replacing the default environment configuration information in the image file with the environment configuration information of the target environment;
and the container starting module is used for starting the image file in the container so as to complete the deployment of the application.
9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method of any one of claims 1 to 7 when executing a program stored on a memory.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any of claims 1 to 7.
CN202111321924.8A 2021-11-09 2021-11-09 Method, device, equipment and medium for deploying application Pending CN116107688A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111321924.8A CN116107688A (en) 2021-11-09 2021-11-09 Method, device, equipment and medium for deploying application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111321924.8A CN116107688A (en) 2021-11-09 2021-11-09 Method, device, equipment and medium for deploying application

Publications (1)

Publication Number Publication Date
CN116107688A true CN116107688A (en) 2023-05-12

Family

ID=86253178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111321924.8A Pending CN116107688A (en) 2021-11-09 2021-11-09 Method, device, equipment and medium for deploying application

Country Status (1)

Country Link
CN (1) CN116107688A (en)

Similar Documents

Publication Publication Date Title
US11178207B2 (en) Software version control without affecting a deployed container
US10452372B2 (en) Method and deployment module for managing a container to be deployed on a software platform
US9338067B2 (en) Network resource deployment for cloud-based services
CN112416524A (en) Implementation method and device of cross-platform CI/CD (compact disc/compact disc) based on docker and kubernets offline
US20130297795A1 (en) Owner command execution in a multi-tenant cloud hosting environment
Benson et al. Survey of automated software deployment for computational and engineering research
US10305752B2 (en) Automatically orchestrating the compliance of cloud services to selected standards and policies
US11474842B2 (en) Integration application creator design
US20170048331A1 (en) Platform runtime abstraction
CN111399840B (en) Module development method and device
CN113302901B (en) Method and system for cloud application and service integration using pattern-based discovery
US9141363B2 (en) Application construction for execution on diverse computing infrastructures
CN112579049A (en) Customized software productization management method and device based on cloud platform
CN110083366B (en) Application running environment generation method and device, computing equipment and storage medium
Tang et al. Application centric lifecycle framework in cloud
CN116107688A (en) Method, device, equipment and medium for deploying application
CN115016862A (en) Kubernetes cluster-based software starting method, device, server and storage medium
Mastelić et al. Towards uniform management of multi-layered cloud services by applying model-driven development
Groenda et al. CACTOS Toolkit Version 2
Guo Introduction to cloud computing
Piedrafita Castañeda et al. Migration of a cloud-based microservice platform to a container solution
CN113986207A (en) Software architecture generating and calling method and device
CN117742880A (en) System and method for deploying containerized heterogeneous platform application based on pipeline
CN114706655A (en) Request processing method, computing device and computer storage medium
CN113407203A (en) Method and device for deploying application

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