This plugin allows Jobs to be prioritised based Queue Strategies and Priority Strategies.
This plugin adds the ability to assign different priorities to Jobs, the lower priority the job has the sooner the Job will run.
This can be very helpful when one wants to add low priority jobs but wants to have higher-priority jobs run first when hardware is limited or when there are different groups of Jobs that should share resources (equally).
There are four included Queue Strategies, the different Queue Strategies will sort the Queue differently.
Each Job will be assigned a Priority, the lower the Priority the sooner the Job will be run.
Each Job will be assigned a Priority, the Queue will try to share the resources equally over the different priorities in a round-robin fashion.
The same as Fair Queuing but Jobs with lower Priority will be run more frequently than Jobs with higher Priority.
Priorities can either be assigned directly on Jobs or, preferably, by assigning them by View.
It is possible to assign the Priority based on different Priority Strategies
The plugin can still operate in Legacy Mode and will then behave as the pre 2.0 version. It is however advised to either upgrade to the Advanced Mode or downgrade the plugin.
The Legacy Mode will be removed in next major release.
The main configuration of the plugin is done on the main Configurations Page and the Priority Strategy configurations done on its own page accessible from the root actions menu.
If you are already using the Priority Sorter and you're upgrading to the 2.0 you'll need to actively select to upgrade the configuration.
Go to the Jenkins main configuration page ad go to the Priority Sorter and you will see this:
to upgrade your system to advanced mode check the check-box and you will be able to configure the Advanced Mode.
Please note that in when you switch to Advanced mode the switch will go through and update all your Jobs. This may take quite some time depending on how many Jobs you have.
The upgrade will convert your legacy priorities to Advanced with the selected range.
If you are installing the Priority Sorter on a new system the configuration panel will directly show the Advanced Mode
Please note that if you are upgrading from Legacy Mode and want to keep the old priorities you must allow priorities on Jobs.
Please note that in Advanced Mode generally lower number means higher priority, also see details on screen for the specifics on each Strategy.
When in advanced mode you will find the link to the page where you can assign priorities to each Job
On this page you will be able to assign priorities to Jobs by View and/or Pattern.
You can limit access to this functionality to Administrators only be checking the appropriate check-box on the main configuration page.
If a Job from a Run Exclusive JobGroup gets started Jobs from other JobGroups will stay blocked and will not get started until all Jobs from the Run Exclusive JobGroup in the Queue is finished, regardless of priority.
Since a Job can get a different Priority each time it is started the View Column cannot show the "correct" priority for the Job.
The column will show the priority used the last time the Job was launched, if the Job has not been started at all yet the column will show Pending.
To get some inside information on how and why a certain Job gets a certain Priority you can turn on some extra logging.
Logger to log is PrioritySorter.Queue.Items
To get more info on the assigned priorities and state transition of the items in the queue log on level FINE.
To get even more info on how the Jobs are matched to Job Groups and Rules to get the priority log on level FINER.
To get logging on when the QueueSorter is active log PrioritySorter.Queue.Sorter on level FINE.
To see all items sorted (the queue) by the QueueSorter PrioritySorter.Queue.Sorter on level FINER.
Fixes : issue #23462 Sectioned views are not evaluated for job priority
Fixes : issue #23428 Jobs in NestedView (ViewGroup) are not correctly found
Fixes : issue #21310 CCE when a Queue.Task was not a Job
Fixes: issue #21173 Anonymous Users Can Configure Priorities
Fixes: issue #11997 Consider jobs in the Executors for priority sorter
Fixing bug that made the plugin switch to Advanced mode even though Legacy (1.3) data was present in the system. (Thanks to help from Matthew Webber)
Fixes: [JENKINS-8597] Deal with matrix builds better
Fixes bug that mapped all Jobs to all Views/JobGroups.
Introducing advanced queueing features with possibility to selected different strategies for how priorities are assigned and how the queue is sorted.
Thanks Oleg for testing, reviewing and helping out.
Removed view column from default view (Thanks to work from larrys)
Added View column to easily compare priorities between jobs (Thanks to work from cjo9900)
Fixed a potential NPE when using the plugin on existing jobs without setting a default priority.
Skip to end of metadata Go to start of metadata