From 42cafcf7da80fab70034e4b330dacf5333f4a9ad Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 20 Oct 2020 11:08:01 +0100 Subject: [PATCH] revert https://github.com/AdoptOpenJDK/openjdk-build/pull/2130 --- pipelines/build/common/build_base_file.groovy | 4 -- .../build/common/config_regeneration.groovy | 1 - .../common/create_job_from_template.groovy | 1 - .../common/openjdk_build_pipeline.groovy | 70 ++++++------------- pipelines/build/openjdk10_pipeline.groovy | 1 - pipelines/build/openjdk11_pipeline.groovy | 1 - pipelines/build/openjdk12_pipeline.groovy | 1 - pipelines/build/openjdk13_pipeline.groovy | 1 - pipelines/build/openjdk14_pipeline.groovy | 1 - pipelines/build/openjdk15_pipeline.groovy | 1 - pipelines/build/openjdk16_pipeline.groovy | 1 - pipelines/build/openjdk8_pipeline.groovy | 1 - pipelines/build/openjdk9_pipeline.groovy | 1 - 13 files changed, 21 insertions(+), 64 deletions(-) diff --git a/pipelines/build/common/build_base_file.groovy b/pipelines/build/common/build_base_file.groovy index c3e40e8ae..a95eb5aa2 100644 --- a/pipelines/build/common/build_base_file.groovy +++ b/pipelines/build/common/build_base_file.groovy @@ -33,7 +33,6 @@ limitations under the License. //@CompileStatic(extensions = "JenkinsTypeCheckHelperExtension") class Builder implements Serializable { String javaToBuild - String activeNodeTimeout String adoptBuildNumber String overrideFileNameVersion String additionalBuildArgs @@ -95,7 +94,6 @@ class Builder implements Serializable { SCM_REF: scmReference, BUILD_ARGS: buildArgs, NODE_LABEL: "${additionalNodeLabels}&&${platformConfig.os}&&${platformConfig.arch}", - ACTIVE_NODE_TIMEOUT: activeNodeTimeout, CODEBUILD: platformConfig.codebuild as Boolean, DOCKER_IMAGE: dockerImage, DOCKER_FILE: dockerFile, @@ -492,7 +490,6 @@ return { String javaToBuild, Map> buildConfigurations, String targetConfigurations, - String activeNodeTimeout, String dockerExcludes, String enableTests, String enableInstallers, @@ -539,7 +536,6 @@ return { javaToBuild: javaToBuild, buildConfigurations: buildConfigurations, targetConfigurations: new JsonSlurper().parseText(targetConfigurations) as Map, - activeNodeTimeout: activeNodeTimeout, dockerExcludes: buildsExcludeDocker, enableTests: Boolean.parseBoolean(enableTests), enableInstallers: Boolean.parseBoolean(enableInstallers), diff --git a/pipelines/build/common/config_regeneration.groovy b/pipelines/build/common/config_regeneration.groovy index 9e520700a..93cebed98 100644 --- a/pipelines/build/common/config_regeneration.groovy +++ b/pipelines/build/common/config_regeneration.groovy @@ -266,7 +266,6 @@ class Regeneration implements Serializable { SCM_REF: "", BUILD_ARGS: buildArgs, NODE_LABEL: "${additionalNodeLabels}&&${platformConfig.os}&&${platformConfig.arch}", - ACTIVE_NODE_TIMEOUT: "", CODEBUILD: platformConfig.codebuild as Boolean, DOCKER_IMAGE: dockerImage, DOCKER_FILE: dockerFile, diff --git a/pipelines/build/common/create_job_from_template.groovy b/pipelines/build/common/create_job_from_template.groovy index 80acca223..ca6513c99 100644 --- a/pipelines/build/common/create_job_from_template.groovy +++ b/pipelines/build/common/create_job_from_template.groovy @@ -71,7 +71,6 @@ pipelineJob("$buildFolder/$JOB_NAME") {
SCM_REF
Source code ref to build, i.e branch, tag, commit id
BUILD_ARGS
args to pass to makejdk-any-platform.sh
NODE_LABEL
Labels of node to build on
-
ACTIVE_NODE_TIMEOUT
Number of minutes we will wait for a label-matching node to become active.
CODEBUILD
Use a dynamic codebuild machine if no other machine is available
DOCKER_IMAGE
Use a docker build environment
DOCKER_FILE
Relative path to a dockerfile to be built and used on top of the DOCKER_IMAGE
diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 0428bd686..842bb6a32 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -750,40 +750,6 @@ class Build { } } - def waitForANodeToBecomeActive(def label) { - def NodeHelper = context.library(identifier: 'openjdk-jenkins-helper@master').NodeHelper - - if (NodeHelper.nodeIsOnline(label)) { - return - } - - context.println("No active node matches this label: " + label) - - int activeNodeTimeout = 0 - if (buildConfig.ACTIVE_NODE_TIMEOUT.isInteger()) { - activeNodeTimeout = buildConfig.ACTIVE_NODE_TIMEOUT as Integer - } - - - if (activeNodeTimeout > 0) { - context.println("Will check again periodically until a node labelled " + label + " comes online, or " + buildConfig.ACTIVE_NODE_TIMEOUT + " minutes (ACTIVE_NODE_TIMEOUT) has passed.") - int x = 0 - while (x < activeNodeTimeout) { - context.sleep(60 * 1000) // 1 minute sleep - if (NodeHelper.nodeIsOnline(label)) { - context.println("A node which matches this label is now active: " + label) - return - } - x++ - } - context.error("No node matching this label became active prior to the timeout: " + label) - throw new Exception() - } else { - context.error("As the timeout value is set to 0, we will not wait for a node to become active.") - throw new Exception() - } - } - def build() { context.timestamps { context.timeout(time: 18, unit: "HOURS") { @@ -803,6 +769,8 @@ class Build { def cleanWorkspace = Boolean.valueOf(buildConfig.CLEAN_WORKSPACE) context.stage("queue") { + def NodeHelper = context.library(identifier: 'openjdk-jenkins-helper@master').NodeHelper + if (buildConfig.DOCKER_IMAGE) { // Docker build environment def label = buildConfig.NODE_LABEL + "&&dockerBuild" @@ -838,23 +806,27 @@ class Build { } } else { - waitForANodeToBecomeActive(buildConfig.NODE_LABEL) - context.node(buildConfig.NODE_LABEL) { - // This is to avoid windows path length issues. - context.echo("checking ${buildConfig.TARGET_OS}") - if (buildConfig.TARGET_OS == "windows") { - // See https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1284#issuecomment-621909378 for justification of the below path - def workspace = "C:/workspace/openjdk-build/" - if (env.CYGWIN_WORKSPACE) { - workspace = env.CYGWIN_WORKSPACE - } - context.echo("changing ${workspace}") - context.ws(workspace) { + if (NodeHelper.nodeIsOnline(buildConfig.NODE_LABEL)) { + context.node(buildConfig.NODE_LABEL) { + // This is to avoid windows path length issues. + context.echo("checking ${buildConfig.TARGET_OS}") + if (buildConfig.TARGET_OS == "windows") { + // See https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1284#issuecomment-621909378 for justification of the below path + def workspace = "C:/workspace/openjdk-build/" + if (env.CYGWIN_WORKSPACE) { + workspace = env.CYGWIN_WORKSPACE + } + context.echo("changing ${workspace}") + context.ws(workspace) { + buildScripts(cleanWorkspace, filename) + } + } else { buildScripts(cleanWorkspace, filename) } - } else { - buildScripts(cleanWorkspace, filename) - } + } + } else { + context.error("No node of this type exists: ${buildConfig.NODE_LABEL}") + return } } } diff --git a/pipelines/build/openjdk10_pipeline.groovy b/pipelines/build/openjdk10_pipeline.groovy index ee6ccdcf9..579337064 100644 --- a/pipelines/build/openjdk10_pipeline.groovy +++ b/pipelines/build/openjdk10_pipeline.groovy @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) { javaToBuild, buildConfigurations, targetConfigurations, - activeNodeTimeout, dockerExcludes, enableTests, enableInstallers, diff --git a/pipelines/build/openjdk11_pipeline.groovy b/pipelines/build/openjdk11_pipeline.groovy index f1cdc5e79..49cb7aa32 100644 --- a/pipelines/build/openjdk11_pipeline.groovy +++ b/pipelines/build/openjdk11_pipeline.groovy @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) { javaToBuild, buildConfigurations, targetConfigurations, - activeNodeTimeout, dockerExcludes, enableTests, enableInstallers, diff --git a/pipelines/build/openjdk12_pipeline.groovy b/pipelines/build/openjdk12_pipeline.groovy index 2cefc855a..d73bd4bf8 100644 --- a/pipelines/build/openjdk12_pipeline.groovy +++ b/pipelines/build/openjdk12_pipeline.groovy @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) { javaToBuild, buildConfigurations, targetConfigurations, - activeNodeTimeout, dockerExcludes, enableTests, enableInstallers, diff --git a/pipelines/build/openjdk13_pipeline.groovy b/pipelines/build/openjdk13_pipeline.groovy index 4bc2e7380..4c49d12b9 100644 --- a/pipelines/build/openjdk13_pipeline.groovy +++ b/pipelines/build/openjdk13_pipeline.groovy @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) { javaToBuild, buildConfigurations, targetConfigurations, - activeNodeTimeout, dockerExcludes, enableTests, enableInstallers, diff --git a/pipelines/build/openjdk14_pipeline.groovy b/pipelines/build/openjdk14_pipeline.groovy index 288641ce8..845386484 100644 --- a/pipelines/build/openjdk14_pipeline.groovy +++ b/pipelines/build/openjdk14_pipeline.groovy @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) { javaToBuild, buildConfigurations, targetConfigurations, - activeNodeTimeout, dockerExcludes, enableTests, enableInstallers, diff --git a/pipelines/build/openjdk15_pipeline.groovy b/pipelines/build/openjdk15_pipeline.groovy index d320e5c0d..c8ca06b24 100644 --- a/pipelines/build/openjdk15_pipeline.groovy +++ b/pipelines/build/openjdk15_pipeline.groovy @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) { javaToBuild, buildConfigurations, targetConfigurations, - activeNodeTimeout, dockerExcludes, enableTests, enableInstallers, diff --git a/pipelines/build/openjdk16_pipeline.groovy b/pipelines/build/openjdk16_pipeline.groovy index 92b1dfffd..1b4555ca9 100644 --- a/pipelines/build/openjdk16_pipeline.groovy +++ b/pipelines/build/openjdk16_pipeline.groovy @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) { javaToBuild, buildConfigurations, targetConfigurations, - activeNodeTimeout, dockerExcludes, enableTests, enableInstallers, diff --git a/pipelines/build/openjdk8_pipeline.groovy b/pipelines/build/openjdk8_pipeline.groovy index 8f8df7948..f32020784 100644 --- a/pipelines/build/openjdk8_pipeline.groovy +++ b/pipelines/build/openjdk8_pipeline.groovy @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) { javaToBuild, buildConfigurations, targetConfigurations, - activeNodeTimeout, dockerExcludes, enableTests, enableInstallers, diff --git a/pipelines/build/openjdk9_pipeline.groovy b/pipelines/build/openjdk9_pipeline.groovy index df14fcc84..2882ec234 100644 --- a/pipelines/build/openjdk9_pipeline.groovy +++ b/pipelines/build/openjdk9_pipeline.groovy @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) { javaToBuild, buildConfigurations, targetConfigurations, - activeNodeTimeout, dockerExcludes, enableTests, enableInstallers,