CN114296871A - Container-based continuous integration method, device and system, working node and medium - Google Patents

Container-based continuous integration method, device and system, working node and medium Download PDF

Info

Publication number
CN114296871A
CN114296871A CN202111578302.3A CN202111578302A CN114296871A CN 114296871 A CN114296871 A CN 114296871A CN 202111578302 A CN202111578302 A CN 202111578302A CN 114296871 A CN114296871 A CN 114296871A
Authority
CN
China
Prior art keywords
compiling
mirror image
latest
image
integrated
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
CN202111578302.3A
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.)
Human Horizons Shanghai Internet Technology Co Ltd
Original Assignee
Human Horizons Shanghai Internet Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Human Horizons Shanghai Internet Technology Co Ltd filed Critical Human Horizons Shanghai Internet Technology Co Ltd
Priority to CN202111578302.3A priority Critical patent/CN114296871A/en
Publication of CN114296871A publication Critical patent/CN114296871A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a continuous integration method, a device and a system based on a container, a working node and a storage medium, wherein the method comprises the following steps: in response to receiving a continuous integration task aiming at the target code engineering and sent by a task management node, acquiring a dependent mirror image generation script of the target code engineering; the method comprises the steps that a dependence mirror image generation script comprises a compiling environment and configuration information of dependence items; generating a script according to the dependence mirror image, and generating a latest compiling integrated mirror image of the object code engineering; the latest compiling integrated image comprises a compiling environment, a dependent item and a compiler for compiling codes according to the compiling environment and the dependent item; distributing the latest compiling integrated mirror image to a corresponding compiling working area, and compiling the object code engineering in the compiling environment of the latest compiling integrated mirror image; and emptying the compiling work area after compiling is finished. The invention can improve the execution efficiency and the resource reuse rate of continuous integration.

Description

