CN112698946A - Jenkins distributed task allocation method and system - Google Patents

Jenkins distributed task allocation method and system Download PDF

Info

Publication number
CN112698946A
CN112698946A CN202011605122.5A CN202011605122A CN112698946A CN 112698946 A CN112698946 A CN 112698946A CN 202011605122 A CN202011605122 A CN 202011605122A CN 112698946 A CN112698946 A CN 112698946A
Authority
CN
China
Prior art keywords
agent
jenkins
execution
machines
execution machines
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
CN202011605122.5A
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.)
Aisino Corp
Original Assignee
Aisino Corp
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 Aisino Corp filed Critical Aisino Corp
Priority to CN202011605122.5A priority Critical patent/CN112698946A/en
Publication of CN112698946A publication Critical patent/CN112698946A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a system for distributing tasks based on Jenkins distribution, and belongs to the technical field of Jenkins distribution. The method comprises the following steps: acquiring configuration information of the execution machines, and configuring a plurality of execution machines of the agent node on Jenkins according to the configuration information; after the configuration of the multiple execution machines is completed, downloading agent.jar packages of the execution machines, and copying the agent.jar packages to the execution machines; after logging in the execution machine, configuring an execution environment for executing the agent.jar package on the execution machine, and after the configuration of the execution environment is completed, executing the agent.jar package to complete the connection of a plurality of execution machines on Jenkins; and installing the JDK environment on the Jenkins agent, starting a sweep-client connection server on the Jenkins agent after the installation is finished, binding the jobs for the Jenkins agent after the connection is successful, and finishing the distribution of the jobs. In the aspect of production efficiency, the load of the main Jenkins server is greatly reduced, the code deployment efficiency is improved, and in the aspect of safety, the data safety is ensured and the attack difficulty coefficient is improved.

Description

