You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2022/01/19 02:28:00 UTC

[couchdb] branch improve-pr-jenkinsfile created (now dd070c1)

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

kocolosk pushed a change to branch improve-pr-jenkinsfile
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at dd070c1  Decompose scripts into specific steps

This branch includes the following new commits:

     new 8c2f1c9  Use specific images for each Erlang version
     new 5e76763  Bump Credo to 1.5.6 for Elixir 1.12 support
     new 423dd61  Start stage-specific timers after acquiring agent
     new dd070c1  Decompose scripts into specific steps

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[couchdb] 03/04: Start stage-specific timers after acquiring agent

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch improve-pr-jenkinsfile
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 423dd61b88804f32af5463e1af58980722d7af28
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Tue Jan 18 21:08:29 2022 -0500

    Start stage-specific timers after acquiring agent
    
    This avoids the situation where a build fails with a timeout because
    all the docker-based agents were busy running other jobs. Jenkins'
    semantics for options.timeout is that the stage-specific timeout starts
    the countdown even while waiting for an agent matching the selected
    label to become available. We see occasional spurious job failures as a
    result.
---
 build-aux/Jenkinsfile.pr | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr
index 1b8ebdf..34955f6 100644
--- a/build-aux/Jenkinsfile.pr
+++ b/build-aux/Jenkinsfile.pr
@@ -72,18 +72,17 @@ pipeline {
           registryCredentialsId 'dockerhub_creds'
         }
       }
