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

revert https://github.com/AdoptOpenJDK/openjdk-build/pull/2130 #2162

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -492,7 +490,6 @@ return {
String javaToBuild,
Map<String, Map<String, ?>> buildConfigurations,
String targetConfigurations,
String activeNodeTimeout,
String dockerExcludes,
String enableTests,
String enableInstallers,
Expand Down Expand Up @@ -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),
Expand Down
1 change: 0 additions & 1 deletion pipelines/build/common/config_regeneration.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion pipelines/build/common/create_job_from_template.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ pipelineJob("$buildFolder/$JOB_NAME") {
<dt><strong>SCM_REF</strong></dt><dd>Source code ref to build, i.e branch, tag, commit id</dd>
<dt><strong>BUILD_ARGS</strong></dt><dd>args to pass to makejdk-any-platform.sh</dd>
<dt><strong>NODE_LABEL</strong></dt><dd>Labels of node to build on</dd>
<dt><strong>ACTIVE_NODE_TIMEOUT</strong></dt><dd>Number of minutes we will wait for a label-matching node to become active.</dd>
<dt><strong>CODEBUILD</strong></dt><dd>Use a dynamic codebuild machine if no other machine is available</dd>
<dt><strong>DOCKER_IMAGE</strong></dt><dd>Use a docker build environment</dd>
<dt><strong>DOCKER_FILE</strong></dt><dd>Relative path to a dockerfile to be built and used on top of the DOCKER_IMAGE</dd>
Expand Down
70 changes: 21 additions & 49 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand All @@ -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"
Expand Down Expand Up @@ -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
}
}
}
Expand Down
1 change: 0 additions & 1 deletion pipelines/build/openjdk10_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) {
javaToBuild,
buildConfigurations,
targetConfigurations,
activeNodeTimeout,
dockerExcludes,
enableTests,
enableInstallers,
Expand Down
1 change: 0 additions & 1 deletion pipelines/build/openjdk11_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) {
javaToBuild,
buildConfigurations,
targetConfigurations,
activeNodeTimeout,
dockerExcludes,
enableTests,
enableInstallers,
Expand Down
1 change: 0 additions & 1 deletion pipelines/build/openjdk12_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) {
javaToBuild,
buildConfigurations,
targetConfigurations,
activeNodeTimeout,
dockerExcludes,
enableTests,
enableInstallers,
Expand Down
1 change: 0 additions & 1 deletion pipelines/build/openjdk13_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) {
javaToBuild,
buildConfigurations,
targetConfigurations,
activeNodeTimeout,
dockerExcludes,
enableTests,
enableInstallers,
Expand Down
1 change: 0 additions & 1 deletion pipelines/build/openjdk14_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) {
javaToBuild,
buildConfigurations,
targetConfigurations,
activeNodeTimeout,
dockerExcludes,
enableTests,
enableInstallers,
Expand Down
1 change: 0 additions & 1 deletion pipelines/build/openjdk15_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) {
javaToBuild,
buildConfigurations,
targetConfigurations,
activeNodeTimeout,
dockerExcludes,
enableTests,
enableInstallers,
Expand Down
1 change: 0 additions & 1 deletion pipelines/build/openjdk16_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) {
javaToBuild,
buildConfigurations,
targetConfigurations,
activeNodeTimeout,
dockerExcludes,
enableTests,
enableInstallers,
Expand Down
1 change: 0 additions & 1 deletion pipelines/build/openjdk8_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) {
javaToBuild,
buildConfigurations,
targetConfigurations,
activeNodeTimeout,
dockerExcludes,
enableTests,
enableInstallers,
Expand Down
1 change: 0 additions & 1 deletion pipelines/build/openjdk9_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if (scmVars != null && configureBuild != null && buildConfigurations != null) {
javaToBuild,
buildConfigurations,
targetConfigurations,
activeNodeTimeout,
dockerExcludes,
enableTests,
enableInstallers,
Expand Down