CN114879977A - Application deployment method, device and storage medium - Google Patents
Application deployment method, device and storage medium Download PDFInfo
- Publication number
- CN114879977A CN114879977A CN202210457295.XA CN202210457295A CN114879977A CN 114879977 A CN114879977 A CN 114879977A CN 202210457295 A CN202210457295 A CN 202210457295A CN 114879977 A CN114879977 A CN 114879977A
- Authority
- CN
- China
- Prior art keywords
- deployment
- deployed
- application
- task
- machine
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
本发明实施例提供一种应用部署方法、装置及存储介质,该方法包括:确定待部署机器列表及待部署应用;根据待部署机器列表划分部署批次;其中,每个部署批次中至少包括一个待部署机器;生成待部署应用的部署任务,通过各个部署批次之间异步的方式,将部署任务并行发送给各个部署批次中的待部署机器,以供待部署机器根据部署任务进行待部署应用的部署。本发明实施例提供的应用部署方法、装置及存储介质,通过部署批次之间异步,同一部署批次内部并行的方式将部署任务发送给待部署机器,有效地提高了应用部署效率。
Embodiments of the present invention provide an application deployment method, device, and storage medium. The method includes: determining a list of machines to be deployed and applications to be deployed; dividing deployment batches according to the list of machines to be deployed; wherein, each deployment batch at least includes A to-be-deployed machine; generates deployment tasks for applications to be deployed, and sends the deployment tasks in parallel to the to-be-deployed machines in each deployment batch in an asynchronous manner, so that the to-be-deployed machines can wait according to the deployment tasks. Deploy the deployment of the application. The application deployment method, device and storage medium provided by the embodiments of the present invention effectively improve application deployment efficiency by sending deployment tasks to machines to be deployed in an asynchronous manner between deployment batches and within a deployment batch in parallel.
Description
技术领域technical field
本发明实施例涉及计算机技术领域,具体涉及一种应用部署方法、装置及存储介质。Embodiments of the present invention relate to the field of computer technologies, and in particular, to an application deployment method, device, and storage medium.
背景技术Background technique
由于业务特殊性,部分应用只能部署在windows服务器上,因此如何高效可靠的部署windows应用至关重要。然而互联网公司更多使用Linux系统作为服务器,在Windows部署上少有成熟易用的部署方案。Due to the particularity of the business, some applications can only be deployed on Windows servers, so how to deploy Windows applications efficiently and reliably is very important. However, Internet companies mostly use Linux systems as servers, and there are few mature and easy-to-use deployment solutions for Windows deployment.
现有的一种windows应用部署方式是基于Jenkins+Openssh进行应用部署,部署应用时Jenkins通过SSH远程连接到待部署机器。Jenkins是一个开源软件项目,是基于Java开发的一种持续集成工具,用于监控持续重复的工作,旨在提供一个开放易用的软件平台,使软件项目可以进行持续集成。Jenkins功能包括:持续的软件版本发布/测试项目,监控外部调用执行的工作。OpenSSH是SSH(Secure SHell)协议的免费开源实现。SSH协议族可以用来进行远程控制,或在计算机之间传送文件。An existing Windows application deployment method is based on Jenkins+Openssh for application deployment. When deploying an application, Jenkins is remotely connected to the machine to be deployed through SSH. Jenkins is an open source software project. It is a continuous integration tool developed based on Java. It is used to monitor continuous and repetitive work. It aims to provide an open and easy-to-use software platform that enables continuous integration of software projects. Jenkins features include: continuous software release/testing projects, monitoring work performed by external calls. OpenSSH is a free and open source implementation of the SSH (Secure SHell) protocol. The SSH protocol suite can be used for remote control, or to transfer files between computers.
现有Jenkins+Openssh的windows应用部署方式,需要Jenkins顺次与待部署机器建立连接,在多个待部署机器上批量部署应用时为串行操作,部署效率低下。The existing Jenkins+Openssh windows application deployment method requires Jenkins to establish connections with the machines to be deployed in sequence, and batch deployment of applications on multiple machines to be deployed is a serial operation, resulting in low deployment efficiency.
发明内容SUMMARY OF THE INVENTION
针对现有技术存在的缺陷,本发明实施例提供一种应用部署方法、装置及存储介质。In view of the defects existing in the prior art, the embodiments of the present invention provide an application deployment method, an apparatus, and a storage medium.
本发明实施例提供一种应用部署方法,包括:确定待部署机器列表及待部署应用;根据所述待部署机器列表划分部署批次;其中,每个所述部署批次中至少包括一个所述待部署机器;生成所述待部署应用的部署任务,通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器,以供所述待部署机器根据所述部署任务进行所述待部署应用的部署。An embodiment of the present invention provides an application deployment method, including: determining a list of machines to be deployed and applications to be deployed; dividing deployment batches according to the list of machines to be deployed; wherein, each deployment batch includes at least one of the The machine to be deployed; the deployment task of the application to be deployed is generated, and the deployment task is sent in parallel to the to-be-deployed machine in each of the deployment batches in an asynchronous manner among the deployment batches, so as to for the to-be-deployed machine to deploy the to-be-deployed application according to the deployment task.
根据本发明实施例提供的一种应用部署方法,所述通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器,包括:通过各个所述部署批次之间异步的方式,将所述部署任务并行写入到各个所述部署批次中的所述待部署机器对应的任务队列。According to an application deployment method provided by an embodiment of the present invention, the deployment tasks are sent in parallel to the machines to be deployed in the deployment batches in an asynchronous manner between the deployment batches, The method includes: writing the deployment task to the task queue corresponding to the to-be-deployed machine in each of the deployment batches in parallel in an asynchronous manner among the deployment batches.
根据本发明实施例提供的一种应用部署方法,所述方法还包括:接收所述待部署机器发送的部署过程数据;其中,所述部署过程数据包括所述部署任务的任务状态。According to an application deployment method provided by an embodiment of the present invention, the method further includes: receiving deployment process data sent by the machine to be deployed; wherein the deployment process data includes a task state of the deployment task.
根据本发明实施例提供的一种应用部署方法,所述任务状态包括任务排队中、等待就绪、启动中、成功及失败中的至少一种,其中:所述待部署机器尚未消费所述部署任务,所述任务状态为任务排队中;所述待部署机器消费到所述部署任务,所述任务状态为等待就绪;所述待部署机器消费到所述部署任务且满足所述部署任务的部署条件,所述任务状态为启动中;其中,所述任务状态为启动中时,所述待部署机器执行所述根据所述部署任务进行所述待部署应用的部署的动作;所述根据所述部署任务进行所述待部署应用的部署的动作执行成功,所述任务状态为成功;所述根据所述部署任务进行所述待部署应用的部署的动作执行失败,所述任务状态为失败。According to an application deployment method provided by an embodiment of the present invention, the task status includes at least one of task queuing, waiting for ready, starting, successful, and failed, wherein: the deployment task has not been consumed by the to-be-deployed machine , the task status is task queuing; the to-be-deployed machine consumes the deployment task, and the task status is waiting for ready; the to-be-deployed machine consumes the deployment task and meets the deployment conditions of the deployment task , the task state is starting; wherein, when the task state is starting, the to-be-deployed machine executes the action of deploying the application to be deployed according to the deployment task; If the task of deploying the application to be deployed is successfully executed, the task status is successful; the action of deploying the application to be deployed according to the deployment task fails to be executed, and the task status is failed.
根据本发明实施例提供的一种应用部署方法,在所述通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器之后,所述方法还包括:生成与所述部署批次对应的批次ID及与所述部署批次中的所述待部署机器对应的任务ID;其中,所述批次ID与所述部署批次中包含的所述待部署机器对应;根据所述批次ID和/或所述任务ID查询所述部署过程数据。According to an application deployment method provided by an embodiment of the present invention, in the asynchronous manner between the deployment batches, the deployment task is sent to the machines to be deployed in the deployment batches in parallel Afterwards, the method further includes: generating a batch ID corresponding to the deployment batch and a task ID corresponding to the to-be-deployed machine in the deployment batch; wherein the batch ID and the deployment batch The to-be-deployed machines included in the batch correspond; the deployment process data is queried according to the batch ID and/or the task ID.
根据本发明实施例提供的一种应用部署方法,所述确定待部署机器列表包括:在web页面,响应于所述待部署应用选中,展示关联有所述待部署应用的机器列表;从所述关联有所述待部署应用的机器列表中进行所述待部署机器的选取,根据选取结果确定所述待部署机器列表。According to an application deployment method provided by an embodiment of the present invention, the determining a list of machines to be deployed includes: on a web page, in response to the selection of the application to be deployed, displaying a list of machines associated with the application to be deployed; The to-be-deployed machine is selected from the machine list associated with the to-be-deployed application, and the to-be-deployed machine list is determined according to the selection result.
根据本发明实施例提供的一种应用部署方法,所述方法还包括:响应于部署环境为测试环境,获取所述待部署应用的代码,对所述代码进行编译打包生成产物,将所述产物上传至预设数据库;响应于所述部署环境为线上环境,确定所述预设数据库中所述待部署应用已经测试通过的所述待部署应用的产物;其中,所述产物包括版本信息。According to an application deployment method provided by an embodiment of the present invention, the method further includes: in response to the deployment environment being a test environment, acquiring the code of the application to be deployed, compiling and packaging the code to generate a product, and compiling the product uploading to a preset database; in response to the deployment environment being an online environment, determining a product of the to-be-deployed application in the preset database that has passed the test of the to-be-deployed application; wherein the product includes version information.
根据本发明实施例提供的一种应用部署方法,所述根据所述部署任务进行所述待部署应用的部署,包括:响应于所述待部署机器当前运行有所述待部署应用,停止所述待部署应用;通过访问所述预设数据库下载所述待部署应用相应版本的所述产物;根据所述产物替换所述待部署应用;启动所述待部署应用。According to an application deployment method provided by an embodiment of the present invention, the deploying the application to be deployed according to the deployment task includes: in response to the machine to be deployed currently running the application to be deployed, stopping the application to be deployed the application to be deployed; download the product of the corresponding version of the application to be deployed by accessing the preset database; replace the application to be deployed according to the product; start the application to be deployed.
本发明实施例还提供一种应用部署装置,包括:确定模块,用于:确定待部署机器列表及待部署应用;分批模块,用于:根据所述待部署机器列表划分部署批次;其中,每个所述部署批次中至少包括一个所述待部署机器;部署模块,用于:生成所述待部署应用的部署任务,通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器,以供所述待部署机器根据所述部署任务进行所述待部署应用的部署。An embodiment of the present invention further provides an application deployment device, comprising: a determination module, used for: determining a list of machines to be deployed and applications to be deployed; a batching module, used for: dividing deployment batches according to the list of machines to be deployed; wherein , each said deployment batch includes at least one said to-be-deployed machine; a deployment module is used to: generate a deployment task of said to-be-deployed application; The deployment task is sent in parallel to the to-be-deployed machines in each of the deployment batches, so that the to-be-deployed machines can deploy the to-be-deployed application according to the deployment task.
本发明实施例还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述应用部署方法的步骤。An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor implements any of the applications described above when the processor executes the program The steps of the deployment method.
本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述应用部署方法的步骤。Embodiments of the present invention further provide a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of any of the foregoing application deployment methods.
本发明实施例还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述任一种所述应用部署方法的步骤。Embodiments of the present invention further provide a computer program product, including a computer program, which implements the steps of any of the foregoing application deployment methods when the computer program is executed by a processor.
本发明实施例提供的应用部署方法、装置及存储介质,通过部署批次之间异步,同一部署批次内部并行的方式将部署任务发送给待部署机器,有效地提高了应用部署效率。The application deployment method, device and storage medium provided by the embodiments of the present invention effectively improve application deployment efficiency by sending deployment tasks to machines to be deployed in an asynchronous manner between deployment batches and in parallel within the same deployment batch.
附图说明Description of drawings
为了更清楚地说明本发明的技术方案,下面将对实施例描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are some embodiments of the present invention, which are of great significance to the art. For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.
图1是本发明实施例提供的应用部署方法的流程示意图之一;FIG. 1 is one of the schematic flowcharts of the application deployment method provided by the embodiment of the present invention;
图2是本发明实施例提供的应用部署方法的流程示意图之二;2 is a second schematic flowchart of an application deployment method provided by an embodiment of the present invention;
图3是本发明实施例提供的应用部署方法的流程示意图之三;3 is a third schematic flowchart of an application deployment method provided by an embodiment of the present invention;
图4是本发明实施例提供的应用部署方法中表征任务状态流转的任务状态机的示意图;4 is a schematic diagram of a task state machine representing task state flow in an application deployment method provided by an embodiment of the present invention;
图5是本发明实施例提供的应用部署装置的结构示意图;5 is a schematic structural diagram of an application deployment apparatus provided by an embodiment of the present invention;
图6是本发明实施例提供的应用部署系统的结构示意图;6 is a schematic structural diagram of an application deployment system provided by an embodiment of the present invention;
图7是本发明实施例提供的电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention. , not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明实施例提供的应用部署方法,适用于window机器的部署,也适用于linux等其他机器的部署。The application deployment method provided by the embodiment of the present invention is applicable to the deployment of a window machine, and is also applicable to the deployment of other machines such as linux.
图1是本发明实施例提供的应用部署方法的流程示意图之一。如图1所示,所述方法包括:FIG. 1 is a schematic flowchart of an application deployment method provided by an embodiment of the present invention. As shown in Figure 1, the method includes:
步骤S1、确定待部署机器列表及待部署应用。Step S1: Determine a list of machines to be deployed and applications to be deployed.
本发明实施例提供的应用部署方法可以应用于服务器,待部署机器列表包括至少一个待部署机器,待部署机器视为服务器的客户端。服务器可以设置部署平台(也可称发布平台)进行应用部署的管理和操作。服务器可以通过API与待部署机器进行交互。The application deployment method provided by the embodiment of the present invention can be applied to a server, the list of machines to be deployed includes at least one machine to be deployed, and the machine to be deployed is regarded as a client of the server. The server can set a deployment platform (also called a publishing platform) to manage and operate application deployment. The server can interact with the machine to be deployed through the API.
待部署应用为待部署到待部署机器上的应用,确定待部署应用包括确定待部署应用的版本。The application to be deployed is an application to be deployed on the machine to be deployed, and determining the application to be deployed includes determining the version of the application to be deployed.
步骤S2、根据所述待部署机器列表划分部署批次;其中,每个所述部署批次中至少包括一个所述待部署机器。Step S2: Divide deployment batches according to the list of machines to be deployed; wherein, each of the deployment batches includes at least one of the machines to be deployed.
为提高部署效率,部署应用时采用分批部署的方式。根据待部署机器列表中的待部署机器的数量划分部署批次,划分部署批次时,若预先确定好了每个部署批次的机器数量,则根据每个部署批次的机器数量对部署机器列表中的待部署机器划分部署批次。如待部署机器列表中有105个待部署机器,预先确定每10个待部署机器为一批次,则可以划分为11个批次进行部署,其中,前10个批次中均有10个待部署机器,最后一个批次中由于数量不足,有5个待部署机器。若对每个部署批次的机器数量没有要求,则可以根据实际需要确定每个部署批次中的待部署机器的数量。每个部署批次至少包括一个待部署机器。To improve deployment efficiency, deploy applications in batches. The deployment batches are divided according to the number of machines to be deployed in the list of to-be-deployed machines. When dividing the deployment batches, if the number of machines in each deployment batch is determined in advance, the deployment machines are allocated according to the number of machines in each deployment batch. The machines to be deployed in the list are divided into deployment batches. If there are 105 machines to be deployed in the list of to-be-deployed machines, and each 10 to-be-deployed machines is predetermined as a batch, it can be divided into 11 batches for deployment, of which 10 of the first 10 batches are to be deployed. Deploy machines. There are 5 machines to be deployed in the last batch due to insufficient quantity. If there is no requirement for the number of machines in each deployment batch, the number of machines to be deployed in each deployment batch can be determined according to actual needs. Each deployment batch includes at least one machine to be deployed.
当然,若待部署机器列表中的待部署机器的数量较少,也可以通过一个部署批次进行部署。Of course, if the number of to-be-deployed machines in the to-be-deployed machine list is small, deployment can also be performed in one deployment batch.
步骤S3、生成所述待部署应用的部署任务,通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器,以供所述待部署机器根据所述部署任务进行所述待部署应用的部署。Step S3, generating a deployment task of the application to be deployed, and sending the deployment task in parallel to the to-be-deployed machines in each of the deployment batches in an asynchronous manner among the deployment batches for use in the deployment batches. The to-be-deployed machine deploys the to-be-deployed application according to the deployment task.
生成待部署应用的部署任务,部署任务包括待部署应用的信息,以用于确定所要部署的待部署应用。待部署应用的信息可以通过任务参数的形式体现,如任务参数中包括待部署应用的版本信息。生成待部署应用的部署任务后,通过各个部署批次之间异步的方式,将部署任务并行发送给各个部署批次中的待部署机器。待部署机器获取到部署任务后,根据部署任务进行待部署应用的部署。A deployment task of the application to be deployed is generated, and the deployment task includes information of the application to be deployed, so as to determine the application to be deployed to be deployed. The information of the application to be deployed may be embodied in the form of task parameters, for example, the task parameter includes version information of the application to be deployed. After the deployment task of the application to be deployed is generated, the deployment task is sent in parallel to the to-be-deployed machines in each deployment batch in an asynchronous manner between each deployment batch. After the machine to be deployed obtains the deployment task, it deploys the application to be deployed according to the deployment task.
对于同一个部署批次中的待部署机器,通过并行的方式将部署任务发送给各个待部署机器。对于各个部署批次之间,通过异步的方式将部署任务发送给各个部署批次中的待部署机器,也即,不等待前一批次部署完成,即开始对后面批次的待部署机器的部署任务的发送。前面批次的待部署机器完成部署后,可以将部署结果回调给服务器。For the machines to be deployed in the same deployment batch, the deployment tasks are sent to each of the machines to be deployed in parallel. Between each deployment batch, the deployment task is sent to the machines to be deployed in each deployment batch in an asynchronous manner, that is, without waiting for the deployment of the previous batch to be completed, the processing of the machines to be deployed in the subsequent batch is started. Sending of deployment tasks. After the previous batch of machines to be deployed are deployed, the deployment result can be called back to the server.
本发明实施例通过部署批次之间异步,同一部署批次内部并行的方式将部署任务发送给待部署机器,大大提高了应用部署效率。实验数据表明,部署时长可以由4小时缩短到10分钟。In the embodiment of the present invention, deployment tasks are sent to the machines to be deployed in an asynchronous manner between deployment batches and in parallel within the same deployment batch, which greatly improves application deployment efficiency. Experimental data shows that the deployment time can be shortened from 4 hours to 10 minutes.
本发明实施例提供的应用部署方法,通过部署批次之间异步,同一部署批次内部并行的方式将部署任务发送给待部署机器,有效地提高了应用部署效率。The application deployment method provided by the embodiment of the present invention effectively improves the application deployment efficiency by sending deployment tasks to the machines to be deployed in an asynchronous manner between deployment batches and within the same deployment batch in parallel.
根据本发明实施例提供的一种应用部署方法,所述通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器,包括:通过各个所述部署批次之间异步的方式,将所述部署任务并行写入到各个所述部署批次中的所述待部署机器对应的任务队列。According to an application deployment method provided by an embodiment of the present invention, the deployment tasks are sent in parallel to the machines to be deployed in the deployment batches in an asynchronous manner between the deployment batches, The method includes: writing the deployment task to the task queue corresponding to the to-be-deployed machine in each of the deployment batches in parallel in an asynchronous manner among the deployment batches.
可以为每个待部署机器设置任务队列。任务队列中可以包含服务器发送的多个待部署应用的部署任务。因此,通过各个部署批次之间异步的方式,将部署任务并行发送给各个部署批次中的待部署机器时,可以通过各个部署批次之间异步的方式,将部署任务并行写入到各个部署批次中的待部署机器对应的任务队列。待部署机器可以设置监听模块,监听任务队列中的部署任务的状态,获取任务队列中的部署任务进行相应待部署任务的部署。A task queue can be set up for each machine to be deployed. The task queue can contain deployment tasks of multiple applications to be deployed sent by the server. Therefore, when the deployment tasks are sent in parallel to the machines to be deployed in each deployment batch in an asynchronous manner between each deployment batch, the deployment tasks can be written in parallel to each deployment batch in an asynchronous manner. The task queue corresponding to the machines to be deployed in the deployment batch. The to-be-deployed machine can set a monitoring module to monitor the status of the deployment tasks in the task queue, and obtain the deployment tasks in the task queue to deploy the corresponding to-be-deployed tasks.
本发明实施例提供的应用部署方法,通过各个部署批次之间异步的方式,将部署任务并行写入到各个部署批次中的待部署机器对应的任务队列,便于实现待部署机器的部署过程的管理。In the application deployment method provided by the embodiment of the present invention, the deployment tasks are written into the task queue corresponding to the to-be-deployed machines in each deployment batch in an asynchronous manner, so as to facilitate the implementation of the deployment process of the to-be-deployed machines management.
根据本发明实施例提供的一种应用部署方法,所述方法还包括:接收所述待部署机器发送的部署过程数据;其中,所述部署过程数据包括所述部署任务的任务状态。According to an application deployment method provided by an embodiment of the present invention, the method further includes: receiving deployment process data sent by the machine to be deployed; wherein the deployment process data includes a task state of the deployment task.
如果同一批次部署过程中某台机器出现问题,不仅会大大拉长部署时间,而且很难快速找出问题机器,对本批次部署结果无可靠机制进行确认。为解决上述问题,本发明实施例中,待部署机器记录部署任务的部署过程数据,部署过程数据包括任务状态。待部署机器可以在执行完待部署应用的部署后将部署过程数据发送给服务器,当然,也可以实时发送给服务器。If there is a problem with a certain machine during the same batch of deployment, it will not only greatly prolong the deployment time, but also it is difficult to quickly identify the problem machine, and there is no reliable mechanism to confirm the deployment results of this batch. To solve the above problem, in this embodiment of the present invention, the to-be-deployed machine records deployment process data of the deployment task, and the deployment process data includes the task status. The to-be-deployed machine can send the deployment process data to the server after executing the deployment of the to-be-deployed application, and of course, it can also be sent to the server in real time.
相应地,服务器接收待部署机器发送的部署过程数据并进行存储,部署过程数据包括部署任务的任务状态。Correspondingly, the server receives and stores the deployment process data sent by the machine to be deployed, where the deployment process data includes the task status of the deployment task.
本发明实施例提供的应用部署方法,通过接收待部署机器发送的包括任务状态的部署过程数据,有利于实现对于部署任务的部署状态的监督,便于及时发现问题机器,避免不必要的时间浪费。In the application deployment method provided by the embodiment of the present invention, by receiving the deployment process data including the task status sent by the to-be-deployed machine, it is beneficial to realize the supervision of the deployment status of the deployment task, facilitate the timely discovery of the problem machine, and avoid unnecessary waste of time.
根据本发明实施例提供的一种应用部署方法,所述任务状态包括任务排队中、等待就绪、启动中、成功及失败中的至少一种,其中:所述待部署机器尚未消费所述部署任务,所述任务状态为任务排队中;所述待部署机器消费到所述部署任务,所述任务状态为等待就绪;所述待部署机器消费到所述部署任务且满足所述部署任务的部署条件,所述任务状态为启动中;其中,所述任务状态为启动中时,所述待部署机器执行所述根据所述部署任务进行所述待部署应用的部署的动作;所述根据所述部署任务进行所述待部署应用的部署的动作执行成功,所述任务状态为成功;所述根据所述部署任务进行所述待部署应用的部署的动作执行失败,所述任务状态为失败。According to an application deployment method provided by an embodiment of the present invention, the task status includes at least one of task queuing, waiting for ready, starting, successful, and failed, wherein: the deployment task has not been consumed by the to-be-deployed machine , the task status is task queuing; the to-be-deployed machine consumes the deployment task, and the task status is waiting for ready; the to-be-deployed machine consumes the deployment task and meets the deployment conditions of the deployment task , the task state is starting; wherein, when the task state is starting, the to-be-deployed machine executes the action of deploying the application to be deployed according to the deployment task; If the task of deploying the application to be deployed is successfully executed, the task status is successful; the action of deploying the application to be deployed according to the deployment task fails to be executed, and the task status is failed.
在整个部署流程,通过将部署操作转换为异步的部署任务,用来避免部署时某个待部署机器有正在处理的任务或有其他故障阻碍整体的部署节奏。待部署任务的任务状态可以用于表示相应待部署机器的部署状态。待部署任务的任务状态的流转过程可以用任务状态机表示。In the entire deployment process, by converting the deployment operation into an asynchronous deployment task, it is used to avoid that a certain machine to be deployed has a task being processed or other failures hinder the overall deployment rhythm during deployment. The task state of the to-be-deployed task can be used to represent the deployment state of the corresponding to-be-deployed machine. The flow process of the task state of the task to be deployed can be represented by a task state machine.
待部署机器可以通过消费任务队列中的部署任务实现待部署应用的部署。由于任务队列中可能有多个待部署的部署任务,需要排队处理。若待部署机器尚未消费部署任务,任务状态为任务排队中;若待部署机器消费到部署任务,任务状态为等待就绪;若此时满足待部署应用的部署条件(如已安装的待部署应用无正在处理的任务),则状态流转为启动中;若此时不满足待部署应用的部署条件,则任务状态仍为等待就绪。在任务状态为启动中时,待部署机器根据部署任务中的任务参数执行根据部署任务进行待部署应用的部署的动作。The machine to be deployed can deploy the application to be deployed by consuming the deployment tasks in the task queue. Since there may be multiple deployment tasks to be deployed in the task queue, they need to be queued for processing. If the machine to be deployed has not consumed the deployment task, the task status is task queued; if the machine to be deployed has consumed the deployment task, the task status is waiting to be ready; The task being processed), the status flow changes to starting; if the deployment conditions of the application to be deployed are not met at this time, the task status is still waiting for ready. When the task status is starting, the to-be-deployed machine executes the action of deploying the to-be-deployed application according to the deployment task according to the task parameters in the deployment task.
若待部署机器根据部署任务进行待部署应用的部署的动作执行成功,任务状态为成功;若待部署机器根据部署任务进行待部署应用的部署的动作执行失败,任务状态为失败。If the machine to be deployed executes the action of deploying the application to be deployed according to the deployment task successfully, the task status is successful; if the machine to be deployed fails to execute the action of deploying the application to be deployed according to the deployment task, the task status is failed.
以上状态流转过程可以在待部署机器中作为部署过程数据进行预先保存,待根据部署任务进行待部署应用的部署的动作执行完成后(无论成功或失败)再将部署过程数据发送给服务器。The above state transfer process can be pre-stored in the to-be-deployed machine as deployment process data, and the deployment process data is sent to the server after the deployment of the application to be deployed according to the deployment task is completed (whether successful or unsuccessful).
本发明实施例提供的应用部署方法,通过设置任务排队中、等待就绪、启动中及表示部署结果的任务状态,提高了部署过程信息获取的丰富性和全面性,有利于了解整个应用部署过程。The application deployment method provided by the embodiment of the present invention improves the richness and comprehensiveness of the information acquisition of the deployment process by setting the task statuses of task queuing, waiting for ready, starting and indicating the deployment result, and is beneficial to understand the entire application deployment process.
根据本发明实施例提供的一种应用部署方法,在所述通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器之后,所述方法还包括:生成与所述部署批次对应的批次ID及与所述部署批次中的所述待部署机器对应的任务ID;其中,所述批次ID与所述部署批次中包含的所述待部署机器对应;根据所述批次ID和/或所述任务ID查询所述部署过程数据。According to an application deployment method provided by an embodiment of the present invention, in the asynchronous manner between the deployment batches, the deployment task is sent to the machines to be deployed in the deployment batches in parallel Afterwards, the method further includes: generating a batch ID corresponding to the deployment batch and a task ID corresponding to the to-be-deployed machine in the deployment batch; wherein the batch ID and the deployment batch The to-be-deployed machines included in the batch correspond; the deployment process data is queried according to the batch ID and/or the task ID.
在通过各个部署批次之间异步的方式,将部署任务并行发送给各个部署批次中的待部署机器之后,可以生成与部署批次对应的批次ID及与部署批次中的待部署机器对应的任务ID。After the deployment tasks are sent in parallel to the machines to be deployed in each deployment batch in an asynchronous manner between the deployment batches, the batch ID corresponding to the deployment batch and the machines to be deployed in the deployment batch can be generated. The corresponding task ID.
批次ID与部署批次中包含的待部署机器对应,可以根据批次ID查询相应批次中的待部署机器的部署过程数据,如查询相应批次中的待部署机器的任务状态。任务ID与部署批次中包含的待部署机器对应,也即根据任务ID可以确定部署批次及部署批次中的待部署机器。可以根据任务ID获取到待部署机器列表中各个待部署机器的部署过程数据,如任务状态。The batch ID corresponds to the to-be-deployed machine included in the deployment batch, and the deployment process data of the to-be-deployed machine in the corresponding batch can be queried according to the batch ID, such as querying the task status of the to-be-deployed machine in the corresponding batch. The task ID corresponds to the to-be-deployed machine included in the deployment batch, that is, the deployment batch and the to-be-deployed machine in the deployment batch can be determined according to the task ID. The deployment process data of each to-be-deployed machine in the to-be-deployed machine list, such as the task status, can be obtained according to the task ID.
批次ID可以与对应部署批次中的待部署机器的任务ID建立关联。The batch ID can be associated with the task ID of the to-be-deployed machine in the corresponding deployment batch.
本发明实施例提供的应用部署方法,通过生成与部署批次对应的批次ID及与部署批次中的待部署机器对应的任务ID,根据批次ID和/或任务ID查询部署过程数据,实现了不同部署批次、不同待部署机器的区分,提高了部署过程数据查询的便利性。In the application deployment method provided by the embodiment of the present invention, by generating a batch ID corresponding to the deployment batch and a task ID corresponding to the machine to be deployed in the deployment batch, and querying the deployment process data according to the batch ID and/or the task ID, It realizes the distinction between different deployment batches and different machines to be deployed, and improves the convenience of data query in the deployment process.
根据本发明实施例提供的一种应用部署方法,所述确定待部署机器列表包括:在web页面,响应于所述待部署应用选中,展示关联有所述待部署应用的机器列表;从所述关联有所述待部署应用的机器列表中进行所述待部署机器的选取,根据选取结果确定所述待部署机器列表。According to an application deployment method provided by an embodiment of the present invention, the determining a list of machines to be deployed includes: on a web page, in response to the selection of the application to be deployed, displaying a list of machines associated with the application to be deployed; The to-be-deployed machine is selected from the machine list associated with the to-be-deployed application, and the to-be-deployed machine list is determined according to the selection result.
服务器可以实现机器管理、应用管理及部署记录管理。需要存储的数据信息可以包括待部署机器的信息,待部署应用的信息及部署记录信息(如包括部署过程数据)。其中,1台待部署机器可关联多个待部署应用,1个待部署应用可以有多条部署记录。1个待部署应用可以有多个版本,多条部署记录可以对应于多个版本。当然,同一版本也可以进行多次部署。The server can implement machine management, application management and deployment record management. The data information to be stored may include information of the machine to be deployed, information of the application to be deployed, and deployment record information (eg, including deployment process data). Among them, one to-be-deployed machine can be associated with multiple to-be-deployed applications, and one to-be-deployed application can have multiple deployment records. An application to be deployed can have multiple versions, and multiple deployment records can correspond to multiple versions. Of course, the same version can also be deployed multiple times.
待部署机器关联的待部署应用表示需要部署到待部署机器上的待部署应用,可以根据部署规划顺序完成各个待部署应用在待部署机器上的部署。机器和应用管理可直接基于数据库进行CRUD操作(增加(Create)、读取查询(Retrieve)、更新(Update)和删除(Delete))。The to-be-deployed application associated with the to-be-deployed machine represents the to-be-deployed application that needs to be deployed on the to-be-deployed machine, and the deployment of each to-be-deployed application on the to-be-deployed machine can be completed according to the deployment planning sequence. Machine and application management can perform CRUD operations (add (Create), read query (Retrieve), update (Update) and delete (Delete)) directly based on the database.
可以基于待部署应用和待部署机器的关联关系在web页面确定待部署机器列表。在web页面,可以设置待部署应用的选择列表,通过选择确定待部署应用。确定待部署应用后,可以展示关联有该待部署应用的机器列表。可以根据部署需求,在关联有该待部署应用的机器列表中进一步进行选择确定待部署机器列表。The list of machines to be deployed may be determined on the web page based on the association between the application to be deployed and the machines to be deployed. On the web page, a selection list of applications to be deployed can be set, and the applications to be deployed can be determined by selection. After the application to be deployed is determined, a list of machines associated with the application to be deployed can be displayed. The list of machines to be deployed may be determined by further selecting from the list of machines associated with the application to be deployed according to the deployment requirements.
本发明实施例提供的应用部署方法,通过在web页面,响应于待部署应用选中,展示关联有待部署应用的机器列表,从关联有待部署应用的机器列表中进行待部署机器的选取,根据选取结果确定待部署机器列表,提高了确定待部署机器列表的简便性。In the application deployment method provided by the embodiment of the present invention, in response to the selection of the application to be deployed on the web page, a list of machines associated with the application to be deployed is displayed, and the machine to be deployed is selected from the list of machines associated with the application to be deployed, and the selection result is performed. Determining the list of machines to be deployed improves the simplicity of determining the list of machines to be deployed.
根据本发明实施例提供的一种应用部署方法,所述方法还包括:响应于部署环境为测试环境,获取所述待部署应用的代码,对所述代码进行编译打包生成产物,将所述产物上传至预设数据库;响应于所述部署环境为线上环境,确定所述预设数据库中所述待部署应用已经测试通过的所述待部署应用的产物;其中,所述产物包括版本信息。According to an application deployment method provided by an embodiment of the present invention, the method further includes: in response to the deployment environment being a test environment, acquiring the code of the application to be deployed, compiling and packaging the code to generate a product, and compiling the product uploading to a preset database; in response to the deployment environment being an online environment, determining a product of the to-be-deployed application in the preset database that has passed the test of the to-be-deployed application; wherein the product includes version information.
应用部署时的部署环境包括测试环境和线上环境,测试环境下的应用部署目的是对开发的待部署应用进行测试,在部署时编译打包生成产物并存储至预设数据库。其中,产物包括版本信息。线上环境下的应用部署目的是开发的待部署应用投入运行,在部署时需要选择已经测试通过的产物版本。The deployment environment during application deployment includes a test environment and an online environment. The purpose of application deployment in the test environment is to test the developed application to be deployed, compile, package, and generate products during deployment and store them in a preset database. Among them, the product includes version information. The purpose of application deployment in the online environment is to put the developed application to be deployed into operation. When deploying, you need to select the product version that has passed the test.
因此,在确定待部署应用后,可以获取部署环境。若部署环境为测试环境,则获取待部署应用的代码,对代码进行编译打包生成产物,将产物上传至预设数据库;比如,通过调用Jenkins进行编译打包生成产物。在产物上传至预设数据库后,可以基于待部署机器列表执行后续的部署操作,如生成部署任务并发送给各个待部署机器以进行待部署应用的部署。产物的版本信息属于待部署应用的信息,可以包括在待部署任务的任务参数中。产物的版本可以和待部署应用的版本相同。Therefore, after determining the application to be deployed, the deployment environment can be obtained. If the deployment environment is a test environment, obtain the code of the application to be deployed, compile and package the code to generate a product, and upload the product to a preset database; for example, by calling Jenkins to compile, package, and generate a product. After the product is uploaded to the preset database, subsequent deployment operations can be performed based on the list of to-be-deployed machines, such as generating a deployment task and sending it to each to-be-deployed machine to deploy the to-be-deployed application. The version information of the product belongs to the information of the application to be deployed, and can be included in the task parameters of the task to be deployed. The version of the product can be the same as the version of the application to be deployed.
若部署环境为线上环境,确定预设数据库中待部署应用已经测试通过的待部署应用的产物。其中,确定预设数据库中待部署应用已经测试通过的待部署应用的产物包括确定产物版本。在确定预设数据库中待部署应用已经测试通过的待部署应用的产物后,可以基于待部署机器列表执行后续的部署操作,如生成部署任务并发送给各个待部署机器以进行待部署应用的部署。If the deployment environment is an online environment, determine the products of the to-be-deployed application that have passed the test of the to-be-deployed application in the preset database. Wherein, determining the product of the to-be-deployed application that has passed the test of the to-be-deployed application in the preset database includes determining the product version. After determining the products of the to-be-deployed application that have passed the test of the to-be-deployed application in the preset database, subsequent deployment operations can be performed based on the list of to-be-deployed machines, such as generating a deployment task and sending it to each to-be-deployed machine to deploy the to-be-deployed application .
本发明实施例提供的应用部署方法,通过响应于部署环境为测试环境,获取待部署应用的代码,对代码进行编译打包生成产物,将产物上传至预设数据库,响应于部署环境为线上环境,确定预设数据库中待部署应用已经测试通过的待部署应用的产物,可以实现测试环境及线上环境的应用部署。In the application deployment method provided by the embodiment of the present invention, in response to the deployment environment being a test environment, the code of the application to be deployed is obtained, the code is compiled and packaged to generate a product, and the product is uploaded to a preset database, and in response to the deployment environment being an online environment , to determine the product of the application to be deployed that has passed the test of the application to be deployed in the preset database, so as to realize application deployment in the test environment and the online environment.
根据本发明实施例提供的一种应用部署方法,所述根据所述部署任务进行所述待部署应用的部署,包括:响应于所述待部署机器当前运行有所述待部署应用,停止所述待部署应用;通过访问所述预设数据库下载所述待部署应用相应版本的所述产物;根据所述产物替换所述待部署应用;启动所述待部署应用。According to an application deployment method provided by an embodiment of the present invention, the deploying the application to be deployed according to the deployment task includes: in response to the machine to be deployed currently running the application to be deployed, stopping the application to be deployed the application to be deployed; download the product of the corresponding version of the application to be deployed by accessing the preset database; replace the application to be deployed according to the product; start the application to be deployed.
若待部署应用(可以包括各个版本)在待部署机器上部署过,则若应用部署时待部署应用正在运行,则先需要进行停服(停止服务,也即停止待部署应用的运行),然后执行产物下载,应用替换,应用启动等操作进行部署。当然,若待部署应用是在待部署机器上初次部署,则部署时不存在待部署应用正在运行的情况。If the application to be deployed (which can include various versions) has been deployed on the machine to be deployed, if the application to be deployed is running when the application is deployed, it is necessary to stop the service (stop the service, that is, stop the running of the application to be deployed), and then Perform operations such as product download, application replacement, and application startup for deployment. Of course, if the application to be deployed is deployed for the first time on the machine to be deployed, the application to be deployed is not running at the time of deployment.
因此,在根据部署任务进行待部署应用的部署时,响应于待部署机器当前运行有待部署应用,停止待部署应用;通过访问预设数据库下载待部署应用相应版本的产物;根据产物替换待部署应用;启动待部署应用,从而完成待部署应用的部署。Therefore, when the application to be deployed is deployed according to the deployment task, the application to be deployed is stopped in response to the current application to be deployed on the machine to be deployed; the product of the corresponding version of the application to be deployed is downloaded by accessing the preset database; the application to be deployed is replaced according to the product ; Start the application to be deployed to complete the deployment of the application to be deployed.
本发明实施例提供的应用部署方法,通过响应于待部署机器当前运行有待部署应用,停止待部署应用,通过访问预设数据库下载待部署应用相应版本的产物,根据产物替换待部署应用,启动待部署应用,实现了待部署应用的可靠部署。In the application deployment method provided by the embodiment of the present invention, the application to be deployed is stopped by responding to the application to be deployed currently running on the machine to be deployed, the product of the corresponding version of the application to be deployed is downloaded by accessing a preset database, the application to be deployed is replaced according to the product, and the application to be deployed is started. Deploying the application realizes the reliable deployment of the application to be deployed.
图2是本发明实施例提供的应用部署方法的流程示意图之二。本发明实施例提供的应用部署方法可以由Server端和client端共同实现。Server端主要负责数据存储,发布管理,Client端收到Server端命令后执行具体的应用部署动作,动作完成后同步Server端。其中,Server端可以分为前后端两部分,前端web页面方便用户部署操作,后端负责权限校验、应用打包、产物上传、生成部署任务等。Client端(待部署机器)用于消费部署任务,根据部署任务中的任务参数进行服务停止、下载产物包和服务启动等操作。如图2所示,应用部署流程包括:FIG. 2 is a second schematic flowchart of an application deployment method provided by an embodiment of the present invention. The application deployment method provided by the embodiment of the present invention can be jointly implemented by the server side and the client side. The server side is mainly responsible for data storage and release management. The client side executes specific application deployment actions after receiving commands from the server side, and synchronizes the server side after the actions are completed. Among them, the server side can be divided into two parts: front-end and back-end. The front-end web page is convenient for users to deploy and operate, and the back-end is responsible for permission verification, application packaging, product upload, and generation and deployment tasks. The client (machine to be deployed) is used to consume deployment tasks, and perform operations such as service stop, product package download, and service startup according to the task parameters in the deployment task. As shown in Figure 2, the application deployment process includes:
在Server端,判断用户是否登录;若没有登录,则跳转到登录页面;若已登录,则对发布权限(部署权限)进行验证;若经验证无发布权限,则只能查看,无发布权限;若经验证有发布权限,则进行待部署应用的选择。On the server side, determine whether the user is logged in; if not, jump to the login page; if logged in, verify the publishing permission (deployment permission); ; If it is verified to have the permission to publish, select the application to be deployed.
判断当前的发布环境(部署环境)是测试环境(test环境)还是线上环境(release环境);若是测试环境,则拉取git(git是一个开源的分布式版本控制系统,可以有效、高速地处理从很小到非常大的项目版本管理)中的待部署应用的代码,进行编译打包得到产物,将产物上传到预设数据库。若是线上环境,则选择已经测试通过的产物版本。确定待部署机器列表,划分部署批次。完成上述处理后,调用API生成待部署应用的部署任务,通过各个部署批次之间异步的方式,将部署任务并行发送给各个部署批次中的待部署机器。Determine whether the current release environment (deployment environment) is a test environment (test environment) or an online environment (release environment); if it is a test environment, pull git (git is an open source distributed version control system, which can effectively and quickly Process the code of the application to be deployed in the project version management from very small to very large, compile and package to obtain the product, and upload the product to the preset database. If it is an online environment, select the product version that has passed the test. Determine the list of machines to be deployed and divide deployment batches. After the above processing is completed, the API is called to generate the deployment task of the application to be deployed, and the deployment task is sent in parallel to the to-be-deployed machines in each deployment batch in an asynchronous manner.
待部署机器取到待部署任务后,根据任务参数进行停止应用、下载产物、替换应用、启动应用等处理,并在处理结束后通过回调将部署结果返回给Server端(如返回给Server端的发布平台进行查询及展示)。After the to-be-deployed machine obtains the to-be-deployed task, it performs processing such as stopping the application, downloading the product, replacing the application, and starting the application according to the task parameters. for inquiries and presentations).
图3是本发明实施例提供的应用部署方法的流程示意图之三。机器1和机器2为Client端,其余模块属于Server端。如发布平台可以是Server端用于发布部署任务,查询部署结果等的操作平台。如图3所示,应用部署流程包括:FIG. 3 is a third schematic flowchart of an application deployment method provided by an embodiment of the present invention. Machine 1 and Machine 2 are the Client side, and the rest of the modules belong to the Server side. For example, the publishing platform may be an operating platform used by the server side to publish deployment tasks, query deployment results, and the like. As shown in Figure 3, the application deployment process includes:
步骤1:部署环境为测试环境,发布平台调用Jenkins进行打包。Step 1: The deployment environment is the test environment, and the publishing platform calls Jenkins for packaging.
步骤2:Jenkins通过访问git获取待部署应用的代码,将代码编译打包完成后生成产物。Step 2: Jenkins obtains the code of the application to be deployed by accessing git, and generates the product after compiling and packaging the code.
步骤3:将产物存储至minio(对象存储服务器)。Step 3: Store the product in minio (object storage server).
步骤4:完成产物上传至minio后Jenkins回调发布平台。发布平台会基于选择的待部署机器列表进行后续部署操作;考虑到部署的规范性,部署环境为线上环境时直接采用测试通过的产物。Step 4: After uploading the product to minio, Jenkins calls back the publishing platform. The publishing platform will perform subsequent deployment operations based on the selected list of machines to be deployed; considering the standardization of deployment, when the deployment environment is an online environment, the products that have passed the test are directly used.
步骤5:发布平台向部署api服务发送部署请求。Step 5: The publishing platform sends a deployment request to the deployment api service.
步骤6:部署api服务接收到部署请求后,校验发布参数(可以为预先设置的用于判断发布规范性的参数),校验通过后,生成部署任务并写入Redis(一种存储系统)任务队列;其中,待部署列表中每个待部署机器对应一个任务队列。Step 6: After the deployment api service receives the deployment request, it verifies the publishing parameters (which can be preset parameters for judging the specification of the publishing), and after the verification passes, generates a deployment task and writes it to Redis (a storage system) Task queue; wherein, each to-be-deployed machine in the to-be-deployed list corresponds to a task queue.
步骤7:生成批次ID和任务ID并返回给发布平台,后续发布平台根据批次ID和任务ID进行部署任务的追踪。Step 7: Generate batch ID and task ID and return to the publishing platform, and the subsequent publishing platform will track the deployment task according to the batch ID and task ID.
步骤8:Client端的服务部署模块会一直监听任务队列,待取到部署任务时会进行后续的应用部署操作。Step 8: The service deployment module on the client side will always monitor the task queue, and will perform subsequent application deployment operations when the deployment task is fetched.
步骤9:在进行应用部署时,从minio下载相应版本的产物,并进行应用部署操作。Step 9: When deploying the application, download the product of the corresponding version from minio, and perform the application deployment operation.
步骤10:应用部署结束后,将部署过程数据回调返回给发布平台。Step 10: After the application deployment is completed, the deployment process data callback is returned to the publishing platform.
图4是本发明实施例提供的应用部署方法中表征任务状态流转的任务状态机的示意图。如图4所示,任务状态机可以包括如下任务状态:FIG. 4 is a schematic diagram of a task state machine representing task state flow in an application deployment method provided by an embodiment of the present invention. As shown in Figure 4, the task state machine may include the following task states:
a)初始化:新机器完成初始化工作后:通过发布平台录入机器,关联应用,由于该机器上的应用从未部署过,状态记录为初始化。a) Initialization: After the new machine completes the initialization work: enter the machine through the publishing platform and associate the application. Since the application on the machine has never been deployed, the status is recorded as initialization.
b)任务排队中:用户通过web页面进行发布操作后,Server端将部署任务写入RedisR任务队列,且Client端消费之前记录为任务排队中。b) Task queuing: After the user performs the publishing operation through the web page, the server side writes the deployment task into the RedisR task queue, and the client side records it as task queuing before consumption.
c)等待就绪:Client端的服务部署模块消费到发布任务后,任务状态流转为等待就绪,若此时待部署应用无正在处理的任务,则继续流转;否则任务状态仍为等待就绪。c) Waiting for ready: After the service deployment module on the client side consumes the published task, the task status flow changes to waiting for ready. If there is no task being processed by the application to be deployed at this time, the flow continues; otherwise, the task status is still waiting for ready.
d)启动中:若应用无正在处理的任务即满足部署条件时,会基于任务参数进行停服、替换代码和重启等操作。d) Starting: If the application meets the deployment conditions without a task being processed, operations such as server shutdown, code replacement, and restart will be performed based on the task parameters.
e)若步骤d中间任何步骤失败任务状态流转为失败,否则任务状态为成功。e) If any step in step d fails, the task status flow changes to failure, otherwise the task status is successful.
本发明实施例提供的应用部署方法,可以解决应用部署过程发布耗时过久、问题定位困难和机器管理混乱等问题,更好的服务于业务。The application deployment method provided by the embodiment of the present invention can solve the problems of the application deployment process taking too long to release, difficult to locate problems, and confusing machine management, etc., and better serve the business.
其中:in:
1、采用异步+并行的部署模式,优化部署过程。1. Adopt the asynchronous + parallel deployment mode to optimize the deployment process.
由于业务应用更多为离线任务,为避免部署应用时机器有正在运行的任务或某台机器出现问题阻塞整体部署流程,部署采用异步模式,更好的支持并行部署。Since business applications are mostly offline tasks, in order to avoid running tasks on the machine or problems with a certain machine blocking the overall deployment process when deploying applications, the deployment adopts the asynchronous mode to better support parallel deployment.
2、汇总部署过程数据,实现对于部署状态的监控。2. Aggregate deployment process data to monitor deployment status.
Client端部署结束后通过API回调至Server端,部署过程数据统一收敛至Server端并存储于数据库,可通过web页面一键查询部署进度以及每台机器的部署状态,便于追踪每台机器的部署结果,减少定位问题时长。After the client side is deployed, it is called back to the server side through the API. The deployment process data is converged to the server side and stored in the database. The deployment progress and the deployment status of each machine can be queried through the web page with one click, which is convenient for tracking the deployment results of each machine. , to reduce the duration of positioning problems.
3、统一管理机器,不同应用的机器统一管理存储至Server端,避免多份数据之间信息不一致。3. Unified management of machines, unified management and storage of machines of different applications to the server side, to avoid information inconsistency between multiple pieces of data.
已有Jenkins+Openssh的部署模式,通过Jenkins job与应用对应管理,而应用可能部署到多个机器上。因此,机器数据会存储多份。多份数据存储在涉及修改时(如某个机器下线,该机器上的所有应用均需下线)容易导致数据修改错误。本发明实施例将机器列表数据存储到数据库,机器数据只维护一份,机器和应用之间一对多关系可通过数据库外键关联进行管理,通过统一进行管理减少了信息修改时的不可靠性。There is a deployment mode of Jenkins+Openssh, which is managed by Jenkins job corresponding to the application, and the application may be deployed to multiple machines. Therefore, machine data is stored in multiple copies. When multiple copies of data are stored in the case of modification (for example, when a machine goes offline, all applications on the machine need to be offline), it is easy to cause data modification errors. In the embodiment of the present invention, the machine list data is stored in the database, and only one copy of the machine data is maintained. The one-to-many relationship between the machine and the application can be managed through the database foreign key association, and the unreliability of information modification is reduced through unified management. .
本发明实施例将集群应用部署转换为异步发布任务,机器集群中每台待部署机器的应用部署都相互独立、互不影响,可以实现真正的并行发布。并且每次发布都会生成新的任务,通过跟踪任务状态,知晓每台机器发布情况,快速高效定位集群问题机器。The embodiment of the present invention converts cluster application deployment into asynchronous publishing tasks, and application deployment of each to-be-deployed machine in the machine cluster is independent of each other and does not affect each other, which can realize true parallel publishing. And each release will generate a new task. By tracking the task status, you can know the release status of each machine, and quickly and efficiently locate the cluster problem machine.
需要说明的是,本实施例所给出的多个优选实施方式,在逻辑或结构相互不冲突的前提下,可以自由组合,本发明对此不做限定。It should be noted that, the multiple preferred implementation manners given in this embodiment can be freely combined on the premise that the logic or structure does not conflict with each other, which is not limited in the present invention.
下面对本发明实施例提供的应用部署装置进行描述,下文描述的应用部署装置与上文描述的应用部署方法可相互对应参照。The application deployment apparatus provided by the embodiment of the present invention is described below, and the application deployment apparatus described below and the application deployment method described above may refer to each other correspondingly.
图5是本发明实施例提供的应用部署装置的结构示意图。如图5所示,该装置包括确定模块10、分批模块20及部署模块30,其中:确定模块10用于:确定待部署机器列表及待部署应用;分批模块20用于:根据所述待部署机器列表划分部署批次;其中,每个所述部署批次中至少包括一个所述待部署机器;部署模块30用于:生成所述待部署应用的部署任务,通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器,以供所述待部署机器根据所述部署任务进行所述待部署应用的部署。FIG. 5 is a schematic structural diagram of an application deployment apparatus provided by an embodiment of the present invention. As shown in FIG. 5 , the device includes a
本发明实施例提供的应用部署装置,通过部署批次之间异步,同一部署批次内部并行的方式将部署任务发送给待部署机器,有效地提高了应用部署效率。The application deployment device provided by the embodiment of the present invention effectively improves the application deployment efficiency by sending deployment tasks to the machines to be deployed in an asynchronous manner between deployment batches and in parallel within the same deployment batch.
根据本发明实施例提供的一种应用部署装置,所述部署模块30在用于通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器时,具体用于:通过各个所述部署批次之间异步的方式,将所述部署任务并行写入到各个所述部署批次中的所述待部署机器对应的任务队列。According to an application deployment apparatus provided by an embodiment of the present invention, the
本发明实施例提供的应用部署装置,通过各个部署批次之间异步的方式,将部署任务并行写入到各个部署批次中的待部署机器对应的任务队列,便于实现待部署机器的部署过程的管理。The application deployment device provided by the embodiment of the present invention writes deployment tasks in parallel to the task queue corresponding to the to-be-deployed machine in each deployment batch in an asynchronous manner between each deployment batch, so as to facilitate the implementation of the deployment process of the to-be-deployed machine management.
根据本发明实施例提供的一种应用部署装置,所述部署模块30还用于:接收所述待部署机器发送的部署过程数据;其中,所述部署过程数据包括所述部署任务的任务状态。According to an application deployment apparatus provided by an embodiment of the present invention, the
本发明实施例提供的应用部署装置,通过接收待部署机器发送的包括任务状态的部署过程数据,有利于实现对于部署任务的部署状态的监督,便于及时发现问题机器,避免不必要的时间浪费。The application deployment device provided by the embodiment of the present invention, by receiving the deployment process data including the task status sent by the to-be-deployed machine, facilitates the supervision of the deployment status of the deployment task, facilitates the timely discovery of problem machines, and avoids unnecessary waste of time.
根据本发明实施例提供的一种应用部署装置,所述任务状态包括任务排队中、等待就绪、启动中、成功及失败中的至少一种,其中:所述待部署机器尚未消费所述部署任务,所述任务状态为任务排队中;所述待部署机器消费到所述部署任务,所述任务状态为等待就绪;所述待部署机器消费到所述部署任务且满足所述部署任务的部署条件,所述任务状态为启动中;其中,所述任务状态为启动中时,所述待部署机器执行所述根据所述部署任务进行所述待部署应用的部署的动作;所述根据所述部署任务进行所述待部署应用的部署的动作执行成功,所述任务状态为成功;所述根据所述部署任务进行所述待部署应用的部署的动作执行失败,所述任务状态为失败。According to an application deployment device provided by an embodiment of the present invention, the task status includes at least one of task queuing, waiting for ready, starting, successful, and failed, wherein: the deployment task has not been consumed by the to-be-deployed machine , the task status is task queuing; the to-be-deployed machine consumes the deployment task, and the task status is waiting for ready; the to-be-deployed machine consumes the deployment task and meets the deployment conditions of the deployment task , the task state is starting; wherein, when the task state is starting, the to-be-deployed machine executes the action of deploying the application to be deployed according to the deployment task; If the task of deploying the application to be deployed is successfully executed, the task status is successful; the action of deploying the application to be deployed according to the deployment task fails to be executed, and the task status is failed.
本发明实施例提供的应用部署装置,通过设置任务排队中、等待就绪、启动中及表示部署结果的任务状态,提高了部署过程信息获取的丰富性和全面性,有利于了解整个应用部署过程。The application deployment device provided by the embodiment of the present invention improves the richness and comprehensiveness of the acquisition of deployment process information by setting the task statuses of task queuing, waiting for ready, starting and indicating the deployment result, and is conducive to understanding the entire application deployment process.
根据本发明实施例提供的一种应用部署装置,在所述通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器之后,所述部署模块30还用于:生成与所述部署批次对应的批次ID及与所述部署批次中的所述待部署机器对应的任务ID;其中,所述批次ID与所述部署批次中包含的所述待部署机器对应;根据所述批次ID和/或所述任务ID查询所述部署过程数据。According to an application deployment apparatus provided by an embodiment of the present invention, in the asynchronous manner between the deployment batches, the deployment task is sent in parallel to the to-be-deployed machines in the deployment batches After that, the
本发明实施例提供的应用部署装置,通过生成与部署批次对应的批次ID及与部署批次中的待部署机器对应的任务ID,根据批次ID和/或任务ID查询部署过程数据,实现了不同部署批次、不同待部署机器的区分,提高了部署过程数据查询的便利性。The application deployment device provided by the embodiment of the present invention queries the deployment process data according to the batch ID and/or the task ID by generating a batch ID corresponding to the deployment batch and a task ID corresponding to the machine to be deployed in the deployment batch, It realizes the distinction between different deployment batches and different machines to be deployed, and improves the convenience of data query in the deployment process.
根据本发明实施例提供的一种应用部署装置,确定模块10在用于确定待部署机器列表时,具体用于:在web页面,响应于所述待部署应用选中,展示关联有所述待部署应用的机器列表;从所述关联有所述待部署应用的机器列表中进行所述待部署机器的选取,根据选取结果确定所述待部署机器列表。According to an application deployment apparatus provided by an embodiment of the present invention, when the determining
本发明实施例提供的应用部署装置,通过在web页面,响应于待部署应用选中,展示关联有待部署应用的机器列表,从关联有待部署应用的机器列表中进行待部署机器的选取,根据选取结果确定待部署机器列表,提高了确定待部署机器列表的简便性。The application deployment device provided by the embodiment of the present invention displays a list of machines associated with the application to be deployed on the web page in response to the selection of the application to be deployed, selects the machine to be deployed from the list of machines associated with the application to be deployed, and selects the machine to be deployed according to the selection result. Determining the list of machines to be deployed improves the simplicity of determining the list of machines to be deployed.
根据本发明实施例提供的一种应用部署装置,所述部署模块30还用于:响应于部署环境为测试环境,获取所述待部署应用的代码,对所述代码进行编译打包生成产物,将所述产物上传至预设数据库;响应于所述部署环境为线上环境,确定所述预设数据库中所述待部署应用已经测试通过的所述待部署应用的产物;其中,所述产物包括版本信息。According to an application deployment device provided by an embodiment of the present invention, the
本发明实施例提供的应用部署装置,通过响应于部署环境为测试环境,获取待部署应用的代码,对代码进行编译打包生成产物,将产物上传至预设数据库,响应于部署环境为线上环境,确定预设数据库中待部署应用已经测试通过的待部署应用的产物,可以实现测试环境及线上环境的应用部署。The application deployment device provided by the embodiment of the present invention obtains the code of the application to be deployed in response to the deployment environment being a test environment, compiles and packages the code to generate a product, and uploads the product to a preset database, and responds that the deployment environment is an online environment , to determine the product of the application to be deployed that has passed the test of the application to be deployed in the preset database, so as to realize application deployment in the test environment and the online environment.
根据本发明实施例提供的一种应用部署装置,所述部署模块30在用于将所述部署任务并行发送给各个所述部署批次中的所述待部署机器,以供所述待部署机器根据所述部署任务进行所述待部署应用的部署,具体用于:将所述部署任务并行发送给各个所述部署批次中的所述待部署机器,以供所述待部署机器响应于所述待部署机器当前运行有所述待部署应用,停止所述待部署应用,通过访问所述预设数据库下载所述待部署应用相应版本的所述产物,根据所述产物替换所述待部署应用,启动所述待部署应用。According to an application deployment apparatus provided by an embodiment of the present invention, the
本发明实施例提供的应用部署装置,通过响应于待部署机器当前运行有待部署应用,停止待部署应用,通过访问预设数据库下载待部署应用相应版本的产物,根据产物替换待部署应用,启动待部署应用,实现了待部署应用的可靠部署。The application deployment device provided by the embodiment of the present invention stops the application to be deployed by responding to the application to be deployed currently running on the machine to be deployed, downloads the product of the corresponding version of the application to be deployed by accessing a preset database, replaces the application to be deployed according to the product, and starts the application to be deployed. Deploying the application realizes the reliable deployment of the application to be deployed.
图6是本发明实施例提供的应用部署系统的结构示意图。如图6所示,所述系统包括应用部署装置100及机器集群200,其中:所述应用部署装置100用于:确定待部署机器列表及待部署应用;根据所述待部署机器列表划分部署批次;生成所述待部署应用的部署任务,通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的待部署机器201;其中,所述机器集群200包括所述待部署机器列表中的所述待部署机器201,每个所述部署批次中至少包括一个所述待部署机器201;FIG. 6 is a schematic structural diagram of an application deployment system provided by an embodiment of the present invention. As shown in FIG. 6 , the system includes an
所述待部署机器201用于:接收所述部署任务,根据所述部署任务进行所述待部署应用的部署。The to-be-deployed machine 201 is configured to: receive the deployment task, and deploy the to-be-deployed application according to the deployment task.
本发明实施例提供的应用部署系统,通过部署批次之间异步,同一部署批次内部并行的方式将部署任务发送给待部署机器,有效地提高了应用部署效率。The application deployment system provided by the embodiment of the present invention effectively improves the application deployment efficiency by sending deployment tasks to the machines to be deployed in an asynchronous manner between deployment batches and in parallel within the same deployment batch.
根据本发明实施例提供的一种应用部署系统,应用部署装置100在用于通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器时,具体用于:通过各个所述部署批次之间异步的方式,将所述部署任务并行写入到各个所述部署批次中的所述待部署机器对应的任务队列。According to an application deployment system provided by an embodiment of the present invention, the
本发明实施例提供的应用部署系统,通过各个部署批次之间异步的方式,将部署任务并行写入到各个部署批次中的待部署机器对应的任务队列,便于实现待部署机器的部署过程的管理。The application deployment system provided by the embodiments of the present invention writes deployment tasks in parallel to the task queues corresponding to the machines to be deployed in each deployment batch in an asynchronous manner between each deployment batch, so as to facilitate the deployment process of the machines to be deployed management.
根据本发明实施例提供的一种应用部署系统,待部署机器201还用于:向应用部署装置100发送部署过程数据;其中,所述部署过程数据包括所述部署任务的任务状态;应用部署装置100还用于接收所述待部署机器201发送的所述部署过程数据。According to an application deployment system provided by an embodiment of the present invention, the machine 201 to be deployed is further configured to: send deployment process data to the
本发明实施例提供的应用部署系统,通过接收待部署机器发送的包括任务状态的部署过程数据,有利于实现对于部署任务的部署状态的监督,便于及时发现问题机器,避免不必要的时间浪费。The application deployment system provided by the embodiments of the present invention, by receiving the deployment process data including the task status sent by the to-be-deployed machine, facilitates the supervision of the deployment status of the deployment task, facilitates timely discovery of problem machines, and avoids unnecessary waste of time.
根据本发明实施例提供的一种应用部署系统,所述任务状态包括任务排队中、等待就绪、启动中、成功及失败中的至少一种,待部署机器201还用于:响应于尚未消费所述部署任务,所述任务状态设置为任务排队中;响应于消费到所述部署任务,所述任务状态设置为等待就绪;响应于消费到所述部署任务且满足所述部署任务的部署条件,所述任务状态设置为启动中;其中,所述任务状态为启动中时,所述执行所述根据所述部署任务进行所述待部署应用的部署的动作;响应于根据所述部署任务进行所述待部署应用的部署的动作执行成功,所述任务状态设置为成功,所述根据所述部署任务进行所述待部署应用的部署的动作执行失败,所述任务状态设置为失败。According to an application deployment system provided by an embodiment of the present invention, the task status includes at least one of task queuing, waiting for ready, starting, successful, and failed, and the machine to be deployed 201 is further configured to: respond to the unconsumed the deployment task, the task status is set to task queuing; in response to consuming the deployment task, the task status is set to waiting for ready; in response to consuming the deployment task and meeting the deployment conditions of the deployment task, The task status is set to be under activation; wherein, when the task status is under activation, the executing the action of deploying the application to be deployed according to the deployment task; in response to the execution of the deployment task according to the deployment task; If the action of deploying the application to be deployed is successfully executed, the task status is set to success, and the action of deploying the application to be deployed according to the deployment task fails to be executed, and the task status is set to fail.
本发明实施例提供的应用部署系统,通过设置任务排队中、等待就绪、启动中及表示部署结果的任务状态,提高了部署过程信息获取的丰富性和全面性,有利于了解整个应用部署过程。The application deployment system provided by the embodiment of the present invention improves the richness and comprehensiveness of the information acquisition of the deployment process by setting the task statuses of task queuing, waiting for ready, starting and indicating the deployment result, which is beneficial to understand the entire application deployment process.
根据本发明实施例提供的一种应用部署系统,在所述通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器之后,应用部署装置100还用于生成与所述部署批次对应的批次ID及与所述部署批次中的所述待部署机器对应的任务ID;其中,所述批次ID与所述部署批次中包含的所述待部署机器对应;根据所述批次ID和/或所述任务ID查询所述部署过程数据。According to an application deployment system provided by an embodiment of the present invention, in the asynchronous manner between the deployment batches, the deployment task is sent to the machines to be deployed in the deployment batches in parallel After that, the
本发明实施例提供的应用部署系统,通过生成与部署批次对应的批次ID及与部署批次中的待部署机器对应的任务ID,根据批次ID和/或任务ID查询部署过程数据,实现了不同部署批次、不同待部署机器的区分,提高了部署过程数据查询的便利性。In the application deployment system provided by the embodiment of the present invention, by generating a batch ID corresponding to the deployment batch and a task ID corresponding to a machine to be deployed in the deployment batch, the deployment process data is queried according to the batch ID and/or the task ID, It realizes the distinction between different deployment batches and different machines to be deployed, and improves the convenience of data query in the deployment process.
根据本发明实施例提供的一种应用部署系统,应用部署装置100在用于确定待部署机器列表时,具体用于:在web页面,响应于所述待部署应用选中,展示关联有所述待部署应用的机器列表;从所述关联有所述待部署应用的机器列表中进行所述待部署机器的选取,根据选取结果确定所述待部署机器列表。According to an application deployment system provided by an embodiment of the present invention, when the
本发明实施例提供的应用部署系统,通过在web页面,响应于待部署应用选中,展示关联有待部署应用的机器列表,从关联有待部署应用的机器列表中进行待部署机器的选取,根据选取结果确定待部署机器列表,提高了确定待部署机器列表的简便性。In the application deployment system provided by the embodiment of the present invention, in response to the selection of the application to be deployed on the web page, a list of machines associated with the application to be deployed is displayed, and the machine to be deployed is selected from the list of machines associated with the application to be deployed, according to the selection result. Determining the list of machines to be deployed improves the simplicity of determining the list of machines to be deployed.
根据本发明实施例提供的一种应用部署系统,应用部署装置100还用于:响应于部署环境为测试环境,获取所述待部署应用的代码,对所述代码进行编译打包生成产物,将所述产物上传至预设数据库;响应于所述部署环境为线上环境,确定所述预设数据库中所述待部署应用已经测试通过的所述待部署应用的产物;其中,所述产物包括版本信息。According to an application deployment system provided by an embodiment of the present invention, the
本发明实施例提供的应用部署系统,通过响应于部署环境为测试环境,获取待部署应用的代码,对代码进行编译打包生成产物,将产物上传至预设数据库,响应于部署环境为线上环境,确定预设数据库中待部署应用已经测试通过的待部署应用的产物,可以实现测试环境及线上环境的应用部署。The application deployment system provided by the embodiment of the present invention obtains the code of the application to be deployed in response to the deployment environment being a test environment, compiles and packages the code to generate a product, and uploads the product to a preset database, and responds that the deployment environment is an online environment , to determine the product of the application to be deployed that has passed the test of the application to be deployed in the preset database, so as to realize application deployment in the test environment and the online environment.
根据本发明实施例提供的一种应用部署系统,待部署机器201在用于根据所述部署任务进行所述待部署应用的部署时,具体用于:响应于所述待部署机器当前运行有所述待部署应用,停止所述待部署应用;通过访问所述预设数据库下载所述待部署应用相应版本的所述产物;根据所述产物替换所述待部署应用;启动所述待部署应用。According to an application deployment system provided by an embodiment of the present invention, when the machine to be deployed 201 is used to deploy the application to be deployed according to the deployment task, it is specifically used for: in response to the current running of the machine to be deployed the application to be deployed, stop the application to be deployed; download the product of the corresponding version of the application to be deployed by accessing the preset database; replace the application to be deployed according to the product; start the application to be deployed.
本发明实施例提供的应用部署系统,通过响应于待部署机器当前运行有待部署应用,停止待部署应用,通过访问预设数据库下载待部署应用相应版本的产物,根据产物替换待部署应用,启动待部署应用,实现了待部署应用的可靠部署。The application deployment system provided by the embodiment of the present invention stops the application to be deployed by responding to the application to be deployed currently running on the machine to be deployed, downloads the product of the corresponding version of the application to be deployed by accessing a preset database, replaces the application to be deployed according to the product, and starts the application to be deployed. Deploying the application realizes the reliable deployment of the application to be deployed.
图7是本发明实施例提供的电子设备的结构示意图,如图7所示,该电子设备可以包括:处理器(processor)710、通信接口(Communications Interface)720、存储器(memory)730和通信总线740,其中,处理器710,通信接口720,存储器730通过通信总线740完成相互间的通信。处理器710可以调用存储器730中的逻辑指令,以执行应用部署方法,该方法包括:确定待部署机器列表及待部署应用;根据所述待部署机器列表划分部署批次;其中,每个所述部署批次中至少包括一个所述待部署机器;生成所述待部署应用的部署任务,通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器,以供所述待部署机器根据所述部署任务进行所述待部署应用的部署。FIG. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. As shown in FIG. 7 , the electronic device may include: a processor (processor) 710, a communications interface (Communications Interface) 720, a memory (memory) 730, and a
此外,上述的存储器730中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the
另一方面,本发明实施例还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,计算机程序可存储在非暂态计算机可读存储介质上,所述计算机程序被处理器执行时,计算机能够执行上述各方法所提供的应用部署方法,该方法包括:确定待部署机器列表及待部署应用;根据所述待部署机器列表划分部署批次;其中,每个所述部署批次中至少包括一个所述待部署机器;生成所述待部署应用的部署任务,通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器,以供所述待部署机器根据所述部署任务进行所述待部署应用的部署。On the other hand, an embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, The computer can execute the application deployment method provided by the above methods, and the method includes: determining a list of machines to be deployed and applications to be deployed; dividing deployment batches according to the list of machines to be deployed; wherein, at least one of the deployment batches Including a machine to be deployed; generating a deployment task of the application to be deployed, and sending the deployment task in parallel to the to-be-deployed in each of the deployment batches in an asynchronous manner among the deployment batches A deployment machine is used for the to-be-deployed machine to deploy the to-be-deployed application according to the deployment task.
又一方面,本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的应用部署方法,该方法包括:确定待部署机器列表及待部署应用;根据所述待部署机器列表划分部署批次;其中,每个所述部署批次中至少包括一个所述待部署机器;生成所述待部署应用的部署任务,通过各个所述部署批次之间异步的方式,将所述部署任务并行发送给各个所述部署批次中的所述待部署机器,以供所述待部署机器根据所述部署任务进行所述待部署应用的部署。In yet another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to execute the application deployment method provided by the above methods, and the method Including: determining a list of machines to be deployed and applications to be deployed; dividing deployment batches according to the list of machines to be deployed; wherein, each of the deployment batches includes at least one of the machines to be deployed; A deployment task, sending the deployment task in parallel to the to-be-deployed machines in each of the deployment batches in an asynchronous manner among the deployment batches, so that the to-be-deployed machines can perform the deployment tasks according to the deployment tasks. Deploy the application to be deployed.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be The technical solutions described in the foregoing embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210457295.XA CN114879977A (en) | 2022-04-27 | 2022-04-27 | Application deployment method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210457295.XA CN114879977A (en) | 2022-04-27 | 2022-04-27 | Application deployment method, device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114879977A true CN114879977A (en) | 2022-08-09 |
Family
ID=82671726
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210457295.XA Pending CN114879977A (en) | 2022-04-27 | 2022-04-27 | Application deployment method, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114879977A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116501339A (en) * | 2023-06-26 | 2023-07-28 | 北京凌云雀科技有限公司 | Application deployment method, device, electronic equipment and computer readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180091624A1 (en) * | 2016-09-25 | 2018-03-29 | Salesforce.Com, Inc. | Staging and deployment to multiple service clouds |
CN110990024A (en) * | 2019-11-28 | 2020-04-10 | 合肥讯飞数码科技有限公司 | Application deployment method, device, equipment and storage medium |
CN112162753A (en) * | 2020-09-28 | 2021-01-01 | 腾讯科技(深圳)有限公司 | Software deployment method and device, computer equipment and storage medium |
CN112306525A (en) * | 2020-10-30 | 2021-02-02 | 康键信息技术(深圳)有限公司 | Method, device and equipment for rolling upgrade of application example and storage medium |
CN114201186A (en) * | 2020-09-18 | 2022-03-18 | 北京金山云网络技术有限公司 | On-line method of service, electronic device and storage medium |
-
2022
- 2022-04-27 CN CN202210457295.XA patent/CN114879977A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180091624A1 (en) * | 2016-09-25 | 2018-03-29 | Salesforce.Com, Inc. | Staging and deployment to multiple service clouds |
CN110990024A (en) * | 2019-11-28 | 2020-04-10 | 合肥讯飞数码科技有限公司 | Application deployment method, device, equipment and storage medium |
CN114201186A (en) * | 2020-09-18 | 2022-03-18 | 北京金山云网络技术有限公司 | On-line method of service, electronic device and storage medium |
CN112162753A (en) * | 2020-09-28 | 2021-01-01 | 腾讯科技(深圳)有限公司 | Software deployment method and device, computer equipment and storage medium |
CN112306525A (en) * | 2020-10-30 | 2021-02-02 | 康键信息技术(深圳)有限公司 | Method, device and equipment for rolling upgrade of application example and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116501339A (en) * | 2023-06-26 | 2023-07-28 | 北京凌云雀科技有限公司 | Application deployment method, device, electronic equipment and computer readable storage medium |
CN116501339B (en) * | 2023-06-26 | 2023-09-08 | 北京凌云雀科技有限公司 | Application deployment method, device, electronic equipment and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102493449B1 (en) | Edge computing test methods, devices, electronic devices and computer-readable media | |
CN110532189B (en) | Continuous integration system, method and device | |
CN108196915B (en) | Code processing method and device based on application container engine and storage medium | |
US8166458B2 (en) | Method and system for automated distributed software testing | |
US7694181B2 (en) | Automated software testing framework | |
EP1497721B1 (en) | A software distribution method and system | |
CN111679888B (en) | A method and device for deploying a proxy container | |
CN102622298A (en) | Software testing system and method | |
CN104360952B (en) | A kind of software testing system and method | |
CN107608897A (en) | The method of testing and system of a kind of distributed type assemblies | |
CN114489711A (en) | Terminal upgrade method, device and storage medium | |
CN113127009A (en) | Automatic deployment method and device for big data management platform | |
CN112231073A (en) | Distributed task scheduling method and device | |
CN113672502A (en) | Program multi-system testing method and corresponding device, equipment and medium | |
US11720424B2 (en) | Single flow execution | |
US20090089772A1 (en) | Arrangement for scheduling jobs with rules and events | |
CN114879977A (en) | Application deployment method, device and storage medium | |
US11528185B1 (en) | Automated network device provisioning | |
US12020039B2 (en) | Compute instance warmup operations | |
CN116627437A (en) | Deployment method and device of Airflow service, storage medium and computer equipment | |
WO2009040171A2 (en) | Method, system and computer program for scheduling execution of jobs driven by events | |
CN116244186A (en) | Operating system test management method and device and computing equipment | |
CN118860577B (en) | Method, device, equipment, medium and product for updating status indication information | |
US20240338209A1 (en) | Software life-cycle component management system | |
CN118132450B (en) | A management method and system for Windows integrated test environment |
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 |