Skip to content

Commit

Permalink
Release dry run job
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Guo <[email protected]>
  • Loading branch information
sophia-guo committed Feb 12, 2024
1 parent a63352a commit e25d805
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 17 deletions.
63 changes: 56 additions & 7 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -770,11 +770,6 @@ class Builder implements Serializable {
Call job to push artifacts to github. Usually it's only executed on a nightly build
*/
def publishBinary() {
if (release) {
// make sure to skip on release
context.println('Not publishing release')
return
}

def timestamp = new Date().format('yyyy-MM-dd-HH-mm', TimeZone.getTimeZone('UTC'))
def tag = "${javaToBuild}-${timestamp}"
Expand Down Expand Up @@ -817,6 +812,54 @@ class Builder implements Serializable {
}
}

/*
Call job to dry run Release Publish, generate release publish jenkins links
*/
def dryrunReleasePublish() {
def javaVersion=determineReleaseToolRepoVersion()
def releaseSummary = manager.createSummary("next.svg")
releaseSummary.appendText("<b>RELEASE PUBLISH BINARIES:</b><ul>", false)

Map<String, IndividualBuildConfig> jobConfigurations = getJobConfigurations()
def jobs = [:]
String paramUrl = "${HUDSON_URL}job/build-scripts/job/release/job/refactor_openjdk_release_tool/parambuild?"
context.stage('Dry run release publish') {
jobConfigurations.each { configuration ->
jobs[configuration.key] = {
IndividualBuildConfig config = configuration.value
def prefixOfArtifactsToCopy = "**/${config.TARGET_OS}/${config.ARCHITECTURE}/${config.VARIANT}"
def artifactsToCopy = "${prefixOfArtifactsToCopy}/*.tar.gz,${prefixOfArtifactsToCopy}/*.zip,${prefixOfArtifactsToCopy}/*.sha256.txt,${prefixOfArtifactsToCopy}/*.msi,${prefixOfArtifactsToCopy}/*.pkg,${prefixOfArtifactsToCopy}/*.json,${prefixOfArtifactsToCopy}/*.sig"
context.println "Dry run publishing : ${publishName} ${config.TARGET_OS} ${config.ARCHITECTURE}"
def releaseJob = context.build job: 'build-scripts/release/refactor_openjdk_release_tool',
parameters: [
['$class': 'BooleanParameterValue', name: 'RELEASE', value: release],
['$class': 'BooleanParameterValue', name: 'DRY_RUN', value: true],
context.string(name: 'TAG', value: publishName),
context.string(name: 'UPSTREAM_JOB_NAME', value: env.JOB_NAME),
context.string(name: 'UPSTREAM_JOB_NUMBER', value: "${currentBuild.getNumber()}"),
context.string(name: 'ARTIFACTS_TO_COPY', value: "${artifactsToCopy}"),
context.string(name: 'ARTIFACTS_TO_SKIP', value: '**/*testimage*'),
context.string(name: 'VERSION', value: javaVersion)
]
String releaseToolUrl = "${paramUrl}"
// pulbish release link - if dry run succeeds the link to ready to publish, if dry run fails the link is dry run link
releaseToolUrl += "VERSION=${javaVersion}&TAG=${publishName}&RELEASE=true&UPSTREAM_JOB_NAME=${env.JOB_NAME}&UPSTREAM_JOB_NUMBER=${currentBuild.getNumber()}&ARTIFACTS_TO_COPY=${artifactsToCopy}&ARTIFACTS_TO_SKIP=**/*testimage*"
def releaseComment = "Release Publish"
if (releaseJob.getResult()) {
releaseToolUrl += "&DRY_RUN=false"
releaseComment = "Dry run release publish"
} else {
releaseToolUrl += "&DRY_RUN=true"
}
URLEncoder.encode(releaseToolUrl.toString(), "UTF-8")
releaseSummary.appendText("<li><a href=${releaseToolUrl}> ${releaseComment} ${config.VARIANT} ${publishName} ${config.TARGET_OS} ${config.ARCHITECTURE}</a></li>", false)
}
}
context.parallel jobs
releaseSummary.appendText("</ul>", false)
}
}

/*
Main function. This is what is executed remotely via the [release-|evaluation-]openjdkxx-pipeline and pr-tester jobs
Running in the *openjdkX-pipeline
Expand Down Expand Up @@ -910,7 +953,7 @@ class Builder implements Serializable {
if ( ! ( "${config.TARGET_OS}" ==~ /^[A-Za-z0-9\/\.\-_]*$/ ) ||
! ( "${config.ARCHITECTURE}" ==~ /^[A-Za-z0-9\/\.\-_]*$/ ) ||
! ( "${config.VARIANT}" ==~ /^[A-Za-z0-9\/\.\-_]*$/ ) ) {
throw new Exception("[ERROR] Dubious character in TARGET_OS, ARCHITECTURE or VARIANT - aborting");
throw new Exception('[ERROR] Dubious character in TARGET_OS, ARCHITECTURE or VARIANT - aborting');
}
context.sh "rm -rf target/${config.TARGET_OS}/${config.ARCHITECTURE}/${config.VARIANT}/"
}
Expand Down Expand Up @@ -989,7 +1032,13 @@ class Builder implements Serializable {
throw new Exception("[ERROR] Publish binary timeout (${pipelineTimeouts.PUBLISH_ARTIFACTS_TIMEOUT} HOURS) has been reached OR the downstream publish job failed. Exiting...")
}
} else if (publish && release) {
context.println 'NOT PUBLISHING RELEASE AUTOMATICALLY'
try {
context.timeout(time: pipelineTimeouts.PUBLISH_ARTIFACTS_TIMEOUT, unit: 'HOURS') {
dryrunReleasePublish()
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Dry run release publish timeout (${pipelineTimeouts.PUBLISH_ARTIFACTS_TIMEOUT} HOURS) has been reached OR the downstream publish job failed. Exiting...")
}
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions pipelines/jobs/configurations/jdk11u_evaluation.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
targetConfigurations = [
'aarch64Windows': [
'temurin'
],
'riscv64Linux': [
'hotspot'
]
// 'x64Mac' : [
// 'openj9'
Expand Down Expand Up @@ -33,13 +36,14 @@ targetConfigurations = [
// ]
]

// if set to empty string then it wont get triggered
triggerSchedule_evaluation = ''
// if set to empty string then it wont get triggered
triggerSchedule_weekly_evaluation= ''
// 11:30 Tue, Thu
triggerSchedule_evaluation = 'TZ=UTC\n30 11 * * 2,4'
// 23:05 Sun
triggerSchedule_weekly_evaluation = 'TZ=UTC\n05 23 * * 7'

// scmReferences to use for weekly evaluation build
weekly_evaluation_scmReferences = [
'hotspot' : '',
'temurin' : '',
'openj9' : '',
'corretto' : '',
Expand Down
23 changes: 18 additions & 5 deletions pipelines/jobs/configurations/jdk11u_pipeline_config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -180,27 +180,40 @@ class Config11 {

riscv64Linux : [
os : 'linux',
arch : 'riscv64',
dockerImage : [
'hotspot' : 'adoptopenjdk/ubuntu2004_build_image:linux-riscv64',
'openj9' : 'adoptopenjdk/centos6_build_image',
'bisheng' : 'adoptopenjdk/centos6_build_image'
],
arch : 'riscv64',
dockerArgs : [
'hotspot' : '--platform linux/riscv64'
],
crossCompile : [
'hotspot' : 'dockerhost-rise-ubuntu2204-aarch64-1',
'openj9' : 'x64',
'bisheng' : 'x64'
],
buildArgs : [
'hotspot' : '--create-sbom',
'openj9' : '--cross-compile',
'bisheng' : '--cross-compile --branch risc-v',
'temurin' : '--create-sbom'
'bisheng' : '--cross-compile --branch risc-v'
],
configureArgs : [
'hotspot' : '--enable-headless-only=yes --enable-dtrace',
'openj9' : '--disable-ddr --openjdk-target=riscv64-unknown-linux-gnu --with-sysroot=/opt/fedora28_riscv_root',
'bisheng' : '--openjdk-target=riscv64-unknown-linux-gnu --with-sysroot=/opt/fedora28_riscv_root --with-jvm-features=shenandoahgc'
],
test : [
nightly: ['sanity.openjdk'],
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf']
'hotspot' : 'default',
'openj9' : [
nightly: ['sanity.openjdk'],
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf']
],
'bisheng' : [
nightly: ['sanity.openjdk'],
weekly : ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf']
]
],
],

Expand Down
1 change: 0 additions & 1 deletion tools/reproduce_comparison/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Jenkins job does reproducible build compare.
import groovy.json.JsonOutput

env.NODE_LABEL = 'worker'

pipeline {
agent none
parameters {
Expand Down

0 comments on commit e25d805

Please sign in to comment.