CN113268332A - Continuous integration method and device - Google Patents

Continuous integration method and device Download PDF

Info

Publication number
CN113268332A
CN113268332A CN202110643782.0A CN202110643782A CN113268332A CN 113268332 A CN113268332 A CN 113268332A CN 202110643782 A CN202110643782 A CN 202110643782A CN 113268332 A CN113268332 A CN 113268332A
Authority
CN
China
Prior art keywords
module
information
execution
pipeline
template
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
CN202110643782.0A
Other languages
Chinese (zh)
Inventor
张风军
王相阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Soufun Science & Technology Development Co ltd
Original Assignee
Beijing Soufun Science & Technology Development 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 Beijing Soufun Science & Technology Development Co ltd filed Critical Beijing Soufun Science & Technology Development Co ltd
Priority to CN202110643782.0A priority Critical patent/CN113268332A/en
Publication of CN113268332A publication Critical patent/CN113268332A/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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design

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

The invention provides a continuous integration method and a device, wherein the method comprises the following steps: responding to a pipeline arrangement instruction sent by a user, and determining an arrangement template corresponding to the pipeline arrangement execution; displaying the layout template to a user to acquire editing information fed back by the user based on the layout template; processing the editing template based on the editing information to obtain a target template, and generating a configuration file based on the target template; running the configuration file to obtain the pipeline operation corresponding to the configuration file, and distributing an execution node for the pipeline operation by using a scheduler; sending the pipeline operation to an execution node distributed to the pipeline operation, triggering the execution node to execute the pipeline operation, and further finishing continuous integration of software corresponding to the pipeline arrangement and execution; the configuration file is generated by applying the layout template, and the assembly line operation can be obtained after the configuration file is executed.

Description

