CN116382694A - Method for improving compiling speed of Maven engineering in container environment - Google Patents

Method for improving compiling speed of Maven engineering in container environment Download PDF

Info

Publication number
CN116382694A
CN116382694A CN202310232084.0A CN202310232084A CN116382694A CN 116382694 A CN116382694 A CN 116382694A CN 202310232084 A CN202310232084 A CN 202310232084A CN 116382694 A CN116382694 A CN 116382694A
Authority
CN
China
Prior art keywords
maven
compiling
warehouse
jenkins
slave node
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
CN202310232084.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.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud 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 Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202310232084.0A priority Critical patent/CN116382694A/en
Publication of CN116382694A publication Critical patent/CN116382694A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The method for improving the compiling speed of the Maven project in the container environment comprises the steps of firstly, submitting compiling tasks related to a branch of a Gitlab warehouse by accessing a Web program containing a scheduling algorithm; calculating an executed slave node corresponding to the Gitlab warehouse and a corresponding Mave n local warehouse, and then storing a corresponding relation; submitting the compiling task to a Jenkins master; the jenkin master node creates Jenkins job, judges whether Jenkins job exists or not, and if the Jenkins job does not exist, issues a command executed by a compiling task to a slave node according to a slave tag; the Jenkins slave node firstly pulls the appointed branch codes under the appointed warehouse from the Gitlab, and then pulls the mirror image for compiling from the Harbor; the Maven local warehouse is mounted while the code warehouse is catalogued. According to the method for improving the compiling speed of the Maven project in the container environment, the compiling speed and the continuous integration efficiency of the Maven project in the container environment are improved.

Description

