Priority of older pipeline starts over newer ones

In short, is there a way to sort a Jenkins queue based on build / start time, and not how long it has been in the queue?

In some way, we have a script pipeline that executes several tasks in parallel, and then, at the end, has a step that aggregates the results from parallel tasks. Here is a simplified version:

stage ('Do Parrallel stuff') {
    def par = [:]
    for (int i = 0; i < 4; i++) { par[i] = {sleep(10)} }
    parallel par;
}

stage ('Aggregate') {
    node {
      echo "Aggregating stuff"
    }
}

Usually, when only one current run is working, this works fine. That is, he performs four parallel tasks, and then performs the aggregate part. However, under high load, this installation does not work. Consider the following scenario in which we have one instance of Jenkins with one executor:

  • We have a job as above
  • ( ), # 1 # 2.
  • 8 , , #1[1], #1[2], #1[3], #1[4], #2[1], #2[2], #2[3] #2[4]
  • Jenkins #1[1], .
  • , #1[2], #1[3] #1[4].
  • script #1 #1-Aggr
  • Jenkins #2[1], #2[2] ..
  • #1-Aggr #2-Aggr

, . , , , . , .

, ? . , , ? ( ) , , .

node . , , .

+4

Source: https://habr.com/ru/post/1669697/


All Articles