Skip to content

Commit

Permalink
Reduce build retention to 40 for some builds (#26224)
Browse files Browse the repository at this point in the history
  • Loading branch information
damccorm authored Apr 11, 2023
1 parent 66c030b commit d3f1acb
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .test-infra/jenkins/CommonJobProperties.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class CommonJobProperties {
int defaultTimeout = 100,
boolean allowRemotePoll = true,
String jenkinsExecutorLabel = 'beam',
boolean cleanWorkspace = true) {
boolean cleanWorkspace = true,
int numBuildsToRetain = -1) {
// GitHub project.
context.properties {
githubProjectUrl('https://github.com/apache/beam/')
Expand All @@ -53,6 +54,7 @@ class CommonJobProperties {
// Discard old builds. Build records are only kept up to this number of days.
context.logRotator {
daysToKeep(30)
numToKeep(numBuildsToRetain)
}

// Source code management.
Expand Down
8 changes: 7 additions & 1 deletion .test-infra/jenkins/PrecommitJobBuilder.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class PrecommitJobBuilder {
*/
boolean defaultPathTriggering = true

/** Number of builds to retain in history. */
int numBuildsToRetain = -1

/**
* Define a set of pre-commit jobs.
*
Expand Down Expand Up @@ -129,7 +132,10 @@ class PrecommitJobBuilder {
commonJobProperties.setTopLevelMainJobProperties(delegate,
'master',
timeoutMins,
allowRemotePoll) // needed for included regions PR triggering; see [JENKINS-23606]
allowRemotePoll,
'beam',
true,
numBuildsToRetain) // needed for included regions PR triggering; see [JENKINS-23606]
steps {
gradle {
rootBuildScriptDir(commonJobProperties.checkoutDir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PostcommitJobBuilder.postCommitJob('beam_PostCommit_Go_VR_Flink',
description('Runs Go integration tests on the Flink runner.')

// Set common parameters.
commonJobProperties.setTopLevelMainJobProperties(delegate)
commonJobProperties.setTopLevelMainJobProperties(delegate, 'master', 100, true, 'beam', true, 40)

// Gradle goals for this job.
steps {
Expand Down
4 changes: 2 additions & 2 deletions .test-infra/jenkins/job_PostCommit_Java_Nexmark_Flink.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ NoPhraseTriggeringPostCommitBuilder.postCommitJob('beam_PostCommit_Java_Nexmark_

description('Runs the Nexmark suite on the Flink runner.')

commonJobProperties.setTopLevelMainJobProperties(delegate, 'master', 240, true, 'beam-perf')
commonJobProperties.setTopLevelMainJobProperties(delegate, 'master', 240, true, 'beam-perf', true, 40)

commonJob(delegate, TriggeringContext.POST_COMMIT)
}
Expand All @@ -41,7 +41,7 @@ PhraseTriggeringPostCommitBuilder.postCommitJob('beam_PostCommit_Java_Nexmark_Fl

description('Runs the Nexmark suite on the Flink runner against a Pull Request, on demand.')

commonJobProperties.setTopLevelMainJobProperties(delegate, 'master', 240)
commonJobProperties.setTopLevelMainJobProperties(delegate, 'master', 240, true, 'beam', true, 40)

commonJob(delegate, TriggeringContext.PR)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PostcommitJobBuilder.postCommitJob('beam_PostCommit_Python_Examples_Flink',

description('Runs the Python Examples with Flink Runner')

commonJobProperties.setTopLevelMainJobProperties(delegate, 'master', 120)
commonJobProperties.setTopLevelMainJobProperties(delegate, 'master', 120, true, 'beam', true, 40)

// Publish all test results to Jenkins
publishers {
Expand Down
3 changes: 2 additions & 1 deletion .test-infra/jenkins/job_PreCommit_Java.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
'^release/.*$',
],
excludePathPatterns: excludePaths.collect {entry ->
"^sdks/java/" + entry + '/.*$'}
"^sdks/java/" + entry + '/.*$'},
numBuildsToRetain: 40
)
builder.build {
publishers {
Expand Down
3 changes: 2 additions & 1 deletion .test-infra/jenkins/job_PreCommit_Python.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
],
gradleSwitches: [
'-Pposargs=\"--ignore=apache_beam/dataframe/ --ignore=apache_beam/examples/ --ignore=apache_beam/runners/ --ignore=apache_beam/transforms/\"' // All these tests are covered by different jobs.
]
],
numBuildsToRetain: 40
)
builder.build {
// Publish all test results to Jenkins.
Expand Down
3 changes: 2 additions & 1 deletion .test-infra/jenkins/job_PreCommit_SQL.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
], // spotless checked in job_PreCommit_Spotless
triggerPathPatterns: [
'^sdks/java/extensions/sql.*$',
]
],
numBuildsToRetain: 40
)
builder.build {
publishers {
Expand Down

0 comments on commit d3f1acb

Please sign in to comment.