Method for improving compiling speed of Maven engineering in container environment
Technical Field
The invention relates to the technical field of virtual machine security, in particular to a method for improving the compiling speed of Maven engineering in a container environment.
Background
In the traditional software development process, the important link of source code compiling is executed on a physical machine, but with the maturity and popularization of container technology, the container has the advantages of native technology, such as: the environment is unified and standardized, so that source code compiling is performed in a container environment, and the method is a better choice.
Software enterprises typically deploy jenkins+nexus+gitlab as a continuous integration and delivery tool for Maven-based Java micro-services. In the compiling stage, jenkins pulls a Docker mirror image with Maven and JDK installed, creates a container, performs compiling in a container environment, and destroys the container after the compiling is finished. The code is compiled in the container environment, and the container has the advantages of safety, unified environment standard and the like, but because the container is destroyed after being used up, the Maven local warehouse can be destroyed accordingly, so that the package and the plug-in the pom can be pulled from Nexus again after each compiling (the package is uniformly used for referring to the package and the plug-in after the patent), and the problems of low compiling speed and low continuous integration efficiency are caused. The problem that the compiling speed of Maven engineering is slow under container environment is solved to this patent.
Disclosure of Invention
The embodiment of the invention provides a method for improving the compiling speed of Maven engineering in a container environment, which aims to solve or partially solve the technical problems.
In order to solve the technical problems, the invention is realized as follows:
in a first aspect of the present application, a method for improving a compilation speed of Maven engineering in a container environment is provided, where the method includes: accessing a Web program containing a scheduling algorithm, and submitting a compiling task related to a certain branch of the Gitlab warehouse; calculating an executed slave node corresponding to the Gitlab warehouse and a corresponding Maven local warehouse, and then storing a corresponding relation; submitting the compiling task to a Jenkins mas ter; the Jenkins master node creates Jenkins job, judges whether the Jenkins job exists or not, and if the Jenkins job does not exist, issues a command for executing a compiling task to a slave node according to a slave tag; the Jenkins slave node firstly pulls the appointed branch codes under the appointed warehouse from the Gitlab, and then pulls the mirror image for compiling from the Harbor; the Maven local warehouse is mounted while the code warehouse is catalogued.
In some embodiments, the method further comprises: the Maven command is executed in the container environment for compiling and packing.
In some embodiments, the method further comprises: after compiling is finished, cleaning up the workspace and destroying the container environment.
In some embodiments, the Jenkin master node creates a Jenkins job, determines whether there is a Jenkins job, and if there is no Jenkins job, issues an instruction for executing a compiling task to a slave node according to a slave tag, including: selecting a slave node with the least current Maven local warehouse, and recording the corresponding relation between the Gitlab warehouse and the Maven local warehouse under the slave node; if the Maven local warehouse quota does not exist, the error prompt contacts an administrator to expand the capacity of the slave node.
In some embodiments, the Jenkin master node creates a Jenkins job, determines whether there is a Jenkins job, and if there is no Jenkins job, issues an instruction for executing a compiling task to a slave node according to a slave tag, and further includes: when the Maven project is compiled again, preferentially scheduling the nodes to the nodes at the first compiling time, and mounting the corresponding Maven local warehouse; if the slave node is in an inactive state, selecting the slave node with the least current Maven local warehouse again, and recording the corresponding relation between the Gitlab warehouse and the Maven local warehouse under the slave node; if the Maven local warehouse quota does not exist, the error prompt contacts an administrator to expand the capacity of the slave node.
In some embodiments, further comprising: and cleaning the Maven local warehouse corresponding to the Gitlab warehouse with the minimum compiling frequency, and recovering the Maven local warehouse resources.
In some embodiments, the cleaning cycle of the cleaning compilation is one month.
In some embodiments, each slave has a unique identifiable tag.
In some embodiments, the Git server uses a Gitlab.
In some embodiments, the Maven private service uses Nexus.
In a second aspect, the present application provides an apparatus for improving a compilation speed of Maven engineering in a container environment, where the apparatus includes:
the access module is used for accessing the Web program containing the scheduling algorithm and submitting a compiling task related to a certain branch of the Gitlab warehouse;
the computing module is used for computing the slave node of the execution corresponding to the Gitleab warehouse and the corresponding Maven local warehouse, and then storing the corresponding relation;
the submitting module submits the compiling task to the Jenkins master;
the creating module is used for creating the Jenkins job by the Jenkins master node, judging whether the Jenkins job exists or not, and if the Jenkins job does not exist, issuing an instruction for executing the compiling task to the slave node according to the slave label;
the pulling module is used for pulling the appointed branch codes under the appointed warehouse from the Gitlab by the Jenkins slave node, and then pulling the mirror image for compiling from the Harbor;
and the mounting module is used for mounting the Maven local warehouse and simultaneously cataloging the code warehouse.
In a third aspect of the embodiment of the present invention, there is provided an electronic device, including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method steps set forth in the first aspect of the embodiments of the present invention.
In a fourth aspect of the embodiment of the present invention, there is provided a computer readable storage medium storing a computer program, where the computer program when executed by a processor implements the method steps set forth in the first aspect of the embodiment of the present invention.
The method for improving the compiling speed of the Maven project in the container environment comprises the steps of firstly, submitting compiling tasks related to a branch of a Gitlab warehouse by accessing a Web program containing a scheduling algorithm; calculating an executed slave node corresponding to the Gitlab warehouse and a corresponding Mave n local warehouse, and then storing a corresponding relation; submitting the compiling task to a Jenkins master; the jenkin master node creates Jenkins job, judges whether Jenkins job exists or not, and if the Jenkins job does not exist, issues a command executed by a compiling task to a slave node according to a slave tag; the Jenkins slave node firstly pulls the appointed branch codes under the appointed warehouse from the Gitlab, and then pulls the mirror image for compiling from the Harbor; the Maven local warehouse is mounted while the code warehouse is catalogued. According to the method for improving the compiling speed of the Maven project in the container environment, the compiling speed and the continuous integration efficiency of the Maven project in the container environment are improved.
1. The Maven local warehouse is fully utilized. The scheme can mount the host Maven local warehouse on the container every time the container for compiling is pulled up.
2. The problem of compiling and blocking when updating the Maven local warehouse metafile in the container environment is solved.
3. The compiling task uses independent Maven local warehouses, and the number of the Maven local warehouses is uniformly distributed on the host machine. Static compiling tasks are uniformly distributed on the Jenkins slave nodes.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an electronic device in a hardware operating environment according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method of increasing the compilation speed of Maven projects in a container environment in accordance with an exemplary embodiment;
FIG. 3 is a flow chart of a Maven pull dependency package in a method for improving the compilation speed of a Maven project in a container environment in accordance with an exemplary embodiment;
FIG. 4 is a schematic diagram of Jenkins based on Kurbenes deployment in a method of increasing the compilation speed of Maven projects in a container environment, according to an exemplary embodiment;
FIG. 5 is a schematic diagram of an improved Maven local warehouse mounting scheme in a method for improving the compiling speed of a Maven project in a container environment according to an exemplary embodiment;
FIG. 6 is a flow chart of resource allocation and task scheduling in a method for improving the compilation speed of Maven projects in a container environment according to an exemplary embodiment;
FIG. 7 is a flowchart illustrating a method for improving the compilation speed of Maven projects in a container environment in accordance with an illustrative embodiment;
FIG. 8 is a diagram illustrating an architecture in a method for improving compilation speed of Maven projects in a container environment, in accordance with an exemplary embodiment.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In the prior art, a Security domain is a technology for guiding network service messages to pass through Security service nodes (Security nodes) in order, and combines SDN (Software Defined Network ) to implement service arrangement, and guides network messages to pass through Security nodes in order as required for processing and forwarding. The security service node is a device in the network that processes a certain service, and may be a physical device or an NFV (Network Function Virtualisation, network function virtualization) device. Multiple service nodes may exist on a security domain service chain. And each security service node processes the message according to the security service type specified by the security service list. The security service list is used for specifying the type and processing sequence of the service, and the typical service types currently comprise nodes such as FW, ACG, DPI, IPS and the like.
When the container for compiling is pulled up, the Maven local warehouse catalogs on the host machine where the container is located are mounted, so that the Maven local warehouse cannot be destroyed along with the destruction of the container, and the aim of improving the compiling speed is fulfilled. This solution may in practice be found to be defective. When a plurality of Maven projects are distributed to the same Jenkins slave node at the same time to compile, if the package of the same snapshot version is downloaded at the same time in the compiling process, the package is blocked at the place where the metafile Maven-metadata. Xml file is downloaded.
The Maven engineering compilation pull dependency package principle is an important basic technology in the patent. The preconditions for Maven engineering compilation in this patent are as follows:
the addresses of a configuration warehouse and plug-ins in the Maven engineering pom file are addresses of Maven private clothing Nexus;
maven engineering compile command: mvn-U clean package-dmaven.test.skip=true;
the package of all snapshot versions relied on by the Maven project is self-developed by the user and is released to the Maven private clothing Nexus;
4. the Maven remote warehouse in this patent only has Maven private services of Nexus and Maven central warehouses, and has no other official remote warehouses.
Maven's dependency package is divided into a formal version and a snapshot version. The pull order for these two version-dependent packages is shown in the flow chart of FIG. 1:
for the formal version-dependent package,
1. checking whether a Maven local warehouse exists or not, and ending if the Maven local warehouse exists; otherwise
2. Checking whether the Maven private service Nexus exists or not, and pulling the existing Nexus to a local Mav en warehouse; otherwise
3. Checking whether a Maven central warehouse exists or not, pulling the Maven central warehouse to a Maven private suit Nexus if the Maven central warehouse exists, and then pulling the Maven central warehouse to a local Maven warehouse; if the Maven central repository does not have the package, then the compilation will fail.
For the snapshot version-dependent package,
1. pulling the dependent package metadata file, checking whether the latest snapshot version exists, ending if the latest snapshot version does not exist, otherwise
2. The latest snapshot version package is pulled from Nexus to the Maven local warehouse.
The reason for this problem is that the-U parameter in the command is compiled, and the specific command is mvn-U cle an package-dmaven. the-U parameter in this command means that the missing formal and all snapshot packages of the local repository are forced to be refreshed. For the snapshot version package, there is a need to compare the Maven-metadata. Xml file on the Maven private service with the lastUpdated field in the Maven-meta data-snapshots. Xml file in the Maven local repository, which is a timestamp, if it is decided whether to download the package of the snapshot, and update the Maven-metadata-snapshots. Xml file. When multiple processes modify a maven-metadata-snapshots.xml file at the same time, a deadlock results. The snapshot in the Maven-metadata-snapshot. Xml file name is because the snapshot version repository on Maven's private servant Nexus is named snapshot.
Based on this, the present application proposes a method for improving the compiling speed of Maven engineering in a container environment, so as to improve the above problem.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device in a hardware running environment according to an embodiment of the present application.
As shown in fig. 1, the electronic device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a keyboard (Keyb oard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., a wireless FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Ra ndom Access Memory, RAM) Memory or a stable nonvolatile Memory (N virtual machine), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the structure shown in fig. 1 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components.
As shown in fig. 1, an operating device, a data storage module, a network communication module, a user interface module, and an electronic program may be included in the memory 1005 as one type of storage medium.
In the electronic device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device of the present invention may be provided in the electronic device, and the electronic device invokes the electronic program stored in the memory 1005 through the processor 1001, and executes the method for improving the compiling speed of Maven engineering in the container environment provided in the embodiment of the present application.
Referring to fig. 2, based on the foregoing hardware running environment, an embodiment of the present application provides a method for improving a Maven engineering compiling speed in a container environment, where the method includes:
s201, accessing a Web program containing a scheduling algorithm, and submitting a compiling task related to a certain branch of a Gitlab warehouse;
s202, calculating an executed slave node corresponding to the Gitlab warehouse and a corresponding Maven local warehouse, and then storing a corresponding relation;
s203, submitting the compiling task to a Jenkins master;
the Jenkins master node creates Jenkins job, judges whether the Jenkins job exists or not, and if the Jenkins job does not exist, issues a command for executing a compiling task to a slave node according to a slave tag;
s204, the Jenkins slave node firstly pulls the appointed branch codes under the appointed warehouse from the Gitlab, and then pulls the mirror image for compiling from the Harbor;
s205, mounting the Maven local warehouse and simultaneously cataloging the code warehouse.
Please refer to fig. 3, fig. 4, fig. 5, fig. 6, fig. 7 and fig. 8.Jenkins has a deployment mode based on kurbenes clusters, and compiling tasks under the deployment mode are executed under a container environment. In kurbenes-based cluster Jenkins, the master node and all slave nodes are running in a k8s cluster. Wherein the Jenkins master node persists some stateful data, while the Jenkins slave node is completely stateless. Each time a compile task request is received by the Jenkins master node, a slave node is automatically created, connection with the master node is established, and when the compile task is completed, the slave node is automatically destroyed. Because the slave node is stateless, the Maven local warehouse is destroyed along with the destruction of the slave node, so that the dependency package needs to be pulled from the Maven private Nexus again each time the compiling task is executed under the slave node, and the compiling speed and the continuous integration efficiency are greatly reduced.
The specific algorithm flow is as follows:
when a Maven project of a Gitlab warehouse is compiled for the first time, selecting a slave node with the least current Maven local warehouse, and recording the corresponding relation between the Gitlab warehouse and the Maven local warehouse under the slave node; if the Maven local warehouse quota does not exist, the error prompt contacts an administrator to expand the capacity of the slave node.
2. When the Maven project is compiled again, preferentially scheduling the nodes to the nodes at the time of first compiling, and mounting the corresponding Maven local warehouse; if the slave node is inactive, executing a 1 process;
3. and periodically cleaning the Maven local warehouse corresponding to the Gitlab warehouse with the minimum compiling frequency at the end of each month, and recovering the Maven local warehouse resources.
It should be noted that, the Maven local warehouse quota on each host, the duration in the cleaning rule, and the proportion of cleaning the Maven local warehouse are configurable. The values of these specific parameters need to be configured according to the specific circumstances in practice.
In some embodiments, the method further comprises: the Maven command is executed in the container environment for compiling and packing.
In some embodiments, the method further comprises: after compiling is finished, cleaning up the workspace and destroying the container environment.
In some embodiments, the Jenkin master node creates a Jenkins job, determines whether there is a Jenkins job, and if there is no Jenkins job, issues an instruction for executing a compiling task to a slave node according to a slave tag, including: selecting a slave node with the least current Maven local warehouse, and recording the corresponding relation between the Gitlab warehouse and the Maven local warehouse under the slave node; if the Maven local warehouse quota does not exist, the error prompt contacts an administrator to expand the capacity of the slave node.
In some embodiments, the Jenkin master node creates a Jenkins job, determines whether there is a Jenkins job, and if there is no Jenkins job, issues an instruction for executing a compiling task to a slave node according to a slave tag, and further includes: when the Maven project is compiled again, preferentially scheduling the nodes to the nodes at the first compiling time, and mounting the corresponding Maven local warehouse; if the slave node is in an inactive state, selecting the slave node with the least current Maven local warehouse again, and recording the corresponding relation between the Gitlab warehouse and the Maven local warehouse under the slave node; if the Maven local warehouse quota does not exist, the error prompt contacts an administrator to expand the capacity of the slave node.
The Program is a self-grinding Web Program comprising a method for improving the compiling speed of Maven engineering in a container environment; jenkins uses a master-slave deployment mode, the master is responsible for scheduling, the slave is responsible for executing specific tasks, and each slave is provided with a unique label which can be identified; the Git server uses Gitlab; the Maven private service uses Nexus, which can pull packets from the Maven central repository out of the public network.
The whole execution flow is as follows:
1. the user accesses a Web program containing a scheduling algorithm and submits a compiling task related to a certain branch of a certain Gitlab warehouse;
2. according to a self-grinding algorithm, calculating an executed slave node and a corresponding Maven local warehouse corresponding to the Gitleb warehouse, storing the corresponding relation, and then submitting a compiling task to a Jenkins master;
creating a Jenkins job by the jenkin master node, and then issuing an instruction executed by a compiling task to a slave node according to the slave tag if the Jenkins job does not exist;
the jenkins slave node firstly pulls codes of specified branches under a specified warehouse from a Gitlab, then pulls images for compiling from a Harbor, mounts the allocated Maven local warehouse in when a container is created, and simultaneously stores the codes in a warehouse catalog, namely: the job catalog of the job under the slave node is also mounted in the container, and finally the Maven command is executed in the container environment to carry out compiling and packaging. After compiling, cleaning the workspace and destroying the container environment.
In some embodiments, further comprising: and cleaning the Maven local warehouse corresponding to the Gitlab warehouse with the minimum compiling frequency, and recovering the Maven local warehouse resources.
In some embodiments, the cleaning cycle of the cleaning compilation is one month.
In some embodiments, each slave has a unique identifiable tag.
In some embodiments, the Git server uses a Gitlab.
In some embodiments, the Maven private service uses Nexus.
The method for improving the compiling speed of the Maven project in the container environment comprises the steps of firstly, submitting compiling tasks related to a branch of a Gitlab warehouse by accessing a Web program containing a scheduling algorithm; calculating an executed slave node corresponding to the Gitlab warehouse and a corresponding Mave n local warehouse, and then storing a corresponding relation; submitting the compiling task to a Jenkins master; the jenkin master node creates Jenkins job, judges whether Jenkins job exists or not, and if the Jenkins job does not exist, issues a command executed by a compiling task to a slave node according to a slave tag; the Jenkins slave node firstly pulls the appointed branch codes under the appointed warehouse from the Gitlab, and then pulls the mirror image for compiling from the Harbor; the Maven local warehouse is mounted while the code warehouse is catalogued. According to the method for improving the compiling speed of the Maven project in the container environment, the compiling speed and the continuous integration efficiency of the Maven project in the container environment are improved.
In a second aspect, the present application provides an apparatus for improving a compilation speed of Maven engineering in a container environment, where the apparatus includes:
the access module is used for accessing the Web program containing the scheduling algorithm and submitting a compiling task related to a certain branch of the Gitlab warehouse;
the computing module is used for computing the slave node of the execution corresponding to the Gitleab warehouse and the corresponding Maven local warehouse, and then storing the corresponding relation;
the submitting module submits the compiling task to the Jenkins master;
the creating module is used for creating the Jenkins job by the Jenkins master node, judging whether the Jenkins job exists or not, and if the Jenkins job does not exist, issuing an instruction for executing the compiling task to the slave node according to the slave label;
the pulling module is used for pulling the appointed branch codes under the appointed warehouse from the Gitlab by the Jenkins slave node, and then pulling the mirror image for compiling from the Harbor;
and the mounting module is used for mounting the Maven local warehouse and simultaneously cataloging the code warehouse.
In some embodiments, the creation module is further to: selecting a slave node with the least current Maven local warehouse, and recording the corresponding relation between the Gitlab warehouse and the Maven local warehouse under the slave node; if the Maven local warehouse quota does not exist, the error prompt contacts an administrator to expand the capacity of the slave node.
In some embodiments, the creating module is further configured to create a Jenkins job by the Jenkin master node, determine whether there is a Jenkins job, and if there is no Jenkins job, issue an instruction for executing a compiling task to a slave node according to a slave tag, and further include: when the Maven project is compiled again, preferentially scheduling the nodes to the nodes at the time of first compiling, and mounting the corresponding Maven local warehouse; if the slave node is in an inactive state, selecting the slave node with the least current Maven local warehouse again, and recording the corresponding relation between the Gitlab warehouse and the Maven local warehouse under the slave node; if the Maven local warehouse quota does not exist, the error prompt contacts an administrator to expand the capacity of the slave node.
Based on the same inventive concept, embodiments of the present application also provide an electronic device, including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method described above.
Based on the same inventive concept, embodiments of the present application also provide a computer-readable storage medium storing a computer program, which when executed by a processor, implements the above method.
Based on the same inventive concept, embodiments of the present application also provide a computer program product, which when being processed, implements the above method.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable vehicles having computer-usable program code embodied therein, including but not limited to disk storage, CD-ROM, optical storage, and the like.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create a system for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. "and/or" means either or both of which may be selected. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The above describes in detail a method for improving the compiling speed of Maven engineering in a container environment, and specific examples are applied to illustrate the principle and implementation of the present invention, and the above description of the examples is only used to help understand the method and core idea of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (10)