Jenkins distributed task allocation method and system
Technical Field
The invention relates to the technical field of Jenkins distribution, in particular to a task distribution method and system based on Jenkins distribution.
Background
Jenkins is an open source software project, is a continuous integration tool based on Java development, is used for monitoring continuous repeated work, aims at providing an open easy-to-use software platform, makes continuous integration of software become possible, is installed on a machine, all jobs run on the machine, if exceed too many jobs to run, can form and wait, leads to inefficiency, and has the security problem.
Disclosure of Invention
Aiming at the problems, the invention provides a task allocation method based on Jenkins distribution, which comprises the following steps:
acquiring configuration information of the execution machines, and configuring a plurality of execution machines of the agent node on Jenkins according to the configuration information;
after the configuration of the multiple execution machines is completed, downloading agent.jar packages of the execution machines, and copying the agent.jar packages to the execution machines;
after logging in the execution machine, configuring an execution environment for executing the agent.jar package on the execution machine, and after the configuration of the execution environment is completed, executing the agent.jar package to complete the connection of a plurality of execution machines on Jenkins;
and installing the JDK environment on the Jenkins agent, starting a sweep-client connection server on the Jenkins agent after the installation is finished, binding the jobs for the Jenkins agent after the connection is successful, and finishing the distribution of the jobs.
Optionally, the configuration information includes: the maximum number of the execution machines executing the job at the same time, the language type of the script in the job which can be executed by the execution machines, the control mode of the execution machines, and any one or any combination of default codes used by the execution machines.
Optionally, the operating systems of the multiple execution machines are different.
Optionally, binding job for agent includes: and filling a label in the configuration page of the agent, adding a label in the configuration page of the job, and binding the job to the agent.
Optionally, if Jenkins are upgraded, Jenkins master is upgraded synchronously and agent is downloaded again, and if Jenkins agent is expanded, agent is dynamically added to agent;
the Jenkins are also used for remote calling, and when the Jenkins are called remotely, Jenkins are called remotely after the http service port is opened by using a shell command and a post request mode;
the shell command uses the http protocol.
The invention also provides a system for distributing tasks based on Jenkins distribution, which comprises:
the configuration module is used for acquiring configuration information of the execution machines and configuring the execution machines of the proxy node on Jenkins according to the configuration information;
the connection module downloads the agent.jar package of the execution machine after the configuration of the execution machines is completed, copies the agent.jar package to the execution machine, configures the execution environment for executing the agent.jar package on the execution machine after logging in the execution machine, and executes the agent.jar package after the configuration of the execution environment is completed to complete the connection of the execution machines on Jenkins;
and the task allocation module is used for installing a JDK environment on the Jenkins agent, starting a sweep-client connection server on the Jenkins agent after the installation is finished, and binding the jobs for the Jenkins agent after the connection is successful to finish the distribution of the jobs.
Optionally, the configuration information includes: the maximum number of the execution machines executing the job at the same time, the language type of the script in the job which can be executed by the execution machines, the control mode of the execution machines, and any one or any combination of default codes used by the execution machines.
Optionally, the operating systems of the multiple execution machines are different.
Optionally, binding job for agent includes: and filling a label in the configuration page of the agent, adding a label in the configuration page of the job, and binding the job to the agent.
Optionally, if Jenkins are upgraded, Jenkins master is upgraded synchronously and agent is downloaded again, and if Jenkins agent is expanded, agent is dynamically added to agent;
the Jenkins are also used for remote calling, and when the Jenkins are called remotely, Jenkins are called remotely after the http service port is opened by using a shell command and a post request mode;
the shell command uses the http protocol.
In the aspect of production efficiency, the load of the main Jenkins server is greatly reduced, the code deployment efficiency is improved, and in the aspect of safety, the data safety is ensured and the attack difficulty coefficient is improved.
Drawings
FIG. 1 is a flow chart of a task allocation method based on Jenkins distribution according to the present invention;
fig. 2 is a structural diagram of a Jenkins-based distributed task allocation system according to the present invention.
Detailed Description
The exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, however, the present invention may be embodied in many different forms and is not limited to the embodiments described herein, which are provided for complete and complete disclosure of the present invention and to fully convey the scope of the present invention to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the accompanying drawings is not intended to be limiting of the invention. In the drawings, the same units/elements are denoted by the same reference numerals.
Unless otherwise defined, terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Further, it will be understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense.
The invention provides a method for distributing tasks based on Jenkins distribution, which comprises the following steps of:
acquiring configuration information of the execution machines, and configuring a plurality of execution machines of the agent node on Jenkins according to the configuration information;
after the configuration of the multiple execution machines is completed, downloading agent.jar packages of the execution machines, and copying the agent.jar packages to the execution machines;
after logging in the execution machine, configuring an execution environment for executing the agent.jar package on the execution machine, and after the configuration of the execution environment is completed, executing the agent.jar package to complete the connection of a plurality of execution machines on Jenkins;
and installing the JDK environment on the Jenkins agent, starting a sweep-client connection server on the Jenkins agent after the installation is finished, binding the jobs for the Jenkins agent after the connection is successful, and finishing the distribution of the jobs.
Wherein the configuration information includes: the maximum number of the execution machines executing the job at the same time, the language type of the script in the job which can be executed by the execution machines, the control mode of the execution machines, and any one or any combination of default codes used by the execution machines.
Wherein the operating systems of the plurality of execution machines are different.
Wherein, binding jobs for agent includes: and filling a label in the configuration page of the agent, adding a label in the configuration page of the job, and binding the job to the agent.
If the Jenkins are upgraded, the Jenkins master is synchronously upgraded and the agents are downloaded again, and if the Jenkins agents are expanded, the agents are dynamically added;
the Jenkins are also used for remote calling, and when the Jenkins are called remotely, Jenkins are called remotely after the http service port is opened by using a shell command and a post request mode;
need not dispose agent on Jenkins master during long-range the calling, increase agent through the Swarm plug-in components, install in Jenkins: a Self-Organizing Swarm Plug-in Modules Plug-in that downloads or copies Swarm-client. jar to Jenkins agent.
The shell command uses the http protocol.
The present invention further provides a system 200 for distributing tasks based on Jenkins distribution, as shown in fig. 2, including:
the configuration module 201 is used for acquiring configuration information of the execution machines and configuring a plurality of execution machines of the proxy node on Jenkins according to the configuration information;
the connection module 202 downloads the agent.jar package of the execution machine after the configuration of the execution machines is completed, copies the agent.jar package to the execution machine, configures the execution environment for executing the agent.jar package on the execution machine after logging in the execution machine, and executes the agent.jar package after the configuration of the execution environment is completed to complete the connection of the execution machines on Jenkins;
and the task allocation module 203 is used for installing a JDK environment on the Jenkins agent, starting a sweep-client connection server on the Jenkins agent after the installation is finished, and binding the jobs for the Jenkins agent after the connection is successful to finish the distribution of the jobs.
Wherein the configuration information includes: the maximum number of the execution machines executing the job at the same time, the language type of the script in the job which can be executed by the execution machines, the control mode of the execution machines, and any one or any combination of default codes used by the execution machines.
Wherein the operating systems of the plurality of execution machines are different.
Wherein, binding jobs for agent includes: and filling a label in the configuration page of the agent, adding a label in the configuration page of the job, and binding the job to the agent.
If the Jenkins are upgraded, the Jenkins master is synchronously upgraded and the agents are downloaded again, and if the Jenkins agents are expanded, the agents are dynamically added;
the Jenkins are also used for remote calling, and when the Jenkins are called remotely, Jenkins are called remotely after the http service port is opened by using a shell command and a post request mode;
the shell command uses the http protocol.
In the aspect of production efficiency, the load of the main Jenkins server is greatly reduced, the code deployment efficiency is improved, and in the aspect of safety, the data safety is ensured and the attack difficulty coefficient is improved.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. The scheme in the embodiment of the application can be implemented by adopting various computer languages, such as object-oriented programming language Java and transliterated scripting language JavaScript.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means 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.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method of task allocation based on Jenkins distribution, the method comprising:
acquiring configuration information of the execution machines, and configuring a plurality of execution machines of the agent node on Jenkins according to the configuration information;
after the configuration of the multiple execution machines is completed, downloading agent.jar packages of the execution machines, and copying the agent.jar packages to the execution machines;
after logging in the execution machine, configuring an execution environment for executing the agent.jar package on the execution machine, and after the configuration of the execution environment is completed, executing the agent.jar package to complete the connection of a plurality of execution machines on Jenkins;
and installing the JDK environment on the Jenkins agent, starting a sweep-client connection server on the Jenkins agent after the installation is finished, binding the jobs for the Jenkins agent after the connection is successful, and finishing the distribution of the jobs.
2. The method of claim 1, the configuration information comprising: the maximum number of the execution machines executing the job at the same time, the language type of the script in the job which can be executed by the execution machines, the control mode of the execution machines, and any one or any combination of default codes used by the execution machines.
3. The method of claim 1, wherein operating systems of the plurality of execution machines are different.
4. The method of claim 1, wherein binding a job to an agent comprises: and filling a label in the configuration page of the agent, adding a label in the configuration page of the job, and binding the job to the agent.
5. The method of claim 1, wherein if Jenkins are upgraded, Jenkins master is upgraded synchronously and agent. jar is downloaded again, if Jenkins agent is expanded, agent is dynamically added to agent;
the Jenkins are also used for remote calling, and when the Jenkins are called remotely, the Jenkins are called remotely after the http service port is opened by using a shell command and a post request mode;
the shell command uses http protocol.
6. A Jenkins-based distributed task distribution system, the system comprising:
the configuration module is used for acquiring configuration information of the execution machines and configuring the execution machines of the proxy node on Jenkins according to the configuration information;
the connection module downloads the agent.jar package of the execution machine after the configuration of the execution machines is completed, copies the agent.jar package to the execution machine, configures the execution environment for executing the agent.jar package on the execution machine after logging in the execution machine, and executes the agent.jar package after the configuration of the execution environment is completed to complete the connection of the execution machines on Jenkins;
and the task allocation module is used for installing a JDK environment on the Jenkins agent, starting a sweep-client connection server on the Jenkins agent after the installation is finished, and binding the jobs for the Jenkins agent after the connection is successful to finish the distribution of the jobs.
7. The system of claim 6, the configuration information comprising: the maximum number of the execution machines executing the job at the same time, the language type of the script in the job which can be executed by the execution machines, the control mode of the execution machines, and any one or any combination of default codes used by the execution machines.
8. The system of claim 6, the plurality of execution machines differing in operating system.
9. The system of claim 6, wherein binding a job to an agent comprises: and filling a label in the configuration page of the agent, adding a label in the configuration page of the job, and binding the job to the agent.
10. The system of claim 6, wherein if Jenkins is upgraded, Jenkins master is upgraded synchronously and agent. jar is downloaded again, if Jenkins agent is expanded, agent is dynamically added to agent;
the Jenkins are also used for remote calling, and when the Jenkins are called remotely, the Jenkins are called remotely after the http service port is opened by using a shell command and a post request mode;
the shell command uses http protocol.
CN202011605122.5A 2020-12-30 2020-12-30 Jenkins distributed task allocation method and system Pending CN112698946A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011605122.5A CN112698946A (en) 2020-12-30 2020-12-30 Jenkins distributed task allocation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011605122.5A CN112698946A (en) 2020-12-30 2020-12-30 Jenkins distributed task allocation method and system