Container-based continuous integration method, device and system, working node and medium
Technical Field
The invention relates to the technical field of software development, in particular to a container-based continuous integration method, device and system, a working node and a storage medium.
Background
During the software development process, developers need to perform continuous integration. In order to normally execute the continuously integrated compiling work, a compiling environment, a large number of dependent projects, a compiling tool chain and an operating system need to be installed and configured in a work node, but because the configurations required by different code projects are different, for different types of continuously integrated tasks, a large amount of time needs to be consumed to configure different types of work nodes, and the work nodes cannot share resources, so that the execution efficiency and the resource utilization rate of the continuous integration are influenced.
Disclosure of Invention
The embodiment of the invention provides a container-based continuous integration method, device and system, a working node and a storage medium, which can improve the execution efficiency and the resource reuse rate of continuous integration.
In a first aspect, an embodiment of the present invention provides a container-based persistent integration method, including:
in response to receiving a continuous integration task aiming at an object code project, which is sent by a task management node, acquiring a dependent mirror image generation script of the object code project; the dependency image generation script comprises configuration information of a compiling environment and a dependency item;
generating a latest compiling integrated mirror image of the object code engineering according to the dependence mirror image generation script; the latest compiling integrated image comprises a compiling environment, a dependent item and a compiler for compiling codes according to the compiling environment and the dependent item;
distributing the latest compiling integrated mirror image to a corresponding compiling working area, and compiling the object code project in a compiling environment of the latest compiling integrated mirror image;
and emptying the compiling work area after compiling is finished.
As an improvement of the above scheme, the dependent image generation script further includes compiling an integrated image ID; the configuration information comprises installation information and updating information;
generating a script according to the dependent image to generate a latest compiled integrated image of the object code project, specifically including:
acquiring a compiled integrated mirror image corresponding to the object code project from the compiled integrated mirror image warehouse according to the compiled integrated mirror image ID;
if the acquisition is successful, updating the compiling integrated mirror image of the object code project according to the updating information to obtain the latest compiling integrated mirror image of the object code project;
and if the acquisition fails, carrying out mirror image installation according to the installation information to obtain a latest compiled integrated mirror image of the object code engineering, and storing the latest compiled integrated mirror image and the compiled integrated mirror image ID in the compiled integrated mirror image warehouse in an associated manner.
As an improvement of the above solution, the compiling the object code engineering in the compiling environment of the latest compiling integrated image specifically includes:
and starting the latest compiling integrated mirror image for compiling by respectively taking the directory of the object code project and the directory of the compiling working area as a compiling code source address and a compiling file output address.
As an improvement of the above scheme, the file obtained by compiling comprises an executable file;
before clearing the compilation workspace after the compilation is complete, the method further comprises:
and saving the executable file to a publishing component warehouse.
As an improvement of the above scheme, the dependency image generation script further includes configuration information of an image generation plug-in; the latest compiled integrated image also comprises the image generation plug-in; the image generation plug-in is used for generating a compiling result image corresponding to the executable file;
the file obtained by compiling further includes the compilation result image.
As an improvement of the above solution, before clearing the compiling work area after the compiling is completed, the method further includes:
and storing the compiling result mirror image to a release mirror image warehouse.
In a second aspect, an embodiment of the present invention provides a container-based persistent integration apparatus, including:
the script acquisition module is used for responding to a received continuous integration task aiming at the object code engineering sent by the task management node and acquiring a dependent mirror image generation script of the object code engineering; the dependency image generation script comprises configuration information of a compiling environment and a dependency item;
the image generation module is used for generating a script according to the dependence image and generating a latest compiling integrated image of the object code engineering; the latest compiling integrated image comprises a compiling environment, a dependent item and a compiler for compiling codes according to the compiling environment and the dependent item;
the code compiling module is used for distributing the latest compiling integrated mirror image to a corresponding compiling working area and compiling the object code project in a compiling environment of the latest compiling integrated mirror image;
and the working area clearing module is used for clearing the compiling working area after compiling is finished.
In a third aspect, an embodiment of the present invention provides a work node, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the processor implements any one of the container-based persistent integration methods provided in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a container-based persistent integration system, including a code repository, a trigger, a master node, and one or more working nodes provided in the third aspect;
the code warehouse is used for receiving and storing code projects submitted by users;
the trigger is used for generating a compiling trigger request aiming at a target code project corresponding to a code change event when the code change event is detected in the code warehouse and sending the compiling trigger request to the main node;
and the main node is used for responding to the compiling trigger request, generating a continuous integration task aiming at the target code project and sending the continuous integration task to any idle working node.
In a fifth aspect, the embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, where the computer program, when running, controls an apparatus where the computer-readable storage medium is located to perform any one of the container-based persistent integration methods provided in the first aspect.
Compared with the prior art, the container-based continuous integration method, the device, the system, the working node and the storage medium provided by the embodiment of the invention, by acquiring the dependent mirror generation script of the target code project when receiving the continuous integration task aiming at the target code project sent by the main node, so as to generate the latest compiling integrated mirror image of the object code engineering, then the latest compiling integrated mirror image is distributed to the pre-constructed compiling work area, compiling the object code project in the compiling environment of the latest compiling integrated mirror image to obtain a compiling file, the compilation workspace is then emptied, thereby enabling rapid configuration of the compilation dependent environment using container techniques, and the isolation of the compiling dependent environment is realized, so that different types of continuous integration tasks can share the resources of the same working node, and the execution efficiency and the resource reuse rate of the continuous integration are improved.
Drawings
FIG. 1 is a schematic flow chart diagram of a container-based persistent integration method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a worker node performing a persistent integration method provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of a worker node in the prior art;
FIGS. 4a and 4b are specific flow charts of a container-based persistent integration method according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a container-based continuously integrated apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a working node according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a container-based persistent integration system 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.
Fig. 1 is a schematic flow chart of a container-based persistent integration method according to an embodiment of the present invention.
The continuous integration method based on the container provided by the embodiment comprises the following steps:
s11, responding to the received continuous integration task aiming at the object code engineering sent by the task management node, and acquiring a dependent mirror image generation script of the object code engineering; wherein the dependency image generation script includes configuration information of a compilation environment and a dependent item.
S12, generating a script according to the dependence mirror image, and generating a latest compiling integrated mirror image of the object code engineering; the latest compiling integrated image comprises a compiling environment, a dependent item and a compiler for compiling codes according to the compiling environment and the dependent item.
And S13, distributing the latest compiling integrated mirror image to a corresponding compiling working area, and compiling the object code engineering in the compiling environment of the latest compiling integrated mirror image.
And S15, emptying the compiling work area after compiling is completed.
Specifically, the dependent project includes an internal dependency source, an external dependency source, and a dependent operating system, where an internal dependency indicates that a file in the code project is dependent on another file in the code project, and an external dependency indicates that a file in the code project is dependent on another file outside the code project. The dependent image generation script may include an environment variable configuration generation script, a compiled computing resource requirement limit, an operating system name and version dependent on the base image, an internal dependent source setting script, an external dependent source setting script, and a dependent image generation script dependent on the operating system environment, such that the compiled integrated image may be generated according to the dependent image generation script. Illustratively, the dependency image generation script is stored in a root directory of the code project.
Exemplarily, as shown in fig. 2, an execution device of the method provided in this embodiment is a work node, the work node may be pre-divided into a plurality of compiling work areas, each compiling work area may be loaded with a compiling integration mirror to compile a code project, so that different types of persistent integration tasks can share a resource of the same work node to be compiled, and after the compiling is completed, the compiling work area is emptied, so that another persistent integration task can continue to use the compiling work area to be compiled. Compared with the prior art shown in fig. 3, in the container-based persistent integration method provided in this embodiment, a docker container for compilation is created by compiling the integrated image, and all the compilation environments and dependent items are integrated inside the docker container, so that the compilation dependent environments can be quickly configured by using a container technology, and all the compilation processes are executed in the image container, thereby achieving isolation of the compilation dependent environments, only using computing and storage resources of the working nodes, automatically clearing the working area after compilation is completed, achieving the purpose of irrelevant compilation with the working node configuration, enabling different types of persistent integration tasks to share resources of the same working node, greatly reducing environment configuration cost, and improving execution efficiency and resource reuse rate of persistent integration.
As an alternative embodiment, the dependent image generation script further includes compiling an integrated image ID; the configuration information comprises installation information and updating information;
generating a script according to the dependent image to generate a latest compiled integrated image of the object code project, specifically including:
s121, acquiring a compiling integrated mirror image corresponding to the object code project from the compiling integrated mirror image warehouse according to the compiling integrated mirror image ID;
s122, if the acquisition is successful, updating the compiling integrated mirror image of the object code project according to the updating information to obtain the latest compiling integrated mirror image of the object code project;
and S123, if the obtaining fails, carrying out mirror image installation according to the installation information to obtain a latest compiled integrated mirror image of the object code project, and storing the latest compiled integrated mirror image and the compiled integrated mirror image ID in the compiled integrated mirror image warehouse in an associated manner.
It should be noted that the compilation integration image ID is unique, so that the compilation integration images of different code projects in the compilation integration image repository can be distinguished by the compilation integration image ID assigned to each code project.
For example, when the code changes, the dependent source may be newly added or reduced, and the dependent source needs to be updated, so the internal dependent source setting script and the external dependent source setting script may include installation, update, and cleaning branches, and the information for update may include information of an update branch in the internal dependent source setting script and the external dependent source setting script, so that the user can update the dependent item by updating the dependent image generation script.
It should be noted that, in the prior art, when a working node needs to be configured or upgraded, manual operation is required, and due to high binding of the working node and an operating system type version, a dependency library, environment configuration, and a compiling tool chain, any change will cause the working node to be offline and unable to provide normal service.
As an optional embodiment, the compiling the object code engineering in the compiling environment of the latest compiling integrated image specifically includes:
and starting the latest compiling integrated mirror image for compiling by respectively taking the directory of the object code project and the directory of the compiling working area as a compiling code source address and a compiling file output address.
In this embodiment, after the generation and the start of the latest compiled integrated image are completed, the working node pulls the object code project to the compiled working area, and the working area directory of the object code project is only read and mounted to the latest compiled integrated image as a compiled code source, so that a compiler in the image can access a code source file, and at the same time, the compiling work is started, and the compiled file is output to the working area directory written and mounted instead of the internal directory of the compiled image, thereby avoiding the swelling and redundancy of the container.
As one of the alternative embodiments, the file obtained by compiling comprises an executable file;
prior to the emptying the compilation workspace, the method further comprises:
and saving the executable file to a publishing component warehouse.
In this embodiment, after the compiling is successful, the executable file is pushed to the publishing component warehouse for storage, so that the user can perform the subsequent testing and verification conveniently.
Further, the dependent image generation script further comprises configuration information of an image generation plug-in; the latest compiled integrated image also comprises the image generation plug-in; the image generation plug-in is used for generating a compiling result image corresponding to the executable file;
the file obtained by compiling further includes the compilation result image.
In this embodiment, since the entire compiling integrated environment operates in a container mirror manner, when an output result also needs to be made into a container, if a container nesting manner is used, the container is bloated and redundancy of the system is caused, and if a new external dependency is generated by using a generation manner of a working node container instance, for this reason, configuration information of a mirror image generation plug-in is configured in a dependency mirror image generation script, so that when a latest compiling integrated mirror image is installed according to the dependency mirror image generation script, the mirror image generation plug-in can be added to the latest compiling integrated mirror image, and the mirror image generation plug-in can directly generate a compiling result mirror image without depending on an external container tool, thereby avoiding the bloated and redundancy of the system.
For example, it may be a create _ image.mk description file that is agreed to directly generate the compilation result image, and the file includes a specified command for ID of the compilation result image, basic image information, identification information of the object code project, start parameter, and packaging position. The basic mirror image information comprises a name and a version of a dependent basic mirror image operating system; the identification information of the object code engineering comprises a code warehouse item ID and a code warehouse code version number; the packing location refers to a packing location of the compiled executable file. It should be noted that the image generation manner of the image generation plug-in is specifically implemented by various compiler extension manners, and is not limited herein.
Still further, prior to said emptying said compilation workspace, said method further comprises:
and storing the compiling result mirror image to a release mirror image warehouse.
In this embodiment, after the compiling is successful, the compiling result mirror image is pushed to the publishing mirror image warehouse for storage, so that the user can perform the subsequent testing and verification conveniently.
As a specific embodiment, the method provided in this embodiment may be applied to a task integration system composed of a plurality of working nodes and a master node, where the method is executed by the working nodes, and the master node is a task management node. Referring to fig. 4a and 4b, the specific implementation flow of the method provided in this embodiment is as follows: a developer submits codes in a code warehouse; when the trigger compares that the code changes, a compiling trigger request aiming at the changed target code engineering is generated and sent to the main node so as to inform the main node to distribute the continuous integration task; the main node generates a continuous integration task aiming at the target code engineering and sends the continuous integration task to any idle working node; the working node pulls a dependent mirror image generation script of the target code project in response to receiving a continuous integration task aiming at the target code project, which is sent by the main node; the working node reads the ID of the compiled integrated mirror image from the dependent mirror image generation script; the working node acquires a compiling integrated mirror image corresponding to the object code project from a compiling integrated mirror image warehouse according to the compiling integrated mirror image ID, if the compiling integrated mirror image is successfully acquired, the compiling integrated mirror image of the object code project is updated according to the updating information to obtain a latest compiling integrated mirror image of the object code project, if the acquiring fails, mirror image installation is carried out according to the installation information to obtain the latest compiling integrated mirror image of the object code project, and the latest compiling integrated mirror image and the mirror image ID are stored in the compiling integrated mirror image warehouse in an associated mode to be used for next compiling; the working node loads the latest compiling integrated mirror image to a preset compiling working area and pulls a target code project from a code warehouse to the compiling working area; the working node only carries the working area directory where the object code project is located to the latest compiling integrated mirror image, starts compiling work, and outputs a compiling result mirror image and an executable file to the working area directory written in the carrying; saving the executable file to a publishing component repository; and storing the compiling result mirror image to a publishing mirror image warehouse.
Fig. 5 is a schematic structural diagram of a container-based continuously integrated device according to an embodiment of the present invention.
The continuous integrated device based on the container provided by the embodiment of the invention comprises:
the script acquisition module 11 is configured to acquire a dependent mirror generation script of an object code project in response to receiving a continuous integration task for the object code project, where the continuous integration task is sent by a task integration node; the dependency image generation script comprises configuration information of a compiling environment and a dependency item;
the mirror image generation module 12 is used for generating a latest compiled integrated mirror image of the object code engineering according to the dependence mirror image generation script; the latest compiling integrated image comprises a compiling environment, a dependent item and a compiler for compiling codes according to the compiling environment and the dependent item;
a code compiling module 13, configured to allocate the latest compiled integrated image to a corresponding compiling work area, and compile the object code project in a compiling environment of the latest compiled integrated image;
and a working area clearing module 14, configured to clear the compiling working area after the compiling is completed.
As an alternative embodiment, the dependent image generation script further includes compiling an integrated image ID; the configuration information comprises installation information and updating information;
the image generation module 12 is specifically configured to:
acquiring a compiled integrated mirror image corresponding to the object code project from the compiled integrated mirror image warehouse according to the compiled integrated mirror image ID;
if the acquisition is successful, updating the compiling integrated mirror image of the object code project according to the updating information to obtain the latest compiling integrated mirror image of the object code project;
and if the acquisition fails, carrying out mirror image installation according to the installation information to obtain a latest compiled integrated mirror image of the object code engineering, and storing the latest compiled integrated mirror image and the compiled integrated mirror image ID in the compiled integrated mirror image warehouse in an associated manner.
As an optional embodiment, the code compiling module 13 is specifically configured to:
and starting the latest compiling integrated mirror image for compiling by respectively taking the directory of the object code project and the directory of the compiling working area as a compiling code source address and a compiling file output address.
As one of the alternative embodiments, the file obtained by compiling comprises an executable file;
before clearing the compiling work area after the compiling is completed, the device further comprises:
and the file publishing module is used for saving the executable file to a publishing component warehouse.
Further, the dependent image generation script further comprises configuration information of an image generation plug-in; the latest compiled integrated image also comprises the image generation plug-in; the image generation plug-in is used for generating a compiling result image corresponding to the executable file;
the compiled file also includes the compilation result image.
Still further, the apparatus further comprises:
and the mirror image publishing module is used for storing the compiling result mirror image to a publishing mirror image warehouse.
Fig. 6 is a schematic structural diagram of a working node according to an embodiment of the present invention.
An embodiment of the present invention provides a work node, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the processor implements the container-based persistent integration method as described in any one of the above embodiments.
One processor 20 is illustrated in fig. 6; the processor 20 and the memory 21 in the working node may be connected by a bus or other means, and fig. 6 illustrates the connection by a bus as an example.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor 20 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program in the working node. For example, the computer program may be partitioned into a script retrieving module for retrieving a dependent mirror generation script for an object code project in response to receiving a persistent integration task for the object code project sent by a master node; the dependency image generation script comprises configuration information of a compiling environment and a dependency item; the image generation module is used for generating a script according to the dependence image and generating a latest compiling integrated image of the object code engineering; the latest compiling integrated image comprises a compiling environment, a dependent item and a compiler for compiling codes according to the compiling environment and the dependent item; the code compiling module is used for distributing the latest compiling integrated mirror image to a corresponding compiling working area and compiling the object code project in a compiling environment of the latest compiling integrated mirror image; and the working area clearing module is used for clearing the compiling working area after compiling is finished. Namely the container-based continuous integration method described in the above embodiments.
The Processor 20 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 21 may be used to store the computer programs and/or modules, such as program instructions/modules corresponding to the container-based persistent integration method in the above-described embodiment of the present invention, and the processor 20 implements various functions of the working node by executing or executing the computer programs and/or modules stored in the memory 21 and calling data stored in the memory 21. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the terminal, and the like. In addition, the memory 21 may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device. In some examples, memory 21 may further include memory located remotely from processor 20, which may be connected to the work node via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
It should be noted that the principle and technical effects of the embodiments of the present invention are the same as those of the container-based continuous integration method described in the above embodiments, and will not be described in detail herein.
Fig. 7 is a schematic structural diagram of a container-based persistent integration system according to an embodiment of the present invention.
The embodiment of the invention provides a container-based continuous integration system, which comprises a code warehouse 1, a trigger 2, a main node 3 and one or more working nodes 4 as described in the above embodiment;
the code warehouse 1 is used for receiving and storing code projects submitted by users;
the trigger 2 is configured to generate a compiling trigger request for a target code project corresponding to a code change event when the code change event is detected in the code repository 1, and send the compiling trigger request to the host node 3;
and the main node 3 is used for responding to the compiling trigger request, generating a continuous integration task aiming at the object code project and sending the continuous integration task to any idle working node 4.
Further, the container-based persistent integration system further comprises:
a compiling integrated mirror image warehouse 5 for storing compiling integrated mirror images of the code projects;
the release mirror image warehouse 6 is used for storing the compiling result mirror images of the code projects;
and the issuing component warehouse 7 is used for storing executable files of the code projects.
It should be noted that the principle and technical effects of the embodiments of the present invention are the same as those of the container-based continuous integration method described in the above embodiments, and will not be described in detail herein.
Another embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, where the computer program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform the container-based persistent integration method according to any one of the embodiments.
The container-based continuous integration method comprises the following steps:
in response to receiving a continuous integration task aiming at a target code project, which is sent by a main node, acquiring a dependent mirror image generation script of the target code project; the dependency image generation script comprises configuration information of a compiling environment and a dependency item;
generating a latest compiling integrated mirror image of the object code engineering according to the dependence mirror image generation script; the latest compiling integrated image comprises a compiling environment, a dependent item and a compiler for compiling codes according to the compiling environment and the dependent item;
distributing the latest compiling integrated mirror image to a corresponding compiling working area, and compiling the object code project in a compiling environment of the latest compiling integrated mirror image;
and emptying the compiling work area after compiling is finished.
Of course, the computer-readable storage medium provided by the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in the container-based persistent integration method provided by any embodiments of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

