From 13618dc7ea63618005bc3d9993b17e2ecc58b5ef Mon Sep 17 00:00:00 2001 From: "eclipse-otterdog[bot]" <158182605+eclipse-otterdog[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 07:29:01 +1300 Subject: [PATCH 01/30] Updating file .github/workflows/dependabot-auto-merge.yml (#1130) Co-authored-by: temurin-bot --- .github/workflows/dependabot-auto-merge.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index be789c6c5..6ecfa398b 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -1,10 +1,12 @@ +# This is a templated file from https://github.com/adoptium/.eclipsefdn/tree/main/otterdog/policies/require_dependabot_auto_merge.yml name: Dependabot auto-merge on: pull_request_target -permissions: - contents: write - pull-requests: write +permissions: read-all jobs: dependabot: + permissions: + contents: write + pull-requests: write uses: adoptium/.github/.github/workflows/dependabot-auto-merge.yml@main From 2f6c22405d6dfb4e5b5cbc5003ec321c3e285f99 Mon Sep 17 00:00:00 2001 From: Adam Farley Date: Thu, 31 Oct 2024 15:46:03 +0000 Subject: [PATCH 02/30] Add reproducibility percentage to daily build summary (#1113) Only for builds that are meant to be reproducible. Contains list of jdk versions and platforms that we check for reproducibility. Signed-off-by: Adam Farley --- tools/nightly_build_and_test_stats.groovy | 203 +++++++++++++++++++--- 1 file changed, 183 insertions(+), 20 deletions(-) diff --git a/tools/nightly_build_and_test_stats.groovy b/tools/nightly_build_and_test_stats.groovy index 7210547f6..5cc595e65 100644 --- a/tools/nightly_build_and_test_stats.groovy +++ b/tools/nightly_build_and_test_stats.groovy @@ -21,6 +21,40 @@ import java.time.ZoneId import java.time.ZonedDateTime import java.time.temporal.ChronoUnit +def getPlatformConversionMap() { + // A map to convert from a standard platform format to the variants used by build and test job names on Jenkins. + def platformConversionMap = [x64Linux: ["linux-x64", "x86-64_linux"], + x64Windows: ["windows-x64", "x86-64_windows"], + x64Mac: ["mac-x64", "x86-64_mac"], + x64AlpineLinux: ["alpine-linux-x64", "x86-64_alpine-linux"], + ppc64Aix: ["aix-ppc64", "ppc64_aix"], + ppc64leLinux: ["linux-ppc64le", "ppc64le_linux"], + s390xLinux: ["linux-s390x", "s390x_linux"], + aarch64Linux: ["linux-aarch64", "aarch64_linux"], + aarch64AlpineLinux: ["alpine-linux-aarch64", "aarch64_alpine-linux"], + aarch64Mac: ["mac-aarch64", "aarch64_mac"], + aarch64Windows: ["windows-aarch64", "aarch64_windows"], + arm32Linux: ["linux-arm", "arm_linux"], + x32Windows: ["windows-x86-32", "x86-32_windows"], + x64Solaris: ["solaris-x64", "x64_solaris"], + sparcv9Solaris: ["solaris-sparcv9", "sparcv9_solaris"], + riscv64Linux: ["linux-riscv64", "riscv64_linux"] + ] + return platformConversionMap +} + +def getPlatformReproTestMap() { + // A map to return the test bucket and test name for the repducibile platforms + def platformReproTestMap = [x64Linux: ["special.system", "Rebuild_Same_JDK_Reproducibility_Test"], + x64Windows: ["dev.system", "Rebuild_Same_JDK_Reproducibility_Test_win"], + x64Mac: ["NA", ""], + ppc64leLinux: ["NA", ""], + aarch64Linux: ["NA", ""], + aarch64Mac: ["NA", ""] + ] + return platformReproTestMap +} + // Check if the given tag is a -ga tag ? def isGaTag(String version, String tag) { if (version == "${params.TIP_RELEASE}".trim()) { @@ -51,7 +85,7 @@ def isGaTag(String version, String tag) { } } -// Determine the upstream OpenJDK reporistory +// Determine the upstream OpenJDK repository def getUpstreamRepo(String version) { def openjdkRepo @@ -92,7 +126,7 @@ def getLatestOpenjdkBuildTag(String version) { return latestTag } -// Get how long ago the given upstream tag was published? +// How long ago was the given upstream tag published? def getOpenjdkBuildTagAge(String version, String tag) { def openjdkRepo = getUpstreamRepo(version) @@ -115,9 +149,9 @@ def getLatestBinariesTag(String version) { return latestTag } -// Make a best guess that the specified build of a given beta EA pipeline build is inprogress? if so return the buildUrl -def getInProgressBuildUrl(String trssUrl, String variant, String featureRelease, String publishName, String scmRef) { - def inProgressBuildUrl = "" +// Return our best guess at the url that generated a specific build. +def getBuildUrl(String trssUrl, String variant, String featureRelease, String publishName, String scmRef) { + def functionBuildUrl = ["", "", ""] def featureReleaseInt = (featureRelease == "aarch32-jdk8u" || featureRelease == "alpine-jdk8u") ? 8 : featureRelease.replaceAll("[a-z]","").toInteger() def pipelineName = "openjdk${featureReleaseInt}-pipeline" @@ -142,21 +176,22 @@ def getInProgressBuildUrl(String trssUrl, String variant, String featureRelease, } } - // Is job for the required tag and currently inprogress? - if (containsVariant && overridePublishName == publishName && buildScmRef == scmRef && job.status != null && job.status.equals('Streaming')) { + // Is there a job for the required tag? + if (containsVariant && overridePublishName == publishName && buildScmRef == scmRef && job.status != null) { if (featureReleaseInt == 8) { // alpine-jdk8u cannot be distinguished from jdk8u by the scmRef alone, so check for "x64AlpineLinux" in the targetConfiguration if ((featureRelease == "alpine-jdk8u" && containsX64AlpineLinux) || (featureRelease != "alpine-jdk8u" && !containsX64AlpineLinux)) { - inProgressBuildUrl = job.buildUrl + functionBuildUrl = [job.buildUrl, job._id, job.status] } } else { - inProgressBuildUrl = job.buildUrl + functionBuildUrl = [job.buildUrl, job._id, job.status] + echo "Found "+featureRelease+" pipeline with this ID: "+job._id } } } } - return inProgressBuildUrl + return functionBuildUrl } // Verify the given release contains all the expected assets @@ -326,6 +361,86 @@ def verifyReleaseContent(String version, String release, String variant, Map sta } } +// For a given pipeline, tell us how reproducible the builds were. +// Note: Will limit itself to jdk versions and platforms in the results Map. +def getReproducibilityPercentage(String jdkVersion, String trssId, String trssURL, Map results) { + echo "Called repro method with trssID:"+trssId + + def platformConversionMap = getPlatformConversionMap() + def platformReproTestMap = getPlatformReproTestMap() + + // We are only looking for reproducible percentages for the relevant jdk versions... + if ( trssId != "" && results.containsKey(jdkVersion) ) { + def jdkVersionInt = jdkVersion.replaceAll("[a-z]", "") + + // ...and platforms. + results[jdkVersion][1].each { onePlatform, valueNotUsed -> + // If this platform doesn't have a reproducibility test yet, skip it. + if (platformReproTestMap[onePlatform][0].equals("NA")) { + results[jdkVersion][1][onePlatform] = "NA" + // Then we exit this lambda and skip to the next platform. + return + } + + def pipelineLink = trssURL+"/api/getAllChildBuilds?parentId="+trssId+"\\&buildNameRegex=^"+jdkVersion+"\\-"+platformConversionMap[onePlatform][0]+"\\-temurin\$" + def trssBuildJobNames = sh(returnStdout: true, script: "wget -q -O - ${pipelineLink}") + def platformResult = "???% - Build not found. Pipeline link: " + pipelineLink + + // Does this platform have a build in this pipeline? + if ( trssBuildJobNames.length() > 2 ) { + def buildJobNamesJson = new JsonSlurper().parseText(trssBuildJobNames) + + // For each build, search the test output for the unit test we need, then look for reproducibility percentage. + buildJobNamesJson.each { buildJob -> + platformResult = "???% - Build found, but no reproducibility tests. Build link: " + buildJob.buildUrl + def testPlatform = platformConversionMap[onePlatform][1] + def reproTestName=platformReproTestMap[onePlatform][1] + def reproTestBucket=platformReproTestMap[onePlatform][0] + def testJobTitle="Test_openjdk${jdkVersionInt}_hs_${reproTestBucket}_${testPlatform}.*" + def trssTestJobNames = sh(returnStdout: true, script: "wget -q -O - ${trssURL}/api/getAllChildBuilds?parentId=${buildJob._id}\\&buildNameRegex=^${testJobTitle}\$") + + // Did this build have tests? + if ( trssTestJobNames.length() > 2 ) { + platformResult = "???% - Found ${reproTestBucket}, but did not find ${reproTestName}. Build Link: " + buildJob.buildUrl + def testJobNamesJson = new JsonSlurper().parseText(trssTestJobNames) + + // For each test job (including testList subjobs), we now search for the reproducibility test. + testJobNamesJson.each { testJob -> + def testOutput = sh(returnStdout: true, script: "wget -q -O - ${testJob.buildUrl}/consoleText") + + // If we can find it, then we look for the anticipated percentage. + if ( testOutput.contains("Running test "+reproTestName) ) { + platformResult = "???% - ${reproTestName} ran but failed to produce a percentage. Test Link: " + testJob.buildUrl + // Now we know the test ran, + def matcherObject = testOutput =~ /ReproduciblePercent = [0-9]+ %/ + if ( matcherObject ) { + platformResult = matcherObject[0] =~ /[0-9]+ %/ + } + } + } + } + } + } + results[jdkVersion][1][onePlatform] = platformResult + } + + // Now we have the percentages for each platform, we canculate the jdkVersion-specific average. + def overallAverage = 0 + // Ignoring the platforms where the test is not available yet. + def naCount = 0 + results[jdkVersion][1].each{key, value -> + if (value.equals("NA")) { + naCount++ + } else if ( (value ==~ /^[0-9]+ %/) ) { + overallAverage += (value =~ /^[0-9]+/)[0] as Integer + } + // else do nothing, as we presume non-integer and non-NA values are 0. + } + overallAverage = overallAverage == 0 ? 0 : overallAverage.intdiv(results[jdkVersion][1].size() - naCount) + results[jdkVersion][0] = overallAverage+" %" + } +} + node('worker') { try{ def variant = "${params.VARIANT}" @@ -342,6 +457,11 @@ node('worker') { def healthStatus = [:] def testStats = [] + // Specifies what JDK versions and platforms are expected to be reproducible. + // The "?" symbols will soon be replaced by reproducibility percentages. + // Layout: [jdkVersion: [Overall-reproducibility, [By-platform reproducibility breakdown]]] + def reproducibleBuilds = ["jdk21u": [ "?", ["x64Linux": "?", "aarch64Linux": "?", "ppc64leLinux": "?", "x64Windows": "?", "x64Mac": "?", "aarch64Mac": "?"]]] + stage('getPipelineStatus') { def apiVariant = variant if (apiVariant == 'temurin') { @@ -648,7 +768,9 @@ node('worker') { def errorMsg = "" def releaseName = status['releaseName'] def lastPublishedMsg = "" - def inProgressBuildUrl = "" + def probableBuildUrl = "" + def probableBuildStatus = "" + def probableBuildIdForTRSS = "" // Is it a non-tag triggered build? eg.Oracle STS version if (nonTagBuildReleases.contains(featureRelease)) { @@ -666,23 +788,59 @@ node('worker') { } } else { // Check if build in-progress - inProgressBuildUrl = getInProgressBuildUrl(trssUrl, variant, featureRelease, status['expectedReleaseName'].replaceAll("-beta", ""), status['upstreamTag']+"_adopt") + (probableBuildUrl, probableBuildIdForTRSS, probableBuildStatus) = getBuildUrl(trssUrl, variant, featureRelease, status['expectedReleaseName'].replaceAll("-beta", ""), status['upstreamTag']+"_adopt") // Check latest published binaries are for the latest openjdk build tag, unless upstream is a GA tag if (status['releaseName'] != status['expectedReleaseName'] && !isGaTag(featureRelease, status['upstreamTag'])) { def upstreamTagAge = getOpenjdkBuildTagAge(featureRelease, status['upstreamTag']) - if (upstreamTagAge > 3 && inProgressBuildUrl == "") { + if (upstreamTagAge > 3 && probableBuildStatus == "Done") { slackColor = 'danger' health = "Unhealthy" errorMsg = "\nLatest Adoptium publish binaries "+status['releaseName']+" != latest upstream openjdk build "+status['upstreamTag']+" published ${upstreamTagAge} days ago. *No build is in progress*." } else { - if (inProgressBuildUrl != "") { - errorMsg = "\nLatest upstream openjdk build "+status['upstreamTag']+" published ${upstreamTagAge} days ago. <" + inProgressBuildUrl + "|Build is in progress>." + if (probableBuildStatus == "Streaming") { + errorMsg = "\nLatest upstream openjdk build "+status['upstreamTag']+" published ${upstreamTagAge} days ago. <" + probableBuildUrl + "|Build is in progress>." } else { errorMsg = "\nLatest upstream openjdk build "+status['upstreamTag']+" published ${upstreamTagAge} days ago. *Build is awaiting 'trigger'*." } } } + + def testsShouldHaveRun = false + if ( probableBuildUrl != "" && sh(returnStdout: true, script: "wget -q -O - ${trssUrl}/api/getBuildHistory?buildUrl=${probableBuildUrl}") ==~ /.*name.:.enableTests.,.value.:true.*/ ) { + testsShouldHaveRun = true + } + if (reproducibleBuilds.containsKey(featureRelease)) { + if (testsShouldHaveRun) { + getReproducibilityPercentage(featureRelease, probableBuildIdForTRSS, trssUrl, reproducibleBuilds) + if ( reproducibleBuilds[featureRelease][0] != "100%") { + slackColor = 'danger' + health = "Unhealthy" + def summaryOfRepros = "" + echo "Build reproducibility percentages for " + featureRelease + " did not add up to 100%. Breakdown: " + reproducibleBuilds[featureRelease][1].each{ key, value -> + if (!value.equals("NA")) { + echo key+": "+value + if(value ==~ /[0-9]+ %/) { + summaryOfRepros+=" "+key+"("+value+")," + } else { + summaryOfRepros+=" "+key+"(?%)," + } + } else { + echo key+": NA - Reproducibility testing has not yet been implimented for this presumed reproducible build." + } + } + + //Remove trailing comma. + summaryOfRepros = summaryOfRepros.substring(0, summaryOfRepros.length() - 1); + + errorMsg += "\nBuild repro summary: "+summaryOfRepros + } + } else { + // Ignore test results if the tests for this pipeline were intentionally disabled. + reproducibleBuilds[featureRelease][0] = "N/A - Tests disabled" + } + } } // Verify if any artifacts missing? @@ -694,14 +852,14 @@ node('worker') { slackColor = 'danger' health = "Unhealthy" errorMsg += "\nArtifact status: "+status['assets'] - if (inProgressBuildUrl != "") { - errorMsg += ", <" + inProgressBuildUrl + "|Build is in progress>" + if (probableBuildStatus == "Streaming") { + errorMsg += ", <" + probableBuildUrl + "|Build is in progress>" } else { errorMsg += ", *No build is in progress*" } missingAssets = status['missingAssets'] } - + // Print out formatted missing artifacts if any missing if (missingAssets.size() > 0) { missingMsg += " :" @@ -720,7 +878,7 @@ node('worker') { missingFiles = missingFile[1]+missingFile[2] } else { missingFiles += ", "+missingFile[1]+missingFile[2] - } + } } if (missingFiles != "") { missingMsg += "\n *${archName}*: ${missingFiles}" @@ -729,8 +887,13 @@ node('worker') { } } + def reproducibilityText = "" + if (reproducibleBuilds.containsKey(featureRelease)) { + reproducibilityText = " Reproducibility: "+reproducibleBuilds[featureRelease][0] + } + def releaseLink = "<" + status['assetsUrl'] + "|${releaseName}>" - def fullMessage = "${featureRelease} latest 'EA Build' publish status: *${health}*. Build: ${releaseLink}.${lastPublishedMsg}${errorMsg}${missingMsg}" + def fullMessage = "${featureRelease} latest 'EA Build' publish status: *${health}*.${reproducibilityText} Build: ${releaseLink}.${lastPublishedMsg}${errorMsg}${missingMsg}" echo "===> ${fullMessage}" slackSend(channel: slackChannel, color: slackColor, message: fullMessage) } From 36b02deb065cb948706342f76107b63df7f91f36 Mon Sep 17 00:00:00 2001 From: Adam Farley Date: Mon, 4 Nov 2024 17:46:36 +0000 Subject: [PATCH 03/30] Adding platforms to reproducibility healthcheck (#1133) We now have automated reproducibility testing on 3 more platforms, so we're checking their results as part of the daily healthcheck. Signed-off-by: Adam Farley --- tools/nightly_build_and_test_stats.groovy | 28 +++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/tools/nightly_build_and_test_stats.groovy b/tools/nightly_build_and_test_stats.groovy index 5cc595e65..e927bd962 100644 --- a/tools/nightly_build_and_test_stats.groovy +++ b/tools/nightly_build_and_test_stats.groovy @@ -15,6 +15,7 @@ limitations under the License. /* groovylint-disable NestedBlockDepth */ import groovy.json.JsonSlurper +import java.math.MathContext; import java.time.LocalDateTime import java.time.Instant import java.time.ZoneId @@ -48,9 +49,9 @@ def getPlatformReproTestMap() { def platformReproTestMap = [x64Linux: ["special.system", "Rebuild_Same_JDK_Reproducibility_Test"], x64Windows: ["dev.system", "Rebuild_Same_JDK_Reproducibility_Test_win"], x64Mac: ["NA", ""], - ppc64leLinux: ["NA", ""], - aarch64Linux: ["NA", ""], - aarch64Mac: ["NA", ""] + ppc64leLinux: ["special.system", "Rebuild_Same_JDK_Reproducibility_Test"], + aarch64Linux: ["special.system", "Rebuild_Same_JDK_Reproducibility_Test"], + aarch64Mac: ["dev.system", "Rebuild_Same_JDK_Reproducibility_Test_Mac"] ] return platformReproTestMap } @@ -412,9 +413,9 @@ def getReproducibilityPercentage(String jdkVersion, String trssId, String trssUR if ( testOutput.contains("Running test "+reproTestName) ) { platformResult = "???% - ${reproTestName} ran but failed to produce a percentage. Test Link: " + testJob.buildUrl // Now we know the test ran, - def matcherObject = testOutput =~ /ReproduciblePercent = [0-9]+ %/ + def matcherObject = testOutput =~ /ReproduciblePercent = (100|[0-9][0-9]?\.?[0-9]?[0-9]?) %/ if ( matcherObject ) { - platformResult = matcherObject[0] =~ /[0-9]+ %/ + platformResult = ((matcherObject[0] =~ /(100|[0-9][0-9]?\.?[0-9]?[0-9]?) %/)[0][0]) } } } @@ -424,20 +425,23 @@ def getReproducibilityPercentage(String jdkVersion, String trssId, String trssUR results[jdkVersion][1][onePlatform] = platformResult } - // Now we have the percentages for each platform, we canculate the jdkVersion-specific average. - def overallAverage = 0 + // Now we have the percentages for each platform, we calculate the jdkVersion-specific average. + BigDecimal overallAverage = 0.0 // Ignoring the platforms where the test is not available yet. def naCount = 0 results[jdkVersion][1].each{key, value -> if (value.equals("NA")) { naCount++ - } else if ( (value ==~ /^[0-9]+ %/) ) { - overallAverage += (value =~ /^[0-9]+/)[0] as Integer + } else if ( value ==~ /^[0-9]+\.?[0-9]* %/ ) { + overallAverage += (value =~ /^[0-9]+\.?[0-9]*/)[0] as BigDecimal } // else do nothing, as we presume non-integer and non-NA values are 0. } - overallAverage = overallAverage == 0 ? 0 : overallAverage.intdiv(results[jdkVersion][1].size() - naCount) - results[jdkVersion][0] = overallAverage+" %" + if (overallAverage != 0) { + overallAverage = overallAverage / (results[jdkVersion][1].size() - naCount) + } + // This reduces the output to 2 decimal places. + results[jdkVersion][0] = ((overallAverage.toString()) =~ /[0-9]+\.?[0-9]?[0-9]?/)[0]+" %" } } @@ -821,7 +825,7 @@ node('worker') { reproducibleBuilds[featureRelease][1].each{ key, value -> if (!value.equals("NA")) { echo key+": "+value - if(value ==~ /[0-9]+ %/) { + if(value ==~ /[0-9]+\.?[0-9]* %/) { summaryOfRepros+=" "+key+"("+value+")," } else { summaryOfRepros+=" "+key+"(?%)," From bb6714ee2bb3844194171f9061bb576bbc83e741 Mon Sep 17 00:00:00 2001 From: Stewart X Addison <6487691+sxa@users.noreply.github.com> Date: Tue, 5 Nov 2024 11:43:43 +0000 Subject: [PATCH 04/30] Update top level README.md so it is more consumable for new users (#1048) * doc: make top level readme more consumable for first-time users Signed-off-by: Stewart X Addison --------- Signed-off-by: Stewart X Addison --- README.md | 398 ++++++++++++------------ pipelines/jobs/configurations/README.md | 191 ++++++++++++ 2 files changed, 397 insertions(+), 192 deletions(-) create mode 100644 pipelines/jobs/configurations/README.md diff --git a/README.md b/README.md index 7a563f708..4e921118b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ Eclipse Adoptium makes use of these scripts to build binaries on the build farm ## Repository contents This repository contains several useful scripts in order to build OpenJDK -personally or at build farm scale. +personally or at build farm scale via jenkins. For the Temurin project at +Adoptium, this is done with the jenkins instance at [ci.adoptium.net](https://ci.adoptium.net) 1. The `docs` folder contains images and utility scripts to produce up to date documentation. @@ -14,197 +15,208 @@ documentation. (e.g. build | test | checksum | release). 3. The `tools` folder contains `pipelines/` analysis scripts that deliever success/failure trends and build scripts for code-tool dependancies for the build and test process (e.g. asmtools | jcov | jtharness | jtreg | sigtest). -## Configuration Files - -The [pipelines/jobs/configurations](pipelines/jobs/configurations) directory contains two categories of configuration files that our jenkins pipelines use (Nicknamed [#Build Configs](#build) and [#Nightly Configs](#nightly) for short). - -To ensure both configurations are not overridden in a race condition scenario by another job, the [job generators](pipelines/build/regeneration/README.md) ensure they remain in the sync with the repository. - -**Generally, any new parameters/configurations that effect the jenkins environment directly should be implemented here.** If this is not the case, it would likely be better placed in [temurin-build/platform-specific-configurations](https://github.com/adoptium/temurin-build/tree/master/build-farm/platform-specific-configurations) (for OS or `make-adopt-build-farm.sh` specific use cases) or [temurin-build/build.sh](https://github.com/adoptium/temurin-build/blob/master/sbin/build.sh) (for anyone, including end users and jenkins pipelines). - -### Build - -The build config files are the ones that follow the format `jdkxx(u)_pipeline_config.groovy` with `xx` being the version number and an optional `u` if the Java source code is pulled from an update repository. Each is a groovy class with a single `Map>` property containing node labels, tests and other jenkins parameters/constants that are crucial for allowing different parts of the build pipeline to mesh together. - -Each architecture/platform has it's own entry similar to the one below (for JDK8 x64 mac builds). The pipelines use the parent map key (e.g. `x64Mac`) to retrieve the data. See [#Data Fields](#data-fields) for the currently available fields you can utilise. - -```groovy -x64Mac : [ - os : 'mac', - arch : 'x64', - additionalNodeLabels : [ - temurin : 'macos10.14', - corretto : 'build-macstadium-macos1010-1', - openj9 : 'macos10.14' - ], - test : 'default' -] -``` - -### Data fields - -NOTE: When the `type` field implies a map, the `String` key of the inner map is the variant for that field. E.g: - -```groovy - additionalNodeLabels : [ - temurin : 'xlc13&&aix710', - openj9 : 'xlc13&&aix715' - ], -``` - ---- - -| Name | Required? | Type |
Description
| -| :------------------------- | :-------: | :------------------------------------------ | :----------------------------------------- | -| os | ✅ | `String` | Operating system tag that will identify the job on jenkins and determine which platforms configs to pull from temurin-build.
*E.g. `windows`, `solaris`* | -| arch | ✅ | `String` | Architecture tag that will identify the job on jenkins and determine which build params to use.
*E.g. `x64`, `sparcv9`, `x86-32`* | -| test | ❌ | `String`
**OR**
`Map`
**OR**
`Map>` | Case one: Tests to run against the binary after the build has completed. A `default` tag indicates that you want to run [whatever the default test nightly/release list is](https://github.com/adoptium/ci-jenkins-pipelines/blob/ab947ce6ab0ecd75ebfb95eb2f75facb83e4dc13/pipelines/build/common/build_base_file.groovy#L66-L88).

Case two: You can also [specify your own list for that particular platform (not variant)](https://github.com/adoptium/ci-jenkins-pipelines/blob/ab947ce6ab0ecd75ebfb95eb2f75facb83e4dc13/pipelines/jobs/configurations/jdk16_pipeline_config.groovy#L59-L64).

Case three: Or you can even [specify the list for that particular platform per variant](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy#L78-L81). The list could be specific one `sanity.openjdk` or `default` (similar to the first case) or a map per nightly or release (similar to case two). | -| testDynamic | ❌ | `Boolean`
**OR**
`Map` | PARALLEL=Dynamic parameter setting. False : no Parallel. Or you can set the parameters with or without variant. -| dockerImage | ❌ | `String`
**OR**
`Map` | Builds the JDK inside a docker container. Should be a DockerHub identifier to pull from in case **dockerFile** is not specified.
*E.g. `adoptopenjdk/centos6_build_image`* | -| dockerFile | ❌ | `String`
**OR**
`Map` | Builds the JDK inside a docker container using the locally stored image file. Used in conjunction with **dockerImage** to specify a particular variant to build or pull.
*E.g. `pipelines/build/dockerFiles/cuda.dockerfile`* | -| dockerNode | ❌ | `String`
**OR**
`Map` | Specifies a specific jenkins docker node label to shift into to build the JDK.
*E.g. `sw.config.uid1000`* | -| dockerRegistry | ❌ | `String`
**OR**
`Map` | Used for Docker login when pulling dockerImage from a custom Docker registry. Used in conjunction with **dockerImage**. Default (blank) will be DockerHub. Must also use dockerCredential. | -| dockerCredential | ❌ | `String`
**OR**
`Map` | Used for Docker login when pulling a dockerImage. Value is the Jenkins credential ID for the username and password of the dockerRegistry. Used in conjunction with **dockerImage**. Can use with custom dockerRegistry or default DockerHub. Must use this if using a non-default registry. | -| additionalNodeLabels | ❌ | `String`
**OR**
`Map` | Appended to the default constructed jenkins node label (often used to lock variants or build configs to specific machines). Jenkins will additionally search for a node with this tag as well as the default node label.
*E.g. `build-macstadium-macos1010-1`, `macos10.14`* | -| additionalTestLabels | ❌ | `String`
**OR**
`Map` | Used by [aqa-tests](https://github.com/adoptium/aqa-tests/blob/2b6ee54f18021c38386cea65c552de4ea20a8d1c/buildenv/jenkins/testJobTemplate#L213) to lock specific tests to specific machine nodes (in the same manner as **additionalNodeLabels**)
*E.g. `!(centos6\|\|rhel6)`, `dragonwell`* | -| configureArgs | ❌ | `String`
**OR**
`Map` | Configuration arguments that will ultimately be passed to OpenJDK's `./configure`
*E.g. `--enable-unlimited-crypto --with-jvm-variants=server --with-zlib=system`* | -| buildArgs | ❌ | `String`
**OR**
`Map` | Build arguments that will ultimately be passed to [temurin-build's ./makejdk-any-platform.sh](https://github.com/adoptium/temurin-build#the-makejdk-any-platformsh-script) script
*E.g. `--enable-unlimited-crypto --with-jvm-variants=server --with-zlib=system`* | -| additionalFileNameTag | ❌ | `String` | Commonly used when building [large heap versions](https://adoptopenjdk.net/faq.html#:~:text=What%20are%20the%20OpenJ9%20%22Large,XL%20in%20the%20download%20filenames) of the binary, this tag will also be included in the jenkins job name and binary filename. Include this parameter if you have an "extra" variant that requires a different tagname
*E.g. `linuxXL`* | -| crossCompile | ❌ | `String`
**OR**
`Map` | Used when building on a cross compiled system, informing jenkins to treat it differently when retrieving the version and producing the binary. This value is also used to create the jenkins node label alongside the **arch** (similarly to **additionalNodeLabels**)
*E.g. `x64`* | -| bootJDK | ❌ | `String` | JDK version number to specify to temurin-build's `make-adopt-build-farm.sh` script, informing it to utilise a [predefined location of a boot jdk](https://github.com/adoptium/temurin-build/blob/2df732492b59b1606439505316c766edbb566cc2/build-farm/make-adopt-build-farm.sh#L115-L141)
*E.g. `8`, `11`* | -| platformSpecificConfigPath | ❌ | `String` | temurin-build repository path to pull the operating system configurations from inside [temurin-build's set-platform-specific-configurations.sh](https://github.com/adoptium/temurin-build/blob/master/build-farm/set-platform-specific-configurations.sh). Do not include the repository name or branch as this is prepended automatically.
*E.g. `pipelines/TestLocation/platform-specific-configurations`* | -| codebuild | ❌ | `Boolean` | Setting this field will tell jenkins to spin up an Azure or [AWS cloud](https://aws.amazon.com/codebuild/) machine, allowing the build to retrieve a machine not normally available on the Jenkins server. It does this by appending a `codebuild` flag to the jenkins label. | -| cleanWorkspaceAfterBuild | ❌ | `Boolean` | Setting this field will tell jenkins to clean down the workspace after the build has completed. Particularly useful for AIX where disk space can be limited. | - -### Nightly - -The nightly or beta/non-release config files are the ones that follow the format `jdkxx(u).groovy` with `xx` being the version number and an optional `u` if the Java source code is pulled from an update repository. Each is a simple groovy script that's contents can be [loaded in](https://www.jenkins.io/doc/pipeline/steps/workflow-cps/#load-evaluate-a-groovy-source-file-into-the-pipeline-script) and accessed by another script. - -### Evaluation pipeline/jobs - -The evaluation config files are the ones that follow the format `jdkxx(u)_evaluation.groovy` with `xx` being the version number and an optional `u` if the Java source code is pulled from an update repository. - -#### targetConfigurations - -A single `Map>` variable containing what platforms and variants will be run in the nightly builds, evaluation builds and releases (by default, this can be altered in jenkins parameters before executing a user build). If you are [creating your own](docs/UsingOurScripts.md) nightly config, you will need to ensure the key values of the upper map are the same as the key values in the corresponding [build config file](#build). - -### Release pipeline/jobs - -The release config files are the ones that follow the format `jdkxx(u)_release.groovy` with `xx` being the version number and an optional `u` if the Java source code is pulled from an update repository. -jdkxx(u)*.groovy - -```groovy -targetConfigurations = [ - "x64Mac" : [ - "temurin", - "openj9" - ], - "x64Linux" : [ - "temurin", - "openj9", - "corretto", - "dragonwell" - ], - "x32Windows" : [ - "temurin", - "openj9" - ], - "x64Windows" : [ - "temurin", - "openj9", - "dragonwell" - ], - "ppc64Aix" : [ - "temurin", - "openj9" - ], - "ppc64leLinux" : [ - "temurin", - "openj9" - ], - "s390xLinux" : [ - "temurin", - "openj9" - ], - "aarch64Linux" : [ - "temurin", - "openj9", - "dragonwell" - ], - "arm32Linux" : [ - "temurin" - ], - "sparcv9Solaris": [ - "temurin" - ] -] -``` - -#### disableJob - -If this is present, the jenkins generators will still create the top-level pipeline and downstream jobs but will set them as disabled. -jdkxx(u).groovy - -```groovy -disableJob = true -``` - -#### triggerSchedule_nightly / triggerSchedule_weekly / triggerSchedule_evaluation / triggerSchedule_weekly_evaluation - -All JDK versions now support "beta" EA triggered builds from the publication of upstream build tags. Eclipse Adoptium no -longer runs scheduled nightly/weekend builds. - -The one exception to this is Oracle managed STS versions, whose builds are managed internal to Oracle and not published -until the GA day. For these a triggerSchedule_weekly is required to build the upstream HEAD commits on a regular basis. - -[Cron expression](https://crontab.guru/) that defines when (and how often) nightly/evaluation and weekly/weekly-evaluation builds will be executed - -in jdkxx(u).groovy - -```groovy -triggerSchedule_nightly="TZ=UTC\n05 18 * * 1,3,5" -triggerSchedule_weekly="TZ=UTC\n05 12 * * 6" -``` - -in jdkXX(u)_evaluation.groovy - -```groovy -triggerSchedule_evaluation="TZ=UTC\n15 18 * * 1,3,5" -triggerSchedule_weekly_evaluation="TZ=UTC\n25 12 * * 6" -``` - -#### weekly_release_scmReferences / weekly_evaluation_scmReferences - -Source control references (e.g. tags) to use in the scheduled weekly release or weekly evaluation builds -in jdkXX(u).groovy -Use below two ways can set the job never to run: - -- do not set `triggerSchedule_nightly` or `triggerSchedule_weekly` in the groovy file -- untick `ENABLE_PIPELINE_SCHEDULE` option in the Jenkins job which calls `pipelines/build/regeneration/build_pipeline_generator.groovy` - -#### weekly_release_scmReferences - -Source control references (e.g. tags) to use in the scheduled weekly release builds -jdkxx(u).groovy - -```groovy -weekly_release_scmReferences = [ - "temurin" : "jdk8u282-b08" -] -``` - -in jdkXX(u)_evaluation.groovy - -```groovy -weekly_evaluation_scmReferences== [ - "temurin" : "jdk8u282-b07", - "openj9" : "v0.24.0-release", - "corretto" : "", - "dragonwell" : "" -] -``` - -## Metadata +For those who prefer diagrams, there is an overview of the information below +including it's interactions with the scripts in other repositories in our +[docs/ARCHITECTURE.md] file and specific ones on the pipeline types in +[docs/diagram.md]. If you want to set up these pipelines in your own jenkins +instance, see +[this guide](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/docs/UsingOurScripts.md). + +## Overview of pipeline types + +The starting point on the jenkins instance from the perspective of the +overall build pipelines is the [build-scripts +folder](https://ci.adoptium.net/job/build-scripts/). This contains the high +level pipelines which are used to run the different types of build. In the +names in this document `XX` is the JDK version number e.g. 8, 17, 21 and so +on. There is one of these for each JDK version which we support. + +When talking about the different types of pipelines, the ones named +"*openjdkXX-pipeline" are referred to as the "top level versioned pipelines" +and the subjobs later on are the "platform specific pipelines" + +### openjdkXX-pipeline + +These were historically used for regular builds of each of our release +platforms using the current state of the master branch of the codebase - +which is it's default behaviour - but is now run each time there is a new +tag in the upstream openjdk codebase. These are triggered by the +`betaTrigger_XXea` jobs in the +[build-scripts/utils](https://ci.adoptium.net/job/build-scripts/job/utils/) +folder. Note that JDK8 for, which comes from a separate codebase and +therefore is tagged separately, is triggered via a separate +[betaTrigger_8ea_arm32Linux](https://ci.adoptium.net/job/build-scripts/job/utils/job/betaTrigger_8ea_arm32Linux/) +job. + +The betaTrigger_XXea jobs use +[trigger_beta_build.groovy](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/pipelines/build/common/trigger_beta_build.groovy) +to determine when to run a build. This contains a trap for the expected GA +release times to prevent triggering so that machine time is not used up +while we are performing release build and test cycles. + +Once complete, the openjdkXX-pipelines which will, by default, invoke the +separate +([refactor_openjdk_release_tool](https://ci.adoptium.net/job/build-scripts/job/release/job/refactor_openjdk_release_tool/)) +job which will publish them as an `ea-beta`-suffixed release in github under e.g. +[temurin-21-binaries](https://github.com/adoptium/temurin21-binaries/releases?q=ea-beta&expanded=true}). + +### release-openjdkXX-pipeline + +These are not publicly visible but are used to build the fully tested +production binaries on a quarterly basis. Similar to the openjdkXX-pipeline +jobs these are automatically triggered by the releaseTrigger_jdkXX jobs in +[build-scripts/utils](https://ci.adoptium.net/job/build-scripts/job/utils/) +every time a new `-ga` suffixed tag is detected. + +releaseTrigger_jdkXX runs once an hour between the 10th and 25th of release +months (Jan, Mar, Apr, Jul, Sep, Oct) and check for a new `-ga` tag. It runs +[triggerReleasePipeline.sh](https://github.com/adoptium/mirror-scripts/blob/master/triggerReleasePipeline.sh) +(from the [mirror-scripts](https://github.com/adoptium/mirror-scripts/) +repository). That script has a loop that checks 5 times with a ten minute +gap between them so that the overall trigger is checked every ten minutes +during the days when it is active based on checking for the "expected" tag +from [releasePlan.cfg](https://github.com/adoptium/mirror-scripts/blob/master/releasePlan.cfg) +using the readExpectedGATag function in +[common.sh](https://github.com/adoptium/mirror-scripts/blob/master/common.sh) + +A couple of points to note on the release configurations: + +- [jdk8u_release.groovy](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/pipelines/jobs/configurations/jdk8u_release.groovy), + [jdk11u_release.groovy](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/pipelines/jobs/configurations/jdk11u_release.groovy) + and [jdk17u_release.groovy](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/pipelines/jobs/configurations/jdk11u_release.groovy) + do not automatically run the win32 (`x32Windows`) builds - they get + triggered manually during a release cycle in order to prioritise the + x64Windows builds during the release cycle on the machines. +- Similarly the [jdk8u_release.groovy](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/pipelines/jobs/configurations/jdk8u_release.groovy) + does not include arm32, since that is built from a separate codebase and + is tagged separately so cannot generally be triggered alongside the main + builds. + +### evaluation-openjdkXX-pipeline + +These are similar to the openjdkXX-pipeline jobs, and are triggered from the +same betaTrigger_XXea jobs. The evaluation pipelines are for platforms +which the Adoptium team are looking to potentially release at some point, +but they are not yet reliable or sufficiently tested. +which are not in the release. + +### weekly-openjdkXX-pipeline / weekly-evaluation-openjdkXX-pipeline + +These are no longer used. These were triggered over the weekend with an extended set +of tests, but since the regular openjdkXX-pipeline jobs are now running +approximately once a week (the usual cadence of new tags appearing in the +upstream codebases) we are running the full AQA suite in those pipelines. +These were triggered by timer and then invoked the openjdkXX-pipeline jobs +with the appropriate parameters. + +### trestle-openjdkXX-pipeline + +Trestle is the name of the experimental project to allow upstream openjdk +committers to run pipelines on our infrastructure in order to test code +changes in openjdk on the full set of platforms which Temurin supports. They +are triggered on demand from a subset of authorized users. + +### PR tester + +In addition to the main pipelines we have "PR tester" jobs that are run on +PRs to the pipelines repository in order to ensure they do not have any +unintended side effects before they are merged. These are triggered when +[specific comments from authorized users](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/pipelines/build/prTester/README.md#usage) +are added into the PR. In that +folder in jenkins there are separate versions of all of the +openjdkXX-pipelines that can be used to run against PRs and will not +"pollute" the history of the main pipelines. + +More documentation on the PR tester process can be found in +[the prTester documentation](pipelines/build/prTester). + +## Subjobs of the top level versioned pipelines (i.e. "platform specific pipelines") + +Each of the top level versioned pipelines described above invoke lower level +jobs to run the platform-specific builds. The jenkins folders containing +these scripts for each of the above top level versioned pipelines are as +follows: + +Top level versioned pipeline | Platform-specific pipeline folder (TODO: Name these!) +---|--- +openjdkXX-pipeline | [jobs/jdkXX](https://ci.adoptium.net/job/build-scripts/job/jobs/) +evaluation-openjdkXX-pipeline | [jobs/evaluation/jdkXX](https://ci.adoptium.net/job/build-scripts/job/jobs/job/evaluation/) [†] +weekly-openjdkXX-pipeline | jobs/jdkXX (Shared with openjdkXX-pipeline) +release-openjdkXX-pipeline | [jobs/release/jobs/jdkXX](https://ci.adoptium.net/job/build-scripts/job/jobs/job/release/job/jobs/) (Restricted access) +PR testers | build-test/jobs/jdkXX + +[†] - The release jobs here are restricted access. The release folder here +should also not be confused with the build-scripts/release folder which +contains jobs used for the final publishing of the builds (early access or +GA) to github + +_Note: jdkXX is generally related to the name of the upstream codebase, which +will often have a `u` suffix. At the moment we have a separate set of jobs +for non-u and u versions when the upstream codebase changes. TODO: Add note +about the new branch process for jdk23+_ + +Inside the jdkXX folders there are pipelines which perform a build of one +variant (e.g. Temurin) for on JDK version on one platform, for example +[jdk21u-linux-aarch64-temurin](https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk21u/job/jdk21u-linux-aarch64-temurin/) +which are reponsible for running the build using +[kick_off_build.groovy](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/pipelines/build/common/kick_off_build.groovy) +and initiating the tests and other jobs against the completed build if +successful. A "Smoke Test" job such as +[jdk21u-linux-aarch64-temurin-SmokeTests](https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk21u/job/jdk21u-linux-aarch64-temurin_SmokeTests/) +which is similar to our test jobs but runs the tests from the temurin-build +[buildAndPackage directory](https://github.com/adoptium/temurin-build/tree/master/test/functional/buildAndPackage) +which is initiated after the +build perfoms some basic tests against the build artefacts and acts as a +gate to kicking off the subsequent steps. Once complete, the +openjdkXX-pipelines which run the early access builds will generally invoke +the jobs to publish them as a release in github (e.g. +[temurin-21-binaries](https://github.com/adoptium/temurin21-binaries/releases?q=ea-beta&expanded=true}). + +## Job generation + +As you can see from the above sections, there are a lot of separate jobs in +jenkins which are used during the build process. Since there are so many of +them, these are not created manually, but are autogenerated using an +automatic generator process. + +The top level +[build-pipeline-generator](https://ci.adoptium.net/job/build-scripts/job/utils/job/build-pipeline-generator/) +job uses +[build_pipeline_generator.groovy](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/pipelines/build/regeneration/build_pipeline_generator.groovy) +to generate the pipelines. It will generate the top level versioned +openjdkXX-pipeline jobs. Similarly there are pipeline_jobs_generator_jdkXX +jobs which use +[build_job_generator.groovy](pipelines/build/regeneration/build_job_generator.groovy) +to generate the subjobs for each platform/variant combination. Both of +these pipelines are triggered on a change (PR merge) to the +ci-jenkins-pipelines repository. They will pause themselves if a pipeline is +not running so as to avoid interfering with a currently executing pipeline. +T +Similarly there is an evaluation-pipeline-generator and +evaluation-pipeline_jobs_generator_jdkXX for generating the evaluation jobs, +a trestle-pipeline-generator for those jobs, plus release-pipeline-generator +andand release_pipeline_jobs_generator_jdkXX for release jobs (the release +generators are not triggered automatically but are re-run manually at +certain points during each release cycle + +The following is a brief summary of how the generation jobs work but more +details can be found in the +[generator documentation](pipelines/build/regeneration/README.md) + +The generators make use of the following files in +[pipelines/jobs/configurations](pipelines/jobs/configurations). The README +file in that directory contains more details of the configuration format: + +- The `jdkXX.groovy`, `jdkXX_evaluation.groovy`, `jdkXX_release.groovy` to determine which platforms to configure and generate for each version. +- The individual platform configurations, such as jenkins labels, are defined by `jdkXX_pipeline_config.groovy` files. + +For more details on the regeneration process overall see the +[regeneration documentation](pipelines/build/regeneration/README.md) + +## Metadata files generated with each build + +
+Information about the metadata file generated alongside the build Alongside the built assets a metadata file will be created with info about the build. This will be a JSON document of the form: @@ -401,6 +413,8 @@ pipelines/build/common/trigger_beta_build.groovy job parameters: - Multi-line Text: OVERRIDE_EVALUATION_TARGET_CONFIGURATIONS - Override targetConfigurations for FORCE_EVALUATION, eg: { "aarch64AlpineLinux": [ "temurin" ] } +
+ ## Build status Table generated with `generateBuildMatrix.sh` diff --git a/pipelines/jobs/configurations/README.md b/pipelines/jobs/configurations/README.md new file mode 100644 index 000000000..53dc6a4d9 --- /dev/null +++ b/pipelines/jobs/configurations/README.md @@ -0,0 +1,191 @@ +# Configuration Files used by the build job generators + +Note: The contents of this file was split out from the top level README.md in this repository + +The [pipelines/jobs/configurations](pipelines/jobs/configurations) directory contains two categories of configuration files that our jenkins pipelines use (Nicknamed [#Build Configs](#build) and [#Nightly Configs](#nightly) for short). + +To ensure both configurations are not overridden in a race condition scenario by another job, the [job generators](../../build/regeneration/README.md) ensure they remain in the sync with the repository. + +**Generally, any new parameters/configurations that effect the jenkins environment directly should be implemented here.** If this is not the case, it would likely be better placed in [temurin-build/platform-specific-configurations](https://github.com/adoptium/temurin-build/tree/master/build-farm/platform-specific-configurations) (for OS or `make-adopt-build-farm.sh` specific use cases) or [temurin-build/build.sh](https://github.com/adoptium/temurin-build/blob/master/sbin/build.sh) (for anyone, including end users and jenkins pipelines). + +## Build + +The build config files are the ones that follow the format `jdkxx(u)_pipeline_config.groovy` with `xx` being the version number and an optional `u` if the Java source code is pulled from an update repository. Each is a groovy class with a single `Map>` property containing node labels, tests and other jenkins parameters/constants that are crucial for allowing different parts of the build pipeline to mesh together. + +Each architecture/platform has it's own entry similar to the one below (for JDK8 x64 mac builds). The pipelines use the parent map key (e.g. `x64Mac`) to retrieve the data. See [#Data Fields](#data-fields) for the currently available fields you can utilise. + +```groovy +x64Mac : [ + os : 'mac', + arch : 'x64', + additionalNodeLabels : [ + temurin : 'macos10.14', + corretto : 'build-macstadium-macos1010-1', + openj9 : 'macos10.14' + ], + test : 'default' +] +``` + +## Data fields + +NOTE: When the `type` field implies a map, the `String` key of the inner map is the variant for that field. E.g: + +```groovy + additionalNodeLabels : [ + temurin : 'xlc13&&aix710', + openj9 : 'xlc13&&aix715' + ], +``` + +--- + +| Name | Required? | Type |
Description
| +| :------------------------- | :-------: | :------------------------------------------ | :----------------------------------------- | +| os | ✅ | `String` | Operating system tag that will identify the job on jenkins and determine which platforms configs to pull from temurin-build.
*E.g. `windows`, `solaris`* | +| arch | ✅ | `String` | Architecture tag that will identify the job on jenkins and determine which build params to use.
*E.g. `x64`, `sparcv9`, `x86-32`* | +| test | ❌ | `String`
**OR**
`Map`
**OR**
`Map>` | Case one: Tests to run against the binary after the build has completed. A `default` tag indicates that you want to run [whatever the default test nightly/release list is](https://github.com/adoptium/ci-jenkins-pipelines/blob/ab947ce6ab0ecd75ebfb95eb2f75facb83e4dc13/pipelines/build/common/build_base_file.groovy#L66-L88).

Case two: You can also [specify your own list for that particular platform (not variant)](https://github.com/adoptium/ci-jenkins-pipelines/blob/ab947ce6ab0ecd75ebfb95eb2f75facb83e4dc13/pipelines/jobs/configurations/jdk16_pipeline_config.groovy#L59-L64).

Case three: Or you can even [specify the list for that particular platform per variant](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy#L78-L81). The list could be specific one `sanity.openjdk` or `default` (similar to the first case) or a map per nightly or release (similar to case two). | +| testDynamic | ❌ | `Boolean`
**OR**
`Map` | PARALLEL=Dynamic parameter setting. False : no Parallel. Or you can set the parameters with or without variant. | +| dockerImage | ❌ | `String`
**OR**
`Map` | Builds the JDK inside a docker container. Should be a DockerHub identifier to pull from in case **dockerFile** is not specified.
*E.g. `adoptopenjdk/centos6_build_image`* | +| dockerFile | ❌ | `String`
**OR**
`Map` | Builds the JDK inside a docker container using the locally stored image file. Used in conjunction with **dockerImage** to specify a particular variant to build or pull.
*E.g. `pipelines/build/dockerFiles/cuda.dockerfile`* | +| dockerNode | ❌ | `String`
**OR**
`Map` | Specifies a specific jenkins docker node label to shift into to build the JDK.
*E.g. `sw.config.uid1000`* | +| dockerRegistry | ❌ | `String`
**OR**
`Map` | Used for Docker login when pulling dockerImage from a custom Docker registry. Used in conjunction with **dockerImage**. Default (blank) will be DockerHub. Must also use dockerCredential. | +| dockerCredential | ❌ | `String`
**OR**
`Map` | Used for Docker login when pulling a dockerImage. Value is the Jenkins credential ID for the username and password of the dockerRegistry. Used in conjunction with **dockerImage**. Can use with custom dockerRegistry or default DockerHub. Must use this if using a non-default registry. | +| additionalNodeLabels | ❌ | `String`
**OR**
`Map` | Appended to the default constructed jenkins node label (often used to lock variants or build configs to specific machines). Jenkins will additionally search for a node with this tag as well as the default node label.
*E.g. `build-macstadium-macos1010-1`, `macos10.14`* | +| additionalTestLabels | ❌ | `String`
**OR**
`Map` | Used by [aqa-tests](https://github.com/adoptium/aqa-tests/blob/2b6ee54f18021c38386cea65c552de4ea20a8d1c/buildenv/jenkins/testJobTemplate#L213) to lock specific tests to specific machine nodes (in the same manner as **additionalNodeLabels**)
*E.g. `!(centos6\|\|rhel6)`, `dragonwell`* | +| configureArgs | ❌ | `String`
**OR**
`Map` | Configuration arguments that will ultimately be passed to OpenJDK's `./configure`
*E.g. `--enable-unlimited-crypto --with-jvm-variants=server --with-zlib=system`* | +| buildArgs | ❌ | `String`
**OR**
`Map` | Build arguments that will ultimately be passed to [temurin-build's ./makejdk-any-platform.sh](https://github.com/adoptium/temurin-build#the-makejdk-any-platformsh-script) script
*E.g. `--enable-unlimited-crypto --with-jvm-variants=server --with-zlib=system`* | +| additionalFileNameTag | ❌ | `String` | Commonly used when building [large heap versions](https://adoptopenjdk.net/faq.html#:~:text=What%20are%20the%20OpenJ9%20%22Large,XL%20in%20the%20download%20filenames) of the binary, this tag will also be included in the jenkins job name and binary filename. Include this parameter if you have an "extra" variant that requires a different tagname
*E.g. `linuxXL`* | +| crossCompile | ❌ | `String`
**OR**
`Map` | Used when building on a cross compiled system, informing jenkins to treat it differently when retrieving the version and producing the binary. This value is also used to create the jenkins node label alongside the **arch** (similarly to **additionalNodeLabels**)
*E.g. `x64`* | +| bootJDK | ❌ | `String` | JDK version number to specify to temurin-build's `make-adopt-build-farm.sh` script, informing it to utilise a [predefined location of a boot jdk](https://github.com/adoptium/temurin-build/blob/2df732492b59b1606439505316c766edbb566cc2/build-farm/make-adopt-build-farm.sh#L115-L141)
*E.g. `8`, `11`* | +| platformSpecificConfigPath | ❌ | `String` | temurin-build repository path to pull the operating system configurations from inside [temurin-build's set-platform-specific-configurations.sh](https://github.com/adoptium/temurin-build/blob/master/build-farm/set-platform-specific-configurations.sh). Do not include the repository name or branch as this is prepended automatically.
*E.g. `pipelines/TestLocation/platform-specific-configurations`* | +| codebuild | ❌ | `Boolean` | Setting this field will tell jenkins to spin up an Azure or [AWS cloud](https://aws.amazon.com/codebuild/) machine, allowing the build to retrieve a machine not normally available on the Jenkins server. It does this by appending a `codebuild` flag to the jenkins label. | +| cleanWorkspaceAfterBuild | ❌ | `Boolean` | Setting this field will tell jenkins to clean down the workspace after the build has completed. Particularly useful for AIX where disk space can be limited. | + +## Nightly + +The nightly or beta/non-release config files are the ones that follow the format `jdkxx(u).groovy` with `xx` being the version number and an optional `u` if the Java source code is pulled from an update repository. Each is a simple groovy script that's contents can be [loaded in](https://www.jenkins.io/doc/pipeline/steps/workflow-cps/#load-evaluate-a-groovy-source-file-into-the-pipeline-script) and accessed by another script. + +## Evaluation pipeline/jobs + +The evaluation config files are the ones that follow the format `jdkxx(u)_evaluation.groovy` with `xx` being the version number and an optional `u` if the Java source code is pulled from an update repository. + +### targetConfigurations + +A single `Map>` variable containing what platforms and variants will be run in the nightly builds, evaluation builds and releases (by default, this can be altered in jenkins parameters before executing a user build). If you are [creating your own](docs/UsingOurScripts.md) nightly config, you will need to ensure the key values of the upper map are the same as the key values in the corresponding [build config file](#build). + +## Release pipeline/jobs + +The release config files are the ones that follow the format `jdkxx(u)_release.groovy` with `xx` being the version number and an optional `u` if the Java source code is pulled from an update repository. +jdkxx(u)*.groovy + +```groovy +targetConfigurations = [ + "x64Mac" : [ + "temurin", + "openj9" + ], + "x64Linux" : [ + "temurin", + "openj9", + "corretto", + "dragonwell" + ], + "x32Windows" : [ + "temurin", + "openj9" + ], + "x64Windows" : [ + "temurin", + "openj9", + "dragonwell" + ], + "ppc64Aix" : [ + "temurin", + "openj9" + ], + "ppc64leLinux" : [ + "temurin", + "openj9" + ], + "s390xLinux" : [ + "temurin", + "openj9" + ], + "aarch64Linux" : [ + "temurin", + "openj9", + "dragonwell" + ], + "arm32Linux" : [ + "temurin" + ], + "sparcv9Solaris": [ + "temurin" + ] +] +``` + +### disableJob + +If this is present, the jenkins generators will still create the top-level pipeline and downstream jobs but will set them as disabled. +jdkxx(u).groovy + +```groovy +disableJob = true +``` + +### triggerSchedule_nightly / triggerSchedule_weekly / triggerSchedule_evaluation / triggerSchedule_weekly_evaluation + +All JDK versions now support "beta" EA triggered builds from the publication of upstream build tags. Eclipse Adoptium no +longer runs scheduled nightly/weekend builds. + +The one exception to this is Oracle managed STS versions, whose builds are managed internal to Oracle and not published +until the GA day. For these a triggerSchedule_weekly is required to build the upstream HEAD commits on a regular basis. + +[Cron expression](https://crontab.guru/) that defines when (and how often) nightly/evaluation and weekly/weekly-evaluation builds will be executed + +in jdkxx(u).groovy + +```groovy +triggerSchedule_nightly="TZ=UTC\n05 18 * * 1,3,5" +triggerSchedule_weekly="TZ=UTC\n05 12 * * 6" +``` + +in jdkXX(u)_evaluation.groovy + +```groovy +triggerSchedule_evaluation="TZ=UTC\n15 18 * * 1,3,5" +triggerSchedule_weekly_evaluation="TZ=UTC\n25 12 * * 6" +``` + +### weekly_release_scmReferences / weekly_evaluation_scmReferences + +Source control references (e.g. tags) to use in the scheduled weekly release or weekly evaluation builds +in jdkXX(u).groovy +Use below two ways can set the job never to run: + +- do not set `triggerSchedule_nightly` or `triggerSchedule_weekly` in the groovy file +- untick `ENABLE_PIPELINE_SCHEDULE` option in the Jenkins job which calls `pipelines/build/regeneration/build_pipeline_generator.groovy` + +### weekly_release_scmReferences + +Source control references (e.g. tags) to use in the scheduled weekly release builds +jdkxx(u).groovy + +```groovy +weekly_release_scmReferences = [ + "temurin" : "jdk8u282-b08" +] +``` + +in jdkXX(u)_evaluation.groovy + +```groovy +weekly_evaluation_scmReferences== [ + "temurin" : "jdk8u282-b07", + "openj9" : "v0.24.0-release", + "corretto" : "", + "dragonwell" : "" +] +``` From f868061256b1d8c977b20e46a90a2b6dc176fe14 Mon Sep 17 00:00:00 2001 From: sophia-guo Date: Wed, 6 Nov 2024 09:33:55 -0500 Subject: [PATCH 05/30] Limit docker label to linux special.system (#1135) * Limit docker label to linux special.system * limit to temurin --- pipelines/build/common/openjdk_build_pipeline.groovy | 7 ++++--- .../jobs/configurations/jdk21u_pipeline_config.groovy | 4 ++-- .../jobs/configurations/jdk23u_pipeline_config.groovy | 6 ++++-- pipelines/jobs/configurations/jdk24_pipeline_config.groovy | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index fda611646..f7aefd09c 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -418,6 +418,8 @@ class Build { testStages["${testType}"] = { context.println "Running test: ${testType}" context.stage("${testType}") { + def jobParams = getAQATestJobParams(testType) + def jobName = jobParams.TEST_JOB_NAME def keep_test_reportdir = buildConfig.KEEP_TEST_REPORTDIR def rerunIterations = '1' if ("${testType}".contains('dev') || "${testType}".contains('external')) { @@ -433,7 +435,8 @@ class Build { DYNAMIC_COMPILE = true } def additionalTestLabel = buildConfig.ADDITIONAL_TEST_LABEL - if (testType == 'dev.openjdk' || testType == 'special.system') { + // Eclipse Adoptium Temurin label speciall requirements for special.system on linux + if (testType == 'dev.openjdk' || (testType == 'special.system' && jobName.contains('linux') && buildConfig.VARIANT == 'temurin')) { context.println "${testType} need extra label sw.tool.docker" if (additionalTestLabel == '') { additionalTestLabel = 'sw.tool.docker' @@ -452,9 +455,7 @@ class Build { vendorTestBranches = buildConfig.BUILD_REF ?: vendorTestBranches } - def jobParams = getAQATestJobParams(testType) - def jobName = jobParams.TEST_JOB_NAME String helperRef = buildConfig.HELPER_REF ?: DEFAULTS_JSON['repository']['helper_ref'] def JobHelper = context.library(identifier: "openjdk-jenkins-helper@${helperRef}").JobHelper diff --git a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy index ae549114f..e7208adbd 100644 --- a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy @@ -68,7 +68,7 @@ class Config21 { arch : 'x64', additionalNodeLabels: 'win2022&&vs2022', test: [ - weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system'] + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], buildArgs : [ 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' @@ -138,7 +138,7 @@ class Config21 { arch : 'aarch64', additionalNodeLabels: 'xcode15.0.1', test: [ - weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system'] + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], buildArgs : [ 'temurin' : '--create-jre-image --create-sbom' diff --git a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy index decb963f3..527995b43 100644 --- a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy @@ -69,7 +69,7 @@ class Config23 { arch : 'x64', additionalNodeLabels: 'win2022&&vs2022', test: [ - weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system'] + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], buildArgs : [ 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' @@ -138,7 +138,9 @@ class Config23 { os : 'mac', arch : 'aarch64', additionalNodeLabels: 'xcode15.0.1', - test : 'default', + test: [ + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] + ], buildArgs : [ 'temurin' : '--create-jre-image --create-sbom' ] diff --git a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy index 0a2b50321..ebca0f466 100644 --- a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy @@ -69,7 +69,7 @@ class Config24 { arch : 'x64', additionalNodeLabels: 'win2022&&vs2022', test: [ - weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system'] + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], buildArgs : [ 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' @@ -139,7 +139,7 @@ class Config24 { arch : 'aarch64', additionalNodeLabels: 'xcode15.0.1', test: [ - weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system'] + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], buildArgs : [ 'temurin' : '--create-jre-image --create-sbom' From 6a60b6b016b0d64b624ebead7918f01d232af140 Mon Sep 17 00:00:00 2001 From: Stewart X Addison <6487691+sxa@users.noreply.github.com> Date: Wed, 6 Nov 2024 18:22:00 +0000 Subject: [PATCH 06/30] Refactor signing/assemble code in openjdk_build_pipeline.groovy to support Windows/docker builds (#1117) * First pass of batOrSh and fixes for windows containers Signed-off-by: Stewart X Addison * Refactoring signing code to allow operation in Windows containers Signed-off-by: Stewart X Addison * Reduce stashing and avoid pre-unstash chmod in non-docker case Signed-off-by: Stewart X Addison * Move workspace scope and use it for cleaning cyclone-dx and security directories Signed-off-by: Stewart X Addison --------- Signed-off-by: Stewart X Addison Signed-off-by: Andrew Leonard Co-authored-by: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Co-authored-by: sophia-guo Co-authored-by: George Adams --- .../common/openjdk_build_pipeline.groovy | 653 ++++++++++++------ 1 file changed, 424 insertions(+), 229 deletions(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index f7aefd09c..dd14d8510 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -746,7 +746,7 @@ class Build { if ( buildConfig.TARGET_OS == 'windows' || (buildConfig.TARGET_OS == 'mac') ) { - context.stage('sign') { + context.stage('sign zip/tgz') { def filter = '' def nodeFilter = 'eclipse-codesign' @@ -785,7 +785,6 @@ class Build { flatten: true) context.sh 'for file in $(ls workspace/target/*.tar.gz workspace/target/*.zip); do sha256sum "$file" > $file.sha256.txt ; done' - writeMetadata(versionInfo, false) context.archiveArtifacts artifacts: 'workspace/target/*' } @@ -1059,17 +1058,23 @@ class Build { Lists and returns any compressed archived or sbom file contents of the top directory of the build node */ List listArchives() { - def files = context.sh( + + def files + if ( context.isUnix() ) { + files = context.sh( script: '''find workspace/target/ | egrep -e '(\\.tar\\.gz|\\.zip|\\.msi|\\.pkg|\\.deb|\\.rpm|-sbom_.*\\.json)$' ''', returnStdout: true, returnStatus: false - ) - .trim() - .split('\n') - .toList() - + ).trim().split('\n').toList() + } else { + // The grep here removes anything that still contains "*" because nothing matched + files = context.bat( + script: 'dir/b/s workspace\\target\\*.zip workspace\\target\\*.msi workspace\\target\\*.-sbom_* workspace\\target\\*.json', + returnStdout: true, + returnStatus: false + ).trim().replaceAll('\\\\','/').replaceAll('\\r','').split('\n').toList().grep( ~/^[^\*]*$/ ) // grep needed extra script approval + } context.println "listArchives: ${files}" - return files } @@ -1334,16 +1339,22 @@ class Build { } else if (file.contains('-sbom')) { type = 'sbom' } + context.println "writeMetaData for " + file - String hash = context.sh(script: """\ + String hash + if ( context.isUnix() ) { + context.println "Non-windows non-docker detected - running sh to generate SHA256 sums in writeMetadata" + hash = context.sh(script: """\ if [ -x "\$(command -v shasum)" ]; then (shasum -a 256 | cut -f1 -d' ') <$file else sha256sum $file | cut -f1 -d' ' fi - """.stripIndent(), returnStdout: true, returnStatus: false) - - hash = hash.replaceAll('\n', '') + """.stripIndent(), returnStdout: true, returnStatus: false).replaceAll('\n', '') + } else { + context.println "Windows detected - running bat to generate SHA256 sums in writeMetadata" + hash = context.bat(script: "sha256sum ${file} | cut -f1 -d' '") // .replaceAll('\n', '') + } data.binary_type = type data.sha256 = hash @@ -1480,35 +1491,276 @@ class Build { return context.readFile(crossCompileVersionPath) } + /* + * In Windows docker containers sh can be unreliable, so use context.bat + * in preference. https://github.com/adoptium/infrastructure/issues/3714 + */ + def batOrSh(command) + { + if ( context.isUnix() ) { + context.sh(command) + } else { + context.bat(command) + } + } + /* Display the current git repo information */ def printGitRepoInfo() { context.println 'Checked out repo:' - context.sh(script: 'git status') + batOrSh('git status') context.println 'Checked out HEAD commit SHA:' - context.sh(script: 'git rev-parse HEAD') + batOrSh('git rev-parse HEAD') } - /* + def buildScriptsEclipseSigner() { + def build_path + build_path = 'workspace/build/src/build' + def base_path + base_path = build_path + def repoHandler = new RepoHandler(USER_REMOTE_CONFIGS, ADOPT_DEFAULTS_JSON, buildConfig.CI_REF, buildConfig.BUILD_REF) + context.stage('internal sign') { + context.node('eclipse-codesign') { + // Safety first! + if (base_path != null && !base_path.isEmpty()) { + context.sh "rm -rf ${base_path}/* || true" + } + + repoHandler.checkoutAdoptBuild(context) + printGitRepoInfo() + + // Copy pre assembled binary ready for JMODs to be codesigned + context.unstash 'jmods' + def target_os = "${buildConfig.TARGET_OS}" + // TODO: Split this out into a separate script at some point + context.withEnv(['base_os='+target_os, 'base_path='+base_path]) { + // groovylint-disable + context.sh ''' + #!/bin/bash + set -eu + echo "Signing JMOD files under build path ${base_path} for base_os ${base_os}" + TMP_DIR="${base_path}/" + if [ "${base_os}" == "mac" ]; then + ENTITLEMENTS="$WORKSPACE/entitlements.plist" + FILES=$(find "${TMP_DIR}" -perm +111 -type f -o -name '*.dylib' -type f || find "${TMP_DIR}" -perm /111 -type f -o -name '*.dylib' -type f) + else + FILES=$(find "${TMP_DIR}" -type f -name '*.exe' -o -name '*.dll') + fi + for f in $FILES + do + echo "Signing $f using Eclipse Foundation codesign service" + dir=$(dirname "$f") + file=$(basename "$f") + mv "$f" "${dir}/unsigned_${file}" + success=false + if [ "${base_os}" == "mac" ]; then + if ! curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" -F entitlements="@$ENTITLEMENTS" https://cbi.eclipse.org/macos/codesign/sign; then + echo "curl command failed, sign of $f failed" + else + success=true + fi + else + if ! curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" https://cbi.eclipse.org/authenticode/sign; then + echo "curl command failed, sign of $f failed" + else + success=true + fi + fi + if [ $success == false ]; then + # Retry up to 20 times + max_iterations=20 + iteration=1 + echo "Code Not Signed For File $f" + while [ $iteration -le $max_iterations ] && [ $success = false ]; do + echo $iteration Of $max_iterations + sleep 1 + if [ "${base_os}" == "mac" ]; then + if curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" -F entitlements="@$ENTITLEMENTS" https://cbi.eclipse.org/macos/codesign/sign; then + success=true + fi + else + if curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" https://cbi.eclipse.org/authenticode/sign; then + success=true + fi + fi + + if [ $success = false ]; then + echo "curl command failed, $f Failed Signing On Attempt $iteration" + iteration=$((iteration+1)) + if [ $iteration -gt $max_iterations ] + then + echo "Errors Encountered During Signing" + exit 1 + fi + else + echo "$f Signed OK On Attempt $iteration" + fi + done + fi + chmod --reference="${dir}/unsigned_${file}" "$f" + rm -rf "${dir}/unsigned_${file}" + done + ''' + // groovylint-enable + } + context.sh(script: "ls -l ${base_path}/**/*") + context.stash name: 'signed_jmods', includes: "${base_path}/**/*" + } // context.node ("eclipse-codesign") - joe thinks it matches with something else though ... + } // context.stage +} + +def postBuildWSclean( + cleanWorkspaceAfter, + cleanWorkspaceBuildOutputAfter +) { + // post-build workspace clean: + if (cleanWorkspaceAfter || cleanWorkspaceBuildOutputAfter) { + try { + context.timeout(time: buildTimeouts.NODE_CLEAN_TIMEOUT, unit: 'HOURS') { + // Note: Underlying org.apache DirectoryScanner used by cleanWs has a bug scanning where it misses files containing ".." so use rm -rf instead + // Issue: https://issues.jenkins.io/browse/JENKINS-64779 + if (context.WORKSPACE != null && !context.WORKSPACE.isEmpty()) { + if (cleanWorkspaceAfter) { + context.println 'Cleaning workspace non-hidden files: ' + context.WORKSPACE + '/*' + context.sh(script: 'rm -rf ' + context.WORKSPACE + '/*') + + // Clean remaining hidden files using cleanWs + try { + context.println 'Cleaning workspace hidden files using cleanWs: ' + context.WORKSPACE + context.cleanWs notFailBuild: true, disableDeferredWipeout: true, deleteDirs: true + } catch (e) { + context.println "Failed to clean ${e}" + } + } else if (cleanWorkspaceBuildOutputAfter) { + context.println 'Cleaning workspace build output files under ' + context.WORKSPACE + batOrSh('rm -rf ' + context.WORKSPACE + '/workspace/build/src/build ' + context.WORKSPACE + '/workspace/target ' + context.WORKSPACE + '/workspace/build/devkit ' + context.WORKSPACE + '/workspace/build/straceOutput') + } + } else { + context.println 'Warning: Unable to clean workspace as context.WORKSPACE is null/empty' + } + } + } catch (FlowInterruptedException e) { + // Set Github Commit Status + if (env.JOB_NAME.contains('pr-tester')) { + updateGithubCommitStatus('FAILED', 'Build FAILED') + } + throw new Exception("[ERROR] AIX clean workspace timeout (${buildTimeouts.AIX_CLEAN_TIMEOUT} HOURS) has been reached. Exiting...") + } + } +} + +def buildScriptsAssemble( + cleanWorkspaceAfter, + cleanWorkspaceBuildOutputAfter, + buildConfigEnvVars +) { + def build_path + + build_path = 'workspace/build/src/build' + def base_path + base_path = build_path + def assembleBuildArgs + // Remove jmod directories to be replaced with the stash saved above + batOrSh "rm -rf ${base_path}/hotspot/variant-server ${base_path}/support/modules_cmds ${base_path}/support/modules_libs" + // JDK 16 + jpackage executables need to be signed as well + if (buildConfig.JAVA_TO_BUILD != 'jdk11u') { + batOrSh "rm -rf ${base_path}/jdk/modules/jdk.jpackage/jdk/jpackage/internal/resources/*" + } + context.stage('assemble') { + // This would ideally not be required but it's due to lack of UID mapping in windows containers + if ( buildConfig.TARGET_OS == 'windows' && buildConfig.DOCKER_IMAGE) { + context.bat('chmod -R a+rwX ' + '/cygdrive/c/workspace/openjdk-build/workspace/build/src/build/*') + } + // Restore signed JMODs + context.unstash 'signed_jmods' + // Convert IndividualBuildConfig to jenkins env variables + context.withEnv(buildConfigEnvVars) { + if (env.BUILD_ARGS != null && !env.BUILD_ARGS.isEmpty()) { + assembleBuildArgs = env.BUILD_ARGS + ' --assemble-exploded-image' + } else { + assembleBuildArgs = '--assemble-exploded-image' + } + context.withEnv(['BUILD_ARGS=' + assembleBuildArgs]) { + context.println '[CHECKOUT] Checking out to adoptium/temurin-build...' + def repoHandler = new RepoHandler(USER_REMOTE_CONFIGS, ADOPT_DEFAULTS_JSON, buildConfig.CI_REF, buildConfig.BUILD_REF) + repoHandler.checkoutAdoptBuild(context) + if ( buildConfig.TARGET_OS == 'windows' && buildConfig.DOCKER_IMAGE ) { + context.bat(script: 'bash -c "git config --global safe.directory $(cygpath ' + '\$' + '{WORKSPACE})"') + } + printGitRepoInfo() + context.println 'openjdk_build_pipeline.groovy: Assembling the exploded image' + // Call make-adopt-build-farm.sh on windows/mac to create signed tarball + try { + context.timeout(time: buildTimeouts.BUILD_JDK_TIMEOUT, unit: 'HOURS') { + context.println "openjdk_build_pipeline: calling MABF to assemble on win/mac JDK11+" + if ( !context.isUnix() && buildConfig.DOCKER_IMAGE ) { + // Running ls -l here generates the shortname links required by the + // build and create paths referenced in the config.status file + context.bat(script: 'ls -l /cygdrive/c "/cygdrive/c/Program Files (x86)" "/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2022" "/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Redist/MSVC" "/cygdrive/c/Program Files (x86)/Windows Kits/10/bin" "/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC" "/cygdrive/c/Program Files (x86)/Windows Kits/10/include" "/cygdrive/c/Program Files (x86)/Windows Kits/10/lib"') + } + batOrSh("bash ${ADOPT_DEFAULTS_JSON['scriptDirectories']['buildfarm']} --assemble-exploded-image") + } + } catch (FlowInterruptedException e) { + // Set Github Commit Status + if (env.JOB_NAME.contains('pr-tester')) { + updateGithubCommitStatus('FAILED', 'Build FAILED') + } + throw new Exception("[ERROR] Build JDK timeout (${buildTimeouts.BUILD_JDK_TIMEOUT} HOURS) has been reached. Exiting...") + } + } // context.withEnv(assembleBuildargs) + } // context.withEnv(buildConfigEnvVars) + String versionOut + if (buildConfig.BUILD_ARGS.contains('--cross-compile')) { + context.println "[WARNING] Don't read faked version.txt on cross compiled build! Archiving early and running downstream job to retrieve java version..." + versionOut = readCrossCompiledVersionString() + } else { + versionOut = context.readFile('workspace/target/metadata/version.txt') + } + versionInfo = parseVersionOutput(versionOut) + writeMetadata(versionInfo, true) + // Always archive any artifacts including failed make logs.. + try { + context.timeout(time: buildTimeouts.BUILD_ARCHIVE_TIMEOUT, unit: 'HOURS') { + // We have already archived cross compiled artifacts, so only archive the metadata files + if (buildConfig.BUILD_ARGS.contains('--cross-compile')) { + context.println '[INFO] Archiving JSON Files...' + context.archiveArtifacts artifacts: 'workspace/target/*.json' + } else { + context.archiveArtifacts artifacts: 'workspace/target/*' + } + } + } catch (FlowInterruptedException e) { + // Set Github Commit Status + if (env.JOB_NAME.contains('pr-tester')) { + updateGithubCommitStatus('FAILED', 'Build FAILED') + } + throw new Exception("[ERROR] Build archive timeout (${buildTimeouts.BUILD_ARCHIVE_TIMEOUT} HOURS) has been reached. Exiting...") + } + postBuildWSclean(cleanWorkspaceAfter, cleanWorkspaceBuildOutputAfter) + } // context.stage('assemble') +} // End of buildScriptsAssemble() 1643-1765 + +/* Executed on a build node, the function checks out the repository and executes the build via ./make-adopt-build-farm.sh Once the build completes, it will calculate its version output, commit the first metadata writeout, and archive the build results. Running in downstream job jdk-*-*-* build stage, called by build() */ + def buildScripts( cleanWorkspace, cleanWorkspaceAfter, cleanWorkspaceBuildOutputAfter, - filename, - useAdoptShellScripts + useAdoptShellScripts, + enableSigner, + buildConfigEnvVars ) { + // Create the repo handler with the user's defaults to ensure a temurin-build checkout is not null + // Pass actual ADOPT_DEFAULTS_JSON, and optional buildConfig CI and BUILD branch/tag overrides, + // so that RepoHandler checks out the desired repo correctly + def repoHandler = new RepoHandler(USER_REMOTE_CONFIGS, ADOPT_DEFAULTS_JSON, buildConfig.CI_REF, buildConfig.BUILD_REF) + repoHandler.setUserDefaultsJson(context, DEFAULTS_JSON['defaultsUrl']) return context.stage('build') { - // Create the repo handler with the user's defaults to ensure a temurin-build checkout is not null - // Pass actual ADOPT_DEFAULTS_JSON, and optional buildConfig CI and BUILD branch/tag overrides, - // so that RepoHandler checks out the desired repo correctly - def repoHandler = new RepoHandler(USER_REMOTE_CONFIGS, ADOPT_DEFAULTS_JSON, buildConfig.CI_REF, buildConfig.BUILD_REF) - repoHandler.setUserDefaultsJson(context, DEFAULTS_JSON['defaultsUrl']) - context.println 'USER_REMOTE_CONFIGS: ' context.println JsonOutput.toJson(USER_REMOTE_CONFIGS) context.println 'DEFAULTS_JSON: ' @@ -1538,7 +1790,7 @@ class Build { // Issue: https://issues.jenkins.io/browse/JENKINS-64779 if (context.WORKSPACE != null && !context.WORKSPACE.isEmpty()) { context.println 'Cleaning workspace non-hidden files: ' + context.WORKSPACE + '/*' - context.sh(script: 'rm -rf ' + context.WORKSPACE + '/*') + batOrSh(script: 'rm -rf ' + context.WORKSPACE + '/*') } else { context.println 'Warning: Unable to clean workspace as context.WORKSPACE is null/empty' } @@ -1565,7 +1817,7 @@ class Build { context.timeout(time: buildTimeouts.NODE_CLEAN_TIMEOUT, unit: 'HOURS') { if (context.WORKSPACE != null && !context.WORKSPACE.isEmpty()) { context.println 'Removing workspace openjdk build directory: ' + openjdk_build_dir - context.sh(script: 'rm -rf ' + openjdk_build_dir) + batOrSh('rm -rf ' + openjdk_build_dir) } else { context.println 'Warning: Unable to remove workspace openjdk build directory as context.WORKSPACE is null/empty' } @@ -1588,11 +1840,11 @@ class Build { // Perform a git clean outside of checkout to avoid the Jenkins enforced 10 minute timeout // https://github.com/adoptium/infrastucture/issues/1553 + if ( buildConfig.TARGET_OS == 'windows' && buildConfig.DOCKER_IMAGE ) { - context.sh(script: 'git config --global safe.directory $(cygpath ' + '\$' + '{WORKSPACE})') + context.bat(script: 'bash -c "git config --global safe.directory $(cygpath ' + '\$' + '{WORKSPACE})"') } - context.sh(script: 'git clean -fdx') - + batOrSh('git clean -fdx') printGitRepoInfo() } } catch (FlowInterruptedException e) { @@ -1601,21 +1853,8 @@ class Build { try { // Convert IndividualBuildConfig to jenkins env variables - List envVars = buildConfig.toEnvVars() - envVars.add("FILENAME=${filename}" as String) - - // Use BUILD_REF override if specified - def adoptBranch = buildConfig.BUILD_REF ?: ADOPT_DEFAULTS_JSON['repository']['build_branch'] - - // Add platform config path so it can be used if the user doesn't have one - def splitAdoptUrl = ((String)ADOPT_DEFAULTS_JSON['repository']['build_url']) - ('.git').split('/') - // e.g. https://github.com/adoptium/temurin-build.git will produce adoptium/temurin-build - String userOrgRepo = "${splitAdoptUrl[splitAdoptUrl.size() - 2]}/${splitAdoptUrl[splitAdoptUrl.size() - 1]}" - // e.g. adoptium/temurin-build/master/build-farm/platform-specific-configurations - envVars.add("ADOPT_PLATFORM_CONFIG_LOCATION=${userOrgRepo}/${adoptBranch}/${ADOPT_DEFAULTS_JSON['configDirectories']['platform']}" as String) - // Execute build - context.withEnv(envVars) { + context.withEnv(buildConfigEnvVars) { try { context.timeout(time: buildTimeouts.BUILD_JDK_TIMEOUT, unit: 'HOURS') { // Set Github Commit Status @@ -1626,9 +1865,9 @@ class Build { context.println '[CHECKOUT] Checking out to adoptium/temurin-build...' repoHandler.checkoutAdoptBuild(context) printGitRepoInfo() - if ((buildConfig.TARGET_OS == 'mac' || buildConfig.TARGET_OS == 'windows') && buildConfig.JAVA_TO_BUILD != 'jdk8u') { - context.println "Processing exploded build, sign JMODS, and assemble build, for platform ${buildConfig.TARGET_OS} version ${buildConfig.JAVA_TO_BUILD}" - def signBuildArgs + if ((buildConfig.TARGET_OS == 'mac' || buildConfig.TARGET_OS == 'windows') && buildConfig.JAVA_TO_BUILD != 'jdk8u' && enableSigner) { + context.println "Generating exploded build" // , sign JMODS, and assemble build, for platform ${buildConfig.TARGET_OS} version ${buildConfig.JAVA_TO_BUILD}" + def signBuildArgs // Build args for make-adopt-build-farm.sh if (env.BUILD_ARGS != null && !env.BUILD_ARGS.isEmpty()) { signBuildArgs = env.BUILD_ARGS + ' --make-exploded-image' + openjdk_build_dir_arg } else { @@ -1636,126 +1875,37 @@ class Build { } context.withEnv(['BUILD_ARGS=' + signBuildArgs]) { context.println 'Building an exploded image for signing' - context.sh(script: "./${ADOPT_DEFAULTS_JSON['scriptDirectories']['buildfarm']}") + // Call make-adopt-build-farm.sh to do initial windows/mac build + context.println "openjdk_build_pipeline: Calling MABF on win/mac to build exploded image" + batOrSh("bash ./${ADOPT_DEFAULTS_JSON['scriptDirectories']['buildfarm']}") } def base_path = build_path if (openjdk_build_dir_arg == "") { // If not using a custom openjdk build dir, then query what autoconf created as the build sub-folder - base_path = context.sh(script: "ls -d ${build_path}/* | tr -d '\\n'", returnStdout:true) + if ( context.isUnix() ) { + base_path = context.sh(script: "ls -d ${build_path}/*", returnStdout:true) + } else { + base_path = context.bat(script: "@ls -d ${build_path}/*", returnStdout:true).trim() + } } context.println "base build path for jmod signing = ${base_path}" context.stash name: 'jmods', - includes: "${base_path}/hotspot/variant-server/**/*," + - "${base_path}/support/modules_cmds/**/*," + - "${base_path}/support/modules_libs/**/*," + + includes: "${base_path}/hotspot/variant-server/**/*.exe," + + "${base_path}/hotspot/variant-server/**/*.dll," + + "${base_path}/hotspot/variant-server/**/*.dylib," + + "${base_path}/support/modules_cmds/**/*.exe," + + "${base_path}/support/modules_cmds/**/*.dll," + + "${base_path}/support/modules_cmds/**/*.dylib," + + "${base_path}/support/modules_libs/**/*.exe," + + "${base_path}/support/modules_libs/**/*.dll," + + "${base_path}/support/modules_libs/**/*.dylib," + // JDK 16 + jpackage needs to be signed as well stash the resources folder containing the executables "${base_path}/jdk/modules/jdk.jpackage/jdk/jpackage/internal/resources/*" - context.node('eclipse-codesign') { - context.sh "rm -rf ${base_path}/* || true" - - repoHandler.checkoutAdoptBuild(context) - printGitRepoInfo() - - // Copy pre assembled binary ready for JMODs to be codesigned - context.unstash 'jmods' - def target_os = "${buildConfig.TARGET_OS}" - context.withEnv(['base_os='+target_os, 'base_path='+base_path]) { - // groovylint-disable - context.sh ''' - #!/bin/bash - set -eu - echo "Signing JMOD files under build path ${base_path} for base_os ${base_os}" - TMP_DIR="${base_path}/" - if [ "${base_os}" == "mac" ]; then - ENTITLEMENTS="$WORKSPACE/entitlements.plist" - FILES=$(find "${TMP_DIR}" -perm +111 -type f -o -name '*.dylib' -type f || find "${TMP_DIR}" -perm /111 -type f -o -name '*.dylib' -type f) - else - FILES=$(find "${TMP_DIR}" -type f -name '*.exe' -o -name '*.dll') - fi - for f in $FILES - do - echo "Signing $f using Eclipse Foundation codesign service" - dir=$(dirname "$f") - file=$(basename "$f") - mv "$f" "${dir}/unsigned_${file}" - success=false - if [ "${base_os}" == "mac" ]; then - if ! curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" -F entitlements="@$ENTITLEMENTS" https://cbi.eclipse.org/macos/codesign/sign; then - echo "curl command failed, sign of $f failed" - else - success=true - fi - else - if ! curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" https://cbi.eclipse.org/authenticode/sign; then - echo "curl command failed, sign of $f failed" - else - success=true - fi - fi - if [ $success == false ]; then - # Retry up to 20 times - max_iterations=20 - iteration=1 - echo "Code Not Signed For File $f" - while [ $iteration -le $max_iterations ] && [ $success = false ]; do - echo $iteration Of $max_iterations - sleep 1 - if [ "${base_os}" == "mac" ]; then - if curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" -F entitlements="@$ENTITLEMENTS" https://cbi.eclipse.org/macos/codesign/sign; then - success=true - fi - else - if curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" https://cbi.eclipse.org/authenticode/sign; then - success=true - fi - fi - - if [ $success = false ]; then - echo "curl command failed, $f Failed Signing On Attempt $iteration" - iteration=$((iteration+1)) - if [ $iteration -gt $max_iterations ] - then - echo "Errors Encountered During Signing" - exit 1 - fi - else - echo "$f Signed OK On Attempt $iteration" - fi - done - fi - chmod --reference="${dir}/unsigned_${file}" "$f" - rm -rf "${dir}/unsigned_${file}" - done - ''' - // groovylint-enable - } - context.stash name: 'signed_jmods', includes: "${base_path}/**/*" - } - - // Remove jmod directories to be replaced with the stash saved above - context.sh "rm -rf ${base_path}/hotspot/variant-server || true" - context.sh "rm -rf ${base_path}/support/modules_cmds || true" - context.sh "rm -rf ${base_path}/support/modules_libs || true" - // JDK 16 + jpackage executables need to be signed as well - if (buildConfig.JAVA_TO_BUILD != 'jdk11u') { - context.sh "rm -rf ${base_path}/jdk/modules/jdk.jpackage/jdk/jpackage/internal/resources/* || true" - } - - // Restore signed JMODs - context.unstash 'signed_jmods' + // eclipse-codesign and assemble sections were inlined here before + // https://github.com/adoptium/ci-jenkins-pipelines/pull/1117 - def assembleBuildArgs - if (env.BUILD_ARGS != null && !env.BUILD_ARGS.isEmpty()) { - assembleBuildArgs = env.BUILD_ARGS + ' --assemble-exploded-image' + openjdk_build_dir_arg - } else { - assembleBuildArgs = '--assemble-exploded-image' + openjdk_build_dir_arg - } - context.withEnv(['BUILD_ARGS=' + assembleBuildArgs]) { - context.println 'Assembling the exploded image' - context.sh(script: "./${ADOPT_DEFAULTS_JSON['scriptDirectories']['buildfarm']}") - } - } else { + } else { // Not Windows/Mac JDK11+ (i.e. doesn't require internal signing) def buildArgs if (env.BUILD_ARGS != null && !env.BUILD_ARGS.isEmpty()) { buildArgs = env.BUILD_ARGS + openjdk_build_dir_arg @@ -1763,7 +1913,8 @@ class Build { buildArgs = openjdk_build_dir_arg } context.withEnv(['BUILD_ARGS=' + buildArgs]) { - context.sh(script: "./${ADOPT_DEFAULTS_JSON['scriptDirectories']['buildfarm']}") + context.println "openjdk_build_pipeline: Calling MABF when not win/mac JDK11+ to do single-pass build and UASS=false" + batOrSh("bash ./${ADOPT_DEFAULTS_JSON['scriptDirectories']['buildfarm']}") } } context.println '[CHECKOUT] Reverting pre-build adoptium/temurin-build checkout...' @@ -1775,7 +1926,7 @@ class Build { repoHandler.checkoutUserPipelines(context) } printGitRepoInfo() - } else { + } else { // USE_ADOPT_SHELL_SCRIPTS == false context.println "[CHECKOUT] Checking out to the user's temurin-build..." repoHandler.setUserDefaultsJson(context, DEFAULTS_JSON) repoHandler.checkoutUserBuild(context) @@ -1787,7 +1938,8 @@ class Build { buildArgs = openjdk_build_dir_arg } context.withEnv(['BUILD_ARGS=' + buildArgs]) { - context.sh(script: "./${DEFAULTS_JSON['scriptDirectories']['buildfarm']}") + context.println "openjdk_build_pipeline: calling MABF to do single pass build when USE_ADOPT_SHELL_SCRIPTS is false" + batOrSh("bash ./${DEFAULTS_JSON['scriptDirectories']['buildfarm']}") } context.println '[CHECKOUT] Reverting pre-build user temurin-build checkout...' repoHandler.checkoutUserPipelines(context) @@ -1801,21 +1953,30 @@ class Build { } throw new Exception("[ERROR] Build JDK timeout (${buildTimeouts.BUILD_JDK_TIMEOUT} HOURS) has been reached. Exiting...") } - - // Run a downstream job on riscv machine that returns the java version. Otherwise, just read the version.txt - String versionOut - if (buildConfig.BUILD_ARGS.contains('--cross-compile')) { - context.println "[WARNING] Don't read faked version.txt on cross compiled build! Archiving early and running downstream job to retrieve java version..." - versionOut = readCrossCompiledVersionString() + // TODO: Make the "internal signing/assembly" part independent of + // ENABLE_SIGNER so that this platform-specific logic is not required + if ((buildConfig.TARGET_OS == 'mac' || buildConfig.TARGET_OS == 'windows') && buildConfig.JAVA_TO_BUILD != 'jdk8u' && enableSigner) { + context.println "openjdk_build_pipeline: Internal signing phase required - skipping metadata reading" } else { - versionOut = context.readFile('workspace/target/metadata/version.txt') + // Run a downstream job on riscv machine that returns the java version. Otherwise, just read the version.txt + String versionOut + if (buildConfig.BUILD_ARGS.contains('--cross-compile')) { + context.println "[WARNING] Don't read faked version.txt on cross compiled build! Archiving early and running downstream job to retrieve java version..." + versionOut = readCrossCompiledVersionString() + } else { + versionOut = context.readFile('workspace/target/metadata/version.txt') + } + versionInfo = parseVersionOutput(versionOut) } - - versionInfo = parseVersionOutput(versionOut) } - - writeMetadata(versionInfo, true) + if (!((buildConfig.TARGET_OS == 'mac' || buildConfig.TARGET_OS == 'windows') && buildConfig.JAVA_TO_BUILD != 'jdk8u' && enableSigner)) { + writeMetadata(versionInfo, true) + } else { + context.println "Skipping writing incomplete metadata for now - will be done in the assemble phase instead" + } + } finally { + // Always archive any artifacts including failed make logs.. try { context.timeout(time: buildTimeouts.BUILD_ARCHIVE_TIMEOUT, unit: 'HOURS') { @@ -1834,46 +1995,8 @@ class Build { } throw new Exception("[ERROR] Build archive timeout (${buildTimeouts.BUILD_ARCHIVE_TIMEOUT} HOURS) has been reached. Exiting...") } - - // post-build workspace clean: - if (cleanWorkspaceAfter || cleanWorkspaceBuildOutputAfter) { - try { - context.timeout(time: buildTimeouts.NODE_CLEAN_TIMEOUT, unit: 'HOURS') { - // Note: Underlying org.apache DirectoryScanner used by cleanWs has a bug scanning where it misses files containing ".." so use rm -rf instead - // Issue: https://issues.jenkins.io/browse/JENKINS-64779 - if (context.WORKSPACE != null && !context.WORKSPACE.isEmpty()) { - if (cleanWorkspaceAfter) { - context.println 'Cleaning workspace non-hidden files: ' + context.WORKSPACE + '/*' - context.sh(script: 'rm -rf ' + context.WORKSPACE + '/*') - - // Clean remaining hidden files using cleanWs - try { - context.println 'Cleaning workspace hidden files using cleanWs: ' + context.WORKSPACE - context.cleanWs notFailBuild: true, disableDeferredWipeout: true, deleteDirs: true - } catch (e) { - context.println "Failed to clean ${e}" - } - } else if (cleanWorkspaceBuildOutputAfter) { - context.println 'Cleaning workspace build output files: ' + openjdk_build_dir - context.sh(script: 'rm -rf ' + openjdk_build_dir) - context.println 'Cleaning workspace build output files: ' + context.WORKSPACE + '/workspace/target' - context.sh(script: 'rm -rf ' + context.WORKSPACE + '/workspace/target') - context.println 'Cleaning workspace build output files: ' + context.WORKSPACE + '/workspace/build/devkit' - context.sh(script: 'rm -rf ' + context.WORKSPACE + '/workspace/build/devkit') - context.println 'Cleaning workspace build output files: ' + context.WORKSPACE + '/workspace/build/straceOutput' - context.sh(script: 'rm -rf ' + context.WORKSPACE + '/workspace/build/straceOutput') - } - } else { - context.println 'Warning: Unable to clean workspace as context.WORKSPACE is null/empty' - } - } - } catch (FlowInterruptedException e) { - // Set Github Commit Status - if (env.JOB_NAME.contains('pr-tester')) { - updateGithubCommitStatus('FAILED', 'Build FAILED') - } - throw new Exception("[ERROR] AIX clean workspace timeout (${buildTimeouts.AIX_CLEAN_TIMEOUT} HOURS) has been reached. Exiting...") - } + if ( !enableSigner ) { // Don't clean if we need the workspace for the later assemble phase + postBuildWSclean(cleanWorkspaceAfter, cleanWorkspaceBuildOutputAfter) } // Set Github Commit Status if (env.JOB_NAME.contains('pr-tester')) { @@ -1967,7 +2090,6 @@ class Build { Main function. This is what is executed remotely via the helper file kick_off_build.groovy, which is in turn executed by the downstream jobs. Running in downstream build job jdk-*-*-* called by kick_off_build.groovy */ - @SuppressWarnings('unused') def build() { context.timestamps { try { @@ -1993,6 +2115,18 @@ class Build { def helperRef = buildConfig.HELPER_REF ?: DEFAULTS_JSON['repository']['helper_ref'] def nonDockerNodeName = '' + // Convert IndividualBuildConfig to jenkins env variables + List envVars = buildConfig.toEnvVars() + envVars.add("FILENAME=${filename}" as String) + // Use BUILD_REF override if specified + def adoptBranch = buildConfig.BUILD_REF ?: ADOPT_DEFAULTS_JSON['repository']['build_branch'] + // Add platform config path so it can be used if the user doesn't have one + def splitAdoptUrl = ((String)ADOPT_DEFAULTS_JSON['repository']['build_url']) - ('.git').split('/') + // e.g. https://github.com/adoptium/temurin-build.git will produce adoptium/temurin-build + String userOrgRepo = "${splitAdoptUrl[splitAdoptUrl.size() - 2]}/${splitAdoptUrl[splitAdoptUrl.size() - 1]}" + // e.g. adoptium/temurin-build/master/build-farm/platform-specific-configurations + envVars.add("ADOPT_PLATFORM_CONFIG_LOCATION=${userOrgRepo}/${adoptBranch}/${ADOPT_DEFAULTS_JSON['configDirectories']['platform']}" as String) + context.stage('queue') { /* This loads the library containing two Helper classes, and causes them to be imported/updated from their repo. Without the library being imported here, runTests method will fail to execute the post-build test jobs for reasons unknown.*/ @@ -2004,8 +2138,12 @@ class Build { updateGithubCommitStatus('PENDING', 'Pending') } } - + def workspace + if (buildConfig.TARGET_OS == 'windows') { + workspace = 'C:/workspace/openjdk-build/' + } if (buildConfig.DOCKER_IMAGE) { + context.println "openjdk_build_pipeline: preparing to use docker image" // Docker build environment def label = buildConfig.NODE_LABEL + '&&dockerBuild' if (buildConfig.DOCKER_NODE) { @@ -2025,6 +2163,12 @@ class Build { context.node(label) { addNodeToBuildDescription() // Cannot clean workspace from inside docker container + if ( buildConfig.TARGET_OS == 'windows' && buildConfig.DOCKER_IMAGE ) { + context.ws(workspace) { + context.bat("rm -rf " + context.WORKSPACE + "/cyclonedx-lib " + + context.WORKSPACE + "/security") + } + } if (cleanWorkspace) { try { context.timeout(time: buildTimeouts.CONTROLLER_CLEAN_TIMEOUT, unit: 'HOURS') { @@ -2097,13 +2241,15 @@ class Build { throw new Exception("[ERROR] Controller docker file scm checkout timeout (${buildTimeouts.DOCKER_CHECKOUT_TIMEOUT} HOURS) has been reached. Exiting...") } + context.println "openjdk_build_pipeline: building in docker image from docker file " + buildConfig.DOCKER_FILE context.docker.build("build-image", "--build-arg image=${buildConfig.DOCKER_IMAGE} -f ${buildConfig.DOCKER_FILE} .").inside(buildConfig.DOCKER_ARGS) { buildScripts( cleanWorkspace, cleanWorkspaceAfter, cleanWorkspaceBuildOutputAfter, - filename, - useAdoptShellScripts + useAdoptShellScripts, + enableSigner, + envVars ) } } else { @@ -2118,38 +2264,59 @@ class Build { dockerRunArg += " --userns keep-id:uid=1002,gid=1003" } if (buildConfig.TARGET_OS == 'windows') { - def workspace = 'C:/workspace/openjdk-build/' + context.println "openjdk_build_pipeline: running exploded build in docker on Windows" context.echo("Switched to using non-default workspace path ${workspace}") + context.println "openjdk_build_pipeline: building in windows docker image " + buildConfig.DOCKER_IMAGE context.ws(workspace) { context.docker.image(buildConfig.DOCKER_IMAGE).inside(buildConfig.DOCKER_ARGS+" "+dockerRunArg) { buildScripts( cleanWorkspace, cleanWorkspaceAfter, cleanWorkspaceBuildOutputAfter, - filename, - useAdoptShellScripts + useAdoptShellScripts, + enableSigner, + envVars ) } } } else { + context.println "openjdk_build_pipeline: running initial build in docker on non-windows with image " + buildConfig.DOCKER_IMAGE context.docker.image(buildConfig.DOCKER_IMAGE).inside(buildConfig.DOCKER_ARGS+" "+dockerRunArg) { buildScripts( cleanWorkspace, cleanWorkspaceAfter, cleanWorkspaceBuildOutputAfter, - filename, - useAdoptShellScripts + useAdoptShellScripts, + enableSigner, + envVars ) } } + // Is thre potential for not enabling the signer on jdk8u instead of having this clause? + if ( enableSigner && buildConfig.JAVA_TO_BUILD != 'jdk8u' ) { + context.println "openjdk_build_pipeline: running eclipse signing phase" + buildScriptsEclipseSigner() + context.ws(workspace) { + context.println "Signing with non-default workspace location ${workspace}" + context.println "openjdk_build_pipeline: running assemble phase (invocation 1)" + context.docker.image(buildConfig.DOCKER_IMAGE).inside(buildConfig.DOCKER_ARGS+" "+dockerRunArg) { + buildScriptsAssemble( + cleanWorkspaceAfter, + cleanWorkspaceBuildOutputAfter, + envVars + ) + } + } + } } } context.println "[NODE SHIFT] OUT OF DOCKER NODE (LABELNAME ${label}!)" // Build the jdk outside of docker container... } else { + context.println "openjdk_build_pipeline: running build without docker" waitForANodeToBecomeActive(buildConfig.NODE_LABEL) - context.println "[NODE SHIFT] MOVING INTO JENKINS NODE MATCHING LABELNAME ${buildConfig.NODE_LABEL}..." + context.println "openjdk_build_pipeline: [NODE SHIFT] MOVING INTO NON-DOCKER JENKINS NODE MATCHING LABELNAME ${buildConfig.NODE_LABEL}..." context.node(buildConfig.NODE_LABEL) { addNodeToBuildDescription() nonDockerNodeName = context.NODE_NAME @@ -2157,28 +2324,49 @@ class Build { context.echo("checking ${buildConfig.TARGET_OS}") if (buildConfig.TARGET_OS == 'windows') { // See https://github.com/adoptium/infrastucture/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("Switched to using non-default workspace path ${workspace}") + context.println "openjdk_build_pipeline: running build without docker on windows" context.ws(workspace) { buildScripts( cleanWorkspace, cleanWorkspaceAfter, cleanWorkspaceBuildOutputAfter, - filename, - useAdoptShellScripts + useAdoptShellScripts, + enableSigner, + envVars ) + if ( enableSigner ) { + buildScriptsEclipseSigner() + context.println "openjdk_build_pipeline: running assemble phase (invocation 2)" + buildScriptsAssemble( + cleanWorkspaceAfter, + cleanWorkspaceBuildOutputAfter, + envVars + ) + } } - } else { + } else { // Non-windows, non-docker + context.println "openjdk_build_pipeline: running build without docker on non-windows platform" buildScripts( cleanWorkspace, cleanWorkspaceAfter, cleanWorkspaceBuildOutputAfter, - filename, - useAdoptShellScripts + useAdoptShellScripts, + enableSigner, + envVars ) + if ( enableSigner ) { + buildScriptsEclipseSigner() + context.println "openjdk_build_pipeline: running assemble phase (invocation 3)" + buildScriptsAssemble( + cleanWorkspaceAfter, + cleanWorkspaceBuildOutputAfter, + envVars + ) + } } } context.println "[NODE SHIFT] OUT OF JENKINS NODE (LABELNAME ${buildConfig.NODE_LABEL}!)" @@ -2189,6 +2377,7 @@ class Build { if (enableSigner) { try { // Sign job timeout managed by Jenkins job config + context.println "openjdk_build_pipeline: executing signing phase" sign(versionInfo) } catch (FlowInterruptedException e) { throw new Exception("[ERROR] Sign job timeout (${buildTimeouts.SIGN_JOB_TIMEOUT} HOURS) has been reached OR the downstream sign job failed. Exiting...") @@ -2199,8 +2388,11 @@ class Build { if (enableInstallers) { try { // Installer job timeout managed by Jenkins job config + context.println "openjdk_build_pipeline: building installers" buildInstaller(versionInfo) - signInstaller(versionInfo) + if ( enableSigner) { + signInstaller(versionInfo) + } } catch (FlowInterruptedException e) { currentBuild.result = 'FAILURE' throw new Exception("[ERROR] Installer job timeout (${buildTimeouts.INSTALLER_JOBS_TIMEOUT} HOURS) has been reached OR the downstream installer job failed. Exiting...") @@ -2208,6 +2400,7 @@ class Build { } if (!env.JOB_NAME.contains('pr-tester') && context.JENKINS_URL.contains('adopt')) { try { + context.println "openjdk_build_pipeline: Running GPG signing process" gpgSign() } catch (Exception e) { context.println(e.message) @@ -2217,8 +2410,9 @@ class Build { if (!env.JOB_NAME.contains('pr-tester')) { // pr-tester does not sign the binaries // Verify Windows and Mac Signing for Temurin - if (buildConfig.VARIANT == 'temurin') { + if (buildConfig.VARIANT == 'temurin' && enableSigner) { try { + context.println "openjdk_build_pipeline: Verifying signing" verifySigning() } catch (Exception e) { context.println(e.message) @@ -2234,7 +2428,9 @@ class Build { } else { try { //Only smoke tests succeed TCK and AQA tests will be triggerred. + context.println "openjdk_build_pipeline: running smoke tests" if (runSmokeTests() == 'SUCCESS') { + context.println "openjdk_build_pipeline: smoke tests OK - running full AQA suite" // Remote trigger Eclipse Temurin JCK tests if (buildConfig.VARIANT == 'temurin' && enableTCK) { def platform = '' @@ -2244,7 +2440,7 @@ class Build { platform = buildConfig.ARCHITECTURE + '_' + buildConfig.TARGET_OS } if ( !(buildConfig.JAVA_TO_BUILD == 'jdk8u' && platform == 's390x_linux') ) { - context.echo "Remote trigger Eclipse Temurin AQA_Test_Pipeline job with ${platform} ${buildConfig.JAVA_TO_BUILD}" + context.echo "openjdk_build_pipeline: Remote trigger Eclipse Temurin AQA_Test_Pipeline job with ${platform} ${buildConfig.JAVA_TO_BUILD}" def remoteTargets = remoteTriggerJckTests(platform, filename) context.parallel remoteTargets } @@ -2280,7 +2476,6 @@ class Build { } } } - } return { From 45af8e948403598a5e57f70779b55de2d121a35d Mon Sep 17 00:00:00 2001 From: sophia-guo Date: Thu, 7 Nov 2024 08:54:48 -0500 Subject: [PATCH 07/30] Running Temurin mac x65 reproducible comparing on aarch64 mac (#1136) --- pipelines/build/common/openjdk_build_pipeline.groovy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index dd14d8510..ee0ead4ad 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -411,6 +411,7 @@ class Build { testTime = '120' parallel = 'Dynamic' } + def testLabel = '' testList.each { testType -> // For each requested test, i.e 'sanity.openjdk', 'sanity.system', 'sanity.perf', 'sanity.external', call test job @@ -445,6 +446,10 @@ class Build { } } + // Eclipse Adoptium Temurin reproducible comparing on x64 mac required to run on aarch64 mac + if (testType == 'special.system' && jobName.contains('x86-64_mac') && buildConfig.VARIANT == 'temurin') { + testLabel = 'ci.role.test&&hw.arch.aarch64&&(sw.os.osx||sw.os.mac)' + } if (testType == 'special.system' || testType == 'dev.system') { def useAdoptShellScripts = Boolean.valueOf(buildConfig.USE_ADOPT_SHELL_SCRIPTS) vendorTestBranches = useAdoptShellScripts ? ADOPT_DEFAULTS_JSON['repository']['build_branch'] : DEFAULTS_JSON['repository']['build_branch'] @@ -498,6 +503,7 @@ class Build { context.string(name: 'JDK_REPO', value: jdkRepo), context.string(name: 'JDK_BRANCH', value: jdkBranch), context.string(name: 'OPENJ9_BRANCH', value: openj9Branch), + context.string(name: 'LABEL', value: testLabel), context.string(name: 'LABEL_ADDITION', value: additionalTestLabel), context.booleanParam(name: 'KEEP_REPORTDIR', value: keep_test_reportdir), context.string(name: 'PARALLEL', value: parallel), From 174a0c14dfbab797176fe440a1a6842e9db6fe4b Mon Sep 17 00:00:00 2001 From: Stewart X Addison <6487691+sxa@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:08:53 +0000 Subject: [PATCH 08/30] Skip internal signing phase unless on windows/mac (#1137) Signed-off-by: Stewart X Addison --- .../build/common/openjdk_build_pipeline.groovy | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index ee0ead4ad..68a33db97 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -1526,6 +1526,7 @@ class Build { def base_path base_path = build_path def repoHandler = new RepoHandler(USER_REMOTE_CONFIGS, ADOPT_DEFAULTS_JSON, buildConfig.CI_REF, buildConfig.BUILD_REF) + context.stage('internal sign') { context.node('eclipse-codesign') { // Safety first! @@ -1667,6 +1668,7 @@ def buildScriptsAssemble( def base_path base_path = build_path def assembleBuildArgs + // Remove jmod directories to be replaced with the stash saved above batOrSh "rm -rf ${base_path}/hotspot/variant-server ${base_path}/support/modules_cmds ${base_path}/support/modules_libs" // JDK 16 + jpackage executables need to be signed as well @@ -1889,12 +1891,12 @@ def buildScriptsAssemble( if (openjdk_build_dir_arg == "") { // If not using a custom openjdk build dir, then query what autoconf created as the build sub-folder if ( context.isUnix() ) { - base_path = context.sh(script: "ls -d ${build_path}/*", returnStdout:true) + base_path = context.sh(script: "ls -d ${build_path}/*", returnStdout:true).trim() } else { base_path = context.bat(script: "@ls -d ${build_path}/*", returnStdout:true).trim() } } - context.println "base build path for jmod signing = ${base_path}" + context.println "base_path for jmod signing = ${base_path}." context.stash name: 'jmods', includes: "${base_path}/hotspot/variant-server/**/*.exe," + "${base_path}/hotspot/variant-server/**/*.dll," + @@ -1964,7 +1966,7 @@ def buildScriptsAssemble( if ((buildConfig.TARGET_OS == 'mac' || buildConfig.TARGET_OS == 'windows') && buildConfig.JAVA_TO_BUILD != 'jdk8u' && enableSigner) { context.println "openjdk_build_pipeline: Internal signing phase required - skipping metadata reading" } else { - // Run a downstream job on riscv machine that returns the java version. Otherwise, just read the version.txt + // Run a downstream job on riscv machine that returns the java version. Otherwise, just read the version.txt String versionOut if (buildConfig.BUILD_ARGS.contains('--cross-compile')) { context.println "[WARNING] Don't read faked version.txt on cross compiled build! Archiving early and running downstream job to retrieve java version..." @@ -2132,6 +2134,7 @@ def buildScriptsAssemble( String userOrgRepo = "${splitAdoptUrl[splitAdoptUrl.size() - 2]}/${splitAdoptUrl[splitAdoptUrl.size() - 1]}" // e.g. adoptium/temurin-build/master/build-farm/platform-specific-configurations envVars.add("ADOPT_PLATFORM_CONFIG_LOCATION=${userOrgRepo}/${adoptBranch}/${ADOPT_DEFAULTS_JSON['configDirectories']['platform']}" as String) + def internalSigningRequired = (buildConfig.TARGET_OS == 'windows' || buildConfig.TARGET_OS == 'mac') context.stage('queue') { /* This loads the library containing two Helper classes, and causes them to be @@ -2299,7 +2302,7 @@ def buildScriptsAssemble( } } // Is thre potential for not enabling the signer on jdk8u instead of having this clause? - if ( enableSigner && buildConfig.JAVA_TO_BUILD != 'jdk8u' ) { + if ( enableSigner && internalSigningRequired && buildConfig.JAVA_TO_BUILD != 'jdk8u' ) { context.println "openjdk_build_pipeline: running eclipse signing phase" buildScriptsEclipseSigner() context.ws(workspace) { @@ -2344,7 +2347,7 @@ def buildScriptsAssemble( enableSigner, envVars ) - if ( enableSigner ) { + if ( enableSigner && internalSigningRequired ) { buildScriptsEclipseSigner() context.println "openjdk_build_pipeline: running assemble phase (invocation 2)" buildScriptsAssemble( @@ -2364,7 +2367,7 @@ def buildScriptsAssemble( enableSigner, envVars ) - if ( enableSigner ) { + if ( enableSigner && internalSigningRequired ) { buildScriptsEclipseSigner() context.println "openjdk_build_pipeline: running assemble phase (invocation 3)" buildScriptsAssemble( From 2f8b53d7d3e7c6d5795ff9e1519776e95302f621 Mon Sep 17 00:00:00 2001 From: sophia-guo Date: Fri, 8 Nov 2024 13:54:26 -0500 Subject: [PATCH 09/30] Add release Tap collection and upload url (#1134) * Add release Tap collection and upload url * Limit to adoptium jenkins * Replace HUDSON_URL to JENKINS_URL as HUDSON_URL deprecates * typo --- pipelines/build/common/build_base_file.groovy | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pipelines/build/common/build_base_file.groovy b/pipelines/build/common/build_base_file.groovy index 7afa82e60..279971091 100644 --- a/pipelines/build/common/build_base_file.groovy +++ b/pipelines/build/common/build_base_file.groovy @@ -788,7 +788,7 @@ class Builder implements Serializable { def osArch = 'all available OS&ARCHs' def artifactsToCopy = '**/temurin/*.tar.gz,**/temurin/*.zip,**/temurin/*.sha256.txt,**/temurin/*.msi,**/temurin/*.pkg,**/temurin/*.json,**/temurin/*.sig' def dryRun = false - def String releaseToolUrl = "${context.HUDSON_URL}job/build-scripts/job/release/job/refactor_openjdk_release_tool/parambuild?" + String releaseToolUrl = "${context.JENKINS_URL}job/build-scripts/job/release/job/refactor_openjdk_release_tool/parambuild?" if ( config != null ) { def prefixOfArtifactsToCopy = "**/${config.TARGET_OS}/${config.ARCHITECTURE}/${config.VARIANT}" artifactsToCopy = "${prefixOfArtifactsToCopy}/*.tar.gz,${prefixOfArtifactsToCopy}/*.zip,${prefixOfArtifactsToCopy}/*.sha256.txt,${prefixOfArtifactsToCopy}/*.msi,${prefixOfArtifactsToCopy}/*.pkg,${prefixOfArtifactsToCopy}/*.json,${prefixOfArtifactsToCopy}/*.sig" @@ -1034,6 +1034,21 @@ class Builder implements Serializable { if (publish || release) { if (release) { context.println 'NOT PUBLISHING RELEASE AUTOMATICALLY, PLEASE SEE THE RERUN RELEASE PUBLISH BINARIES LINKS' + if (context.JENKINS_URL.contains('adoptium')) { + releaseSummary.appendText('', false) + releaseSummary.appendText("TAP files COLLECTION and RELEASE:
    ") + def urlJobName = URLEncoder.encode("${env.JOB_NAME}", 'UTF-8') + def tapCollectionUrl = "${context.JENKINS_URL}job/TAP_Collection/parambuild?Release_PipelineJob_Name=${urlJobName}" + releaseSummary.appendText("
  • RELEASE TAPs COLLECTION
  • ") + String releaseToolUrl = "${context.JENKINS_URL}job/build-scripts/job/release/job/refactor_openjdk_release_tool/parambuild?RELEASE=${release}}&UPSTREAM_JOB_NAME=TAP_Collection&UPLOAD_TESTRESULTS_ONLY=true&dryrun=false" + def tag = publishName + tag = URLEncoder.encode(tag, 'UTF-8') + def artifactsToCopy = '**/AQAvitTapFiles.tar.gz' + artifactsToCopy = URLEncoder.encode(artifactsToCopy, 'UTF-8') + def javaVersion=determineReleaseToolRepoVersion() + releaseToolUrl += "&VERSION=${javaVersion}&TAG=${tag}&ARTIFACTS_TO_COPY=${artifactsToCopy}" + releaseSummary.appendText("
  • RELEASE TEST RESULTS TAPs Link
  • ") + } } else { try { context.timeout(time: pipelineTimeouts.PUBLISH_ARTIFACTS_TIMEOUT, unit: 'HOURS') { From afe0c07c636a584aec11fb40d260411f2abce7b7 Mon Sep 17 00:00:00 2001 From: sophia-guo Date: Sun, 10 Nov 2024 07:07:14 -0500 Subject: [PATCH 10/30] Auto gen remote temurin compliance test jobs for ea builds (#1138) --- pipelines/build/common/openjdk_build_pipeline.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 68a33db97..4c9780fa5 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -568,6 +568,7 @@ class Build { context.echo "sdkUrl is ${sdkUrl}" def remoteTargets = [:] def additionalTestLabel = buildConfig.ADDITIONAL_TEST_LABEL + def aqaAutoGen = buildConfig.AQA_AUTO_GEN ?: false def setupJCKRun = false if (buildConfig.SCM_REF && buildConfig.AQA_REF && sdkUrl.contains("release")) { setupJCKRun = true @@ -645,6 +646,7 @@ class Build { context.MapParameter(name: 'APPLICATION_OPTIONS', value: "${appOptions}"), context.MapParameter(name: 'LABEL_ADDITION', value: additionalTestLabel), context.MapParameter(name: 'cause', value: "Remote triggered by job ${env.BUILD_URL}"), // Label is lowercase on purpose to map to the Jenkins target reporting system + context.MapParameter(name: 'AUTO_AQA_GEN', value: "${aqaAutoGen}"), context.MapParameter(name: 'SETUP_JCK_RUN', value: "${setupJCKRun}")]), remoteJenkinsName: 'temurin-compliance', shouldNotFailBuild: true, From b6ea3048812bc94ec5f926de36cff60e7071134e Mon Sep 17 00:00:00 2001 From: Stewart X Addison <6487691+sxa@users.noreply.github.com> Date: Tue, 12 Nov 2024 09:17:28 +0000 Subject: [PATCH 11/30] Go back to stashing all, but exclude file types with problematic permissions (#1139) Signed-off-by: Stewart X Addison --- .../build/common/openjdk_build_pipeline.groovy | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 4c9780fa5..95e734601 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -1900,17 +1900,12 @@ def buildScriptsAssemble( } context.println "base_path for jmod signing = ${base_path}." context.stash name: 'jmods', - includes: "${base_path}/hotspot/variant-server/**/*.exe," + - "${base_path}/hotspot/variant-server/**/*.dll," + - "${base_path}/hotspot/variant-server/**/*.dylib," + - "${base_path}/support/modules_cmds/**/*.exe," + - "${base_path}/support/modules_cmds/**/*.dll," + - "${base_path}/support/modules_cmds/**/*.dylib," + - "${base_path}/support/modules_libs/**/*.exe," + - "${base_path}/support/modules_libs/**/*.dll," + - "${base_path}/support/modules_libs/**/*.dylib," + - // JDK 16 + jpackage needs to be signed as well stash the resources folder containing the executables - "${base_path}/jdk/modules/jdk.jpackage/jdk/jpackage/internal/resources/*" + includes: "${base_path}/hotspot/variant-server/**/*," + + "${base_path}/support/modules_cmds/**/*," + + "${base_path}/support/modules_libs/**/*," + + // JDK 16 + jpackage needs to be signed as well stash the resources folder containing the executables + "${base_path}/jdk/modules/jdk.jpackage/jdk/jpackage/internal/resources/*", + excludes: "**/*.dat,**/*bfc" // eclipse-codesign and assemble sections were inlined here before // https://github.com/adoptium/ci-jenkins-pipelines/pull/1117 From 5078087f63fc6dc650862f9cabfe8d274316f2b1 Mon Sep 17 00:00:00 2001 From: Stewart X Addison <6487691+sxa@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:11:36 +0000 Subject: [PATCH 12/30] Do not archive before assembly phase when internal signing (Fixes cross-compile situation) (#1140) Signed-off-by: Stewart X Addison --- .../common/openjdk_build_pipeline.groovy | 59 ++++++++++--------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 95e734601..04010a1e6 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -1981,32 +1981,35 @@ def buildScriptsAssemble( } } finally { - - // Always archive any artifacts including failed make logs.. - try { - context.timeout(time: buildTimeouts.BUILD_ARCHIVE_TIMEOUT, unit: 'HOURS') { - // We have already archived cross compiled artifacts, so only archive the metadata files - if (buildConfig.BUILD_ARGS.contains('--cross-compile')) { - context.println '[INFO] Archiving JSON Files...' - context.archiveArtifacts artifacts: 'workspace/target/*.json' - } else { - context.archiveArtifacts artifacts: 'workspace/target/*' - } - } - } catch (FlowInterruptedException e) { - // Set Github Commit Status - if (env.JOB_NAME.contains('pr-tester')) { - updateGithubCommitStatus('FAILED', 'Build FAILED') - } - throw new Exception("[ERROR] Build archive timeout (${buildTimeouts.BUILD_ARCHIVE_TIMEOUT} HOURS) has been reached. Exiting...") - } - if ( !enableSigner ) { // Don't clean if we need the workspace for the later assemble phase - postBuildWSclean(cleanWorkspaceAfter, cleanWorkspaceBuildOutputAfter) - } - // Set Github Commit Status - if (env.JOB_NAME.contains('pr-tester')) { - updateGithubCommitStatus('SUCCESS', 'Build PASSED') - } + // Archive any artifacts including failed make logs, unless doing internal + // signing where we will perform this step after the assemble phase + if (!((buildConfig.TARGET_OS == 'mac' || buildConfig.TARGET_OS == 'windows') && buildConfig.JAVA_TO_BUILD != 'jdk8u' && enableSigner)) { + try { + context.timeout(time: buildTimeouts.BUILD_ARCHIVE_TIMEOUT, unit: 'HOURS') { + // We have already archived cross compiled artifacts, so only archive the metadata files + if (buildConfig.BUILD_ARGS.contains('--cross-compile')) { + context.println '[INFO] Archiving JSON Files...' + context.archiveArtifacts artifacts: 'workspace/target/*.json' + } else { + context.archiveArtifacts artifacts: 'workspace/target/*' + } + } + } catch (FlowInterruptedException e) { + // Set Github Commit Status + if (env.JOB_NAME.contains('pr-tester')) { + updateGithubCommitStatus('FAILED', 'Build FAILED') + } + throw new Exception("[ERROR] Build archive timeout (${buildTimeouts.BUILD_ARCHIVE_TIMEOUT} HOURS) has been reached. Exiting...") + } + // With the exclusion above this is no longer strictly required + if ( !enableSigner ) { // Don't clean if we need the workspace for the later assemble phase + postBuildWSclean(cleanWorkspaceAfter, cleanWorkspaceBuildOutputAfter) + } + // Set Github Commit Status + if (env.JOB_NAME.contains('pr-tester')) { + updateGithubCommitStatus('SUCCESS', 'Build PASSED') + } + } } } } @@ -2344,7 +2347,7 @@ def buildScriptsAssemble( enableSigner, envVars ) - if ( enableSigner && internalSigningRequired ) { + if ( enableSigner && internalSigningRequired && buildConfig.JAVA_TO_BUILD != 'jdk8u' ) { buildScriptsEclipseSigner() context.println "openjdk_build_pipeline: running assemble phase (invocation 2)" buildScriptsAssemble( @@ -2364,7 +2367,7 @@ def buildScriptsAssemble( enableSigner, envVars ) - if ( enableSigner && internalSigningRequired ) { + if ( enableSigner && internalSigningRequired && buildConfig.JAVA_TO_BUILD != 'jdk8u' ) { buildScriptsEclipseSigner() context.println "openjdk_build_pipeline: running assemble phase (invocation 3)" buildScriptsAssemble( From 5bd79eb1d95a033c4ee364a8f9fcc270ad653178 Mon Sep 17 00:00:00 2001 From: Stewart X Addison <6487691+sxa@users.noreply.github.com> Date: Thu, 14 Nov 2024 18:15:48 +0000 Subject: [PATCH 13/30] FAQ typo fix (#1142) Signed-off-by: Stewart X Addison --- FAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FAQ.md b/FAQ.md index 0590eb705..b889e75cf 100644 --- a/FAQ.md +++ b/FAQ.md @@ -94,7 +94,7 @@ Check out [Adopt's guide](docs/UsingOurScripts.md) to setting up your own script ## I want to build code from my own fork/branch of openjdk in jenkins You will need to add some parameters to the `BUILD_ARGS` on the individual -platform-specific pipeline (or `additionalBuildArgs` if runnibg a top level pipeline) and +platform-specific pipeline (or `additionalBuildArgs` if running a top level pipeline) and specify `--disable-adopt-branch-safety` for example: `--disable-adopt-branch-safety -r https://github.com/sxa/openjdk-jdk11u -b mybranch` From 2fd5c302f341ffbf1c712660f54641c7f4f25a31 Mon Sep 17 00:00:00 2001 From: AdamBrousseau Date: Thu, 21 Nov 2024 15:56:57 -0500 Subject: [PATCH 14/30] Pull cuda image from NVCR and change to ubi8 base (#1147) * Switch to ubi8 base cuda image The ubuntu image does not support ppc64le arch. We are now building (Semeru) on ppc64le in the cent7 container and require the cuda libs. Related ibmruntimes/ci-jenkins-pipelines#228 Signed-off-by: Adam Brousseau * Pull cuda image from nvcr Nvidia Sometimes pulls fail because DockerHub is rate limited. We are also facing pull restrictions from DockerHub for Semeru. Related eclipse-openj9/openj9#20622 Signed-off-by: Adam Brousseau --------- Signed-off-by: Adam Brousseau --- pipelines/build/dockerFiles/cuda.dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelines/build/dockerFiles/cuda.dockerfile b/pipelines/build/dockerFiles/cuda.dockerfile index 1f4e4e27b..2dbc29eae 100644 --- a/pipelines/build/dockerFiles/cuda.dockerfile +++ b/pipelines/build/dockerFiles/cuda.dockerfile @@ -1,8 +1,8 @@ ARG image ARG cuda_ver=12.2.0 -ARG cuda_distro=ubuntu20.04 +ARG cuda_distro=ubi8 -FROM nvidia/cuda:${cuda_ver}-devel-${cuda_distro} as cuda +FROM nvcr.io/nvidia/cuda:${cuda_ver}-devel-${cuda_distro} as cuda FROM $image # Install cuda headers https://github.com/eclipse/openj9/blob/master/buildenv/docker/mkdocker.sh#L586-L593 From 926a185d7e43ac34f32222b19b7cf95da597252f Mon Sep 17 00:00:00 2001 From: Adam Farley Date: Fri, 22 Nov 2024 08:09:44 +0000 Subject: [PATCH 15/30] Platform-specific reproducibility healthcheck (#1146) * Adding platforms to reproducibility healthcheck We now have automated reproducibility testing on 3 more platforms, so we're checking their results as part of the daily healthcheck. Signed-off-by: Adam Farley * Adding tolerance for decimal point Signed-off-by: Adam Farley * Typo fix * Syntax fix Signed-off-by: Adam Farley * Fixing the regex Signed-off-by: Adam Farley * Fixing variable content loss Signed-off-by: Adam Farley * Fixing another regex Signed-off-by: Adam Farley * Typo fix Signed-off-by: Adam Farley * Fixing Linter concerns Signed-off-by: Adam Farley * Alternative rounding method to solve Jenkins' MathContext aversion Signed-off-by: Adam Farley * Changing method of rounding down Signed-off-by: Adam Farley * Removing banned method Signed-off-by: Adam Farley * Making sure we use the latest build repro info during healthcheck Currently, we use the earliest pipeline with a given tag as our best guess at the root source of a published build. However, if the build link is rerun by a user for specific platforms, the original link becomes outdated, and we should use the new link for healthchecks (but only on the affected platform). This change adds the per-platform logic required to do that. We may expand the scope for this in the long run, but for now this logic will only be used by the section of the code which identifies the reproducibility percentages for published builds. Signed-off-by: Adam Farley * Swapping paranthesis with curley braces Signed-off-by: Adam Farley * Continues should be changed to returns if used inside lambdas Signed-off-by: Adam Farley * Adding useful debug messages Signed-off-by: Adam Farley * More debug output Signed-off-by: Adam Farley * Point repro healthcheck at the correct build. Signed-off-by: Adam Farley * Resolving conflict and fixing typo Signed-off-by: Adam Farley * Renaming variable Signed-off-by: Adam Farley * Adapting contains call to map API Signed-off-by: Adam Farley * Adding white space tolerance to 100 percent check Signed-off-by: Adam Farley * Adding debug output Signed-off-by: Adam Farley * Debug messages * Switching nodes to try and get faster performance Will revert before merge. Signed-off-by: Adam Farley * Fixing typos Signed-off-by: Adam Farley * Changing node * Debug output Signed-off-by: Adam Farley * Trimming string Signed-off-by: Adam Farley * Expanding range of nodes to be used for execution Signed-off-by: Adam Farley * Resetting label Signed-off-by: Adam Farley * Fixing method signature Signed-off-by: Adam Farley * Debug output Signed-off-by: Adam Farley * Adjusting debug messages Signed-off-by: Adam Farley * Removing lambdas Signed-off-by: Adam Farley * Removing another lambda Signed-off-by: Adam Farley * Restructuring error checking Signed-off-by: Adam Farley * Debug message Signed-off-by: Adam Farley * debug Signed-off-by: Adam Farley * Changing structure to prevent syntax problem Signed-off-by: Adam Farley * debug Signed-off-by: Adam Farley * To ensure accuracy when some platforms are subsets of other platforms Like how alpine-linux contains the string linux. Signed-off-by: Adam Farley * debug Signed-off-by: Adam Farley * Bracket mislaid - fixing Signed-off-by: Adam Farley * Switching for loop styles Because the previous kind doesn't appear to work, unsure why. Signed-off-by: Adam Farley * Removing reference to restricted job Signed-off-by: Adam Farley * Removing legacy code Signed-off-by: Adam Farley * Moving platformKeys scope to allow wider usage Signed-off-by: Adam Farley * Adding tests check Signed-off-by: Adam Farley * Typo Signed-off-by: Adam Farley * Regex fix Signed-off-by: Adam Farley * Adjusting regex and adding debug Signed-off-by: Adam Farley * Swapping out regex Signed-off-by: Adam Farley * Removing superfluous check Signed-off-by: Adam Farley * Better debug messages and a test tag Signed-off-by: Adam Farley * Changing tag for testing Signed-off-by: Adam Farley * Removing lambdas and getting test output data from trss Signed-off-by: Adam Farley * Removing another lambda Signed-off-by: Adam Farley * Correcting variable name Signed-off-by: Adam Farley * Making sure that a missing buildOutputId can be worked around Signed-off-by: Adam Farley * Removing static method use Signed-off-by: Adam Farley * Removing legacy code. * Removing redundant command Signed-off-by: Adam Farley * Adding check for blank test output Signed-off-by: Adam Farley * Fixing typo Signed-off-by: Adam Farley * Tidying output and adding debug Signed-off-by: Adam Farley * Reducing quanity of output Signed-off-by: Adam Farley * Debug Signed-off-by: Adam Farley * Reducing output Signed-off-by: Adam Farley * More useful output Signed-off-by: Adam Farley * More debug Signed-off-by: Adam Farley * Syntax fix Signed-off-by: Adam Farley * Changing expected repro test bucket for windows and mac Signed-off-by: Adam Farley * Removing debug messages, making all wgets more robust, plus code tidy wgets to trss can hang if you're passing an invalid value, as per aqa-test-tools issue 935. This code change allows us to treat hangs (no response) as if the wget had returned an empty string. Signed-off-by: Adam Farley * Making wget spider call silent Signed-off-by: Adam Farley * Fixing output typo Signed-off-by: Adam Farley * Removing excess white spaces Signed-off-by: Adam Farley * Adding variable use to make linter happy Signed-off-by: Adam Farley * Removing build-passed check in favor of an upload-success check So that if one of the tests fails and the upload is still successful, we can still try to provide information on the reproducibility test (assuming it ran at all). Signed-off-by: Adam Farley --------- Signed-off-by: Adam Farley --- tools/nightly_build_and_test_stats.groovy | 347 ++++++++++++++++------ 1 file changed, 248 insertions(+), 99 deletions(-) diff --git a/tools/nightly_build_and_test_stats.groovy b/tools/nightly_build_and_test_stats.groovy index e927bd962..7ebcbca73 100644 --- a/tools/nightly_build_and_test_stats.groovy +++ b/tools/nightly_build_and_test_stats.groovy @@ -15,7 +15,6 @@ limitations under the License. /* groovylint-disable NestedBlockDepth */ import groovy.json.JsonSlurper -import java.math.MathContext; import java.time.LocalDateTime import java.time.Instant import java.time.ZoneId @@ -23,23 +22,23 @@ import java.time.ZonedDateTime import java.time.temporal.ChronoUnit def getPlatformConversionMap() { - // A map to convert from a standard platform format to the variants used by build and test job names on Jenkins. - def platformConversionMap = [x64Linux: ["linux-x64", "x86-64_linux"], - x64Windows: ["windows-x64", "x86-64_windows"], - x64Mac: ["mac-x64", "x86-64_mac"], - x64AlpineLinux: ["alpine-linux-x64", "x86-64_alpine-linux"], - ppc64Aix: ["aix-ppc64", "ppc64_aix"], - ppc64leLinux: ["linux-ppc64le", "ppc64le_linux"], - s390xLinux: ["linux-s390x", "s390x_linux"], - aarch64Linux: ["linux-aarch64", "aarch64_linux"], - aarch64AlpineLinux: ["alpine-linux-aarch64", "aarch64_alpine-linux"], - aarch64Mac: ["mac-aarch64", "aarch64_mac"], - aarch64Windows: ["windows-aarch64", "aarch64_windows"], - arm32Linux: ["linux-arm", "arm_linux"], - x32Windows: ["windows-x86-32", "x86-32_windows"], - x64Solaris: ["solaris-x64", "x64_solaris"], - sparcv9Solaris: ["solaris-sparcv9", "sparcv9_solaris"], - riscv64Linux: ["linux-riscv64", "riscv64_linux"] + // A map to convert from a standard platform format to the variants used by builds, tests, and assets. + def platformConversionMap = [x64Linux: ["linux-x64", "x86-64_linux", "x64_linux"], + x64Windows: ["windows-x64", "x86-64_windows", "x64_windows"], + x64Mac: ["mac-x64", "x86-64_mac", "x64_mac"], + x64AlpineLinux: ["alpine-linux-x64", "x86-64_alpine-linux", "x64_alpine-linux"], + ppc64Aix: ["aix-ppc64", "ppc64_aix", "ppc64_aix"], + ppc64leLinux: ["linux-ppc64le", "ppc64le_linux", "ppc64le_linux"], + s390xLinux: ["linux-s390x", "s390x_linux", "s390x_linux"], + aarch64Linux: ["linux-aarch64", "aarch64_linux", "aarch64_linux"], + aarch64AlpineLinux: ["alpine-linux-aarch64", "aarch64_alpine-linux", "aarch64_alpine-linux"], + aarch64Mac: ["mac-aarch64", "aarch64_mac", "aarch64_mac"], + aarch64Windows: ["windows-aarch64", "aarch64_windows", "aarch64_windows"], + arm32Linux: ["linux-arm", "arm_linux", "arm_linux"], + x32Windows: ["windows-x86-32", "x86-32_windows", "x86-32_windows"], + x64Solaris: ["solaris-x64", "x64_solaris", "x64_solaris"], + sparcv9Solaris: ["solaris-sparcv9", "sparcv9_solaris", "sparcv9_solaris"], + riscv64Linux: ["linux-riscv64", "riscv64_linux", "riscv64_linux"] ] return platformConversionMap } @@ -47,11 +46,11 @@ def getPlatformConversionMap() { def getPlatformReproTestMap() { // A map to return the test bucket and test name for the repducibile platforms def platformReproTestMap = [x64Linux: ["special.system", "Rebuild_Same_JDK_Reproducibility_Test"], - x64Windows: ["dev.system", "Rebuild_Same_JDK_Reproducibility_Test_win"], + x64Windows: ["special.system", "Rebuild_Same_JDK_Reproducibility_Test_win"], x64Mac: ["NA", ""], ppc64leLinux: ["special.system", "Rebuild_Same_JDK_Reproducibility_Test"], aarch64Linux: ["special.system", "Rebuild_Same_JDK_Reproducibility_Test"], - aarch64Mac: ["dev.system", "Rebuild_Same_JDK_Reproducibility_Test_Mac"] + aarch64Mac: ["special.system", "Rebuild_Same_JDK_Reproducibility_Test_Mac"] ] return platformReproTestMap } @@ -147,18 +146,143 @@ def getLatestBinariesTag(String version) { def latestTag = sh(returnStdout: true, script:"git ls-remote --sort=-v:refname --tags ${binariesRepo} | grep '\\-ea\\-beta' | grep -v '\\^{}' | tr -s '\\t ' ' ' | cut -d' ' -f2 | sed 's,refs/tags/,,' | sort -V -r | head -1 | tr -d '\\n'") echo "latest jdk${version} binaries repo tag = ${latestTag}" - return latestTag + return latestTag +} + +// Calls wget with the given URL and returns the output. +// Returns an empty string if fails. +def callWgetSafely(String url) { + def testOutputRC = sh(returnStatus : true, returnStdout: false, script: "wget --spider -q ${url} 2> /dev/null") + if ( testOutputRC != 0 ) { + echo "Warning: This URL's data could not be found, and is likely expired: ${url}" + return "" + } + return sh(returnStdout: true, script: "wget -q -O - ${url}") } -// Return our best guess at the url that generated a specific build. +// Return our best guess at the build TRSS IDs for the latest successful build+publish of a specific set of platforms for a specific build tag. +// Takes a jdk major version, a tag, and an array of platform names (standard platform format). +def getBuildIDsByPlatform(String trssUrl, String jdkVersion, String srcTag, Map platformsList) { + // First we gather a list of the latest pipelines for this jdkVersion. + echo "Gathering Build IDs by platform." + def jdkVersionMinusTheU = jdkVersion.endsWith("u") ? jdkVersion.substring(0, jdkVersion.length() - 1) : jdkVersion + def pipelineName = "open${jdkVersionMinusTheU}-pipeline" + def pipelines = callWgetSafely("${trssUrl}/api/getBuildHistory?buildName=${pipelineName}") + def pipelineJson = new JsonSlurper().parseText(pipelines) + String srcTagLocal = srcTag.replaceAll("-beta","") + + if (pipelineJson.size() == 0) { + echo "WARNING: Cannot find pipelines for per-platform build job identification." + return + } + + def platformConversionMap = getPlatformConversionMap() + Set platformKeys = platformsList.keySet() + + // Then we iterate over the list of pipelines, seeking a pipeline that contains one of our platforms. + assert pipelineJson instanceof List + + for (int i = 0 ; i < pipelineJson.size() ; i++ ) { + Map onePipeline = pipelineJson[i] + def jdksPublished = "" + + if (!onePipeline.toString().contains(srcTagLocal)) { + continue + } + + def pipelineBuilds = callWgetSafely("${trssUrl}/api/getChildBuilds?parentId=${onePipeline._id}") + def pipelineBuildsJson = new JsonSlurper().parseText(pipelineBuilds) + + if (pipelineBuildsJson.size() == 0) { + continue + } + + boolean pipelinePublishBool = false + def onePipelinePlatformsMap = [:] + + // For each build within a given pipeline: + assert pipelineBuildsJson instanceof List + for (int j = 0 ; j < pipelineBuildsJson.size() ; j++ ) { + Map onePipelineBuild = pipelineBuildsJson[j] + + // - Is this platform in our platform list? + for (int k = 0 ; k < platformKeys.size() ; k++ ) { + String onePlatformKey = platformKeys[k] + String onePlatformValue = platformsList[onePlatformKey] + if (!onePlatformValue.isEmpty()) { + continue + } + + if (onePipelineBuild.buildName.contains("${jdkVersion}-${platformConversionMap[onePlatformKey][0]}")) { + // - Does the build job for one of our listed platforms contain a successful build job? + if (onePipelineBuild.status.equals("Done")) { + onePipelinePlatformsMap[onePlatformKey] = onePipelineBuild._id + } + } + + // Also, check if the pipeline published any successful builds overall. + if (onePipelineBuild.buildName.contains("refactor_openjdk_release_tool") && onePipelineBuild.status.contains("Done")) { + def wgetUrlForReleaseTool = "${onePipelineBuild.buildUrl}/consoleText" + if (onePipelineBuild.buildOutputId != null) { + wgetUrlForReleaseTool = "${trssURL}/api/getOutputById?id=${onePipelineBuild.buildOutputId}" + } + + def releaseToolOutput = callWgetSafely(wgetUrlForReleaseTool) + + if ((releaseToolOutput.length() <= 2) || (!releaseToolOutput.contains("Finished: SUCCESS"))) { + echo "Warning: The refactor_openjdk_release_tool job in this pipeline has not completed successfully: ${wgetUrlForReleaseTool}" + continue + } + + // Now we identify the platforms that were successfully published. + for (int n = 0 ; n < platformKeys.size() ; n++ ) { + // Example: Uploading OpenJDK21U-jdk_x64_windows_hotspot_21.0.6_3-ea.zip + platformUploadingString = "Uploading Open${srcTagLocal.toUpperCase}-jdk_${platformConversionMap[platformKeys[n]]}_hotspot_${srcTagLocal}" + if (releaseToolOutput.contains(platformUploadingString + ".zip") || releaseToolOutput.contains(platformUploadingString + ".tar.gz")) { + jdksPublished += ",${platformKeys[n]}," + } + } + + pipelinePublishBool = true + } + } + } + + // If this pipeline successfully published, then we put the relevant TRSS ids into the platformsList Map. + if (pipelinePublishBool) { + def platformsWithAValue = 0 + for (int m = 0 ; m < platformKeys.size() ; m++ ) { + String onePlatformKey = platformKeys[m] + if (platformsList[onePlatformKey].isEmpty() && jdksPublished.contains(",${onePlatformKey},")) { + if (onePipelinePlatformsMap.containsKey(onePlatformKey)) { + platformsList[onePlatformKey] = onePipelinePlatformsMap[onePlatformKey] + platformsWithAValue++ + echo "Found new build ID for platform ${onePlatformKey}." + } + } else { + platformsWithAValue++ + } + } + + // If we have all the entries we need, we exit the loop and end this method. + if (platformsWithAValue == platformsList.size()) { + echo "Finished getting build IDs by platform." + return + } + } + } + echo "Finished getting build IDs by platform." +} + +// Return our best guess at the url for the first pipeline that generated builds from a specific tag. +// This pipeline is expected to have attempted to build JDKs for all supported platforms. def getBuildUrl(String trssUrl, String variant, String featureRelease, String publishName, String scmRef) { def functionBuildUrl = ["", "", ""] - def featureReleaseInt = (featureRelease == "aarch32-jdk8u" || featureRelease == "alpine-jdk8u") ? 8 : featureRelease.replaceAll("[a-z]","").toInteger() def pipelineName = "openjdk${featureReleaseInt}-pipeline" - - def pipeline = sh(returnStdout: true, script: "wget -q -O - ${trssUrl}/api/getBuildHistory?buildName=${pipelineName}") + def pipeline = callWgetSafely("${trssUrl}/api/getBuildHistory?buildName=${pipelineName}") def pipelineJson = new JsonSlurper().parseText(pipeline) + if (pipelineJson.size() > 0) { pipelineJson.each { job -> def overridePublishName = "" @@ -219,13 +343,14 @@ def verifyReleaseContent(String version, String release, String variant, Map sta if (rc == 0) { releaseAssets = sh(script: "cat releaseAssets.json | grep '\"name\"' | tr '\\n' '#'", returnStdout: true) } + if (releaseAssets == "") { echo "Error loading release assets list for ${releaseAssetsUrl}" status['assets'] = "Error loading ${releaseAssetsUrl}" } else { def configFile = "${configVersion}.groovy" - targetConfigurations = null + // aarch32-jdk8u and alpine-jdk8u are single configurations if (version == "aarch32-jdk8u") { targetConfigurations = [:] @@ -248,24 +373,8 @@ def verifyReleaseContent(String version, String release, String variant, Map sta if (targetConfigurations) { // Map of config architecture to artifact name - def archToAsset = [x64Linux: "x64_linux", - x64Windows: "x64_windows", - aarch64Windows: "aarch64_windows", - x64Mac: "x64_mac", - x64AlpineLinux: "x64_alpine-linux", - ppc64Aix: "ppc64_aix", - ppc64leLinux: "ppc64le_linux", - s390xLinux: "s390x_linux", - aarch64Linux: "aarch64_linux", - aarch64AlpineLinux: "aarch64_alpine-linux", - aarch64Mac: "aarch64_mac", - arm32Linux: "arm_linux", - x32Windows: "x86-32_windows", - x64Solaris: "x64_solaris", - sparcv9Solaris: "sparcv9_solaris", - riscv64Linux: "riscv64_linux" - ] - + def archToAsset = getPlatformConversionMap().collectEntries{key, value -> [key, value[2]]} + def missingAssets = [] def foundAtLeastOneAsset = false targetConfigurations.keySet().each { osarch -> @@ -364,7 +473,7 @@ def verifyReleaseContent(String version, String release, String variant, Map sta // For a given pipeline, tell us how reproducible the builds were. // Note: Will limit itself to jdk versions and platforms in the results Map. -def getReproducibilityPercentage(String jdkVersion, String trssId, String trssURL, Map results) { +def getReproducibilityPercentage(String jdkVersion, String trssId, String trssURL, String srcTag, Map results) { echo "Called repro method with trssID:"+trssId def platformConversionMap = getPlatformConversionMap() @@ -372,64 +481,96 @@ def getReproducibilityPercentage(String jdkVersion, String trssId, String trssUR // We are only looking for reproducible percentages for the relevant jdk versions... if ( trssId != "" && results.containsKey(jdkVersion) ) { + + // See if we can find a more recent build ID for each platform. + def mapOfMoreRecentBuildIDs = [:] + results[jdkVersion][1].each { onePlatform, valueNotUsed -> + mapOfMoreRecentBuildIDs[onePlatform] = "" + } + + getBuildIDsByPlatform(trssURL, jdkVersion, srcTag, mapOfMoreRecentBuildIDs) + def jdkVersionInt = jdkVersion.replaceAll("[a-z]", "") // ...and platforms. - results[jdkVersion][1].each { onePlatform, valueNotUsed -> + def platformsForOneJDKVersion = results[jdkVersion][1] + assert platformsForOneJDKVersion instanceof Map + for ( String onePlatform in platformsForOneJDKVersion.keySet() ) { // If this platform doesn't have a reproducibility test yet, skip it. if (platformReproTestMap[onePlatform][0].equals("NA")) { results[jdkVersion][1][onePlatform] = "NA" // Then we exit this lambda and skip to the next platform. - return + continue } - def pipelineLink = trssURL+"/api/getAllChildBuilds?parentId="+trssId+"\\&buildNameRegex=^"+jdkVersion+"\\-"+platformConversionMap[onePlatform][0]+"\\-temurin\$" - def trssBuildJobNames = sh(returnStdout: true, script: "wget -q -O - ${pipelineLink}") - def platformResult = "???% - Build not found. Pipeline link: " + pipelineLink - - // Does this platform have a build in this pipeline? - if ( trssBuildJobNames.length() > 2 ) { - def buildJobNamesJson = new JsonSlurper().parseText(trssBuildJobNames) - - // For each build, search the test output for the unit test we need, then look for reproducibility percentage. - buildJobNamesJson.each { buildJob -> - platformResult = "???% - Build found, but no reproducibility tests. Build link: " + buildJob.buildUrl - def testPlatform = platformConversionMap[onePlatform][1] - def reproTestName=platformReproTestMap[onePlatform][1] - def reproTestBucket=platformReproTestMap[onePlatform][0] - def testJobTitle="Test_openjdk${jdkVersionInt}_hs_${reproTestBucket}_${testPlatform}.*" - def trssTestJobNames = sh(returnStdout: true, script: "wget -q -O - ${trssURL}/api/getAllChildBuilds?parentId=${buildJob._id}\\&buildNameRegex=^${testJobTitle}\$") - - // Did this build have tests? - if ( trssTestJobNames.length() > 2 ) { - platformResult = "???% - Found ${reproTestBucket}, but did not find ${reproTestName}. Build Link: " + buildJob.buildUrl - def testJobNamesJson = new JsonSlurper().parseText(trssTestJobNames) - - // For each test job (including testList subjobs), we now search for the reproducibility test. - testJobNamesJson.each { testJob -> - def testOutput = sh(returnStdout: true, script: "wget -q -O - ${testJob.buildUrl}/consoleText") - - // If we can find it, then we look for the anticipated percentage. - if ( testOutput.contains("Running test "+reproTestName) ) { - platformResult = "???% - ${reproTestName} ran but failed to produce a percentage. Test Link: " + testJob.buildUrl - // Now we know the test ran, - def matcherObject = testOutput =~ /ReproduciblePercent = (100|[0-9][0-9]?\.?[0-9]?[0-9]?) %/ - if ( matcherObject ) { - platformResult = ((matcherObject[0] =~ /(100|[0-9][0-9]?\.?[0-9]?[0-9]?) %/)[0][0]) - } - } - } + def pipelineLink = "${trssURL}/api/getAllChildBuilds?parentId=${trssId}\\&buildNameRegex=^${jdkVersion}\\-${platformConversionMap[onePlatform][0]}\\-temurin\$" + if (mapOfMoreRecentBuildIDs.containsKey(onePlatform) && !mapOfMoreRecentBuildIDs[onePlatform].equals("")) { + echo "Overriding the TRSS build ID for ${jdkVersion}, platform ${onePlatform}, tag ${srcTag}" + echo "Original TRSS pipeline link: ${pipelineLink}" + echo "New link: ${trssURL}/api/getData?_id=${mapOfMoreRecentBuildIDs[onePlatform]}" + pipelineLink = "${trssURL}/api/getData?_id=${mapOfMoreRecentBuildIDs[onePlatform]}" + } + + def trssBuildJobNames = callWgetSafely("${pipelineLink}") + results[jdkVersion][1][onePlatform] = "???% - Build not found. Pipeline link: " + pipelineLink + + // Does this platform have a build in this pipeline? If not, skip to next platform. + if ( trssBuildJobNames.length() <= 2 ) { + continue + } + + def buildJobNamesJson = new JsonSlurper().parseText(trssBuildJobNames) + + // For each build, search the test output for the unit test we need, then look for reproducibility percentage. + assert buildJobNamesJson instanceof List + for ( Map buildJob in buildJobNamesJson ) { + results[jdkVersion][1][onePlatform] = "???% - Build found, but no reproducibility tests. Build link: " + buildJob.buildUrl + def testPlatform = platformConversionMap[onePlatform][1] + def reproTestName=platformReproTestMap[onePlatform][1] + def reproTestBucket=platformReproTestMap[onePlatform][0] + def testJobTitle="Test_openjdk${jdkVersionInt}_hs_${reproTestBucket}_${testPlatform}.*" + def trssTestJobNames = callWgetSafely("${trssURL}/api/getAllChildBuilds?parentId=${buildJob._id}\\&buildNameRegex=^${testJobTitle}\$") + + // Did this build have tests? If not, skip to next build job. + if ( trssTestJobNames.length() <= 2 ) { + continue + } + + results[jdkVersion][1][onePlatform] = "???% - Found ${reproTestBucket}, but did not find ${reproTestName}. Build Link: " + buildJob.buildUrl + def testJobNamesJson = new JsonSlurper().parseText(trssTestJobNames) + + // For each test job (including testList subjobs), we now search for the reproducibility test. + assert testJobNamesJson instanceof List + for ( Map testJob in testJobNamesJson ) { + def wgetUrl = "${testJob.buildUrl}/consoleText" + if (testJob.buildOutputId != null) { + wgetUrl = "${trssURL}/api/getOutputById?id=${testJob.buildOutputId}" + } + + def testOutput = callWgetSafely(wgetUrl) + + // If we can find it, then we look for the anticipated percentage. + if ( !testOutput.contains("Running test "+reproTestName) ) { + echo "The following test's output does not contain ${reproTestName}, so we are skipping it: ${wgetUrl}" + continue + } + + results[jdkVersion][1][onePlatform] = "???% - ${reproTestName} ran but failed to produce a percentage. Test Link: " + testJob.buildUrl + // Now we know the test ran, + def matcherObject = testOutput =~ /ReproduciblePercent = (100|[0-9][0-9]?\.?[0-9]?[0-9]?) %/ + if ( matcherObject ) { + results[jdkVersion][1][onePlatform] = ((matcherObject[0] =~ /(100|[0-9][0-9]?\.?[0-9]?[0-9]?) %/)[0][0]) } } } - results[jdkVersion][1][onePlatform] = platformResult } // Now we have the percentages for each platform, we calculate the jdkVersion-specific average. BigDecimal overallAverage = 0.0 // Ignoring the platforms where the test is not available yet. def naCount = 0 - results[jdkVersion][1].each{key, value -> + for (String key in results[jdkVersion][1].keySet()) { + def value = results[jdkVersion][1][key] if (value.equals("NA")) { naCount++ } else if ( value ==~ /^[0-9]+\.?[0-9]* %/ ) { @@ -437,9 +578,11 @@ def getReproducibilityPercentage(String jdkVersion, String trssId, String trssUR } // else do nothing, as we presume non-integer and non-NA values are 0. } + if (overallAverage != 0) { overallAverage = overallAverage / (results[jdkVersion][1].size() - naCount) } + // This reduces the output to 2 decimal places. results[jdkVersion][0] = ((overallAverage.toString()) =~ /[0-9]+\.?[0-9]?[0-9]?/)[0]+" %" } @@ -492,7 +635,7 @@ node('worker') { extraFilter = "architecture=x64&os=alpine-linux&" } - def assets = sh(returnStdout: true, script: "wget -q -O - '${apiUrl}/v3/assets/feature_releases/${featureReleaseInt}/ea?${extraFilter}image_type=jdk&sort_method=DATE&pages=1&jvm_impl=${apiVariant}'") + def assets = callWgetSafely("'${apiUrl}/v3/assets/feature_releases/${featureReleaseInt}/ea?${extraFilter}image_type=jdk&sort_method=DATE&pages=1&jvm_impl=${apiVariant}'") def assetsJson = new JsonSlurper().parseText(assets) def status = [] @@ -571,7 +714,7 @@ node('worker') { } // Get top level builds names - def trssBuildNames = sh(returnStdout: true, script: "wget -q -O - ${trssUrl}/api/getTopLevelBuildNames?type=Test") + def trssBuildNames = callWgetSafely("${trssUrl}/api/getTopLevelBuildNames?type=Test") def buildNamesJson = new JsonSlurper().parseText(trssBuildNames) buildNamesJson.each { build -> // Is it a build Pipeline? @@ -582,7 +725,7 @@ node('worker') { // Are we interested in this pipeline? if (pipelinesOfInterest.contains(pipelineName)) { // Find all the "Done" pipeline builds in the last 7 days, started by "timer", or upstream project "build-scripts/utils/betaTrigger_" - def pipeline = sh(returnStdout: true, script: "wget -q -O - ${trssUrl}/api/getBuildHistory?buildName=${pipelineName}") + def pipeline = callWgetSafely("${trssUrl}/api/getBuildHistory?buildName=${pipelineName}") def pipelineJson = new JsonSlurper().parseText(pipeline) if (pipelineJson.size() > 0) { // Find first in list started by "timer", "build-scripts/utils/betaTrigger_" or "build-scripts/utils/releaseTrigger_" @@ -625,7 +768,7 @@ node('worker') { // Was job a "match"? if (pipeline_id != null) { // Get all child Test jobs for this pipeline job - def pipelineTestJobs = sh(returnStdout: true, script: "wget -q -O - ${trssUrl}/api/getAllChildBuilds?parentId=${pipeline_id}\\&buildNameRegex=^Test_.*${testVariant}.*") + def pipelineTestJobs = callWgetSafely("${trssUrl}/api/getAllChildBuilds?parentId=${pipeline_id}\\&buildNameRegex=^Test_.*${testVariant}.*") def pipelineTestJobsJson = new JsonSlurper().parseText(pipelineTestJobs) if (pipelineTestJobsJson.size() > 0) { testJobNumber = pipelineTestJobsJson.size() @@ -645,7 +788,7 @@ node('worker') { } } // Get all child Build jobs for this pipeline job - def pipelineBuildJobs = sh(returnStdout: true, script: "wget -q -O - ${trssUrl}/api/getChildBuilds?parentId=${pipeline_id}") + def pipelineBuildJobs = callWgetSafely("${trssUrl}/api/getChildBuilds?parentId=${pipeline_id}") def pipelineBuildJobsJson = new JsonSlurper().parseText(pipelineBuildJobs) buildJobNumber = 0 pipelineBuildJobsJson.each { buildJob -> @@ -810,15 +953,20 @@ node('worker') { } } - def testsShouldHaveRun = false - if ( probableBuildUrl != "" && sh(returnStdout: true, script: "wget -q -O - ${trssUrl}/api/getBuildHistory?buildUrl=${probableBuildUrl}") ==~ /.*name.:.enableTests.,.value.:true.*/ ) { - testsShouldHaveRun = true - } if (reproducibleBuilds.containsKey(featureRelease)) { - if (testsShouldHaveRun) { - getReproducibilityPercentage(featureRelease, probableBuildIdForTRSS, trssUrl, reproducibleBuilds) - if ( reproducibleBuilds[featureRelease][0] != "100%") { - slackColor = 'danger' + def (reproBuildUrl, reproBuildTrss, reproBuildStatus) = getBuildUrl(trssUrl, variant, featureRelease, releaseName.replaceAll("-beta", ""), releaseName.replaceAll("-beta", "").replaceAll("-ea", "")+"_adopt") + + if ( reproBuildUrl != "" && callWgetSafely("${trssUrl}/api/getBuildHistory?buildUrl=${reproBuildUrl}") ==~ /.*name.:.enableTests.,.value.:true.*/ ) { + echo "This pipeline has testing enabled: ${reproBuildUrl}" + echo "This pipeline's current status is ${reproBuildStatus}" + + getReproducibilityPercentage(featureRelease, reproBuildTrss, trssUrl, releaseName, reproducibleBuilds) + + if ( ! reproducibleBuilds[featureRelease][0].startsWith("100") ) { + + if (!slackColor.equals('danger')) { + slackColor = 'warning' + } health = "Unhealthy" def summaryOfRepros = "" echo "Build reproducibility percentages for " + featureRelease + " did not add up to 100%. Breakdown: " @@ -841,8 +989,9 @@ node('worker') { errorMsg += "\nBuild repro summary: "+summaryOfRepros } } else { - // Ignore test results if the tests for this pipeline were intentionally disabled. + // Ignore test results if the tests for this pipeline were intentionally disabled, or if we cannot find a likely pipeline job. reproducibleBuilds[featureRelease][0] = "N/A - Tests disabled" + echo "This pipeline is either a blank string, or does not have testing enabled: ${reproBuildUrl}" } } } From 77da5695d8a14652ece5b0b269b53e8b6d0d015f Mon Sep 17 00:00:00 2001 From: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:10:54 +0000 Subject: [PATCH 16/30] Improve build pipeline summary publish link text with build failure warning (#1150) * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard * Add pipeline publish link warning if job fails Signed-off-by: Andrew Leonard --------- Signed-off-by: Andrew Leonard --- pipelines/build/common/build_base_file.groovy | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/pipelines/build/common/build_base_file.groovy b/pipelines/build/common/build_base_file.groovy index 279971091..c794a062a 100644 --- a/pipelines/build/common/build_base_file.groovy +++ b/pipelines/build/common/build_base_file.groovy @@ -776,11 +776,17 @@ class Builder implements Serializable { /* Call job to push artifacts to github. Usually it's only executed on a nightly build */ - def publishBinary(IndividualBuildConfig config=null) { + def publishBinary(IndividualBuildConfig config=null, String jobResult, String jobUrl) { def timestamp = new Date().format('yyyy-MM-dd-HH-mm', TimeZone.getTimeZone('UTC')) def javaVersion=determineReleaseToolRepoVersion() def stageName = 'BETA publish' def releaseComment = 'BETA publish' + def releaseWarning = '' + if ( jobResult != "SUCCESS" && jobResult != "UNSTABLE" ) { + // Build was not successful, add warning and link to build job + releaseWarning = 'WARNING: pipeline status was ' + jobResult + ' : ' + } + def tag = "${javaToBuild}-${timestamp}" if (publishName) { tag = publishName @@ -828,7 +834,7 @@ class Builder implements Serializable { releaseToolUrl += "&TAG=${tag}&UPSTREAM_JOB_NAME=${urlJobName}&ARTIFACTS_TO_COPY=${artifactsToCopy}" context.echo "return releaseToolUrl is ${releaseToolUrl}" - return ["${releaseToolUrl}", "${releaseComment}"] + return ["${releaseToolUrl}", "${releaseComment}", "${releaseWarning}"] } /* @@ -975,8 +981,8 @@ class Builder implements Serializable { copyArtifactSuccess = true if (release) { - def (String releaseToolUrl, String releaseComment) = publishBinary(config) - releaseSummary.appendText("
  • ${releaseComment} ${config.VARIANT} ${publishName} ${config.TARGET_OS} ${config.ARCHITECTURE}
  • ") + def (String releaseToolUrl, String releaseComment, String releaseWarning) = publishBinary(config, downstreamJob.getResult(), downstreamJob.getAbsoluteUrl()) + releaseSummary.appendText("
  • ${releaseWarning} ${releaseComment} ${config.VARIANT} ${publishName} ${config.TARGET_OS} ${config.ARCHITECTURE}
  • ") } } } @@ -1014,17 +1020,20 @@ class Builder implements Serializable { flatten: true, optional: true ) - // Archive tap files as a single tar file - context.sh """ - cd ${tarDir}/ - tar -czf ${tarTap} *.tap - """ - try { - context.timeout(time: pipelineTimeouts.ARCHIVE_ARTIFACTS_TIMEOUT, unit: 'HOURS') { - context.archiveArtifacts artifacts: "${tarDir}/${tarTap}" + // Archive tap files as a single tar file if we have any + def tapExists = context.sh(script: "ls -l ${tarDir}/*.tap", returnStatus:true) + if (tapExists == 0) { + context.sh """ + cd ${tarDir}/ + tar -czf ${tarTap} *.tap + """ + try { + context.timeout(time: pipelineTimeouts.ARCHIVE_ARTIFACTS_TIMEOUT, unit: 'HOURS') { + context.archiveArtifacts artifacts: "${tarDir}/${tarTap}" + } + } catch (FlowInterruptedException e) { + throw new Exception("[ERROR] Archive AQAvitTapFiles.tar.gz timeout Exiting...") } - } catch (FlowInterruptedException e) { - throw new Exception("[ERROR] Archive AQAvitTapFiles.tar.gz timeout Exiting...") } } } @@ -1052,8 +1061,8 @@ class Builder implements Serializable { } else { try { context.timeout(time: pipelineTimeouts.PUBLISH_ARTIFACTS_TIMEOUT, unit: 'HOURS') { - def (String releaseToolUrl, String releaseComment) = publishBinary() - releaseSummary.appendText("
  • ${releaseComment} Rerun Link
  • ") + def (String releaseToolUrl, String releaseComment, String releaseWarning) = publishBinary(null, currentBuild.result, "${context.BUILD_URL}") + releaseSummary.appendText("
  • ${releaseWarning} ${releaseComment} Rerun Link
  • ") } } catch (FlowInterruptedException e) { throw new Exception("[ERROR] Publish binary timeout (${pipelineTimeouts.PUBLISH_ARTIFACTS_TIMEOUT} HOURS) has been reached OR the downstream publish job failed. Exiting...") From 782ebb0ffc5fbf9947dfb6c9065648e47bab2c7f Mon Sep 17 00:00:00 2001 From: Stewart X Addison <6487691+sxa@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:48:18 +0000 Subject: [PATCH 17/30] Set all windows pipelines to use vs2022 label as that is what they are configured to run with (#1151) Signed-off-by: Stewart X Addison --- pipelines/jobs/configurations/jdk11u_pipeline_config.groovy | 6 +++--- pipelines/jobs/configurations/jdk17u_pipeline_config.groovy | 6 +++--- pipelines/jobs/configurations/jdk8u_pipeline_config.groovy | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy index 8e16dc941..697860168 100644 --- a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy @@ -71,7 +71,7 @@ class Config11 { os : 'windows', arch : 'x64', additionalNodeLabels: [ - temurin: 'win2022&&vs2019', + temurin: 'win2022&&vs2022', openj9: 'win2012&&vs2017', dragonwell: 'win2012' ], @@ -87,7 +87,7 @@ class Config11 { x32Windows: [ os : 'windows', arch : 'x86-32', - additionalNodeLabels: 'win2022&&vs2019', + additionalNodeLabels: 'win2022&&vs2022', configureArgs : [ 'temurin' : '--disable-ccache' ], @@ -247,7 +247,7 @@ class Config11 { os : 'windows', arch : 'aarch64', crossCompile : 'x64', - additionalNodeLabels: 'win2022&&vs2019', + additionalNodeLabels: 'win2022&&vs2022', test : 'default', configureArgs : [ 'temurin' : '--disable-ccache' diff --git a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy index 3aa7991af..28a2d6ed1 100644 --- a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy @@ -68,7 +68,7 @@ class Config17 { x64Windows: [ os : 'windows', arch : 'x64', - additionalNodeLabels: 'win2022&&vs2019', + additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' @@ -78,7 +78,7 @@ class Config17 { x32Windows: [ os : 'windows', arch : 'x86-32', - additionalNodeLabels: 'win2022&&vs2019', + additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ 'temurin' : '--jvm-variant client,server --create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' @@ -177,7 +177,7 @@ class Config17 { os : 'windows', arch : 'aarch64', crossCompile : 'x64', - additionalNodeLabels: 'win2022&&vs2019', + additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' diff --git a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy index 00be49c5c..9879a1aca 100644 --- a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy @@ -68,7 +68,7 @@ class Config8 { x64Windows : [ os : 'windows', arch : 'x64', - additionalNodeLabels: 'win2022&&vs2017', + additionalNodeLabels: 'win2022&&vs2022', test : 'default', configureArgs : [ 'temurin' : '--disable-ccache' From 562ec67b59ee0ee652bf7e86ef460abaf6c76b2c Mon Sep 17 00:00:00 2001 From: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:30:52 +0000 Subject: [PATCH 18/30] For jdk8u aarch32|alpine beta triggers check for existance of a specific asset (#1153) * Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard * Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard * Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard * Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard * Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard * Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard * Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard * Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard * Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard * Make trigger_beta job check specific jdk8u aarch32 and alpine assests exist Signed-off-by: Andrew Leonard --------- Signed-off-by: Andrew Leonard --- .../build/common/trigger_beta_build.groovy | 71 +++++++++++++++---- 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/pipelines/build/common/trigger_beta_build.groovy b/pipelines/build/common/trigger_beta_build.groovy index 947ac2435..124c79677 100644 --- a/pipelines/build/common/trigger_beta_build.groovy +++ b/pipelines/build/common/trigger_beta_build.groovy @@ -114,6 +114,47 @@ def loadTargetConfigurations(String javaVersion, String variant, String configSe return targetConfigurationsForVariant } +// Verify the given published release tag contains the given asset architecture +def checkJDKAssetExistsForArch(String binariesRepo, String version, String releaseTag, String arch) { + def assetExists = false + + echo "Verifying ${version} JDK asset for ${arch} in release: ${releaseTag}" + + def escRelease = releaseTag.replaceAll("\\+", "%2B") + def releaseAssetsUrl = binariesRepo.replaceAll("github.com","api.github.com/repos") + "/releases/tags/${escRelease}" + + // Get list of assets, concatenate into a single string + def rc = sh(script: 'rm -f releaseAssets.json && curl -L -o releaseAssets.json '+releaseAssetsUrl, returnStatus: true) + def releaseAssets = "" + if (rc == 0) { + releaseAssets = sh(script: "cat releaseAssets.json | grep '\"name\"' | tr '\\n' '#'", returnStdout: true) + } + + if (releaseAssets == "") { + echo "No release assets for ${releaseAssetsUrl}" + } else { + // Work out the JDK artifact filetype + def filetype + if (arch.contains("windows")) { + filetype = "\\.zip" + } else { + filetype = "\\.tar\\.gz" + } + + def findAsset = releaseAssets =~/.*jdk_${arch}_[^"]*${filetype}".*/ + if (findAsset) { + assetExists = true + } + } + + if (assetExists) { + echo "${arch} JDK asset for version ${version} tag ${releaseTag} exists" + } else { + echo "${arch} JDK asset for version ${version} tag ${releaseTag} NOT FOUND" + } + return assetExists +} + node('worker') { def adopt_tag_search if (version == 8) { @@ -170,14 +211,22 @@ node('worker') { echo "Version "+versionStr+" already has a GA tag so not triggering a MAIN build" } - // Check binaries repo for existance of the given release? - echo "Checking if ${binariesRepoTag} is already published?" - def desiredRepoTagURL="${binariesRepo}/releases/tag/${binariesRepoTag}" - def httpCode=sh(script:"curl -s -o /dev/null -w '%{http_code}' "+desiredRepoTagURL, returnStdout:true) + // Check binaries repo for existance of the given release tag having being already built? + def jdkAssetToCheck = "x64_linux" + if (mirrorRepo.contains("aarch32-jdk8u")) { + // aarch32-jdk8u built in its own pipeline + jdkAssetToCheck = "arm_linux" + } else if (mirrorRepo.contains("alpine-jdk8u")) { + // alpine-jdk8u built in its own pipeline + jdkAssetToCheck = "x64_alpine-linux" + } + + echo "Checking if ${binariesRepoTag} is already published for JDK asset ${jdkAssetToCheck} ?" + def assetExists = checkJDKAssetExistsForArch(binariesRepo, versionStr, binariesRepoTag, jdkAssetToCheck) - if (httpCode == "200") { + if (assetExists) { echo "Build tag ${binariesRepoTag} is already published - nothing to do" - } else if (httpCode == "404") { + } else { echo "New unpublished build tag ${binariesRepoTag} - triggering builds" if (gaTagCheck == 0) { echo "Version "+versionStr+" already has a GA tag so not triggering a MAIN build" @@ -185,10 +234,6 @@ node('worker') { triggerMainBuild = true } triggerEvaluationBuild = true - } else { - def error = "Unexpected HTTP code ${httpCode} when querying for existing build tag at $desiredRepoTagURL" - echo "${error}" - throw new Exception("${error}") } } else { echo "FORCE triggering specified builds.." @@ -232,12 +277,14 @@ if (triggerMainBuild || triggerEvaluationBuild) { def jobs = [:] def pipelines = [:] - if (triggerMainBuild) { + // Trigger Main pipeline as long as we have a non-empty target configuration + if (triggerMainBuild && mainTargetConfigurations != "{}") { pipelines["main"] = "build-scripts/openjdk${version}-pipeline" echo "main build targetConfigurations:" echo JsonOutput.prettyPrint(mainTargetConfigurations) } - if (triggerEvaluationBuild) { + // Trigger Evaluation as long as we have a non-empty target configuration + if (triggerEvaluationBuild && evaluationTargetConfigurations != "{}") { pipelines["evaluation"] = "build-scripts/evaluation-openjdk${version}-pipeline" echo "evaluation build targetConfigurations:" echo JsonOutput.prettyPrint(evaluationTargetConfigurations) From fb9c8214d1625fe468b1ecb6968aa15e6682eb07 Mon Sep 17 00:00:00 2001 From: Stewart X Addison <6487691+sxa@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:13:49 +0000 Subject: [PATCH 19/30] windows: switch to running builds in docker containers (#1155) Signed-off-by: Stewart X Addison --- pipelines/jobs/configurations/jdk11u_pipeline_config.groovy | 3 +++ pipelines/jobs/configurations/jdk17u_pipeline_config.groovy | 3 +++ pipelines/jobs/configurations/jdk21u_pipeline_config.groovy | 2 ++ pipelines/jobs/configurations/jdk23u_pipeline_config.groovy | 2 ++ pipelines/jobs/configurations/jdk24_pipeline_config.groovy | 2 ++ pipelines/jobs/configurations/jdk8u_pipeline_config.groovy | 2 ++ 6 files changed, 14 insertions(+) diff --git a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy index 697860168..0a3ab868e 100644 --- a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy @@ -70,6 +70,7 @@ class Config11 { x64Windows: [ os : 'windows', arch : 'x64', + dockerImage : 'win2022_notrhel_image', additionalNodeLabels: [ temurin: 'win2022&&vs2022', openj9: 'win2012&&vs2017', @@ -87,6 +88,7 @@ class Config11 { x32Windows: [ os : 'windows', arch : 'x86-32', + dockerImage : 'win2022_notrhel_image', additionalNodeLabels: 'win2022&&vs2022', configureArgs : [ 'temurin' : '--disable-ccache' @@ -246,6 +248,7 @@ class Config11 { aarch64Windows: [ os : 'windows', arch : 'aarch64', + dockerImage : 'win2022_notrhel_image', crossCompile : 'x64', additionalNodeLabels: 'win2022&&vs2022', test : 'default', diff --git a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy index 28a2d6ed1..3cc96a97e 100644 --- a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy @@ -68,6 +68,7 @@ class Config17 { x64Windows: [ os : 'windows', arch : 'x64', + dockerImage : 'win2022_notrhel_image', additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ @@ -78,6 +79,7 @@ class Config17 { x32Windows: [ os : 'windows', arch : 'x86-32', + dockerImage : 'win2022_notrhel_image', additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ @@ -176,6 +178,7 @@ class Config17 { aarch64Windows: [ os : 'windows', arch : 'aarch64', + dockerImage : 'win2022_notrhel_image', crossCompile : 'x64', additionalNodeLabels: 'win2022&&vs2022', test : 'default', diff --git a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy index e7208adbd..827222203 100644 --- a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy @@ -66,6 +66,7 @@ class Config21 { x64Windows: [ os : 'windows', arch : 'x64', + dockerImage : 'win2022_notrhel_image', additionalNodeLabels: 'win2022&&vs2022', test: [ weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] @@ -161,6 +162,7 @@ class Config21 { aarch64Windows: [ os : 'windows', arch : 'aarch64', + dockerImage : 'win2022_notrhel_image', crossCompile : 'x64', additionalNodeLabels: 'win2022&&vs2022', test : 'default', diff --git a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy index 527995b43..04f845a49 100644 --- a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy @@ -67,6 +67,7 @@ class Config23 { x64Windows: [ os : 'windows', arch : 'x64', + dockerImage : 'win2022_notrhel_image', additionalNodeLabels: 'win2022&&vs2022', test: [ weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] @@ -162,6 +163,7 @@ class Config23 { aarch64Windows: [ os : 'windows', arch : 'aarch64', + dockerImage : 'win2022_notrhel_image', crossCompile : 'x64', additionalNodeLabels: 'win2022&&vs2022', test : 'default', diff --git a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy index ebca0f466..60e0d80d7 100644 --- a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy @@ -67,6 +67,7 @@ class Config24 { x64Windows: [ os : 'windows', arch : 'x64', + dockerImage : 'win2022_notrhel_image', additionalNodeLabels: 'win2022&&vs2022', test: [ weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] @@ -162,6 +163,7 @@ class Config24 { aarch64Windows: [ os : 'windows', arch : 'aarch64', + dockerImage : 'win2022_notrhel_image', crossCompile : 'x64', additionalNodeLabels: 'win2022&&vs2022', test : 'default', diff --git a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy index 9879a1aca..2c30bec98 100644 --- a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy @@ -68,6 +68,7 @@ class Config8 { x64Windows : [ os : 'windows', arch : 'x64', + dockerImage : 'win2022_notrhel_image', additionalNodeLabels: 'win2022&&vs2022', test : 'default', configureArgs : [ @@ -81,6 +82,7 @@ class Config8 { x32Windows : [ os : 'windows', arch : 'x86-32', + dockerImage : 'win2022_notrhel_image', additionalNodeLabels: 'win2022', configureArgs : [ 'temurin' : '--disable-ccache' From 4c30388d2fa94761fd068051fe6fe72470bea5d0 Mon Sep 17 00:00:00 2001 From: sophia-guo Date: Tue, 10 Dec 2024 21:38:54 -0500 Subject: [PATCH 20/30] Add special.system for JDK21+ mac64 and reset variables inside the parallel (#1160) --- pipelines/build/common/openjdk_build_pipeline.groovy | 10 +++++----- .../jobs/configurations/jdk21u_pipeline_config.groovy | 4 +++- .../jobs/configurations/jdk23u_pipeline_config.groovy | 4 +++- .../jobs/configurations/jdk24_pipeline_config.groovy | 4 +++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 04010a1e6..80da212e8 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -389,10 +389,6 @@ class Build { def jdkBranch = getJDKBranch() def jdkRepo = getJDKRepo() def openj9Branch = (buildConfig.SCM_REF && buildConfig.VARIANT == 'openj9') ? buildConfig.SCM_REF : 'master' - - def vendorTestRepos = '' - def vendorTestBranches = '' - def vendorTestDirs = '' List testList = buildConfig.TEST_LIST def enableTestDynamicParallel = Boolean.valueOf(buildConfig.ENABLE_TESTDYNAMICPARALLEL) def aqaBranch = 'master' @@ -411,7 +407,6 @@ class Build { testTime = '120' parallel = 'Dynamic' } - def testLabel = '' testList.each { testType -> // For each requested test, i.e 'sanity.openjdk', 'sanity.system', 'sanity.perf', 'sanity.external', call test job @@ -446,10 +441,14 @@ class Build { } } + def testLabel = '' // Eclipse Adoptium Temurin reproducible comparing on x64 mac required to run on aarch64 mac if (testType == 'special.system' && jobName.contains('x86-64_mac') && buildConfig.VARIANT == 'temurin') { testLabel = 'ci.role.test&&hw.arch.aarch64&&(sw.os.osx||sw.os.mac)' } + def vendorTestRepos = '' + def vendorTestBranches = '' + def vendorTestDirs = '' if (testType == 'special.system' || testType == 'dev.system') { def useAdoptShellScripts = Boolean.valueOf(buildConfig.USE_ADOPT_SHELL_SCRIPTS) vendorTestBranches = useAdoptShellScripts ? ADOPT_DEFAULTS_JSON['repository']['build_branch'] : DEFAULTS_JSON['repository']['build_branch'] @@ -2478,6 +2477,7 @@ def buildScriptsAssemble( } catch (Exception e) { currentBuild.result = 'FAILURE' context.println "Execution error: ${e}" + def sw = new StringWriter() def pw = new PrintWriter(sw) e.printStackTrace(pw) diff --git a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy index 827222203..4c6c5b7a6 100644 --- a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy @@ -8,7 +8,9 @@ class Config21 { additionalTestLabels: [ openj9 : '!sw.os.osx.10_11' ], - test : 'default', + test: [ + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] + ], configureArgs : '--enable-dtrace', buildArgs : [ 'temurin' : '--create-jre-image --create-sbom' diff --git a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy index 04f845a49..c8a696c86 100644 --- a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy @@ -9,7 +9,9 @@ class Config23 { openj9 : '!sw.os.osx.10_11', temurin : '!sw.os.osx.10_14' ], - test : 'default', + test: [ + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] + ], configureArgs : '--enable-dtrace', buildArgs : [ 'temurin' : '--create-jre-image --create-sbom' diff --git a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy index 60e0d80d7..21af1a295 100644 --- a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy @@ -9,7 +9,9 @@ class Config24 { openj9 : '!sw.os.osx.10_11', temurin : '!sw.os.osx.10_14' ], - test : 'default', + test: [ + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] + ], configureArgs : '--enable-dtrace', buildArgs : [ 'temurin' : '--create-jre-image --create-sbom' From 98add170bbc52fc3828ea74beabab08656bb4179 Mon Sep 17 00:00:00 2001 From: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:24:01 +0000 Subject: [PATCH 21/30] Prevent multiple Windows exe/dll signing and verify (#1157) * Update verify_signing.groovy to check Windows exes only have one signature Signed-off-by: Andrew Leonard * Update verify_signing.groovy to check Windows exes only have one signature Signed-off-by: Andrew Leonard * Update verify_signing.groovy to check Windows exes only have one signature Signed-off-by: Andrew Leonard * Update verify_signing.groovy to check Windows exes only have one signature Signed-off-by: Andrew Leonard * Prevent jdk11+ from running external sign.sh as already signed during build Signed-off-by: Andrew Leonard * Prevent jdk11+ from running external sign.sh as already signed during build Signed-off-by: Andrew Leonard * Prevent jdk11+ from running external sign.sh as already signed during build Signed-off-by: Andrew Leonard * Prevent jdk11+ from running external sign.sh as already signed during build Signed-off-by: Andrew Leonard * Prevent jdk11+ from running external sign.sh as already signed during build Signed-off-by: Andrew Leonard * Prevent jdk11+ from running external sign.sh as already signed during build Signed-off-by: Andrew Leonard * Prevent jdk11+ from running external sign.sh as already signed during build Signed-off-by: Andrew Leonard * Prevent jdk11+ from running external sign.sh as already signed during build Signed-off-by: Andrew Leonard * Prevent jdk11+ from running external sign.sh as already signed during build Signed-off-by: Andrew Leonard * Prevent jdk11+ from running external sign.sh as already signed during build Signed-off-by: Andrew Leonard * Prevent jdk11+ from running external sign.sh as already signed during build Signed-off-by: Andrew Leonard --------- Signed-off-by: Andrew Leonard --- .../common/openjdk_build_pipeline.groovy | 96 ++++++++++--------- pipelines/build/common/verify_signing.groovy | 27 +++++- 2 files changed, 75 insertions(+), 48 deletions(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 80da212e8..488eb908e 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -1557,57 +1557,67 @@ class Build { fi for f in $FILES do - echo "Signing $f using Eclipse Foundation codesign service" dir=$(dirname "$f") file=$(basename "$f") - mv "$f" "${dir}/unsigned_${file}" - success=false - if [ "${base_os}" == "mac" ]; then - if ! curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" -F entitlements="@$ENTITLEMENTS" https://cbi.eclipse.org/macos/codesign/sign; then - echo "curl command failed, sign of $f failed" - else - success=true - fi - else - if ! curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" https://cbi.eclipse.org/authenticode/sign; then - echo "curl command failed, sign of $f failed" - else - success=true + ms_file_skipped=false + if [ "${base_os}" == "windows" ]; then + # Check if file is a Microsoft supplied file that is already signed + if [[ "$file" =~ api-ms-win.* ]] || [[ "$file" =~ msvcp.* ]] || [[ "$file" =~ ucrtbase.* ]] || [[ "$file" =~ vcruntime.* ]]; then + echo "Skipping Microsoft file $file" + ms_file_skipped=true fi fi - if [ $success == false ]; then - # Retry up to 20 times - max_iterations=20 - iteration=1 - echo "Code Not Signed For File $f" - while [ $iteration -le $max_iterations ] && [ $success = false ]; do - echo $iteration Of $max_iterations - sleep 1 - if [ "${base_os}" == "mac" ]; then - if curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" -F entitlements="@$ENTITLEMENTS" https://cbi.eclipse.org/macos/codesign/sign; then - success=true - fi + if [ $ms_file_skipped == false ]; then + echo "Signing $f using Eclipse Foundation codesign service" + mv "$f" "${dir}/unsigned_${file}" + success=false + if [ "${base_os}" == "mac" ]; then + if ! curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" -F entitlements="@$ENTITLEMENTS" https://cbi.eclipse.org/macos/codesign/sign; then + echo "curl command failed, sign of $f failed" else - if curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" https://cbi.eclipse.org/authenticode/sign; then - success=true - fi + success=true fi - - if [ $success = false ]; then - echo "curl command failed, $f Failed Signing On Attempt $iteration" - iteration=$((iteration+1)) - if [ $iteration -gt $max_iterations ] - then - echo "Errors Encountered During Signing" - exit 1 - fi + else + if ! curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" https://cbi.eclipse.org/authenticode/sign; then + echo "curl command failed, sign of $f failed" else - echo "$f Signed OK On Attempt $iteration" + success=true fi - done - fi - chmod --reference="${dir}/unsigned_${file}" "$f" - rm -rf "${dir}/unsigned_${file}" + fi + if [ $success == false ]; then + # Retry up to 20 times + max_iterations=20 + iteration=1 + echo "Code Not Signed For File $f" + while [ $iteration -le $max_iterations ] && [ $success = false ]; do + echo $iteration Of $max_iterations + sleep 1 + if [ "${base_os}" == "mac" ]; then + if curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" -F entitlements="@$ENTITLEMENTS" https://cbi.eclipse.org/macos/codesign/sign; then + success=true + fi + else + if curl --fail --silent --show-error -o "$f" -F file="@${dir}/unsigned_${file}" https://cbi.eclipse.org/authenticode/sign; then + success=true + fi + fi + + if [ $success = false ]; then + echo "curl command failed, $f Failed Signing On Attempt $iteration" + iteration=$((iteration+1)) + if [ $iteration -gt $max_iterations ] + then + echo "Errors Encountered During Signing" + exit 1 + fi + else + echo "$f Signed OK On Attempt $iteration" + fi + done + fi + chmod --reference="${dir}/unsigned_${file}" "$f" + rm -rf "${dir}/unsigned_${file}" + fi # ms_file_skipped == false done ''' // groovylint-enable diff --git a/pipelines/build/common/verify_signing.groovy b/pipelines/build/common/verify_signing.groovy index 25e7bebbc..f28bd4264 100644 --- a/pipelines/build/common/verify_signing.groovy +++ b/pipelines/build/common/verify_signing.groovy @@ -22,6 +22,7 @@ Parameters: - TARGET_OS : "mac" or "windows" - TARGET_ARCH : "aarch64 or "x64" or "x86-32" - NODE_LABEL : Jenkins label for where to run + - CERT_ISSUED_TO : Issued to org name to verify Windows Signatures */ @@ -112,7 +113,7 @@ void unpackArchives(String unpack_dir, String[] archives) { } // Verify executables for Signatures -void verifyExecutables(String unpack_dir) { +void verifyExecutables(String unpack_dir, String issueToOrg) { if (params.TARGET_OS == "mac") { // On Mac find all dylib's and "executable" binaries // Ignore "legal" text folder to reduce the number of non-extension files it finds... @@ -167,7 +168,7 @@ void verifyExecutables(String unpack_dir) { // Find all exe/dll's that must be Signed - withEnv(['unpack_dir='+unpack_dir, 'signtool='+signtool]) { + withEnv(['unpack_dir='+unpack_dir, 'signtool='+signtool, 'issueToOrg='+issueToOrg]) { // groovylint-disable sh ''' #!/bin/bash @@ -185,8 +186,24 @@ void verifyExecutables(String unpack_dir) { unsigned="$unsigned $f" cc_unsigned=$((cc_unsigned+1)) else - echo "Signed correctly: ${f}" - cc_signed=$((cc_signed+1)) + num_microsoft_sigs=$("${signtool}" verify /v /all /pa ${f} | grep "Issued to:" | grep "Microsoft" | wc -l) + num_org_sigs=$("${signtool}" verify /v /all /pa ${f} | grep "Issued to:" | grep "${issueToOrg}" | wc -l) + if [[ "$num_microsoft_sigs" -ne 0 ]] && [[ "$num_org_sigs" -ne 0 ]]; then + echo "Error: ${f} should not be signed by ${issueToOrg} as it is already signed by Microsoft." + unsigned="$unsigned $f" + cc_unsigned=$((cc_unsigned+1)) + elif [[ "$num_microsoft_sigs" -eq 0 ]] && [[ "$num_org_sigs" -gt 1 ]]; then + echo "Error: ${f} is signed by ${issueToOrg} ${num_org_sigs} times, it must only be signed once." + unsigned="$unsigned $f" + cc_unsigned=$((cc_unsigned+1)) + elif [[ "$num_microsoft_sigs" -eq 0 ]] && [[ "$num_org_sigs" -eq 0 ]]; then + echo "Error: ${f} is NOT signed by ${issueToOrg}." + unsigned="$unsigned $f" + cc_unsigned=$((cc_unsigned+1)) + else + echo "Signed correctly: ${f}" + cc_signed=$((cc_signed+1)) + fi fi done @@ -355,7 +372,7 @@ if (params.TARGET_OS != "mac" && params.TARGET_OS != "windows") { unpackArchives(unpack_dir, archives) // Verify all executables for Signatures - verifyExecutables(unpack_dir) + verifyExecutables(unpack_dir, "${params.CERT_ISSUED_TO}") // Verify installers (if built) are Signed and Notarized(mac only) verifyInstallers() From c092e0eb0c84696ab4b686746b755d89b0421d15 Mon Sep 17 00:00:00 2001 From: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Date: Wed, 11 Dec 2024 11:26:12 +0000 Subject: [PATCH 22/30] Add jdk25 pipeline configurations (#1161) Signed-off-by: Andrew Leonard --- pipelines/jobs/configurations/jdk25.groovy | 50 +++++ .../configurations/jdk25_evaluation.groovy | 9 + .../jdk25_pipeline_config.groovy | 181 ++++++++++++++++++ .../jobs/configurations/jdk25_release.groovy | 40 ++++ 4 files changed, 280 insertions(+) create mode 100644 pipelines/jobs/configurations/jdk25.groovy create mode 100644 pipelines/jobs/configurations/jdk25_evaluation.groovy create mode 100644 pipelines/jobs/configurations/jdk25_pipeline_config.groovy create mode 100644 pipelines/jobs/configurations/jdk25_release.groovy diff --git a/pipelines/jobs/configurations/jdk25.groovy b/pipelines/jobs/configurations/jdk25.groovy new file mode 100644 index 000000000..77256624b --- /dev/null +++ b/pipelines/jobs/configurations/jdk25.groovy @@ -0,0 +1,50 @@ +targetConfigurations = [ + 'x64Mac' : [ + 'temurin' + ], + 'x64Linux' : [ + 'temurin' + ], + 'x64AlpineLinux' : [ + 'temurin' + ], + 'aarch64AlpineLinux' : [ + 'temurin' + ], + 'x64Windows' : [ + 'temurin' + ], + 'aarch64Windows' : [ + 'temurin' + ], + 'ppc64Aix' : [ + 'temurin' + ], + 'ppc64leLinux': [ + 'temurin' + ], + 's390xLinux' : [ + 'temurin' + ], + 'aarch64Linux': [ + 'hotspot', + 'temurin' + ], + 'aarch64Mac': [ + 'temurin' + ], + 'riscv64Linux': [ + 'temurin' + ] +] + +// scmReferences to use for weekly release build +weekly_release_scmReferences = [ + 'hotspot' : '', + 'temurin' : '', + 'openj9' : '', + 'corretto' : '', + 'dragonwell' : '' +] + +return this diff --git a/pipelines/jobs/configurations/jdk25_evaluation.groovy b/pipelines/jobs/configurations/jdk25_evaluation.groovy new file mode 100644 index 000000000..420a3e2a8 --- /dev/null +++ b/pipelines/jobs/configurations/jdk25_evaluation.groovy @@ -0,0 +1,9 @@ +targetConfigurations = [] + +// scmReferences to use for weekly evaluation release build +weekly_evaluation_scmReferences = [ + 'hotspot' : '', + 'temurin' : '' +] + +return this diff --git a/pipelines/jobs/configurations/jdk25_pipeline_config.groovy b/pipelines/jobs/configurations/jdk25_pipeline_config.groovy new file mode 100644 index 000000000..b29112660 --- /dev/null +++ b/pipelines/jobs/configurations/jdk25_pipeline_config.groovy @@ -0,0 +1,181 @@ +class Config25 { + + final Map> buildConfigurations = [ + x64Mac : [ + os : 'mac', + arch : 'x64', + additionalNodeLabels: 'xcode15.0.1', + additionalTestLabels: [ + openj9 : '!sw.os.osx.10_11', + temurin : '!sw.os.osx.10_14' + ], + test: [ + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] + ], + configureArgs : '--enable-dtrace', + buildArgs : [ + 'temurin' : '--create-jre-image --create-sbom' + ] + ], + + x64Linux : [ + os : 'linux', + arch : 'x64', + dockerImage : 'adoptopenjdk/centos7_build_image', + dockerFile: [ + openj9 : 'pipelines/build/dockerFiles/cuda.dockerfile' + ], + test: [ + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'dev.openjdk', 'dev.functional', 'dev.system', 'special.system'] + ], + additionalTestLabels: [ + openj9 : '!(centos6||rhel6)', + temurin : '!(centos6||rhel6)' + ], + configureArgs : [ + 'openj9' : '--enable-dtrace', + 'temurin' : '--enable-dtrace' + ], + buildArgs : [ + 'temurin' : '--create-source-archive --create-jre-image --create-sbom --enable-sbom-strace --use-adoptium-devkit gcc-11.3.0-Centos7.9.2009-b03' + ] + ], + + x64AlpineLinux : [ + os : 'alpine-linux', + arch : 'x64', + dockerImage : 'adoptopenjdk/alpine3_build_image', + test : 'default', + configureArgs : '--enable-headless-only=yes', + buildArgs : [ + 'temurin' : '--create-jre-image --create-sbom --enable-sbom-strace' + ] + ], + + aarch64AlpineLinux : [ + os : 'alpine-linux', + arch : 'aarch64', + dockerImage : 'adoptopenjdk/alpine3_build_image', + test : 'default', + configureArgs : [ + 'openj9' : '--enable-headless-only=yes', + 'temurin' : '--enable-headless-only=yes --with-jobs=4' + ], + buildArgs : [ + 'temurin' : '--create-jre-image --create-sbom --enable-sbom-strace' + ] + ], + + x64Windows: [ + os : 'windows', + arch : 'x64', + dockerImage : 'win2022_notrhel_image', + additionalNodeLabels: 'win2022&&vs2022', + test: [ + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] + ], + buildArgs : [ + 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + ] + ], + + ppc64Aix : [ + os : 'aix', + arch : 'ppc64', + additionalNodeLabels: [ + temurin: 'openxl17&&aix720', + openj9: 'xlc16&&aix715' + ], + test : 'default', + additionalTestLabels: [ + temurin : 'sw.os.aix.7_2TL5' + ], + cleanWorkspaceAfterBuild: true, + buildArgs : [ + 'temurin' : '--create-jre-image --create-sbom' + ] + ], + + s390xLinux : [ + os : 'linux', + arch : 's390x', + dockerImage : 'rhel7_build_image', + test : 'default', + buildArgs : [ + 'temurin' : '--create-jre-image --create-sbom --enable-sbom-strace --use-adoptium-devkit gcc-11.3.0-Centos7.9.2009-b03' + ] + ], + + ppc64leLinux : [ + os : 'linux', + arch : 'ppc64le', + dockerImage : 'adoptopenjdk/centos7_build_image', + test: [ + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'special.system'] + ], + configureArgs : [ + 'openj9' : '--enable-dtrace' + ], + buildArgs : [ + 'temurin' : '--create-jre-image --create-sbom --enable-sbom-strace --use-adoptium-devkit gcc-11.3.0-Centos7.9.2009-b03' + ] + ], + + aarch64Linux : [ + os : 'linux', + arch : 'aarch64', + dockerImage : 'adoptopenjdk/centos7_build_image', + test: [ + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'special.system'] + ], + configureArgs : [ + 'openj9' : '--enable-dtrace', + 'temurin' : '--enable-dtrace --with-jobs=4' + ], + buildArgs : [ + 'temurin' : '--create-jre-image --create-sbom --enable-sbom-strace --use-adoptium-devkit gcc-11.3.0-Centos7.6.1810-b03' + ] + ], + + aarch64Mac: [ + os : 'mac', + arch : 'aarch64', + additionalNodeLabels: 'xcode15.0.1', + test: [ + weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] + ], + buildArgs : [ + 'temurin' : '--create-jre-image --create-sbom' + ] + ], + + riscv64Linux : [ + os : 'linux', + arch : 'riscv64', + crossCompile : 'qemustatic', + dockerImage : 'adoptopenjdk/ubuntu2004_build_image:linux-riscv64', + dockerArgs : '--platform linux/riscv64', + test : 'default', + configureArgs : '--enable-headless-only=yes --enable-dtrace', + buildArgs : [ + 'temurin' : '--create-jre-image --create-sbom' + ] + ], + + aarch64Windows: [ + os : 'windows', + arch : 'aarch64', + dockerImage : 'win2022_notrhel_image', + crossCompile : 'x64', + additionalNodeLabels: 'win2022&&vs2022', + test : 'default', + buildArgs : [ + 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + ] + ] + ] + +} + +Config25 config = new Config25() +return config.buildConfigurations diff --git a/pipelines/jobs/configurations/jdk25_release.groovy b/pipelines/jobs/configurations/jdk25_release.groovy new file mode 100644 index 000000000..04777f38b --- /dev/null +++ b/pipelines/jobs/configurations/jdk25_release.groovy @@ -0,0 +1,40 @@ +targetConfigurations = [ + 'x64Mac' : [ + 'temurin' + ], + 'x64Linux' : [ + 'temurin' + ], + 'x64AlpineLinux' : [ + 'temurin' + ], + 'aarch64AlpineLinux' : [ + 'temurin' + ], + 'x64Windows' : [ + 'temurin' + ], + 'aarch64Windows' : [ + 'temurin' + ], + 'ppc64Aix' : [ + 'temurin' + ], + 'ppc64leLinux': [ + 'temurin' + ], + 's390xLinux' : [ + 'temurin' + ], + 'aarch64Linux': [ + 'temurin' + ], + 'aarch64Mac': [ + 'temurin' + ], + 'riscv64Linux': [ + 'temurin' + ] +] + +return this From f5db088d29b7154c35ea443f6fe7d31fa016d6f9 Mon Sep 17 00:00:00 2001 From: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:27:35 +0000 Subject: [PATCH 23/30] Prevent build_job_generator regeneration from blowing up if no targetConfigurations (#1162) Signed-off-by: Andrew Leonard --- pipelines/build/regeneration/build_job_generator.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pipelines/build/regeneration/build_job_generator.groovy b/pipelines/build/regeneration/build_job_generator.groovy index 4a6962c0c..f58387705 100644 --- a/pipelines/build/regeneration/build_job_generator.groovy +++ b/pipelines/build/regeneration/build_job_generator.groovy @@ -211,7 +211,10 @@ node('worker') { checkoutUserPipelines() } - if (jenkinsCreds != '') { + if (targetConfigurations.size() == 0) { + println "[WARNING] No targetConfigurations to be generated for this version" + } else { + if (jenkinsCreds != '') { withCredentials([usernamePassword( credentialsId: "${JENKINS_AUTH}", usernameVariable: 'jenkinsUsername', @@ -240,7 +243,7 @@ node('worker') { jobType ).regenerate() } - } else { + } else { println '[WARNING] No Jenkins API Credentials have been provided! If your server does not have anonymous read enabled, you may encounter 403 api request error code.' regenerationScript( javaVersion, @@ -263,6 +266,7 @@ node('worker') { checkoutCreds, jobType ).regenerate() + } } println '[SUCCESS] All done!' } finally { From 0f1a7a9204411080a364b68ab6c8e97baa34dfa7 Mon Sep 17 00:00:00 2001 From: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:47:18 +0000 Subject: [PATCH 24/30] Update daily Slack status to handle multiple head repo versions jdk24 and jdk25 (#1163) * Prevent build_job_generator regeneration from blowing up if no targetConfigurations Signed-off-by: Andrew Leonard * Allow for multiple tip/head repo release versions Signed-off-by: Andrew Leonard * Allow for multiple tip/head repo release versions Signed-off-by: Andrew Leonard --------- Signed-off-by: Andrew Leonard --- tools/nightly_build_and_test_stats.groovy | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/nightly_build_and_test_stats.groovy b/tools/nightly_build_and_test_stats.groovy index 7ebcbca73..6b62a2298 100644 --- a/tools/nightly_build_and_test_stats.groovy +++ b/tools/nightly_build_and_test_stats.groovy @@ -57,7 +57,7 @@ def getPlatformReproTestMap() { // Check if the given tag is a -ga tag ? def isGaTag(String version, String tag) { - if (version == "${params.TIP_RELEASE}".trim()) { + if ("${params.TIP_RELEASES}".contains(version)) { // Tip release has no GA tags return false } @@ -595,7 +595,7 @@ node('worker') { def apiUrl = "${params.API_URL}" def slackChannel = "${params.SLACK_CHANNEL}" def featureReleases = "${params.FEATURE_RELEASES}".split("[, ]+") // feature versions - def tipRelease = "${params.TIP_RELEASE}".trim() // Current jdk(head) version + def tipReleases = "${params.TIP_RELEASES}".split("[, ]+") // Current jdk(head) versions def nightlyStaleDays = "${params.MAX_NIGHTLY_STALE_DAYS}" def amberBuildAlertLevel = params.AMBER_BUILD_ALERT_LEVEL ? params.AMBER_BUILD_ALERT_LEVEL as Integer : -99 def amberTestAlertLevel = params.AMBER_TEST_ALERT_LEVEL ? params.AMBER_TEST_ALERT_LEVEL as Integer : -99 @@ -668,8 +668,9 @@ node('worker') { } } - // Check tip_release status, by querying binaries repo as API does not server the "tip" dev release - if (tipRelease != "") { + // Check tip_releases status, by querying binaries repo as API does not server the "tip" dev releases + if (tipReleases.size() > 0) { + tipReleases.each { tipRelease -> def latestOpenjdkBuild = getLatestOpenjdkBuildTag(tipRelease) def tipVersion = tipRelease.replaceAll("[a-z]","").toInteger() def releaseName = getLatestBinariesTag("${tipVersion}") @@ -677,6 +678,7 @@ node('worker') { verifyReleaseContent(tipRelease, releaseName, variant, status) echo " ${tipRelease} release binaries verification: "+status['assets'] healthStatus[tipRelease] = status + } } } } @@ -698,8 +700,8 @@ node('worker') { def pipelinesOfInterest = "" def allReleases = [] allReleases.addAll(featureReleases) - if (tipRelease != "") { - allReleases.add(tipRelease) + if (tipReleases.size() > 0) { + allReleases.addAll(tipReleases) } if ("${params.NON_TAG_BUILD_RELEASES}".trim() != "") { allReleases.addAll(nonTagBuildReleases) @@ -901,8 +903,8 @@ node('worker') { echo '-------------- Latest pipeline health report ------------------' def allReleases = [] allReleases.addAll(featureReleases) - if (tipRelease != "") { - allReleases.add(tipRelease) + if (tipReleases.size() > 0) { + allReleases.addAll(tipReleases) } if (("${params.NON_TAG_BUILD_RELEASES}".trim() != "")) { allReleases.addAll(nonTagBuildReleases) From 4cdec81cc161e42f1ca61299e7c2f1840ddd466b Mon Sep 17 00:00:00 2001 From: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Date: Fri, 13 Dec 2024 16:40:53 +0000 Subject: [PATCH 25/30] Slack daily build status does not report latest in-progress build correctly (#1164) * Update daily Slack status to check for latest running build Signed-off-by: Andrew Leonard * Update daily Slack status to check for latest running build Signed-off-by: Andrew Leonard * Update daily Slack status to check for latest running build Signed-off-by: Andrew Leonard * Update daily Slack status to check for latest running build Signed-off-by: Andrew Leonard --------- Signed-off-by: Andrew Leonard --- tools/nightly_build_and_test_stats.groovy | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/tools/nightly_build_and_test_stats.groovy b/tools/nightly_build_and_test_stats.groovy index 6b62a2298..b8d530d86 100644 --- a/tools/nightly_build_and_test_stats.groovy +++ b/tools/nightly_build_and_test_stats.groovy @@ -274,7 +274,7 @@ def getBuildIDsByPlatform(String trssUrl, String jdkVersion, String srcTag, Map echo "Finished getting build IDs by platform." } -// Return our best guess at the url for the first pipeline that generated builds from a specific tag. +// Return our best guess at the url for the latest pipeline that generated builds from a specific tag. // This pipeline is expected to have attempted to build JDKs for all supported platforms. def getBuildUrl(String trssUrl, String variant, String featureRelease, String publishName, String scmRef) { def functionBuildUrl = ["", "", ""] @@ -284,6 +284,7 @@ def getBuildUrl(String trssUrl, String variant, String featureRelease, String pu def pipelineJson = new JsonSlurper().parseText(pipeline) if (pipelineJson.size() > 0) { + def foundBuildTimestamp = 0 pipelineJson.each { job -> def overridePublishName = "" def buildScmRef = "" @@ -306,11 +307,18 @@ def getBuildUrl(String trssUrl, String variant, String featureRelease, String pu if (featureReleaseInt == 8) { // alpine-jdk8u cannot be distinguished from jdk8u by the scmRef alone, so check for "x64AlpineLinux" in the targetConfiguration if ((featureRelease == "alpine-jdk8u" && containsX64AlpineLinux) || (featureRelease != "alpine-jdk8u" && !containsX64AlpineLinux)) { - functionBuildUrl = [job.buildUrl, job._id, job.status] + if (job.timestamp > foundBuildTimestamp) { + functionBuildUrl = [job.buildUrl, job._id, job.status] + foundBuildTimestamp = job.timestamp + echo "Found latest "+featureRelease+" pipeline with this ID: "+job._id+" buildNumber: "+job.buildNum + } } } else { - functionBuildUrl = [job.buildUrl, job._id, job.status] - echo "Found "+featureRelease+" pipeline with this ID: "+job._id + if (job.timestamp > foundBuildTimestamp) { + functionBuildUrl = [job.buildUrl, job._id, job.status] + foundBuildTimestamp = job.timestamp + echo "Found latest "+featureRelease+" pipeline with this ID: "+job._id+" buildNumber: "+job.buildNum + } } } } @@ -958,8 +966,8 @@ node('worker') { if (reproducibleBuilds.containsKey(featureRelease)) { def (reproBuildUrl, reproBuildTrss, reproBuildStatus) = getBuildUrl(trssUrl, variant, featureRelease, releaseName.replaceAll("-beta", ""), releaseName.replaceAll("-beta", "").replaceAll("-ea", "")+"_adopt") - if ( reproBuildUrl != "" && callWgetSafely("${trssUrl}/api/getBuildHistory?buildUrl=${reproBuildUrl}") ==~ /.*name.:.enableTests.,.value.:true.*/ ) { - echo "This pipeline has testing enabled: ${reproBuildUrl}" + if ( reproBuildUrl != "" ) { + echo "Latest pipeline: ${reproBuildUrl}" echo "This pipeline's current status is ${reproBuildStatus}" getReproducibilityPercentage(featureRelease, reproBuildTrss, trssUrl, releaseName, reproducibleBuilds) @@ -991,9 +999,9 @@ node('worker') { errorMsg += "\nBuild repro summary: "+summaryOfRepros } } else { - // Ignore test results if the tests for this pipeline were intentionally disabled, or if we cannot find a likely pipeline job. - reproducibleBuilds[featureRelease][0] = "N/A - Tests disabled" - echo "This pipeline is either a blank string, or does not have testing enabled: ${reproBuildUrl}" + // Ignore if we cannot find a likely pipeline job. + reproducibleBuilds[featureRelease][0] = "N/A" + echo "This pipeline is blank string" } } } From 207bcc88ad4ca1b6cedc72b64092e2541637cccd Mon Sep 17 00:00:00 2001 From: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:38:35 +0000 Subject: [PATCH 26/30] x86 Redist API-MS-Win DLLs (#1166) Signed-off-by: Andrew Leonard --- pipelines/build/common/openjdk_build_pipeline.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 488eb908e..8014f3573 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -1562,7 +1562,7 @@ class Build { ms_file_skipped=false if [ "${base_os}" == "windows" ]; then # Check if file is a Microsoft supplied file that is already signed - if [[ "$file" =~ api-ms-win.* ]] || [[ "$file" =~ msvcp.* ]] || [[ "$file" =~ ucrtbase.* ]] || [[ "$file" =~ vcruntime.* ]]; then + if [[ "$file" =~ api-ms-win.* ]] || [[ "$file" =~ API-MS-Win.* ]] || [[ "$file" =~ msvcp.* ]] || [[ "$file" =~ ucrtbase.* ]] || [[ "$file" =~ vcruntime.* ]]; then echo "Skipping Microsoft file $file" ms_file_skipped=true fi From 5bb83105c56336ba012d1f77f4e9a8cf46fbb3a5 Mon Sep 17 00:00:00 2001 From: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Date: Wed, 18 Dec 2024 21:12:03 +0000 Subject: [PATCH 27/30] Windows docker build ensure cleanWorkspace cleans build tmp workspace (#1167) * Windows docker build ensure cleanWorkspace cleans build tmp workspace Signed-off-by: Andrew Leonard * Windows docker build ensure cleanWorkspace cleans build tmp workspace Signed-off-by: Andrew Leonard * Windows docker build ensure cleanWorkspace cleans build tmp workspace Signed-off-by: Andrew Leonard * Windows docker build ensure cleanWorkspace cleans build tmp workspace Signed-off-by: Andrew Leonard * Windows docker build ensure cleanWorkspace cleans build tmp workspace Signed-off-by: Andrew Leonard * Update pipelines/build/common/openjdk_build_pipeline.groovy Co-authored-by: Stewart X Addison <6487691+sxa@users.noreply.github.com> * Update pipelines/build/common/openjdk_build_pipeline.groovy Co-authored-by: Stewart X Addison <6487691+sxa@users.noreply.github.com> * Update pipelines/build/common/openjdk_build_pipeline.groovy Co-authored-by: Stewart X Addison <6487691+sxa@users.noreply.github.com> * Windows docker build ensure cleanWorkspace cleans build tmp workspace Signed-off-by: Andrew Leonard --------- Signed-off-by: Andrew Leonard Co-authored-by: Stewart X Addison <6487691+sxa@users.noreply.github.com> --- .../common/openjdk_build_pipeline.groovy | 34 +++++++++++++++---- .../build/prTester/pr_test_pipeline.groovy | 1 + 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 8014f3573..249d24485 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -1640,19 +1640,27 @@ def postBuildWSclean( // Issue: https://issues.jenkins.io/browse/JENKINS-64779 if (context.WORKSPACE != null && !context.WORKSPACE.isEmpty()) { if (cleanWorkspaceAfter) { - context.println 'Cleaning workspace non-hidden files: ' + context.WORKSPACE + '/*' - context.sh(script: 'rm -rf ' + context.WORKSPACE + '/*') + try { + context.println 'Cleaning workspace non-hidden files: ' + context.WORKSPACE + '/*' + context.sh(script: 'rm -rf ' + context.WORKSPACE + '/*') + } catch (e) { + context.println "Warning: Failed to clean workspace non-hidden files ${e}" + } // Clean remaining hidden files using cleanWs try { context.println 'Cleaning workspace hidden files using cleanWs: ' + context.WORKSPACE context.cleanWs notFailBuild: true, disableDeferredWipeout: true, deleteDirs: true } catch (e) { - context.println "Failed to clean ${e}" + context.println "Warning: Failed to clean ${e}" } } else if (cleanWorkspaceBuildOutputAfter) { - context.println 'Cleaning workspace build output files under ' + context.WORKSPACE - batOrSh('rm -rf ' + context.WORKSPACE + '/workspace/build/src/build ' + context.WORKSPACE + '/workspace/target ' + context.WORKSPACE + '/workspace/build/devkit ' + context.WORKSPACE + '/workspace/build/straceOutput') + try { + context.println 'Cleaning workspace build output files under ' + context.WORKSPACE + batOrSh('rm -rf ' + context.WORKSPACE + '/workspace/build/src/build ' + context.WORKSPACE + '/workspace/target ' + context.WORKSPACE + '/workspace/build/devkit ' + context.WORKSPACE + '/workspace/build/straceOutput') + } catch (e) { + context.println "Warning: Failed to clean workspace build output files ${e}" + } } } else { context.println 'Warning: Unable to clean workspace as context.WORKSPACE is null/empty' @@ -1687,6 +1695,7 @@ def buildScriptsAssemble( batOrSh "rm -rf ${base_path}/jdk/modules/jdk.jpackage/jdk/jpackage/internal/resources/*" } context.stage('assemble') { + try { // This would ideally not be required but it's due to lack of UID mapping in windows containers if ( buildConfig.TARGET_OS == 'windows' && buildConfig.DOCKER_IMAGE) { context.bat('chmod -R a+rwX ' + '/cygdrive/c/workspace/openjdk-build/workspace/build/src/build/*') @@ -1756,7 +1765,9 @@ def buildScriptsAssemble( } throw new Exception("[ERROR] Build archive timeout (${buildTimeouts.BUILD_ARCHIVE_TIMEOUT} HOURS) has been reached. Exiting...") } + } finally { postBuildWSclean(cleanWorkspaceAfter, cleanWorkspaceBuildOutputAfter) + } } // context.stage('assemble') } // End of buildScriptsAssemble() 1643-1765 @@ -2195,10 +2206,21 @@ def buildScriptsAssemble( try { context.cleanWs notFailBuild: true } catch (e) { - context.println "Failed to clean ${e}" + context.println "Warning: Failed to clean ${e}" } cleanWorkspace = false } + // For Windows build also clean alternative(shorter path length) workspace + if ( buildConfig.TARGET_OS == 'windows' ) { + context.ws(workspace) { + try { + context.println "Windows build cleaning" + context.WORKSPACE + context.cleanWs notFailBuild: true + } catch (e) { + context.println "Warning: Failed to clean ${e}" + } + } + } } } catch (FlowInterruptedException e) { throw new Exception("[ERROR] Controller clean workspace timeout (${buildTimeouts.CONTROLLER_CLEAN_TIMEOUT} HOURS) has been reached. Exiting...") diff --git a/pipelines/build/prTester/pr_test_pipeline.groovy b/pipelines/build/prTester/pr_test_pipeline.groovy index 084f21a95..c7007a13b 100644 --- a/pipelines/build/prTester/pr_test_pipeline.groovy +++ b/pipelines/build/prTester/pr_test_pipeline.groovy @@ -163,6 +163,7 @@ class PullRequestTestPipeline implements Serializable { context.booleanParam(name: 'enableInstallers', value: false), // never need this enabled in pr-test context.booleanParam(name: 'useAdoptBashScripts', value: false), // should not use defaultsJson but adoptDefaultsJson context.booleanParam(name: 'keepReleaseLogs', value: false), // never need this enabled in pr-tester + context.booleanParam(name: 'cleanWorkspace', value: true), // always clean prtester workspace before the build context.booleanParam(name: 'cleanWorkspaceAfterBuild', value: true) // always clean prtester workspace after the build ] } catch (err) { From fd4b53cb2832b796b2402456395799147af982b1 Mon Sep 17 00:00:00 2001 From: Andrew Leonard <31470007+andrew-m-leonard@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:29:20 +0000 Subject: [PATCH 28/30] Upgraded Windows VS2022 Redist configuration to use latest vs2022_redist_14.40.33807_10.0.26100.1742 (#1168) Signed-off-by: Andrew Leonard --- pipelines/jobs/configurations/jdk11u_pipeline_config.groovy | 6 +++--- pipelines/jobs/configurations/jdk17u_pipeline_config.groovy | 6 +++--- pipelines/jobs/configurations/jdk21u_pipeline_config.groovy | 4 ++-- pipelines/jobs/configurations/jdk23u_pipeline_config.groovy | 4 ++-- pipelines/jobs/configurations/jdk24_pipeline_config.groovy | 4 ++-- pipelines/jobs/configurations/jdk25_pipeline_config.groovy | 4 ++-- pipelines/jobs/configurations/jdk8u_pipeline_config.groovy | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy index 0a3ab868e..8b6a87901 100644 --- a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy @@ -80,7 +80,7 @@ class Config11 { 'temurin' : '--disable-ccache' ], buildArgs : [ - 'temurin' : '--jvm-variant client,server --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--jvm-variant client,server --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ], test : 'default' ], @@ -94,7 +94,7 @@ class Config11 { 'temurin' : '--disable-ccache' ], buildArgs : [ - 'temurin' : '--jvm-variant client,server --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--jvm-variant client,server --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ], test : 'default' ], @@ -256,7 +256,7 @@ class Config11 { 'temurin' : '--disable-ccache' ], buildArgs : [ - 'temurin' : '--jvm-variant client,server --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--jvm-variant client,server --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ] ] diff --git a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy index 3cc96a97e..7f038e1a1 100644 --- a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy @@ -72,7 +72,7 @@ class Config17 { additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ - 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ], @@ -83,7 +83,7 @@ class Config17 { additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ - 'temurin' : '--jvm-variant client,server --create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--jvm-variant client,server --create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ], @@ -183,7 +183,7 @@ class Config17 { additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ - 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ] ] diff --git a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy index 4c6c5b7a6..f3bf6106e 100644 --- a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy @@ -74,7 +74,7 @@ class Config21 { weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], buildArgs : [ - 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ], @@ -169,7 +169,7 @@ class Config21 { additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ - 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ] ] diff --git a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy index c8a696c86..6bf49d8a7 100644 --- a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy @@ -75,7 +75,7 @@ class Config23 { weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], buildArgs : [ - 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ], @@ -170,7 +170,7 @@ class Config23 { additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ - 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ] ] diff --git a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy index 21af1a295..b6ef730ee 100644 --- a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy @@ -75,7 +75,7 @@ class Config24 { weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], buildArgs : [ - 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ], @@ -170,7 +170,7 @@ class Config24 { additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ - 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ] ] diff --git a/pipelines/jobs/configurations/jdk25_pipeline_config.groovy b/pipelines/jobs/configurations/jdk25_pipeline_config.groovy index b29112660..e7d3abe81 100644 --- a/pipelines/jobs/configurations/jdk25_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk25_pipeline_config.groovy @@ -75,7 +75,7 @@ class Config25 { weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], buildArgs : [ - 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--create-jre-image --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ], @@ -170,7 +170,7 @@ class Config25 { additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ - 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--create-jre-image --create-sbom --cross-compile --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ] ] diff --git a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy index 2c30bec98..ffec27a0a 100644 --- a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy @@ -75,7 +75,7 @@ class Config8 { 'temurin' : '--disable-ccache' ], buildArgs : [ - 'temurin' : '--create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + 'temurin' : '--create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ] ], @@ -88,7 +88,7 @@ class Config8 { 'temurin' : '--disable-ccache' ], buildArgs : [ - temurin : '--jvm-variant client,server --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.0' + temurin : '--jvm-variant client,server --create-sbom --use-adoptium-devkit vs2022_redist_14.40.33807_10.0.26100.1742' ], test : 'default' ], From bbe5e72c72f2183d93aab264f46a7daba47464c2 Mon Sep 17 00:00:00 2001 From: Stewart X Addison <6487691+sxa@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:16:58 +0000 Subject: [PATCH 29/30] switch windows builds to use docker image from azurecr (#1170) * switch windows builds to use docker image from azurecr --------- Signed-off-by: Stewart X Addison --- .../configurations/jdk11u_pipeline_config.groovy | 12 +++++++++--- .../configurations/jdk17u_pipeline_config.groovy | 12 +++++++++--- .../configurations/jdk21u_pipeline_config.groovy | 8 ++++++-- .../configurations/jdk23u_pipeline_config.groovy | 8 ++++++-- .../jobs/configurations/jdk24_pipeline_config.groovy | 8 ++++++-- .../jobs/configurations/jdk25_pipeline_config.groovy | 8 ++++++-- .../jobs/configurations/jdk8u_pipeline_config.groovy | 8 ++++++-- 7 files changed, 48 insertions(+), 16 deletions(-) diff --git a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy index 8b6a87901..3a5365fb3 100644 --- a/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk11u_pipeline_config.groovy @@ -70,7 +70,9 @@ class Config11 { x64Windows: [ os : 'windows', arch : 'x64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', additionalNodeLabels: [ temurin: 'win2022&&vs2022', openj9: 'win2012&&vs2017', @@ -88,7 +90,9 @@ class Config11 { x32Windows: [ os : 'windows', arch : 'x86-32', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', additionalNodeLabels: 'win2022&&vs2022', configureArgs : [ 'temurin' : '--disable-ccache' @@ -248,7 +252,9 @@ class Config11 { aarch64Windows: [ os : 'windows', arch : 'aarch64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', crossCompile : 'x64', additionalNodeLabels: 'win2022&&vs2022', test : 'default', diff --git a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy index 7f038e1a1..03094fc76 100644 --- a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy @@ -68,7 +68,9 @@ class Config17 { x64Windows: [ os : 'windows', arch : 'x64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ @@ -79,7 +81,9 @@ class Config17 { x32Windows: [ os : 'windows', arch : 'x86-32', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', additionalNodeLabels: 'win2022&&vs2022', test : 'default', buildArgs : [ @@ -178,7 +182,9 @@ class Config17 { aarch64Windows: [ os : 'windows', arch : 'aarch64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', crossCompile : 'x64', additionalNodeLabels: 'win2022&&vs2022', test : 'default', diff --git a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy index f3bf6106e..fd3539148 100644 --- a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy @@ -68,7 +68,9 @@ class Config21 { x64Windows: [ os : 'windows', arch : 'x64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', additionalNodeLabels: 'win2022&&vs2022', test: [ weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] @@ -164,7 +166,9 @@ class Config21 { aarch64Windows: [ os : 'windows', arch : 'aarch64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', crossCompile : 'x64', additionalNodeLabels: 'win2022&&vs2022', test : 'default', diff --git a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy index 6bf49d8a7..1774f1786 100644 --- a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy @@ -69,7 +69,9 @@ class Config23 { x64Windows: [ os : 'windows', arch : 'x64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', additionalNodeLabels: 'win2022&&vs2022', test: [ weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] @@ -165,7 +167,9 @@ class Config23 { aarch64Windows: [ os : 'windows', arch : 'aarch64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', crossCompile : 'x64', additionalNodeLabels: 'win2022&&vs2022', test : 'default', diff --git a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy index b6ef730ee..c21a8760a 100644 --- a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy @@ -69,7 +69,9 @@ class Config24 { x64Windows: [ os : 'windows', arch : 'x64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', additionalNodeLabels: 'win2022&&vs2022', test: [ weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] @@ -165,7 +167,9 @@ class Config24 { aarch64Windows: [ os : 'windows', arch : 'aarch64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', crossCompile : 'x64', additionalNodeLabels: 'win2022&&vs2022', test : 'default', diff --git a/pipelines/jobs/configurations/jdk25_pipeline_config.groovy b/pipelines/jobs/configurations/jdk25_pipeline_config.groovy index e7d3abe81..0331a09c1 100644 --- a/pipelines/jobs/configurations/jdk25_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk25_pipeline_config.groovy @@ -69,7 +69,9 @@ class Config25 { x64Windows: [ os : 'windows', arch : 'x64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', additionalNodeLabels: 'win2022&&vs2022', test: [ weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'special.openjdk', 'dev.functional', 'dev.system', 'special.system'] @@ -165,7 +167,9 @@ class Config25 { aarch64Windows: [ os : 'windows', arch : 'aarch64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', crossCompile : 'x64', additionalNodeLabels: 'win2022&&vs2022', test : 'default', diff --git a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy index ffec27a0a..e4a9368a7 100644 --- a/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk8u_pipeline_config.groovy @@ -68,7 +68,9 @@ class Config8 { x64Windows : [ os : 'windows', arch : 'x64', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', additionalNodeLabels: 'win2022&&vs2022', test : 'default', configureArgs : [ @@ -82,7 +84,9 @@ class Config8 { x32Windows : [ os : 'windows', arch : 'x86-32', - dockerImage : 'win2022_notrhel_image', + dockerImage : 'windows2022_build_image', + dockerRegistry : 'https://adoptium.azurecr.io', + dockerCredential : 'bbb9fa70-a1de-4853-b564-5f02193329ac', additionalNodeLabels: 'win2022', configureArgs : [ 'temurin' : '--disable-ccache' From 6a55e2f29a6436756c28aa5790e8b58064d59d85 Mon Sep 17 00:00:00 2001 From: Stewart X Addison <6487691+sxa@users.noreply.github.com> Date: Sat, 21 Dec 2024 21:37:16 +0000 Subject: [PATCH 30/30] switch rhel6||centos6 labels for sw.tool.glibc.2_12 (#1171) Signed-off-by: Stewart X Addison --- pipelines/jobs/configurations/jdk17u_pipeline_config.groovy | 2 +- pipelines/jobs/configurations/jdk21u_pipeline_config.groovy | 4 ++-- pipelines/jobs/configurations/jdk23u_pipeline_config.groovy | 4 ++-- pipelines/jobs/configurations/jdk24_pipeline_config.groovy | 4 ++-- pipelines/jobs/configurations/jdk25_pipeline_config.groovy | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy index 03094fc76..d9a6ac1f9 100644 --- a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy @@ -29,7 +29,7 @@ class Config17 { weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'sanity.external', 'dev.openjdk', 'dev.functional'] ], additionalTestLabels: [ - openj9 : '!(centos6||rhel6)' + openj9 : '!sw.tool.glibc.2_12' ], configureArgs : [ 'openj9' : '--enable-dtrace', diff --git a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy index fd3539148..dd33c3e25 100644 --- a/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk21u_pipeline_config.groovy @@ -28,8 +28,8 @@ class Config21 { weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'sanity.external', 'dev.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], additionalTestLabels: [ - openj9 : '!(centos6||rhel6)', - temurin : '!(centos6||rhel6)' + openj9 : '!sw.tool.glibc.2_12', + temurin : '!sw.tool.glibc.2_12' ], configureArgs : [ 'openj9' : '--enable-dtrace', diff --git a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy index 1774f1786..352d91942 100644 --- a/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk23u_pipeline_config.groovy @@ -29,8 +29,8 @@ class Config23 { weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'dev.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], additionalTestLabels: [ - openj9 : '!(centos6||rhel6)', - temurin : '!(centos6||rhel6)' + openj9 : '!sw.tool.glibc.2_12', + temurin : '!sw.tool.glibc.2_12' ], configureArgs : [ 'openj9' : '--enable-dtrace', diff --git a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy index c21a8760a..25b830a30 100644 --- a/pipelines/jobs/configurations/jdk24_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk24_pipeline_config.groovy @@ -29,8 +29,8 @@ class Config24 { weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'dev.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], additionalTestLabels: [ - openj9 : '!(centos6||rhel6)', - temurin : '!(centos6||rhel6)' + openj9 : '!sw.tool.glibc.2_12', + temurin : '!sw.tool.glibc.2_12' ], configureArgs : [ 'openj9' : '--enable-dtrace', diff --git a/pipelines/jobs/configurations/jdk25_pipeline_config.groovy b/pipelines/jobs/configurations/jdk25_pipeline_config.groovy index 0331a09c1..67e1bb032 100644 --- a/pipelines/jobs/configurations/jdk25_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk25_pipeline_config.groovy @@ -29,8 +29,8 @@ class Config25 { weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional', 'extended.openjdk', 'extended.perf', 'special.functional', 'dev.openjdk', 'dev.functional', 'dev.system', 'special.system'] ], additionalTestLabels: [ - openj9 : '!(centos6||rhel6)', - temurin : '!(centos6||rhel6)' + openj9 : '!sw.tool.glibc.2_12', + temurin : '!sw.tool.glibc.2_12' ], configureArgs : [ 'openj9' : '--enable-dtrace',