Skip to content

Commit

Permalink
Merge branch 'master' of github.com:adoptium/ci-jenkins-pipelines int…
Browse files Browse the repository at this point in the history
…o riscv64-docker-images
  • Loading branch information
luhenry committed Dec 15, 2023
2 parents 5b3774f + d57fcec commit ac8e8a0
Show file tree
Hide file tree
Showing 17 changed files with 533 additions and 35 deletions.
29 changes: 25 additions & 4 deletions docs/UsingOurScripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This file contains the default constants and paths used in the build scripts for
"enableTests" : true,
/*
Test targets triggered in 'nightly' build pipelines running 6 days per week
nightly + weekly to be run during a 'release' pipeline
'weekly' to be run on the weekend and 'release' from a release pipeline
*/
"nightlyDefault" : [
"sanity.openjdk",
Expand All @@ -96,15 +96,36 @@ This file contains the default constants and paths used in the build scripts for
],
/*
Test targets triggered in 'weekly' build pipelines running once per week
nightly + weekly + jck to be run during a 'release' pipeline
nightly + weekly to be run during 'evaluation weekly' pipeline
weekly + jck to be run during a 'weekly' pipeline
weekly to be run during 'evaluation weekly' pipeline
*/
"weeklyDefault" : [
"sanity.openjdk",
"sanity.system",
"extended.system",
"sanity.perf",
"sanity.functional",
"extended.functional"
"extended.openjdk",
"extended.perf",
"special.functional",
"dev.openjdk",
"dev.system"
"dev.functional"
],
/*
Test targets triggered in 'release' build pipelines
release + jck to be run during a 'release' pipeline
*/
"releaseDefault" : [
"sanity.openjdk",
"sanity.system",
"extended.system",
"sanity.perf",
"sanity.functional",
"extended.functional"
"extended.openjdk",
"extended.perf",
"special.functional"
]
},
// Raw content URL of this (defaults.json) file. This is so the openjdk_build_pipeline.groovy script can set user default configs when checking out to the shell script repo
Expand Down
57 changes: 44 additions & 13 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -254,52 +254,63 @@ class Builder implements Serializable {
List<String> getTestList(Map<String, ?> configuration, String variant) {
final List<String> nightly = DEFAULTS_JSON['testDetails']['nightlyDefault']
final List<String> weekly = DEFAULTS_JSON['testDetails']['weeklyDefault']
final List<String> release = DEFAULTS_JSON['testDetails']['releaseDefault']
List<String> testList = []
/*
* No test key or key value is test: false --- test disabled
* Key value is test: 'default' --- nightly build trigger 'nightly' test set, weekly build trigger or release build trigger 'nightly' + 'weekly' test sets
* Key value is test: [customized map] specified nightly and weekly test lists
* Key value is test: 'default' --- nightly build trigger 'nightly' test set, weekly build trigger 'weekly' or release build trigger 'release' test sets
* Key value is test: [customized map] specified nightly, weekly, release test lists
* Key value is test: [customized map] specified for different variant
*/
if (configuration.containsKey('test') && configuration.get('test')) {
def testJobType = 'nightly'
if (releaseType.startsWith('Weekly') || releaseType.equals('Release')) {
if (releaseType.startsWith('Weekly')) {
testJobType = 'weekly'
} else if (releaseType.equals('Release')){
testJobType = 'release'
}
if (isMap(configuration.test)) {
if (configuration.test.containsKey(variant)) {
//Test is enable for the variant
//Test is enabled for the variant
if (configuration.test.get(variant)) {
def testObj = configuration.test.get(variant)
if (isMap(testObj)) {
if (testJobType == 'nightly') {
testList = (configuration.test.get(variant) as Map).get('nightly') as List<String>
} else if (testJobType == 'weekly') {
testList = (configuration.test.get(variant) as Map).get('weekly') as List<String>
} else {
testList = ((configuration.test.get(variant) as Map).get('nightly') as List<String>) + ((configuration.test as Map).get('weekly') as List<String>)
testList = (configuration.test.get(variant) as Map).get('release') as List<String>
}
} else if (testObj instanceof List) {
testList = (configuration.test as Map).get(variant) as List<String>
} else {
if (testJobType == 'nightly') {
testList = nightly
} else if (testJobType == 'weekly') {
testList = weekly
} else {
testList = nightly + weekly
testList = release
}
}
}
} else {
if (testJobType == 'nightly') {
testList = (configuration.test as Map).get('nightly') as List<String>
} else if (testJobType == 'weekly') {
testList = (configuration.test as Map).get('weekly') as List<String>
} else {
testList = ((configuration.test as Map).get('nightly') as List<String>) + ((configuration.test as Map).get('weekly') as List<String>)
testList = (configuration.test as Map).get('release') as List<String>
}
}
} else {
// Default to the test sets declared if one isn't set in the build configuration
if (testJobType == 'nightly') {
testList = nightly
} else if (testJobType == 'weekly') {
testList = weekly
} else {
testList = nightly + weekly
testList = release
}
}
}
Expand Down Expand Up @@ -771,16 +782,36 @@ class Builder implements Serializable {
tag = publishName
}

// Definition of filenames when building an EA tag. This is passed
// to the release tool in place of the "TIMESTAMP" Criteria for this:
// JDK21 or 22 when a scmRef (tag) is specified and it's not a release build
if ((javaVersion=="jdk21" || javaVersion=="jdk22") && scmReference && !release) {
publishName = scmReference.replace('_adopt','')
def firstDot=publishName.indexOf('.')
def plusSign=publishName.indexOf('+')
def secondDot=publishName.indexOf('.', firstDot+1)
// Translate jdk-AA+BB to jdk-AA-0-BB
// Translate jdk-AA.B.C+DD to jdk-AA-C-DD-ea-beta
// Note that jdk-AA-B-C-D+EE will become jdk-AA-C-D-EE-ea-beta
if ( firstDot==-1 ) {
publishName=publishName.substring(4,plusSign)+'.0.'+publishName.substring(plusSign+1)
} else {
publishName=publishName.substring(4,firstDot)+publishName.substring(secondDot).replace("+","-")
}
publishName='ea_'+publishName.replaceAll("\\.","-")
}

context.stage('publish') {
context.build job: 'build-scripts/release/refactor_openjdk_release_tool',
context.println "publishing with publishName: ${publishName}"
context.build job: 'build-scripts/release/refactor_openjdk_release_tool',
parameters: [
['$class': 'BooleanParameterValue', name: 'RELEASE', value: release],
['$class': 'BooleanParameterValue', name: 'DRY_RUN', value: ((releaseType=="Weekly" && javaVersion=="jdk21") ? true : false)],
context.string(name: 'TAG', value: tag),
context.string(name: 'TIMESTAMP', value: timestamp),
['$class': 'BooleanParameterValue', name: 'DRY_RUN', value: false],
context.string(name: 'TAG', value: ((scmReference && (javaVersion=="jdk21" || javaVersion=="jdk22"))?(scmReference.replace('_adopt','')):tag)),
context.string(name: 'TIMESTAMP', value: ((scmReference && (javaVersion=="jdk21" || javaVersion=="jdk22"))?publishName:timestamp)),
context.string(name: 'UPSTREAM_JOB_NAME', value: env.JOB_NAME),
context.string(name: 'UPSTREAM_JOB_NUMBER', value: "${currentBuild.getNumber()}"),
context.string(name: 'VERSION', value: javaVersion )
context.string(name: 'VERSION', value: javaVersion)
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion pipelines/build/common/config_regeneration.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Regeneration implements Serializable {
private final jobType

private String javaToBuild
private final List<String> defaultTestList = ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.external']
private final List<String> defaultTestList = ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf']

private final String EXCLUDED_CONST = 'EXCLUDED'

Expand Down
55 changes: 53 additions & 2 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ class Build {
case 'hotspot':
if (buildConfig.ARCHITECTURE == "riscv64"
&& (buildConfig.JAVA_TO_BUILD == "jdk8u"
|| buildConfig.JAVA_TO_BUILD == "jdk11u"
|| buildConfig.JAVA_TO_BUILD == "jdk17u")) {
|| buildConfig.JAVA_TO_BUILD == "jdk11u")) {
suffix = "openjdk/riscv-port-${buildConfig.JAVA_TO_BUILD}";
} else {
suffix = "openjdk/${buildConfig.JAVA_TO_BUILD}"
Expand Down Expand Up @@ -905,6 +904,42 @@ class Build {
flatten: true)
}

// For Windows and Mac verify that all necessary executables are Signed and Notarized(mac)
private void verifySigning() {
if (buildConfig.TARGET_OS == "windows" || buildConfig.TARGET_OS == "mac") {
try {
context.println "RUNNING sign_verification for ${buildConfig.TARGET_OS}/${buildConfig.ARCHITECTURE} ..."

// Determine suitable node to run on
def verifyNode
if (buildConfig.TARGET_OS == "windows") {
verifyNode = "ci.role.test&&sw.os.windows"
} else {
verifyNode = "ci.role.test&&(sw.os.osx||sw.os.mac)"
}
if (buildConfig.ARCHITECTURE == "aarch64") {
verifyNode = verifyNode + "&&hw.arch.aarch64"
} else {
verifyNode = verifyNode + "&&hw.arch.x86"
}

// Execute sign verification job
context.build job: 'build-scripts/release/sign_verification',
propagate: true,
parameters: [
context.string(name: 'UPSTREAM_JOB_NUMBER', value: "${env.BUILD_NUMBER}"),
context.string(name: 'UPSTREAM_JOB_NAME', value: "${env.JOB_NAME}"),
context.string(name: 'TARGET_OS', value: "${buildConfig.TARGET_OS}"),
context.string(name: 'TARGET_ARCH', value: "${buildConfig.ARCHITECTURE}"),
context.string(name: 'NODE_LABEL', value: "${verifyNode}")
]
} catch (e) {
context.println("Failed to sign_verification for ${buildConfig.TARGET_OS}/${buildConfig.ARCHITECTURE} ${e}")
currentBuild.result = 'FAILURE'
}
}
}

private void gpgSign() {
context.stage('GPG sign') {
context.println "RUNNING sign_temurin_gpg for ${buildConfig.TARGET_OS}/${buildConfig.ARCHITECTURE} ..."
Expand Down Expand Up @@ -1724,6 +1759,11 @@ class Build {
String helperRef = buildConfig.HELPER_REF ?: DEFAULTS_JSON['repository']['helper_ref']
def NodeHelper = context.library(identifier: "openjdk-jenkins-helper@${helperRef}").NodeHelper

// If label contains mac skip waiting for node to become active as we use Orka
if (label.contains('mac')) {
return
}

// A node with the requested label is ready to go
if (NodeHelper.nodeIsOnline(label)) {
return
Expand Down Expand Up @@ -2047,6 +2087,17 @@ 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') {
try {
verifySigning()
} catch (Exception e) {
context.println(e.message)
}
}
}

// Compare reproducible build if needed
if (enableReproducibleCompare) {
compareReproducibleBuild(nonDockerNodeName)
Expand Down
Loading

0 comments on commit ac8e8a0

Please sign in to comment.