Skip to content

Commit

Permalink
[ci] revert one shot-workers (elastic#22622)
Browse files Browse the repository at this point in the history
* Revert "[CI] filter static versus ephemeral workers (elastic#22607)"
This reverts commit 5e21666.
* Revert "[CI] ensure one shot-worker (elastic#22588)"
This reverts commit 0a75258.
  • Loading branch information
v1v authored Nov 17, 2020
1 parent 5e21666 commit 9157d18
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def generateStages(Map args = [:]) {
}

def cloud(Map args = [:]) {
withNode(args.label) {
node(args.label) {
startCloudTestEnv(name: args.directory, dirs: args.dirs)
}
withCloudTestEnv() {
Expand All @@ -226,7 +226,7 @@ def cloud(Map args = [:]) {
def k8sTest(Map args = [:]) {
def versions = args.versions
versions.each{ v ->
withNode(args.label) {
node(args.label) {
stage("${args.context} ${v}"){
withEnv(["K8S_VERSION=${v}", "KIND_VERSION=v0.7.0", "KUBECONFIG=${env.WORKSPACE}/kubecfg"]){
withGithubNotify(context: "${args.context} ${v}") {
Expand Down Expand Up @@ -271,7 +271,7 @@ def target(Map args = [:]) {
def directory = args.get('directory', '')
def withModule = args.get('withModule', false)
def isMage = args.get('isMage', false)
withNode(args.label) {
node(args.label) {
withGithubNotify(context: "${context}") {
withBeatsEnv(archive: true, withModule: withModule, directory: directory, id: args.id) {
dumpVariables()
Expand Down Expand Up @@ -681,25 +681,6 @@ 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 in some cases when there is a peak load.
*/
def withNode(def label, Closure body) {
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()
}
}

/**
* This class is the one used for running the parallel stages, therefore
* its arguments are passed by the beatsStages step.
Expand Down

0 comments on commit 9157d18

Please sign in to comment.