1. A method for container-based continuous integration, comprising:
in response to receiving a continuous integration task aiming at an object code project, which is sent by a task management node, acquiring a dependent mirror image generation script of the object code project; the dependency image generation script comprises configuration information of a compiling environment and a dependency item;
generating a latest compiling integrated mirror image of the object code engineering according to the dependence mirror image generation script; the latest compiling integrated image comprises a compiling environment, a dependent item and a compiler for compiling codes according to the compiling environment and the dependent item;
distributing the latest compiling integrated mirror image to a corresponding compiling working area, and compiling the object code project in a compiling environment of the latest compiling integrated mirror image;
and emptying the compiling work area after compiling is finished.
2. The container-based persistent integration method of claim 1, wherein the dependency image generation script further comprises compiling an integration image ID; the configuration information comprises installation information and updating information;
generating a script according to the dependent image to generate a latest compiled integrated image of the object code project, specifically including:
acquiring a compiled integrated mirror image corresponding to the object code project from the compiled integrated mirror image warehouse according to the compiled integrated mirror image ID;
if the acquisition is successful, updating the compiling integrated mirror image of the object code project according to the updating information to obtain the latest compiling integrated mirror image of the object code project;
and if the acquisition fails, carrying out mirror image installation according to the installation information to obtain a latest compiled integrated mirror image of the object code engineering, and storing the latest compiled integrated mirror image and the compiled integrated mirror image ID in the compiled integrated mirror image warehouse in an associated manner.
3. The container-based persistent integration method of claim 1, wherein said compiling said object code project in a compilation environment of said latest compilation integration image is further characterized by:
and starting the latest compiling integrated mirror image for compiling by respectively taking the directory of the object code project and the directory of the compiling working area as a compiling code source address and a compiling file output address.
4. The container-based persistent integration method of claim 1, wherein the compiled file comprises an executable file;
before clearing the compilation workspace after the compilation is complete, the method further comprises:
and saving the executable file to a publishing component warehouse.
5. The container-based persistent integration method of claim 4, wherein the image-dependent generation script further comprises configuration information of an image generation plug-in; the latest compiled integrated image also comprises the image generation plug-in; the image generation plug-in is used for generating a compiling result image corresponding to the executable file;
the file obtained by compiling further includes the compilation result image.
6. The container-based persistent integration method of claim 5, wherein prior to emptying the compilation workspace after the compilation is complete, the method further comprises:
and storing the compiling result mirror image to a release mirror image warehouse.
7. A container-based continuously integrated device, comprising:
the script acquisition module is used for responding to a received continuous integration task aiming at the object code engineering sent by the task management node and acquiring a dependent mirror image generation script of the object code engineering; the dependency image generation script comprises configuration information of a compiling environment and a dependency item;
the image generation module is used for generating a script according to the dependence image and generating a latest compiling integrated image of the object code engineering; the latest compiling integrated image comprises a compiling environment, a dependent item and a compiler for compiling codes according to the compiling environment and the dependent item;
the code compiling module is used for distributing the latest compiling integrated mirror image to a corresponding compiling working area and compiling the object code project in a compiling environment of the latest compiling integrated mirror image;
and the working area clearing module is used for clearing the compiling working area after compiling is finished.
8. A working node comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the container-based persistent integration method of any of claims 1 to 6 when executing the computer program.
9. A container-based persistent integration system comprising a code repository, triggers, master nodes and one or more worker nodes according to claim 8;
the code warehouse is used for receiving and storing code projects submitted by users;
the trigger is used for generating a compiling trigger request aiming at a target code project corresponding to a code change event when the code change event is detected in the code warehouse and sending the compiling trigger request to the main node;
and the main node is used for responding to the compiling trigger request, generating a continuous integration task aiming at the target code project and sending the continuous integration task to any idle working node.
10. A computer-readable storage medium, comprising a stored computer program, wherein the computer program, when executed, controls an apparatus on which the computer-readable storage medium is located to perform the container-based persistent integration method of any of claims 1 to 6.
CN202111578302.3A 2021-12-22 2021-12-22 Container-based continuous integration method, device and system, working node and medium Pending CN114296871A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111578302.3A CN114296871A (en) 2021-12-22 2021-12-22 Container-based continuous integration method, device and system, working node and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111578302.3A CN114296871A (en) 2021-12-22 2021-12-22 Container-based continuous integration method, device and system, working node and medium