1. A method for improving the compiling speed of Maven engineering in a container environment, comprising the following steps:
accessing a Web program containing a scheduling algorithm, and submitting a compiling task related to a certain branch of the Gitlab warehouse;
calculating an executed slave node corresponding to the Gitlab warehouse and a corresponding Maven local warehouse, and then storing a corresponding relation;
submitting the compiling task to a Jenkins master;
the Jenkins master node creates Jenkins job, judges whether the Jenkins job exists or not, and if the Jenkins job does not exist, issues a command for executing a compiling task to a slave node according to a slave tag;
the Jenkins slave node firstly pulls the appointed branch codes under the appointed warehouse from the Gitlab, and then pulls the mirror image for compiling from the Harbor;
the Maven local warehouse is mounted while the code warehouse is catalogued.
2. The method for increasing the compiling speed of Maven project in a container environment according to claim 1, wherein the method further comprises:
the Maven command is executed in the container environment for compiling and packing.
3. The method for increasing the compiling speed of Maven project in a container environment according to claim 2, wherein the method further comprises:
after compiling is finished, cleaning up the workspace and destroying the container environment.
4. The method for improving the compiling speed of Maven engineering in a container environment according to claim 3, wherein the Jenkin master node creates Jenkins job, judges whether Jenkins job exists, and if not, issues a compiling task executing instruction to a slave node according to a slave tag, including:
selecting the slave node with the least current Maven local warehouse, and recording the corresponding relation between the Gitlab warehouse and the Maven local warehouse under the slave node; if the Maven local warehouse quota does not exist, the error prompt contacts an administrator to expand the capacity of the slave node.
5. The method for increasing the compiling speed of Maven engineering in a container environment according to claim 4, wherein the Jenkin master node creates Jenkins job, determines whether Jenkins job exists, if not, issues a compiling task executing instruction to the slave node according to the slave tag, and further comprises:
when the Maven project is compiled again, preferentially scheduling the nodes to the nodes at the first compiling time, and mounting the corresponding Maven local warehouse; if the slave node is in an inactive state, selecting the slave node with the least current Maven local warehouse again, and recording the corresponding relation between the Gitlab warehouse and the Maven local warehouse under the slave node; if the Maven local warehouse quota does not exist, the error prompt contacts an administrator to expand the capacity of the slave node.
6. The method for increasing the compiling speed of Maven project in a container environment according to claim 5, further comprising:
and cleaning the Maven local warehouse corresponding to the Gitlab warehouse with the minimum compiling frequency, and recovering the Maven local warehouse resources.
7. The method for improving compilation speed of Maven project in a container environment of claim 6 wherein the cleaning cycle of cleaning compilation is one month.
8. The method of claim 7, wherein each slave has a unique identifiable tag.
9. The method for improving compilation speed of Maven project in container environment according to claim 8, wherein the Git server uses Gitlab.
10. The method of claim 9, wherein the Maven private service uses Ne xus.
CN202310232084.0A 2023-03-12 2023-03-12 Method for improving compiling speed of Maven engineering in container environment Pending CN116382694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310232084.0A CN116382694A (en) 2023-03-12 2023-03-12 Method for improving compiling speed of Maven engineering in container environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310232084.0A CN116382694A (en) 2023-03-12 2023-03-12 Method for improving compiling speed of Maven engineering in container environment

