Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multi-configuration jenkins job order

Tags:

jenkins

I am using mutli-configuration job with sequential execution.  2 axis: - slaves  - user-defined 

Jenkins run my jobs in "random" order.

Is there a way to fix that order? Why jenkins does not use the order of the used-defined variable (first line first)?

regards

like image 833
trax Avatar asked Feb 15 '13 18:02

trax


People also ask

What is multi-configuration?

multiconfiguration (not comparable) (physics, chemistry) Having, or involving multiple configurations.

What is configuration matrix in Jenkins?

The Configuration Matrix allows you to specify what steps to duplicate, and create a multiple-axis graph of the type of builds to create. For example, let us say that we have a build that we want to create for several different targets alpha, beta, and we want to produce both debug and release outputs.

What is Jenkins job configuration?

Job Configuration History PluginThis plugin saves a copy of the configuration file of jobs and agents ( config. xml ) for every change made and of the system configuration ( <config-name>. xml ). You can also see what changes have been made by which user if you configured a security policy.


2 Answers

It is possible to use the Matrix configuration sorter plugin[1] for this. After installing the plugin, you get an option Execution order of builds, with the following values to choose from:

  • Doesn't care
  • Estimated duration of build (longest first)
  • Estimated duration of build (shortest first)
  • Last axis order

Selecting the last option should order the jobs the way they are specified in the axis, though only for the last one.

[1] https://wiki.jenkins-ci.org/display/JENKINS/Matrix+configuration+sorter+plugin

like image 184
roelvanmeer Avatar answered Oct 21 '22 10:10

roelvanmeer


According to page 267 of Jenkins: The Definitive Guide by John Smart, Jenkins will use the values of an axis in the same manner as parameter values, but when triggered the job will run once per axis value.

The order for these values is not fixed (and may be random; I'm not sure). Presumably the assumptions here are that there are enough build slaves that each permutation can be handled by a different slave and that the order of permutations does not matter. I say permutations because, if there is more than one axis, the total number of builds corresponds to the Cartesian product of the axes.

A multiple-axis scenario probably holds the answer to why there is no way to specify order in a user-defined axis: it would be complicated and, when the build slaves are distributed, not very useful. Jenkins simply doesn't care about axis ordering, for good reason. The simple case of one axis and one build slave, where ordering might actually matter, is essentially an edge case.

like image 33
Philip Hanson Avatar answered Oct 21 '22 08:10

Philip Hanson