Publications (1)

Publication Number Publication Date
CN112698946A true CN112698946A (en) 2021-04-23

Family

ID=75512346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011605122.5A Pending CN112698946A (en) 2020-12-30 2020-12-30 Jenkins distributed task allocation method and system

Country Status (1)

Country Link
CN (1) CN112698946A (en)

Similar Documents

Publication Publication Date Title
US10031740B2 (en) Method for programming vehicle electronic control modules
CN110463162B (en) Application deployment method, device and system
US20120272204A1 (en) Uninterruptible upgrade for a build service engine
KR20110114497A (en) Methods and systems to implement non-abi conforming features across unseen interfaces
CN106020882A (en) Application upgrading method, intelligent terminal and upgrading system
CN106569863B (en) Resource and code modularization-based android app resource updating and repairing method
CN110268378B (en) Method for creating data backup, storage medium and virtual server
CN109964181B (en) Controller for an industrial automation device and method for programming and operating such a controller
CN113330419A (en) Equipment application installation method and device
EP3159792B1 (en) Method of optimally compiling plc command
CN112698946A (en) Jenkins distributed task allocation method and system
CN101627605A (en) In computer system, be used to carry out the method and the corresponding apparatus of transfer of data
CN114924772A (en) Updating method and equipment of algorithm package
CN113485692A (en) Big data componentization development method and device based on component store
JP2023518198A (en) A method and apparatus for managing an automation program for an industrial automation platform
CN106648870A (en) Service restarting method and device
CN113157329A (en) Method, system, server and storage medium for starting application
CN112685051A (en) Method, device, platform and storage medium for automatically executing shell script
CN109643094B (en) Security control unit, security control method, and storage medium
CN108573142B (en) Method and device for realizing hook
US10088834B2 (en) Control system having function for optimizing control software of numerical controller in accordance with machining program
US11729051B2 (en) Automated deployment of control nodes at remote locations
JP6295914B2 (en) Programmable controller system, its support device, programmable controller
EP3982250A1 (en) Generation of code for a system
WO2007051958A1 (en) Update package format and method for grouping and sequencing update payloads

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