Publications (1)

Publication Number Publication Date
CN116382694A true CN116382694A (en) 2023-07-04

Family

ID=86972205

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310232084.0A Pending CN116382694A (en) 2023-03-12 2023-03-12 Method for improving compiling speed of Maven engineering in container environment

Country Status (1)

Country Link
CN (1) CN116382694A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116661811A (en) * 2023-07-31 2023-08-29 明阳时创(北京)科技有限公司 Closed-loop containerized controllable service cluster construction method and service cluster device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116661811A (en) * 2023-07-31 2023-08-29 明阳时创(北京)科技有限公司 Closed-loop containerized controllable service cluster construction method and service cluster device
CN116661811B (en) * 2023-07-31 2023-10-20 明阳时创(北京)科技有限公司 Closed-loop containerized controllable service cluster construction method and service cluster device

Similar Documents

Publication Publication Date Title
CN109814879B (en) Automatic CI/CD project deployment method and storage medium
JP7090657B2 (en) Methods, devices, devices and storage media for upgrading applications
US10191733B2 (en) Software change process orchestration in a runtime environment
US20170255886A1 (en) Workflow execution
US20150220308A1 (en) Model-based development
CN108733553B (en) Docker-based test device configuration method, device and system
CN113220431B (en) Cross-cloud distributed data task scheduling method, device and storage medium
US20180157472A1 (en) Customized application state transition
US10929124B2 (en) Application release using integration into unified code system
US9141363B2 (en) Application construction for execution on diverse computing infrastructures
CN114077423A (en) Airport APP development container architecture based on mobile cross-platform
CN111562950B (en) Distributed application parameter dynamic release system and method
WO2021092502A1 (en) Just-in-time containers
CN112416415A (en) Front-end micro-service implementation method and related components
CN114968406B (en) Plug-in management method and device, electronic equipment and storage medium
CN112328307A (en) Development, operation and maintenance integrated system
CN116382694A (en) Method for improving compiling speed of Maven engineering in container environment
CN112114896A (en) Plug-in framework and method for service function expansion
CN112242920B (en) Cloud platform deployment method, device and node
CN111831567A (en) Application test environment configuration method, device, system and medium
CN112860251A (en) Method and system for constructing website front end
CN117270864A (en) Code compiling method, device, equipment and storage medium
CN116755788A (en) On-line rule modification method, device, equipment and storage medium
CN107885574B (en) Deployment method of virtual machine, service node, control device and control node
CN115509531A (en) Micro front end implementation method, device, terminal and storage medium based on front end technology

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