Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] filter static versus ephemeral workers #22607

Merged
merged 2 commits into from
Nov 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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