You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by mc...@apache.org on 2022/01/25 13:07:19 UTC

[cassandra-builds] branch trunk updated: In Jenkins, replace PostBuildTask plugin with PostBuildScript plugin.

This is an automated email from the ASF dual-hosted git repository.

mck pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-builds.git


The following commit(s) were added to refs/heads/trunk by this push:
     new ef3c02e  In Jenkins, replace PostBuildTask plugin with PostBuildScript plugin.
ef3c02e is described below

commit ef3c02e0b99a14079c251474d3bdeeb6a6df9a25
Author: Mick Semb Wever <mc...@apache.org>
AuthorDate: Tue Jan 25 12:08:23 2022 +0100

    In Jenkins, replace PostBuildTask plugin with PostBuildScript plugin.
    
    PostbuildTask loads build log into memory, causing OutOfMemoryException
    https://issues.jenkins.io/browse/JENKINS-12830
    https://the-asf.slack.com/archives/CK23JSY2K/p1643063068079200?thread_ts=1643052183.068300&cid=CK23JSY2K
    
     patch by Mick Semb Wever; reviewed by Brandon Williams for CASSANDRA-17288
---
 jenkins-dsl/cassandra_job_dsl_seed.groovy | 56 ++++++++++++++++++++++---------
 1 file changed, 40 insertions(+), 16 deletions(-)

diff --git a/jenkins-dsl/cassandra_job_dsl_seed.groovy b/jenkins-dsl/cassandra_job_dsl_seed.groovy
index 0d710ac..b9a9317 100644
--- a/jenkins-dsl/cassandra_job_dsl_seed.groovy
+++ b/jenkins-dsl/cassandra_job_dsl_seed.groovy
@@ -409,10 +409,12 @@ cassandraBranches.each {
                 }
                 failOnError(false)
             }
-            postBuildTask {
+            postBuildScripts {
+              onlyIfBuildSucceeds(false)
+              steps {
                 // docker needs to (soon or later) prune its volumes too, but that can only be done when the agent is idle
                 // if the agent is busy, just prune everything that is older than maxJobHours
-                task('.', """
+                shell("""
                     echo "Cleaning project…"; git clean -xdff ;
                     echo "Cleaning processes…" ;
                     if ! pgrep -af "cassandra-builds/build-scripts" ; then pkill -9 -f org.apache.cassandra. || echo "already clean" ; fi ;
@@ -424,6 +426,7 @@ cassandraBranches.each {
                     find /tmp -type f -atime +2 -user jenkins -and -not -exec fuser -s {} ';' -and -delete 2>/dev/null || echo clean tmp failed ;
                     echo "For test report and logs see https://nightlies.apache.org/cassandra/${branchName}/${jobNamePrefix}-artifacts/\${BUILD_NUMBER}/\${JOB_NAME}/"
                 """)
+              }
             }
         }
     }
@@ -503,10 +506,12 @@ cassandraBranches.each {
                         }
                         failOnError(false)
                     }
-                    postBuildTask {
+                    postBuildScripts {
+                      onlyIfBuildSucceeds(false)
+                      steps {
                         // docker needs to (soon or later) prune its volumes too, but that can only be done when the agent is idle
                         // if the agent is busy, just prune everything that is older than maxJobHours
-                        task('.', """
+                        shell("""
                             echo "Cleaning project…"; git clean -xdff -e build/test/jmh-result.json ;
                             echo "Cleaning processes…" ;
                             if ! pgrep -af "cassandra-builds/build-scripts" ; then pkill -9 -f org.apache.cassandra. || echo "already clean" ; fi ;
@@ -518,6 +523,7 @@ cassandraBranches.each {
                             find /tmp -type f -atime +2 -user jenkins -and -not -exec fuser -s {} ';' -and -delete 2>/dev/null || echo clean tmp failed ;
                             echo "For test report and logs see https://nightlies.apache.org/cassandra/${branchName}/${jobNamePrefix}-${targetName}/\${BUILD_NUMBER}/\${JOB_NAME}/"
                         """)
+                      }
                     }
                 }
             }
@@ -594,10 +600,12 @@ cassandraBranches.each {
                                 publishTestStabilityData()
                             }
                         }