Continuous integration method and device
Technical Field
The invention relates to the technical field of computers, in particular to a continuous integration method and a continuous integration device.
Background
In order to discover errors of software integration in a software development process as early as possible, it is generally necessary to integrate the work of a plurality of development members, each of which is integrated at least once a day, and each integration is verified through automated construction, such as compilation, release, and automatic testing, so as to discover integration errors, and therefore, continuous integration is an important software development practice.
In the process of continuous integration, developers need to perform processes such as compiling and designing according to a complex task generation mode to generate tasks or operations required by continuous integration of software, and the current continuous integration method needs to spend a large amount of time in generating corresponding tasks or operations, so that the continuous integration efficiency is low.
Disclosure of Invention
In view of this, the present invention provides a persistent integration method and apparatus, which use an orchestration template to quickly generate pipeline operations, thereby improving the efficiency of persistent integration of software.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
a method of persistent integration, comprising:
responding to a pipeline arranging instruction sent by a user, and determining an arranging template corresponding to the pipeline arranging instruction;
displaying the layout template to the user to acquire editing information fed back by the user based on the layout template;
processing the arrangement template based on the editing information to obtain a target template, and generating a configuration file based on the target template;
running the configuration file to obtain the pipeline operation corresponding to the configuration file, and distributing execution nodes for the pipeline operation by using a preset scheduler;
and sending the pipeline operation to an execution node distributed to the pipeline operation, and triggering the execution node to execute the pipeline operation so as to complete continuous integration of software corresponding to the pipeline arrangement instruction.
The above method, optionally, further includes:
acquiring an execution log and an execution result generated when the execution node executes the pipeline operation;
and sending the execution log and the execution result to a front end, so that the front end displays the execution log and the execution result to the user.
Optionally, in the method, processing the layout template based on the editing information to obtain a target template includes:
analyzing the editing information, and judging whether the editing information contains module self-defining information or not;
if the editing information does not contain module self-defining information, acquiring configuration data of each first module in the editing information;
for each first module configuration data, determining a corresponding processing module in the processing modules of the arrangement template, and deploying the first module configuration data to the corresponding processing module;
after each first module configuration data is deployed to the corresponding processing module, obtaining a target template corresponding to the pipeline arrangement instruction;
if the editing information contains module self-defining information, determining a target module corresponding to the arrangement template based on the module self-defining information, and acquiring configuration data of each second module in the editing information;
for each second module configuration data, determining a target module corresponding to each second module configuration data in each target module, and deploying the second module configuration data to the target module corresponding to the second module configuration data;
and after each second module configuration data is deployed to the corresponding target module, obtaining a target template corresponding to the pipeline arranging instruction.
Optionally, the method for determining the target module corresponding to the layout template based on the module customization information includes:
determining module editing information in the module self-defining information, and determining each processing module in the arrangement template;
determining modules to be arranged in each processing module and each standard module of a preset module library based on the module editing information;
acquiring module execution information in the module self-defining information, and determining the execution sequence of each module to be arranged based on the module execution information;
and arranging the modules to be arranged according to the execution sequence of each module to be arranged to obtain a target module corresponding to the arrangement template.
In the foregoing method, optionally, the allocating an execution node for the pipeline job by using a preset scheduler includes:
the scheduler determines the operation attribute of the pipeline operation and acquires the registration information of each node in a preset configuration management center;
determining a registration node corresponding to each node registration information, and acquiring state information and operation attributes of each registration node;
matching the operation attributes with the operation attributes, and determining a registered node to which the operation attribute matched with the operation attribute belongs as a matched node;
and determining the health score of each matching node based on the state information of each matching node, and taking the matching node with the highest health score as the execution node of the pipeline work.
A continuously integrated device, comprising:
the response unit is used for responding to a pipeline arranging instruction sent by a user and determining an arranging template corresponding to the pipeline arranging instruction;
the display unit is used for displaying the arrangement template to the user so as to acquire the editing information fed back by the user based on the arrangement template;
the generating unit is used for processing the arrangement template based on the editing information to obtain a target template and generating a configuration file based on the target template;
the operation unit is used for operating the configuration file, obtaining the pipeline operation corresponding to the configuration file, and distributing execution nodes for the pipeline operation by using a preset scheduler;
and the triggering unit is used for sending the pipeline operation to the execution node distributed to the pipeline operation, and triggering the execution node to execute the pipeline operation so as to complete the continuous integration of the software corresponding to the pipeline arrangement instruction.
The above apparatus, optionally, further comprises:
an acquisition unit configured to acquire an execution log and an execution result generated when the execution node executes the pipeline job;
and the sending unit is used for sending the execution log and the execution result to a front end, so that the front end displays the execution log and the execution result to the user.
The above apparatus, optionally, the generating unit includes:
the judging subunit is used for analyzing the editing information and judging whether the editing information contains module self-defining information;
the first obtaining subunit is configured to obtain, if the editing information does not include module customization information, each first module configuration data in the editing information;
the first determining subunit is used for determining a processing module corresponding to each first module configuration data in each processing module of the arrangement template, and deploying the first module configuration data to the corresponding processing module;
the first deployment subunit is used for acquiring a target template corresponding to the pipeline arranging instruction after the configuration data of each first module is deployed to the corresponding processing module;
the second determining subunit is configured to determine, based on the module customization information, a target module corresponding to the arrangement template if the editing information includes module customization information, and acquire second module configuration data in the editing information;
the second deployment subunit is configured to, for each second module configuration data, determine a target module corresponding to the second module in each target module, and deploy the second module configuration data to the target module corresponding to the second module;
and the second obtaining subunit is configured to obtain, after each second module configuration data is deployed to the corresponding target module, a target template corresponding to the pipeline arranging instruction.
The above apparatus, optionally, the second determining subunit includes:
the third determining subunit is used for determining module editing information in the module self-defining information and determining each processing module in the arrangement template;
a fourth determining subunit, configured to determine, based on the module editing information, modules to be arranged in each of the processing modules and each of the standard modules in the preset module library;
a third obtaining subunit, configured to obtain module execution information in the module customization information, and determine, based on the module execution information, an execution order of each of the modules to be arranged;
and the arrangement subunit is used for arranging the modules to be arranged according to the execution sequence of each module to be arranged to obtain the target module corresponding to the arrangement template.
The above apparatus, optionally, the operation unit includes:
a fourth obtaining subunit, configured to determine, by the scheduler, a job attribute of the pipeline job, and obtain registration information of each node in a preset configuration management center;
a fifth determining subunit, configured to determine a registration node corresponding to each piece of node registration information, and obtain state information and an operation attribute of each registration node;
the matching subunit is used for matching the job attributes with the operation attributes and determining the registered node to which the operation attribute matched with the job attribute belongs as a matched node;
and the sixth determining subunit is configured to determine the health score of each matching node based on the state information of each matching node, and use the matching node with the highest health score as the execution node of the pipeline job.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a continuous integration method and a device, wherein the method comprises the following steps: responding to a pipeline arrangement instruction sent by a user, and determining an arrangement template corresponding to the pipeline arrangement execution; displaying the layout template to a user to acquire editing information fed back by the user based on the layout template; processing the editing template based on the editing information to obtain a target template, and generating a configuration file based on the target template; running the configuration file to obtain the pipeline operation corresponding to the configuration file, and distributing an execution node for the pipeline operation by using a scheduler; sending the pipeline operation to an execution node distributed to the pipeline operation, triggering the execution node to execute the pipeline operation, and further finishing continuous integration of software corresponding to the pipeline arrangement and execution; the configuration file is generated by applying the layout template, the assembly line operation can be obtained after the configuration file is executed, the process is simple, convenient and fast, the time consumption is short, the universality of the layout template is high, the method is suitable for application scenes of various software, the assembly line operation can be generated rapidly, and the continuous integration efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method of persistent integration according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method of a persistent integration method according to an embodiment of the present invention;
FIG. 3 is a flowchart of another method of a persistent integration method according to an embodiment of the present invention;
FIG. 4 is a flowchart of another method of a persistent integration method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a persistent integration apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In order to improve the efficiency of continuous integration, the invention provides a continuous integration method, which is used for a continuous integration platform, wherein a continuous integration engine is loaded in the continuous integration platform, and the continuous integration platform is built by using a computer terminal or an intelligent terminal device.
Referring to fig. 1, a flowchart of a method of a persistent integration method according to an embodiment of the present invention is provided, where a main execution body of the method is a processor or a server in a persistent integration platform, and the method shown in fig. 1 is described as follows:
s101, responding to a pipeline arranging instruction sent by a user, and determining an arranging template corresponding to the pipeline arranging instruction.
When a user sends the assembly line arrangement execution through the assembly line front end arrangement device, the back end processor analyzes the assembly line arrangement execution to obtain the template identification in the assembly line arrangement instruction, traverses each arrangement template in the template library, determines the arrangement template corresponding to the template identification in the template library, and determines the arrangement template corresponding to the template identification as the arrangement template corresponding to the assembly line arrangement instruction.
The template library is stored with a plurality of preset arranging templates, each arranging template comprises at least one processing module, each processing module has different functions, and further, the execution sequence of each processing module in the arranging template is preset.
And S102, displaying the arrangement template to the user to acquire the editing information fed back by the user based on the arrangement template.
The back-end processor sends the layout template to the front-end, so that the front-end displays the layout template to a user, the user inputs editing information about the layout template to the front-end based on the integration requirement of the user, and the front-end sends the editing information to the back-end processor, so that the back-end processor can obtain the editing information fed back by the user based on the layout template.
The editing information includes information that the user edits the layout template, wherein the operation of editing the layout template includes, but is not limited to, deleting the processing module in the layout template, adding the processing module to the layout template, and the like.
S103, processing the layout template based on the editing information to obtain a target template, and generating a configuration file based on the target template.
When the configuration file is generated according to the target template, the configuration file may be generated according to the execution sequence and the execution configuration of each processing module in the target template, where the configuration file includes various configuration data of the target template, such as arrangement information and execution information of the modules in the target template.
Referring to fig. 2, a flowchart of one method for processing an arrangement template based on editing information to obtain a target template according to an embodiment of the present invention is specifically described as follows:
s201, analyzing the editing information, and judging whether the editing information contains module self-defining information; if the editing information does not contain module self-defining information, executing S202; if the editing information includes module customization information, S205 is executed.
Analyzing the editing information, judging whether the editing information contains a change identifier, and if the editing information contains the change identifier, determining that the editing information contains module self-defined information; and if the editing information does not contain the change identification, determining that the editing information does not contain the module self-defining information.
The change identifier is used for representing that the user needs to change the processing module in the arrangement template, the module self-defined information is specific change information of the user on the processing module in the change arrangement template, and further, specific types of the processing module in the user change arrangement template include but are not limited to adding the processing module, deleting the processing module and the like.
S202, obtaining the configuration data of each first module in the editing information.
S203, for each first module configuration data, determining a corresponding processing module in each processing module of the arrangement template, and deploying the first module configuration data to the corresponding processing module.
The different first module configuration data correspond to different processing modules, the first module configuration data correspond to the processing modules one to one, the first configuration data are a set of data input by a user according to editable fields of the processing modules, wherein the editable fields of the different processing modules are different, and the editable fields can be specifically such as project names, source code catalogues, source code codes, project versions and the like.
The first configuration data is deployed to the processing module to complete configuration of execution logic of the processing module.
And S204, after each first module configuration data is deployed to the corresponding processing module, obtaining a target template corresponding to the pipeline arranging instruction.
It should be noted that, the execution sequence of each processing module in the arrangement template is preset, and after the configuration data of each first module is deployed to the corresponding processing module, the execution configuration of the arrangement template is completed, so that the target template corresponding to the pipeline arrangement instruction can be obtained.
S205, determining a target module corresponding to the arrangement template based on the module self-defining information, and acquiring configuration data of each second module in the editing information.
In the case that the editing information includes module customization information, an object module corresponding to the layout template needs to be determined first, and referring to fig. 3, a flowchart of a method for determining an object module corresponding to the layout template provided by the present invention is described as follows:
s301, determining module editing information in the module self-defining information, and determining each processing module in the arrangement template.
The module edit information includes information on a specific operation of the process module in the layout template, module information, and the like.
S302, determining modules to be arranged in each processing module and each standard module of a preset module library based on the module editing information.
When the arrangement template is operated, the processing modules in the arrangement template are added and deleted. The processing module and the standard module in the invention include, but are not limited to, a code pulling module, a code scanning module, a code compiling module, a mirror image constructing module, a mirror image uploading module, a file uploading module and the like.
When the editing operation performed on the layout template includes adding a processing module in the layout template, the specific operation is as follows: the method comprises the steps of acquiring a first module identification and insertion position information in module editing information, determining a standard module corresponding to the first module identification in a preset module library, adding the determined standard module into an arrangement template based on the insertion position information, and determining each processing module and the added standard module in the arrangement template as modules to be arranged.
When the editing operation performed on the layout template includes deleting the processing module in the layout template, the specific operation is as follows: and acquiring a second module identifier in the module editing information, determining a processing module corresponding to the second module identifier in each processing module, deleting the processing module corresponding to the second module identifier, and determining each processing module which is not deleted in the arrangement template as a module to be arranged.
Further, the module editing information may only include one of the related information of adding the processing module in the layout template, deleting the processing module in the layout template, and reordering the processing modules in the layout template, or may include all of the related information.
S303, obtaining module execution information in the module self-defining information, and determining the execution sequence of each module to be arranged based on the module execution information.
The module execution information includes an execution sequence of each module to be arranged set by a user, and the execution sequence of each module to be arranged can be determined based on the module execution information.
S304, arranging the modules to be arranged according to the execution sequence of each target module to obtain the target modules corresponding to the arrangement template.
And arranging the modules to be arranged based on the execution sequence of each module to be arranged so as to obtain a target module corresponding to the arrangement template.
It should be noted that the execution order of each module in the layout template is determined, and each template is arranged according to the execution order.
In the method provided by the embodiment of the invention, the user can perform self-defined operation on the arrangement template, delete the modules in the arrangement template or add the templates into the arrangement template, so that a user can perform deletion and addition operation on the modules in the arrangement template according to the self requirement, and arrange the modules after determining the execution sequence of the modules, thereby standardizing and ordering the modules in the arrangement template.
S206, for each second module configuration data, determining a corresponding target module in each target module, and deploying the second module configuration data to the corresponding target module.
Each second module configuration data is a set of data input by a user according to each editable field of the target module, specifically, when the target module is a code pulling module, the editable fields in the module include, but are not limited to, a project name, a source code directory, a source code, a project version, and the like, the user inputs corresponding data according to the editable fields, and the data input by the user is composed into second module configuration data corresponding to the target module.
After the configuration data of each second module in the editing information is acquired, for each second module configuration data, a target module corresponding to the second module configuration data is determined, and the second module configuration data is deployed to the target module corresponding to the second module configuration data, so that corresponding data exist in editable fields in the target module.
And S207, after the configuration data of each second module is deployed to the corresponding target module, obtaining a target template corresponding to the pipeline arranging instruction.
In the method provided by the embodiment of the invention, when the self-defining operation is performed on the modules in the arrangement template, the modules in the arrangement template can be deleted, the modules can be added into the arrangement template, and the modules in the arrangement template are rearranged, so that the arrangement template can be applied to various different software application scenes, the universality and the adaptability of the arrangement template are improved, a user can quickly generate pipeline operation, and the efficiency of continuous integration is further improved.
And S104, operating the configuration file to obtain the pipeline operation corresponding to the configuration file, and distributing execution nodes for the pipeline operation by using a preset scheduler.
The configuration file is operated, so that the pipeline operation corresponding to the configuration file can be obtained, wherein the pipeline operation can be obtained by operating the configuration file once, the pipeline operation can also be called a continuous integration task, the number of operating the configuration file can be set according to the actual requirement of a user, and preferably, the method is explained by operating once.
After obtaining the pipeline job, allocating an execution node for the pipeline job by using a scheduler, where the scheduler is specifically a schedule scheduler, and a specific process of allocating an execution node for the pipeline job by the scheduler may refer to fig. 4, which is described in detail as follows:
s401, the scheduler determines the operation attribute of the pipeline operation and acquires the registration information of each node in a preset configuration management center.
The job attribute specifically includes an editing language type, an execution environment attribute, a job type, and the like of the pipeline job, where the editing language specifically includes C language, java language, and the like, the job type specifically includes python, exe, and the execution environment attribute specifically includes information of a system to be executed by the pipeline job, and the like.
The scheduler acquires registration information of each node in the configuration management center, wherein the configuration management center can be Consul, the Consul is a service discovery and configuration management center service developed by using a go language, a service registration and discovery framework, a distributed consistency protocol implementation, health check, Key/Value storage and a multi-data center scheme are built in the configuration management center service, no other tools (such as ZooKeeper and the like) are required to be relied on, and each node needs to be registered in the configuration management center when starting work so that the configuration management center can contain node work information of the node.
S402, determining a registration node corresponding to each node registration information, and acquiring the state information and the operation attribute of each registration node.
The node registration information comprises node identification information, registration nodes corresponding to the node registration information are determined based on the node identification information in the node registration information, and state information and operation attributes of each registration node are obtained, wherein the state information comprises but is not limited to information such as CPU (Central processing Unit) utilization rate, memory utilization rate and disk use state of the node; the operation attribute includes system information of the node, such as an ios system, a linux system, a Windows system, or an Android system.
And S403, matching the job attributes with the operation attributes, and determining the registered node to which the operation attribute matched with the job attribute belongs as a matched node.
And matching the job attributes with the operation attributes to determine the operation attributes corresponding to the job attributes in the operation attributes, wherein the system information in the operation attributes corresponding to the job attributes is matched with the environment operation attributes in the job attributes, and specifically, if the environment operation attributes in the job attributes are operated in the ios system, the operation attributes of the ios system including the system information are determined as the operation attributes corresponding to the job attributes.
Furthermore, the number of the operation attributes corresponding to the operation attributes is at least one, and the registration node to which the operation attributes corresponding to the operation attributes belong is determined as a matching node; specifically, if the operation attribute corresponding to the job attribute is the operation attribute 1 and the operation attribute 2, both the registration node to which the operation attribute 1 belongs and the registration node to which the operation attribute 2 belongs are determined as matching nodes.
S404, determining the health score of each matching node based on the state information of each matching node, and taking the matching node with the highest health score as the execution node of the pipeline operation.
And for each matching node, processing the state information of the matching node by using a consistent hash algorithm so as to obtain a health score of the matching node, wherein the health score can be used for representing the health state of the matching node, and the health state of the matching node is better when the health score is higher.
And determining the matching node with the highest health score in all the matching nodes, and taking the matching node with the highest health score as an execution node of the pipeline operation.
In the method provided by the embodiment of the invention, based on the operation attribute of the pipeline operation, the state information and the running information of the registration order, the execution node is distributed for the pipeline operation, wherein the execution node distributed for the pipeline operation is the node which meets the execution environment requirement of the pipeline operation and has the best health state, the node with the healthy state is provided for the pipeline operation, the smooth execution of the pipeline operation is ensured, the workload of each node in the platform is balanced, the optimal distribution of resources is realized, and the waste of resources is avoided.
And S105, sending the pipeline operation to an execution node distributed to the pipeline operation, and triggering the execution node to execute the pipeline operation so as to complete continuous integration of software corresponding to the pipeline arrangement instruction.
When the pipeline operation is sent to the execution node distributed to the pipeline operation, the pipeline operation is carried out according to the sending information of the pipeline operation, and particularly when the sending information of the pipeline operation represents that the pipeline operation is timing operation, the pipeline operation can be sent to the execution node after the time reaches the time node in the sending information; if the sending information of the pipelining represents that the pipelining is real-time operation, directly sending the pipelining to an execution node; further, after the pipeline operation is sent to the execution node, the execution node may have a plurality of pipeline operations, and when the pipeline operation is received, the execution node needs to queue the received pipeline operations and execute the pipeline operations in sequence, wherein when the pipeline operation is queued, the queuing can be performed according to the sequence of arrival time of each pipeline operation, or according to the priority of each pipeline operation from high to low, and the queuing manner of the pipeline operation is not described herein one by one.
Furthermore, when the execution node executes the pipeline operation, an execution log and an execution result corresponding to the pipeline operation can be generated, the execution node feeds the execution log and the execution result back to the back-end processor, so that the back-end processor obtains the execution log and the execution result, the back-end processor can send the execution log and the execution result to the front end, and the front end displays the execution log and the execution result to a user; therefore, the user can check the execution result and the execution log of the execution node at any time at the front end.
In the method provided by the embodiment of the invention, an arrangement template corresponding to the arrangement and execution of the production line is determined in response to a production line arrangement instruction sent by a user; displaying the layout template to a user to acquire editing information fed back by the user based on the layout template; processing the editing template based on the editing information to obtain a target template, and generating a configuration file based on the target template; running the configuration file to obtain the pipeline operation corresponding to the configuration file, and distributing an execution node for the pipeline operation by using a scheduler; sending the pipeline operation to an execution node distributed to the pipeline operation, triggering the execution node to execute the pipeline operation, and further finishing continuous integration of software corresponding to the pipeline arrangement and execution; the configuration file is generated by applying the layout template, the assembly line operation can be obtained after the configuration file is executed, the process is simple, convenient and fast, the time consumption is short, the universality of the layout template is high, and the method can be suitable for application scenes of various software, so that the assembly line operation can be quickly generated, and the efficiency of continuous integration is improved.
Corresponding to the method shown in fig. 1, the present invention further provides a persistent integration apparatus, which is disposed on a persistent integration platform, where the persistent integration platform may be formed by using a computer terminal or a distributed intelligent device, and the apparatus is used to support the application of the method shown in fig. 1 in real life, and a schematic structural diagram of the apparatus is shown in fig. 5, which is specifically described as follows:
a response unit 501, configured to determine, in response to a pipeline arrangement instruction sent by a user, an arrangement template corresponding to the pipeline arrangement instruction;
a display unit 502, configured to display the layout template to the user to obtain editing information fed back by the user based on the layout template;
a generating unit 503, configured to process the layout template based on the editing information to obtain a target template, and generate a configuration file based on the target template;
an operation unit 504, configured to operate the configuration file, obtain a pipeline job corresponding to the configuration file, and allocate an execution node for the pipeline job by using a preset scheduler;
and a triggering unit 505, configured to send the pipeline job to an execution node allocated to the pipeline job, and trigger the execution node to execute the pipeline job, so as to complete continuous integration of software corresponding to the pipeline orchestration instruction.
In the device provided by the embodiment of the invention, in response to a pipeline arrangement instruction sent by a user, an arrangement template corresponding to the pipeline arrangement execution is determined; displaying the layout template to a user to acquire editing information fed back by the user based on the layout template; processing the editing template based on the editing information to obtain a target template, and generating a configuration file based on the target template; running the configuration file to obtain the pipeline operation corresponding to the configuration file, and distributing an execution node for the pipeline operation by using a scheduler; sending the pipeline operation to an execution node distributed to the pipeline operation, triggering the execution node to execute the pipeline operation, and further finishing continuous integration of software corresponding to the pipeline arrangement and execution; the configuration file is generated by applying the layout template, the assembly line operation can be obtained after the configuration file is executed, the process is simple, convenient and fast, the time consumption is short, the universality of the layout template is high, and the method can be suitable for application scenes of various software, so that the assembly line operation can be quickly generated, and the efficiency of continuous integration is improved.
In the apparatus provided in the embodiment of the present invention, the apparatus may further be configured to:
an acquisition unit configured to acquire an execution log and an execution result generated when the execution node executes the pipeline job;
and the sending unit is used for sending the execution log and the execution result to a front end, so that the front end displays the execution log and the execution result to the user.
In the apparatus provided in the embodiment of the present invention, the generating unit 503 may be configured to:
the judging subunit is used for analyzing the editing information and judging whether the editing information contains module self-defining information;
the first obtaining subunit is configured to obtain, if the editing information does not include module customization information, each first module configuration data in the editing information;
the first determining subunit is used for determining a processing module corresponding to each first module configuration data in each processing module of the arrangement template, and deploying the first module configuration data to the corresponding processing module;
the first deployment subunit is used for acquiring a target template corresponding to the pipeline arranging instruction after the configuration data of each first module is deployed to the corresponding processing module;
the second determining subunit is configured to determine, based on the module customization information, a target module corresponding to the arrangement template if the editing information includes module customization information, and acquire second module configuration data in the editing information;
the second deployment subunit is configured to, for each second module configuration data, determine a target module corresponding to the second module in each target module, and deploy the second module configuration data to the target module corresponding to the second module;
and the second obtaining subunit is configured to obtain, after each second module configuration data is deployed to the corresponding target module, a target template corresponding to the pipeline arranging instruction.
In the apparatus provided in the embodiment of the present invention, the second determining subunit may be configured to:
the third determining subunit is used for determining module editing information in the module self-defining information and determining each processing module in the arrangement template;
a fourth determining subunit, configured to determine, based on the module editing information, modules to be arranged in each of the processing modules and each of the standard modules in the preset module library;
a third obtaining subunit, configured to obtain module execution information in the module customization information, and determine, based on the module execution information, an execution order of each of the modules to be arranged;
and the arrangement subunit is used for arranging the modules to be arranged according to the execution sequence of each module to be arranged to obtain the target module corresponding to the arrangement template.
In the apparatus provided in the embodiment of the present invention, the operation unit 504 may be configured to:
a fourth obtaining subunit, configured to determine, by the scheduler, a job attribute of the pipeline job, and obtain registration information of each node in a preset configuration management center;
a fifth determining subunit, configured to determine a registration node corresponding to each piece of node registration information, and obtain state information and an operation attribute of each registration node;
the matching subunit is used for matching the job attributes with the operation attributes and determining the registered node to which the operation attribute matched with the job attribute belongs as a matched node;
and the sixth determining subunit is configured to determine the health score of each matching node based on the state information of each matching node, and use the matching node with the highest health score as the execution node of the pipeline job.
The embodiment of the invention also provides a storage medium, which comprises a stored instruction, wherein when the instruction runs, the device where the storage medium is located is controlled to execute the continuous integration method.
An electronic device is provided in an embodiment of the present invention, and the structural diagram of the electronic device is shown in fig. 6, which specifically includes a memory 601 and one or more instructions 602, where the one or more instructions 602 are stored in the memory 601 and configured to be executed by one or more processors 603 to perform the following operations on the one or more instructions 602:
responding to a pipeline arranging instruction sent by a user, and determining an arranging template corresponding to the pipeline arranging instruction;
displaying the layout template to the user to acquire editing information fed back by the user based on the layout template;
processing the arrangement template based on the editing information to obtain a target template, and generating a configuration file based on the target template;
running the configuration file to obtain the pipeline operation corresponding to the configuration file, and distributing execution nodes for the pipeline operation by using a preset scheduler;
and sending the pipeline operation to an execution node distributed to the pipeline operation, and triggering the execution node to execute the pipeline operation so as to complete continuous integration of software corresponding to the pipeline arrangement instruction.
The specific implementation procedures and derivatives thereof of the above embodiments are within the scope of the present invention.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present 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 persistent integration, comprising:
responding to a pipeline arranging instruction sent by a user, and determining an arranging template corresponding to the pipeline arranging instruction;
displaying the layout template to the user to acquire editing information fed back by the user based on the layout template;
processing the arrangement template based on the editing information to obtain a target template, and generating a configuration file based on the target template;
running the configuration file to obtain the pipeline operation corresponding to the configuration file, and distributing execution nodes for the pipeline operation by using a preset scheduler;
and sending the pipeline operation to an execution node distributed to the pipeline operation, and triggering the execution node to execute the pipeline operation so as to complete continuous integration of software corresponding to the pipeline arrangement instruction.
2. The method of claim 1, further comprising:
acquiring an execution log and an execution result generated when the execution node executes the pipeline operation;
and sending the execution log and the execution result to a front end, so that the front end displays the execution log and the execution result to the user.
3. The method of claim 1, wherein processing the layout template based on the editing information to obtain a target template comprises:
analyzing the editing information, and judging whether the editing information contains module self-defining information or not;
if the editing information does not contain module self-defining information, acquiring configuration data of each first module in the editing information;
for each first module configuration data, determining a corresponding processing module in the processing modules of the arrangement template, and deploying the first module configuration data to the corresponding processing module;
after each first module configuration data is deployed to the corresponding processing module, obtaining a target template corresponding to the pipeline arrangement instruction;
if the editing information contains module self-defining information, determining a target module corresponding to the arrangement template based on the module self-defining information, and acquiring configuration data of each second module in the editing information;
for each second module configuration data, determining a target module corresponding to each second module configuration data in each target module, and deploying the second module configuration data to the target module corresponding to the second module configuration data;
and after each second module configuration data is deployed to the corresponding target module, obtaining a target template corresponding to the pipeline arranging instruction.
4. The method of claim 3, wherein determining the goal module corresponding to the orchestration template based on the module customization information comprises:
determining module editing information in the module self-defining information, and determining each processing module in the arrangement template;
determining modules to be arranged in each processing module and each standard module of a preset module library based on the module editing information;
acquiring module execution information in the module self-defining information, and determining the execution sequence of each module to be arranged based on the module execution information;
and arranging the modules to be arranged according to the execution sequence of each module to be arranged to obtain a target module corresponding to the arrangement template.
5. The method of claim 1, wherein the allocating execution nodes for the pipeline job using a pre-defined scheduler comprises:
the scheduler determines the operation attribute of the pipeline operation and acquires the registration information of each node in a preset configuration management center;
determining a registration node corresponding to each node registration information, and acquiring state information and operation attributes of each registration node;
matching the operation attributes with the operation attributes, and determining a registered node to which the operation attribute matched with the operation attribute belongs as a matched node;
and determining the health score of each matching node based on the state information of each matching node, and taking the matching node with the highest health score as the execution node of the pipeline work.
6. A persistent integration device, comprising:
the response unit is used for responding to a pipeline arranging instruction sent by a user and determining an arranging template corresponding to the pipeline arranging instruction;
the display unit is used for displaying the arrangement template to the user so as to acquire the editing information fed back by the user based on the arrangement template;
the generating unit is used for processing the arrangement template based on the editing information to obtain a target template and generating a configuration file based on the target template;
the operation unit is used for operating the configuration file, obtaining the pipeline operation corresponding to the configuration file, and distributing execution nodes for the pipeline operation by using a preset scheduler;
and the triggering unit is used for sending the pipeline operation to the execution node distributed to the pipeline operation, and triggering the execution node to execute the pipeline operation so as to complete the continuous integration of the software corresponding to the pipeline arrangement instruction.
7. The apparatus of claim 6, further comprising:
an acquisition unit configured to acquire an execution log and an execution result generated when the execution node executes the pipeline job;
and the sending unit is used for sending the execution log and the execution result to a front end, so that the front end displays the execution log and the execution result to the user.
8. The apparatus of claim 6, wherein the generating unit comprises:
the judging subunit is used for analyzing the editing information and judging whether the editing information contains module self-defining information;
the first obtaining subunit is configured to obtain, if the editing information does not include module customization information, each first module configuration data in the editing information;
the first determining subunit is used for determining a processing module corresponding to each first module configuration data in each processing module of the arrangement template, and deploying the first module configuration data to the corresponding processing module;
the first deployment subunit is used for acquiring a target template corresponding to the pipeline arranging instruction after the configuration data of each first module is deployed to the corresponding processing module;
the second determining subunit is configured to determine, based on the module customization information, a target module corresponding to the arrangement template if the editing information includes module customization information, and acquire second module configuration data in the editing information;
the second deployment subunit is configured to, for each second module configuration data, determine a target module corresponding to the second module in each target module, and deploy the second module configuration data to the target module corresponding to the second module;
and the second obtaining subunit is configured to obtain, after each second module configuration data is deployed to the corresponding target module, a target template corresponding to the pipeline arranging instruction.
9. The apparatus of claim 8, wherein the second determining subunit comprises:
the third determining subunit is used for determining module editing information in the module self-defining information and determining each processing module in the arrangement template;
a fourth determining subunit, configured to determine, based on the module editing information, modules to be arranged in each of the processing modules and each of the standard modules in the preset module library;
a third obtaining subunit, configured to obtain module execution information in the module customization information, and determine, based on the module execution information, an execution order of each of the modules to be arranged;
and the arrangement subunit is used for arranging the modules to be arranged according to the execution sequence of each module to be arranged to obtain the target module corresponding to the arrangement template.
10. The apparatus of claim 6, wherein the operation unit comprises:
a fourth obtaining subunit, configured to determine, by the scheduler, a job attribute of the pipeline job, and obtain registration information of each node in a preset configuration management center;
a fifth determining subunit, configured to determine a registration node corresponding to each piece of node registration information, and obtain state information and an operation attribute of each registration node;
the matching subunit is used for matching the job attributes with the operation attributes and determining the registered node to which the operation attribute matched with the job attribute belongs as a matched node;
and the sixth determining subunit is configured to determine the health score of each matching node based on the state information of each matching node, and use the matching node with the highest health score as the execution node of the pipeline job.
CN202110643782.0A 2021-06-09 2021-06-09 Continuous integration method and device Pending CN113268332A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110643782.0A CN113268332A (en) 2021-06-09 2021-06-09 Continuous integration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110643782.0A CN113268332A (en) 2021-06-09 2021-06-09 Continuous integration method and device