Publications (1)

Publication Number Publication Date
CN114296871A true CN114296871A (en) 2022-04-08

Family

ID=80969397

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111578302.3A Pending CN114296871A (en) 2021-12-22 2021-12-22 Container-based continuous integration method, device and system, working node and medium

Country Status (1)

Country Link
CN (1) CN114296871A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114995897A (en) * 2022-05-07 2022-09-02 远光软件股份有限公司 Method, device, storage medium and computer equipment for acquiring running result of continuous integration tool
CN115469878A (en) * 2022-09-13 2022-12-13 上海掌御信息科技有限公司 Android code diversity compiling method
CN115756514A (en) * 2022-11-14 2023-03-07 中国电子科技集团公司第十五研究所 Software automation compiling method and system
CN116737173A (en) * 2023-08-11 2023-09-12 华控清交信息科技(北京)有限公司 Service integration method and device on k8s container cluster and electronic equipment
CN117707609A (en) * 2024-02-06 2024-03-15 云账户技术(天津)有限公司 Method and device for managing script tasks based on container arrangement management tool
CN117873650A (en) * 2024-01-25 2024-04-12 镁佳(北京)科技有限公司 Real-time running environment generation system, method, computer device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170085419A1 (en) * 2015-09-18 2017-03-23 Le Holdings (Beijing) Co., Ltd. System and method for deploying an application
CN107678756A (en) * 2017-09-29 2018-02-09 千寻位置网络有限公司 A kind of Web based on Docker applies a key dissemination method
CN107729020A (en) * 2017-10-11 2018-02-23 北京航空航天大学 A kind of method for realizing extensive container rapid deployment
CN109117170A (en) * 2017-06-22 2019-01-01 中兴通讯股份有限公司 A kind of running environment building method and device, code are incorporated into method and system
CN110647332A (en) * 2019-09-30 2020-01-03 北京百度网讯科技有限公司 Software deployment method and device based on container cloud

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170085419A1 (en) * 2015-09-18 2017-03-23 Le Holdings (Beijing) Co., Ltd. System and method for deploying an application
CN109117170A (en) * 2017-06-22 2019-01-01 中兴通讯股份有限公司 A kind of running environment building method and device, code are incorporated into method and system
CN107678756A (en) * 2017-09-29 2018-02-09 千寻位置网络有限公司 A kind of Web based on Docker applies a key dissemination method
CN107729020A (en) * 2017-10-11 2018-02-23 北京航空航天大学 A kind of method for realizing extensive container rapid deployment
CN110647332A (en) * 2019-09-30 2020-01-03 北京百度网讯科技有限公司 Software deployment method and device based on container cloud

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
卢志春: "基于Docker的容器集群管理系统的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 May 2021 (2021-05-15), pages 138 - 338 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114995897A (en) * 2022-05-07 2022-09-02 远光软件股份有限公司 Method, device, storage medium and computer equipment for acquiring running result of continuous integration tool
CN115469878A (en) * 2022-09-13 2022-12-13 上海掌御信息科技有限公司 Android code diversity compiling method
CN115469878B (en) * 2022-09-13 2023-11-24 上海掌御信息科技有限公司 Android code diversity compiling method
CN115756514A (en) * 2022-11-14 2023-03-07 中国电子科技集团公司第十五研究所 Software automation compiling method and system
CN116737173A (en) * 2023-08-11 2023-09-12 华控清交信息科技(北京)有限公司 Service integration method and device on k8s container cluster and electronic equipment
CN117873650A (en) * 2024-01-25 2024-04-12 镁佳(北京)科技有限公司 Real-time running environment generation system, method, computer device and storage medium
CN117707609A (en) * 2024-02-06 2024-03-15 云账户技术(天津)有限公司 Method and device for managing script tasks based on container arrangement management tool
CN117707609B (en) * 2024-02-06 2024-04-30 云账户技术(天津)有限公司 Method and device for managing script tasks based on container arrangement management tool

