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

Restrict nightly node labeler to linux (docker) only #1272

Merged
merged 3 commits into from
Feb 28, 2025
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
12 changes: 5 additions & 7 deletions jenkins-scripts/tools/label-assignment-backstop.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import hudson.model.Label;
*/
def nightly_label_prefix = "linux-nightly"
def exactly_one_labels = [
["${nightly_label_prefix}-focal", "large-memory"],
["${nightly_label_prefix}-jammy", "large-memory"],
["${nightly_label_prefix}-noble", "large-memory"],
["${nightly_label_prefix}-focal", "docker && large-memory"],
["${nightly_label_prefix}-jammy", "docker && large-memory"],
["${nightly_label_prefix}-noble", "docker && large-memory"],
]

for (tup in exactly_one_labels) {
Expand Down Expand Up @@ -48,18 +48,16 @@ for (tup in exactly_one_labels) {
println("No online host currently has the label ${nightly_label}")
println("Appointing a node from the configured pool matching '${pool_label}'")

def node_pool = Jenkins.instance.nodes.findAll { node ->
def node_pool = Label.get(pool_label).getNodes().findAll { node ->
node.toComputer()?.isOnline() &&
node.getLabelString().contains(pool_label) &&
!node.getLabelString().contains(nightly_label_prefix) &&
!node.getLabelString().contains("test-instance")
}

if (node_pool.size() <= 0) {
println("The Pool of '${pool_label}' machines for ${nightly_label} is empty. Reusing a node:")
node_pool = Jenkins.instance.nodes.findAll { node ->
node_pool = Label.get(pool_label).getNodes().findAll { node ->
node.toComputer()?.isOnline() &&
node.getLabelString().contains(pool_label) &&
!node.getLabelString().contains("test-instance")
}
}
Expand Down