-      options {
-        timeout(time: 15, unit: "MINUTES")
-      }
       steps {
-        sh '''
-          set
-          rm -rf apache-couchdb-*
-          ./configure
-          make erlfmt-check
-          make dist
-          chmod -R a+w * .
-        '''
+        timeout(time: 15, unit: "MINUTES") {
+          sh '''
+            set
+            rm -rf apache-couchdb-*
+            ./configure
+            make erlfmt-check
+            make dist
+            chmod -R a+w * .
+          '''
+        }
       }
       post {
         success {
@@ -121,11 +120,12 @@ pipeline {
             }
             options {
               skipDefaultCheckout()
-              timeout(time: 90, unit: "MINUTES")
             }
             steps {
-              unstash 'tarball'
-              sh( script: build_and_test )
+              timeout(time: 90, unit: "MINUTES") {
+                unstash 'tarball'
+                sh( script: build_and_test )
+              }
             }
             post {
               always {

[couchdb] 04/04: Decompose scripts into specific steps

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch improve-pr-jenkinsfile
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit dd070c10b263026a36061bf329289958f4862f7e
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Tue Jan 18 21:26:11 2022 -0500

    Decompose scripts into specific steps
    
    Improves developer UX and debugging when builds go awry.
---
 build-aux/Jenkinsfile.pr | 46 ++++++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr
index 34955f6..4bfdb18 100644
--- a/build-aux/Jenkinsfile.pr
+++ b/build-aux/Jenkinsfile.pr
@@ -12,17 +12,6 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-build_and_test = '''
-mkdir -p ${COUCHDB_IO_LOG_DIR} ${ERLANG_VERSION}
-cd ${ERLANG_VERSION}
-rm -rf build
-mkdir build
-cd build
-tar -xf ${WORKSPACE}/apache-couchdb-*.tar.gz
-cd apache-couchdb-*
-./configure
-make check || (make build-report && false)
-'''
 
 pipeline {
 
@@ -74,19 +63,16 @@ pipeline {
       }
       steps {
         timeout(time: 15, unit: "MINUTES") {
-          sh '''
-            set
-            rm -rf apache-couchdb-*
-            ./configure
-            make erlfmt-check
-            make dist
-            chmod -R a+w * .
-          '''
+          sh( script: 'rm -rf apache-couchdb-*', label: 'Clean out workspace' )
+          sh( script: './configure', label: 'Configure CouchDB build system' )
+          sh( script: 'make erlfmt-check', label: 'Verify Erlang coding style' )
+          sh( script: 'make elixir-check-formatted', label: 'Verify Elixir coding style' )
+          sh( script: 'make dist', label: 'Build self-contained release' )
         }
       }
       post {
         success {
-          stash includes: 'apache-couchdb-*.tar.gz', name: 'tarball'
+          stash includes: 'apache-couchdb-*.tar.gz', name: 'release-tarball'
         }
         cleanup {
           // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
@@ -123,14 +109,30 @@ pipeline {
             }
             steps {
               timeout(time: 90, unit: "MINUTES") {
-                unstash 'tarball'
-                sh( script: build_and_test )
+                sh( script: "rm -rf ${ERLANG_VERSION} apache-couchdb-*", label: 'Clean out workspace' )
+                unstash 'release-tarball'
+                sh( script: "mkdir -p ${COUCHDB_IO_LOG_DIR} ${ERLANG_VERSION}"
+                sh( script: "tar -xf apache-couchdb-*.tar.gz -C ${ERLANG_VERSION} --strip-components=1", label: 'Unpack release' )
+                dir( "${ERLANG_VERSION}" ) {
+                  sh( script: './configure --skip-deps', label: 'Configure CouchDB build system' )
+                  sh( script: 'make', label: 'Build CouchDB' )
+                  sh( script: 'make eunit', label: 'EUnit test suite' )
+                  sh( script: 'make elixir-suite', label: 'ExUnit unit test suite' )
+                  sh( script: 'make exunit', label: 'ExUnit integration test suite' )
+                  sh( script: 'make mango-test', label: 'Python-based Mango query test suite' )
+                }
               }
             }
             post {
               always {
                 junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml'
               }
+              failure {
+                dir( "${ERLANG_VERSION}" ) {
+                  sh 'ls -l'
+                  sh 'make build-report'
+                }
+              }
               cleanup {
                 sh 'rm -rf ${WORKSPACE}/* ${COUCHDB_IO_LOG_DIR}'
               }

[couchdb] 02/04: Bump Credo to 1.5.6 for Elixir 1.12 support

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch improve-pr-jenkinsfile
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 5e767637f86d0343a0c9780f8878b0e656265180
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Tue Jan 18 21:08:01 2022 -0500

    Bump Credo to 1.5.6 for Elixir 1.12 support
---
 mix.exs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mix.exs b/mix.exs
index 12e0221..dd6da4a 100644
--- a/mix.exs
+++ b/mix.exs
@@ -93,7 +93,7 @@ defmodule CouchDBTest.Mixfile do
       {:jwtf, path: Path.expand("src/jwtf", __DIR__)},
       {:ibrowse,
        path: Path.expand("src/ibrowse", __DIR__), override: true, compile: false},
-      {:credo, "~> 1.5.4", only: [:dev, :test, :integration], runtime: false}
+      {:credo, "~> 1.5.6", only: [:dev, :test, :integration], runtime: false}
     ]
   end
 

[couchdb] 01/04: Use specific images for each Erlang version

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch improve-pr-jenkinsfile
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 8c2f1c9159881358e7c5fa2b09ed32f5d6076970
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Fri Jan 14 12:49:35 2022 -0500

    Use specific images for each Erlang version
    
    Instead of building one image with all supported Erlang versions through
    kerl, this configuration looks for a specific container image for each
    Erlang version. Decoupling it like this enables us to more easily adopt
    newer distros for newer Erlang versions, and to build new images with
    patch releases of Erlang without needing a simultaneous PR to the
    CouchDB repo to pick them up in CI (although some change to Jenkins
    might be needed to avoid images being cached for too long when a stable
    tag changes).
---
 build-aux/Jenkinsfile.pr | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr
index e3f2961..1b8ebdf 100644
--- a/build-aux/Jenkinsfile.pr
+++ b/build-aux/Jenkinsfile.pr
@@ -20,7 +20,6 @@ mkdir build
 cd build
 tar -xf ${WORKSPACE}/apache-couchdb-*.tar.gz
 cd apache-couchdb-*
-. /usr/local/kerl/${ERLANG_VERSION}/activate
 ./configure
 make check || (make build-report && false)
 '''
@@ -39,7 +38,7 @@ pipeline {
     GIT_COMMITTER_NAME = 'Jenkins User'
     GIT_COMMITTER_EMAIL = 'couchdb@apache.org'
     // Parameters for the matrix build
-    DOCKER_IMAGE = 'apache/couchdbci-debian:bullseye-erlang-all-1'
+    DOCKER_IMAGE_BASE = 'apache/couchdbci-debian:erlang'
     // https://github.com/jenkins-infra/jenkins.io/blob/master/Jenkinsfile#64
     // We need the jenkins user mapped inside of the image
     // npm config cache below deals with /home/jenkins not mapping correctly
@@ -50,10 +49,7 @@ pipeline {
     // Search for ERLANG_VERSION
     // see https://issues.jenkins.io/browse/JENKINS-61047 for why this cannot
     // be done parametrically
-    LOW_ERLANG_VER = '21.3.8.24'
-
-    // Ensure that the SpiderMonkey version is appropriate for the $DOCKER_IMAGE
-    SM_VSN = '78'
+    MIN_ERLANG_VERSION = '21'
   }
 
   options {
@@ -69,7 +65,7 @@ pipeline {
     stage('Build Release Tarball') {
       agent {
         docker {
-          image "${DOCKER_IMAGE}"
+          image "${DOCKER_IMAGE_BASE}-${MIN_ERLANG_VERSION}"
           label 'docker'
           args "${DOCKER_ARGS}"
           registryUrl 'https://docker.io/'
@@ -83,7 +79,6 @@ pipeline {
         sh '''
           set
           rm -rf apache-couchdb-*
-          . /usr/local/kerl/${LOW_ERLANG_VER}/activate
           ./configure
           make erlfmt-check
           make dist
@@ -111,7 +106,7 @@ pipeline {
         axes {
           axis {
             name 'ERLANG_VERSION'
-            values '21.3.8.24', '22.3.4.24', '23.3.4.10', '24.2'
+            values '21', '22', '23', '24'
           }
         }
 
@@ -119,7 +114,7 @@ pipeline {
           stage('Build and Test') {
             agent {
               docker {
-                image "${DOCKER_IMAGE}"
+                image "${DOCKER_IMAGE_BASE}-${ERLANG_VERSION}"
                 label 'docker'
                 args "${DOCKER_ARGS}"
               }