-                        postBuildTask {
+                        postBuildScripts {
+                          onlyIfBuildSucceeds(false)
+                          steps {
                             // docker needs to (soon or later) prune its volumes too, but that can only be done when the agent is idle
                             // if the agent is busy, just prune everything that is older than maxJobHours
-                            task('.', """
+                            shell("""
                                 echo "Cleaning project…"; git clean -xdff ;
                                 echo "Cleaning processes…" ;
                                 if ! pgrep -af "cassandra-builds/build-scripts" ; then pkill -9 -f org.apache.cassandra. || echo "already clean" ; fi ;
@@ -609,6 +617,7 @@ cassandraBranches.each {
                                 find /tmp -type f -atime +2 -user jenkins -and -not -exec fuser -s {} ';' -and -delete 2>/dev/null || echo clean tmp failed ;
                                 echo "For test report and logs see https://nightlies.apache.org/cassandra/${branchName}/${jobNamePrefix}-${targetArchName}/\${BUILD_NUMBER}/\${JOB_NAME}/"
                             """)
+                          }
                         }
                     }
                 }
@@ -656,10 +665,12 @@ cassandraBranches.each {
                         xz console.log
                         """)
                 }
-                postBuildTask {
+                postBuildScripts {
+                  onlyIfBuildSucceeds(false)
+                  steps {
                     // docker needs to (soon or later) prune its volumes too, but that can only be done when the agent is idle
                     // if the agent is busy, just prune everything that is older than maxJobHours
-                    task('.', """
+                    shell("""
                         echo "Cleaning project…"; git clean -xdff ;
                         echo "Cleaning processes…" ;
                         if ! pgrep -af "cassandra-builds/build-scripts" ; then pkill -9 -f org.apache.cassandra. || echo "already clean" ; fi ;
@@ -671,6 +682,7 @@ cassandraBranches.each {
                         find /tmp -type f -atime +2 -user jenkins -and -not -exec fuser -s {} ';' -and -delete 2>/dev/null || echo clean tmp failed ;
                         echo "For test report and logs see https://nightlies.apache.org/cassandra/${branchName}/${jobNamePrefix}-cqlsh-tests/\${BUILD_NUMBER}/\${JOB_NAME}/"
                     """)
+                  }
                 }
             }
         }
@@ -804,10 +816,12 @@ matrixJob('Cassandra-devbranch-artifacts') {
             }
             failOnError(false)
         }
-        postBuildTask {
+        postBuildScripts {
+          
+          steps {
             // docker needs to (soon or later) prune its volumes too, but that can only be done when the agent is idle
             // if the agent is busy, just prune everything that is older than maxJobHours
-            task('.', """
+            shell("""
                 echo "Cleaning project…"; git clean -xdff ;
                 echo "Cleaning processes…" ;
                 if ! pgrep -af "cassandra-builds/build-scripts" ; then pkill -9 -f org.apache.cassandra. || echo "already clean" ; fi ;
@@ -819,6 +833,7 @@ matrixJob('Cassandra-devbranch-artifacts') {
                 find /tmp -type -f -atime +3 -user jenkins -and -not -exec fuser -s {} ';' -and -delete 2>/dev/null || echo clean tmp failed ;
                 echo "For test report and logs see https://nightlies.apache.org/cassandra/devbranch/Cassandra-devbranch-artifacts/\${BUILD_NUMBER}/\${JOB_NAME}/"
             """)
+          }
         }
     }
 }
@@ -923,10 +938,12 @@ testTargets.each {
             archiveJunit('build/test/**/TEST-*.xml') {
                 allowEmptyResults()
             }
-            postBuildTask {
+            postBuildScripts {
+              onlyIfBuildSucceeds(false)
+              steps {
                 // docker needs to (soon or later) prune its volumes too, but that can only be done when the agent is idle
                 // if the agent is busy, just prune everything that is older than maxJobHours
-                task('.', """
+                shell("""
                     echo "Cleaning project…"; git clean -xdff ${targetName == 'microbench' ? '-e build/test/jmh-result.json' : ''};
                     echo "Cleaning processes…" ;
                     if ! pgrep -af "cassandra-builds/build-scripts" ; then pkill -9 -f org.apache.cassandra. || echo "already clean" ; fi ;
@@ -938,6 +955,7 @@ testTargets.each {
                     find /tmp -type f -atime +2 -user jenkins -and -not -exec fuser -s {} ';' -and -delete 2>/dev/null || echo clean tmp failed ;
                     echo "For test report and logs see https://nightlies.apache.org/cassandra/devbranch/Cassandra-devbranch-${targetName}/\${BUILD_NUMBER}/\${JOB_NAME}/"
                 """)
+              }
             }
         }
     }
@@ -1057,10 +1075,12 @@ archs.each {
                     fingerprint()
                 }
                 archiveJunit('nosetests.xml')
-                postBuildTask {
+                postBuildScripts {
+                  onlyIfBuildSucceeds(false)
+                  steps {
                     // docker needs to (soon or later) prune its volumes too, but that can only be done when the agent is idle
                     // if the agent is busy, just prune everything that is older than maxJobHours
-                    task('.', """
+                    shell("""
                         echo "Cleaning project…" ; git clean -xdff ;
                         echo "Cleaning processes…" ;
                         if ! pgrep -af "cassandra-builds/build-scripts" ; then pkill -9 -f org.apache.cassandra. || echo "already clean" ; fi ;
@@ -1072,6 +1092,7 @@ archs.each {
                         find /tmp -type f -atime +2 -user jenkins -and -not -exec fuser -s {} ';' -and -delete 2>/dev/null || echo clean tmp failed ;
                         echo "For test report and logs see https://nightlies.apache.org/cassandra/devbranch/Cassandra-devbranch-${targetArchName}/\${BUILD_NUMBER}/\${JOB_NAME}/"
                     """)
+                  }
                 }
             }
         }
@@ -1168,10 +1189,12 @@ matrixJob('Cassandra-devbranch-cqlsh-tests') {
             fingerprint()
         }
         archiveJunit('**/cqlshlib.xml')
-        postBuildTask {
+        postBuildScripts {
+          onlyIfBuildSucceeds(false)
+          steps {
             // docker needs to (soon or later) prune its volumes too, but that can only be done when the agent is idle
             // if the agent is busy, just prune everything that is older than maxJobHours
-            task('.', """
+            shell("""
                 echo "Cleaning project…"; git clean -xdff ;
                 echo "Cleaning processes…" ;
                 if ! pgrep -af "cassandra-builds/build-scripts" ; then pkill -9 -f org.apache.cassandra. || echo "already clean" ; fi ;
@@ -1183,6 +1206,7 @@ matrixJob('Cassandra-devbranch-cqlsh-tests') {
                 find /tmp -type f -atime +2 -user jenkins -and -not -exec fuser -s {} ';' -and -delete 2>/dev/null || echo clean tmp failed ;
                 echo "For test report and logs see https://nightlies.apache.org/cassandra/devbranch/Cassandra-devbranch-cqlsh-tests/\${BUILD_NUMBER}/\${JOB_NAME}/"
             """)
+          }
         }
     }
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org