Skip to content

Commit

Permalink
[CI] filter static versus ephemeral workers (elastic#22607)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Nov 17, 2020
1 parent 70ff0a7 commit 5e21666
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -683,11 +683,18 @@ def notifyBuildReason() {

/**
* Guarantee a specific worker can only be used for a specific build. This was not the case
* with the customise node provisioner that reuses workers when there is peak load.
* with the customise node provisioner that reuses workers in some cases when there is a peak load.
*/
def withNode(def label, Closure body) {
def uuid = UUID.randomUUID().toString()
def labels = label?.trim() ? "${label} && extra/${uuid}" : "extra/${uuid}"
def labels
// There are immutable workers and static ones, so the static ones are only metal, macosx and arm
if (label.contains('arm') || label.contains('macosx') || label.contains('metal')) {
labels = label
} else {
// Otherwise use the dynamic UUID for the gobld
def uuid = UUID.randomUUID().toString()
labels = label?.trim() ? "${label} && extra/${uuid}" : "extra/${uuid}"
}
node("${labels}") {
body()
}
Expand Down

0 comments on commit 5e21666

Please sign in to comment.