Publications (1)

Publication Number Publication Date
CN113268332A true CN113268332A (en) 2021-08-17

Family

ID=77234985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110643782.0A Pending CN113268332A (en) 2021-06-09 2021-06-09 Continuous integration method and device

Country Status (1)

Country Link
CN (1) CN113268332A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108958721A (en) * 2018-07-09 2018-12-07 中国科学院软件研究所 A kind of intelligence continuous integrating with persistently dispose pipelining technique and system
CN111722842A (en) * 2020-05-29 2020-09-29 北京宝兰德软件股份有限公司 Pipeline arranging method and device, electronic equipment and storage medium
CN112328229A (en) * 2020-11-06 2021-02-05 无锡江南计算技术研究所 Method for quickly creating Jenkins assembly line

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108958721A (en) * 2018-07-09 2018-12-07 中国科学院软件研究所 A kind of intelligence continuous integrating with persistently dispose pipelining technique and system
CN111722842A (en) * 2020-05-29 2020-09-29 北京宝兰德软件股份有限公司 Pipeline arranging method and device, electronic equipment and storage medium
CN112328229A (en) * 2020-11-06 2021-02-05 无锡江南计算技术研究所 Method for quickly creating Jenkins assembly line

Similar Documents

Publication Publication Date Title
CN109117363B (en) Test case generation method and device and server
US9519884B2 (en) Data driven dynamic workflow
CN110603522A (en) Method for containerizing application program on cloud platform
CN106970880A (en) A kind of distributed automatization method for testing software and system
CN110647332A (en) Software deployment method and device based on container cloud
US20180129595A1 (en) Method of automatically testing smart device application program using permission booster
US9542161B2 (en) Method and system for generating a source code for a computer program for execution and simulation of a process
CN114237676A (en) FPGA (field programmable Gate array) logic updating method, device, equipment and readable storage medium
CN101753619A (en) Method and system for extending service model
CN111598428A (en) Method and device for managing process nodes, storage medium and server
CN114546588A (en) Task deployment method and device, storage medium and electronic device
CN110096304A (en) Task construction method, device, equipment and storage medium based on Jenkins
CN113238851A (en) Script automatic execution method, system, equipment and medium based on cloud platform
CN110806891B (en) Method and device for generating software version of embedded device
EP4007955A1 (en) Parallel cloned workflow execution
CN110764911A (en) Resource scheduling method, device and control system based on order
CN114327779B (en) Application running environment building method, device and storage medium
CN113268332A (en) Continuous integration method and device
CN112363700A (en) Cooperative creation method and device of intelligent contract, computer equipment and storage medium
CN110096377B (en) Method for realizing customized software release
CN114500268B (en) Method and device for deploying char resources, server and storage medium
CN113126961B (en) Pipeline processing method, device and storage medium
CN115373696B (en) Low code configuration method, system, equipment and storage medium for software resource generation
CN114968339A (en) Method for deploying software infrastructure resources based on directed acyclic graph characteristics
CN112612514A (en) Program development method and device, storage medium and electronic device

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