Skip to content

Commit 9c86dae

Browse files
authored
Add GENERATE_JOBS in Perf Pipeline. (#6397)
* Add GENERATE_JOBS in Perf Pipeline. Added GENERATE_JOBS in perfL2JobTemplate. Fixes: #6379 Signed-off-by: Matthew Wei <[email protected]> * added GENERATE_JOBS logic in perfPipeline_root and perfPipeline --------- Signed-off-by: Matthew Wei <[email protected]>
1 parent 39b085d commit 9c86dae

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

buildenv/jenkins/perfL2JobTemplate

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ if (!binding.hasVariable('BASELINE_SDK_URL')) BASELINE_SDK_URL = ""
2525
if (!binding.hasVariable('PLATFORM')) PLATFORM = ['x86-64_linux']
2626
if (!binding.hasVariable('JDK_IMPL')) JDK_IMPL = "hotspot"
2727
if (!binding.hasVariable('JDK_VERSION')) JDK_VERSION = 21
28+
if (!binding.hasVariable('GENERATE_JOBS')) GENERATE_JOBS = false
2829

2930
if (!binding.hasVariable('BUILDS_TO_KEEP')) {
3031
BUILDS_TO_KEEP = 100
@@ -93,6 +94,8 @@ pipelineJob("$ACTUAL_TEST_JOB_NAME") {
9394
If upstream is selected, please provide UPSTREAM_JOB_NAME and UPSTREAM_JOB_NUMBER <br/>''')
9495
stringParam('BASELINE_SDK_URL', BASELINE_SDK_URL, "")
9596
stringParam('JDK_IMPL', JDK_IMPL, "hotspot")
97+
stringParam('GENERATE_JOBS', GENERATE_JOBS, '''If GENERATE_JOBS is set to false (default),
98+
only generate the job if the job is not runnable. If GENERATE_JOBS is set to true, generate the job regardless.''')
9699
}
97100
cpsScm {
98101
scm {

buildenv/jenkins/perfPipeline.groovy

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,17 @@ node ("ci.role.test&&hw.arch.x86&&sw.os.linux") {
9393
def triggerJob(benchmarkName, platformName, buildParams, jobSuffix) {
9494
def buildJobName = "${JOB_NAME}_${jobSuffix}"
9595
def JobHelper = library(identifier: 'openjdk-jenkins-helper@master').JobHelper
96-
def jobIsRunnable = JobHelper.jobIsRunnable("${buildJobName}")
97-
if (!jobIsRunnable) {
96+
if (params.GENERATE_JOBS) {
9897
echo "Child job ${buildJobName} doesn't exist, set child job ${buildJobName} params for generating the job"
9998
generateChildJobViaAutoGen(buildJobName)
10099
}
100+
else {
101+
def jobIsRunnable = JobHelper.jobIsRunnable("${buildJobName}")
102+
if (!jobIsRunnable) {
103+
echo "Child job ${buildJobName} doesn't exist, set child job ${buildJobName} params for generating the job"
104+
generateChildJobViaAutoGen(buildJobName)
105+
}
106+
}
101107
build job: buildJobName, parameters: buildParams, propagate: true
102108
}
103109

buildenv/jenkins/perfPipeline_root.groovy

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,18 @@ node("worker || (ci.role.test&&hw.arch.x86&&sw.os.linux)") {
7373

7474
def shortName = (params.JDK_IMPL && params.JDK_IMPL == "hotspot") ? "hs" : "j9"
7575
def jobName = "Perf_openjdk${params.JDK_VERSION}_${shortName}_sanity.perf_${p}_${item.BENCHMARK}"
76-
def jobIsRunnable = JobHelper.jobIsRunnable(jobName)
77-
echo "jobName ${jobName} params: ${thisChildParams}"
78-
if (!jobIsRunnable) {
76+
if (params.GENERATE_JOBS) {
7977
echo "Generating downstream job '${jobName}' from perfL2JobTemplate …"
8078
createPerfL2Job(jobName, p, item.BENCHMARK)
8179
}
80+
else {
81+
def jobIsRunnable = JobHelper.jobIsRunnable(jobName)
82+
echo "jobName ${jobName} params: ${thisChildParams}"
83+
if (!jobIsRunnable) {
84+
echo "Generating downstream job '${jobName}' from perfL2JobTemplate …"
85+
createPerfL2Job(jobName, p, item.BENCHMARK)
86+
}
87+
}
8288
JOBS[jobName] = {
8389
build job: jobName, parameters: thisChildParams, propagate: true
8490
}

0 commit comments

Comments
 (0)