diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index f495ac44f..aa497b5a9 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -585,7 +585,7 @@ class Build { return remoteTargets } - def compareReproducibleBuild() { + def compareReproducibleBuild(String nonDockerNodeName) { // Currently only enable for jdk17, linux_x64, temurin, nightly, which shouldn't affect current build // Move out of normal jdk** folder as it won't be regenerated automatically right now def jobName = "${env.JOB_NAME}" @@ -601,6 +601,7 @@ class Build { parameters: [ context.string(name: 'COMPARED_JOB_NUMBER', value: "${env.BUILD_NUMBER}"), context.string(name: 'COMPARED_JOB_NAME', value: "${env.JOB_NAME}"), + context.string(name: 'COMPARED_AGENT', value: nonDockerNodeName), context.string(name: 'COMPARED_JOB_PARAMS', value: buildParams) ], wait: false @@ -1734,6 +1735,7 @@ class Build { def cleanWorkspaceBuildOutputAfter = Boolean.valueOf(buildConfig.CLEAN_WORKSPACE_BUILD_OUTPUT_ONLY_AFTER) // Get branch/tag of temurin-build, ci-jenkins-pipeline and jenkins-helper repo from BUILD_CONFIGURATION or defaultsJson def helperRef = buildConfig.HELPER_REF ?: DEFAULTS_JSON['repository']['helper_ref'] + def nonDockerNodeName = '' context.stage('queue') { /* This loads the library containing two Helper classes, and causes them to be @@ -1867,6 +1869,7 @@ class Build { context.println "[NODE SHIFT] MOVING INTO JENKINS NODE MATCHING LABELNAME ${buildConfig.NODE_LABEL}..." context.node(buildConfig.NODE_LABEL) { addNodeToBuildDescription() + nonDockerNodeName = context.NODE_NAME // This is to avoid windows path length issues. context.echo("checking ${buildConfig.TARGET_OS}") if (buildConfig.TARGET_OS == 'windows') { @@ -1911,7 +1914,7 @@ class Build { // Compare reproducible build if needed if (enableReproducibleCompare) { - compareReproducibleBuild() + compareReproducibleBuild(nonDockerNodeName) } // Run Smoke Tests and AQA Tests if (enableTests) { diff --git a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy index a4fc591f2..541284431 100644 --- a/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy +++ b/pipelines/jobs/configurations/jdk17u_pipeline_config.groovy @@ -9,6 +9,9 @@ class Config17 { openj9 : '!sw.os.osx.10_11' ], test : 'default', + reproducibleCompare : [ + 'temurin' : true + ], configureArgs : '--enable-dtrace', buildArgs : [ 'temurin' : '--create-jre-image --create-sbom' @@ -145,6 +148,9 @@ class Config17 { arch : 'aarch64', additionalNodeLabels: 'macos11', test : 'default', + reproducibleCompare : [ + 'temurin' : true + ], buildArgs : [ 'temurin' : '--create-jre-image --create-sbom' ] diff --git a/tools/reproduce_comparison/Jenkinsfile b/tools/reproduce_comparison/Jenkinsfile index 4d54d2b02..fd1b97a30 100644 --- a/tools/reproduce_comparison/Jenkinsfile +++ b/tools/reproduce_comparison/Jenkinsfile @@ -9,6 +9,7 @@ pipeline { parameters { string(name: 'COMPARED_JOB_NUMBER', defaultValue: '', description: 'Compared nightly build job number') string(name: 'COMPARED_JOB_NAME', defaultValue: '', description: 'Compared nightly build job name') + string(name: 'COMPARED_AGENT', defaultValue: '', description: 'Compared nightly build job agent') string(name: 'COMPARED_JOB_PARAMS', defaultValue: '', description: 'Compared nightly build job parameters') } @@ -64,8 +65,9 @@ pipeline { jsonJobParams.BUILD_CONFIGURATION.ENABLE_TESTS = false jsonJobParams.BUILD_CONFIGURATION.ENABLE_INSTALLERS = false - if (!COMPARED_JOB_NAME.contains('linux')) { - NODE_LABEL=jsonJobParams.BUILD_CONFIGURATION.NODE_LABEL + NODE_LABEL=jsonJobParams.BUILD_CONFIGURATION.NODE_LABEL + if (!jsonJobParams.BUILD_CONFIGURATION.DOCKER_IMAGE) { + jsonJobParams.BUILD_CONFIGURATION.NODE_LABEL = "${NODE_LABEL}&&!${COMPARED_AGENT}" } def buildParams = [ text(name: 'BUILD_CONFIGURATION', value: JsonOutput.prettyPrint(JsonOutput.toJson(jsonJobParams.BUILD_CONFIGURATION))), @@ -152,12 +154,8 @@ pipeline { if (COMPARED_JOB_NAME.contains('linux')) { rc = sh returnStatus: true, script: "./repro_compare.sh temurin ${WORKSPACE}/original temurin ${WORKSPACE}/reproduced Linux" } else if (COMPARED_JOB_NAME.contains('mac')) { - // mac - //rc = sh returnStatus: true, script: "./repro_compare.sh temurin ${WORKSPACE}/original temurin ${WORKSPACE}/reproduced Darwin" - echo 'todo mac build comparison' + rc = sh returnStatus: true, script: "./repro_compare.sh temurin ${WORKSPACE}/original/Contents/Home temurin ${WORKSPACE}/reproduced/Contents/Home Darwin" } else if (COMPARED_JOB_NAME.contains('windows')) { - //windows - echo 'todo windows build comparison' rc = sh returnStatus: true, script: "./repro_compare.sh temurin `pwd`/../../original temurin `pwd`/../../reproduced CYGWIN" } if (rc != 0) {