|
40 | 40 | // When running builds parameterised to other architectures the corresponding labels are expected. |
41 | 41 | // For example 'arm64' requires the labels: cassandra-arm64-small, cassandra-arm64-medium, cassandra-arm64-large. |
42 | 42 | // |
43 | | -// The built-in node must has the "controller" label. There must be more than two agents for each label. |
| 43 | +// Nodes running on spot instances have to have labels with `-spot` suffixes. |
| 44 | +// For example: cassandra-amd64-large-spot |
| 45 | +// |
| 46 | +// The built-in node must has the "controller" label. There must be more than two agents for all "cassandra-*" labels. |
44 | 47 | // |
45 | 48 | // Plugins required are: |
46 | 49 | // git, workflow-job, workflow-cps, junit, workflow-aggregator, ws-cleanup, pipeline-build-step, test-stability, copyartifact. |
@@ -333,7 +336,7 @@ def build(command, cell) { |
333 | 336 | def nodeExclusion = "" |
334 | 337 | retry(maxAttempts) { |
335 | 338 | attempt++ |
336 | | - node(getNodeLabel(command, cell) + nodeExclusion) { |
| 339 | + node(getNodeLabel(command, cell, attempt != maxAttempts) + nodeExclusion) { |
337 | 340 | nodeExclusion = "&&!${NODE_NAME}" |
338 | 341 | withEnv(cell.collect { k, v -> "${k}=${v}" }) { |
339 | 342 | ws("workspace/${JOB_NAME}/${BUILD_NUMBER}/${cell.step}/${cell.arch}/jdk-${cell.jdk}") { |
@@ -376,7 +379,7 @@ def test(command, cell) { |
376 | 379 | def nodeExclusion = "" |
377 | 380 | retry(maxAttempts) { |
378 | 381 | attempt++ |
379 | | - node(getNodeLabel(command, cell) + nodeExclusion) { |
| 382 | + node(getNodeLabel(command, cell, attempt != maxAttempts) + nodeExclusion) { |
380 | 383 | nodeExclusion = "&&!${NODE_NAME}" |
381 | 384 | withEnv(cell.collect { k, v -> "${k}=${v}" }) { |
382 | 385 | ws("workspace/${JOB_NAME}/${BUILD_NUMBER}/${cell.step}/${cell.arch}/jdk-${cell.jdk}/python-${cell.python}") { |
@@ -482,9 +485,10 @@ def fetchDockerImages(dockerfiles) { |
482 | 485 | """ |
483 | 486 | } |
484 | 487 |
|
485 | | -def getNodeLabel(command, cell) { |
486 | | - echo "using node label: cassandra-${cell.arch}-${command.size}" |
487 | | - return "cassandra-${cell.arch}-${command.size}" |
| 488 | +def getNodeLabel(command, cell, canSpot) { |
| 489 | + def label = "cassandra-${cell.arch}-${command.size}" (+ "-spot" if canSpot else "") |
| 490 | + echo "using node label: ${label}" |
| 491 | + return label |
488 | 492 | } |
489 | 493 |
|
490 | 494 | def copyToNightlies(sourceFiles, remoteDirectory='') { |
|
0 commit comments