Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable mac x64 & aarch64 reproduciable comparison build #764

Merged
merged 7 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -1911,7 +1914,7 @@ class Build {

// Compare reproducible build if needed
if (enableReproducibleCompare) {
compareReproducibleBuild()
compareReproducibleBuild(nonDockerNodeName)
}
// Run Smoke Tests and AQA Tests
if (enableTests) {
Expand Down
6 changes: 6 additions & 0 deletions pipelines/jobs/configurations/jdk17u_pipeline_config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -145,6 +148,9 @@ class Config17 {
arch : 'aarch64',
additionalNodeLabels: 'macos11',
test : 'default',
reproducibleCompare : [
'temurin' : true
],
buildArgs : [
'temurin' : '--create-jre-image --create-sbom'
]
Expand Down
12 changes: 5 additions & 7 deletions tools/reproduce_comparison/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}

Expand Down Expand Up @@ -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))),
Expand Down Expand Up @@ -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) {
Expand Down