Similar Documents

Publication Publication Date Title
CN114296871A (en) Container-based continuous integration method, device and system, working node and medium
CN109271198A (en) Mirror image packaging method, device and electronic equipment based on Docker container
CN108733553B (en) Docker-based test device configuration method, device and system
CN107577609B (en) Embedded system dynamic module debugging system based on host end dynamic link
CN106528170A (en) Software package release method and system based on multi-language environment
US9904574B2 (en) Parallel computing without requiring antecedent code deployment
CN112631614A (en) Application deployment method and device, computer equipment and storage medium
CN111736810A (en) Method for dynamically creating node of docker container to execute task based on jenkins real-time task
CN110851143A (en) Source code deployment method, device, equipment and storage medium
CN114546588A (en) Task deployment method and device, storage medium and electronic device
CN113885915A (en) Service updating method, module and system
CN113254022A (en) Distributed compilation system and method
CN107783826B (en) Virtual machine migration method, device and system
CN110334031B (en) Memory allocation code detection method and device, computer equipment and storage medium
CN114265595B (en) Cloud native application development and deployment system and method based on intelligent contracts
CN107229506B (en) Virtual machine migration method and device
CN110806891A (en) Method and device for generating software version of embedded equipment
CN110795113B (en) Redis cluster service installation method, server and medium
CN114816475A (en) Method, device, equipment and medium for updating embedded operating system
CN113885875A (en) Distributed compiling method, system, main server and storage medium
Gracioli et al. An operating system infrastructure for remote code update in deeply embedded systems
CN113867776A (en) Method and device for publishing middle station application, electronic equipment and storage medium
CN107493316B (en) Application operation management method, server and computer readable storage medium
CN111857816A (en) Register allocation method and device, electronic equipment and computer storage medium
CN113918239B (en) Code implementation method and system

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