]> https://gitweb.dealii.org/ - dealii.git/commitdiff
[CI] add new MPI Jenkinsfile
authorTimo Heister <timo.heister@gmail.com>
Tue, 6 Dec 2022 19:41:55 +0000 (14:41 -0500)
committerTimo Heister <timo.heister@gmail.com>
Wed, 7 Dec 2022 20:27:52 +0000 (15:27 -0500)
This enables a new Jenkins project on a new server,
https://ci.tjhei.info to run the tests with MPI enabled.

a

contrib/ci/Jenkinsfile.mpi [new file with mode: 0644]

diff --git a/contrib/ci/Jenkinsfile.mpi b/contrib/ci/Jenkinsfile.mpi
new file mode 100644 (file)
index 0000000..f891c71
--- /dev/null
@@ -0,0 +1,138 @@
+#!groovy
+
+/*
+
+This Jenkins job compiles and tests deal.II with MPI enabled
+
+See https://ci.tjhei.info/job/dealii-mpi/ for details.
+*/
+
+/*
+Settings to apply inside Jenkins:
+  - discover pull requests (remove branches/master)
+  - Strategy: merged PR
+  - enable "Disable GitHub Multibranch Status Plugin"
+  - trigger build on pull request comment: .* /rebuild.* (without space!)
+  - Jenkinsfile: choose contrib/ci/Jenkinsfile.mpi
+  - scan: every 4 hours
+  - discard: 5+ items
+*/
+
+// load library https://github.com/tjhei/jenkins-stuff to provide
+// killold.killOldBuilds() function:
+@Library('tjhei') _
+
+pipeline
+{
+  agent none
+
+  stages
+  {
+    stage("abort old")
+    {
+      agent none
+      steps
+      {
+        githubNotify context: 'Jenkins: MPI', description: 'initializing...',  status: 'PENDING'
+        // kill older builds in this PR:
+        script { killold.killOldBuilds() }
+      }
+    }
+
+    stage("main")
+    {
+      agent
+      {
+        docker
+        {
+          image 'tjhei/candi:v9.4.1-r1-ubuntu20.04'
+        }
+      }
+
+      post { cleanup { cleanWs() } }
+
+      stages
+      {
+        stage("check")
+        {
+          when {
+            not {
+             anyOf {
+               branch 'master'
+               branch pattern: "dealii-*", comparator: "GLOB"
+             }
+            }
+         }
+
+          steps
+          {
+            githubNotify context: 'Jenkins: MPI', description: 'pending...',  status: 'PENDING'
+            sh '''
+               wget -q -O - https://api.github.com/repos/dealii/dealii/issues/${CHANGE_ID}/labels | grep 'ready to test' || \
+               { echo "This commit will only be tested when it has the label 'ready to test'. Trigger a rebuild by adding a comment that contains '/rebuild'..."; exit 1; }
+               '''
+          }
+          post
+          {
+            failure
+            {
+              githubNotify context: 'Jenkins: MPI', description: 'need ready to test label and /rebuild',  status: 'PENDING'
+              script
+              {
+                currentBuild.result='NOT_BUILT'
+              }
+            }
+          }
+        }
+
+        stage('build')
+        {
+          steps
+          {
+            timeout(time: 2, unit: 'HOURS')
+            {
+              sh "echo \"building on node ${env.NODE_NAME}\""
+              sh '''#!/bin/bash
+                  set -e
+                  set -x
+                  export NP=`grep -c ^processor /proc/cpuinfo`
+                  mkdir -p /home/dealii/build
+                  cd /home/dealii/build
+                  cmake -G "Ninja" \
+                    -D DEAL_II_CXX_FLAGS='-Werror' \
+                    -D DEAL_II_CXX_FLAGS_DEBUG='-Og' \
+                    -D DEAL_II_EARLY_DEPRECATIONS=ON \
+                    -D CMAKE_BUILD_TYPE=Debug \
+                    -D DEAL_II_WITH_MPI=ON \
+                    -D DEAL_II_UNITY_BUILD=OFF \
+                    $WORKSPACE/
+                  time ninja -j 10 # 12 gives OOM
+                  time ninja test # quicktests
+                  time ninja setup_tests
+                  time ctest -R "all-headers|multigrid/transfer|matrix_free/matrix_" --output-on-failure -j $NP --no-compress-output -T test
+                 '''
+              githubNotify context: 'Jenkins: MPI', description: 'OK',  status: 'SUCCESS'
+            }
+          }
+
+          post
+          {
+            always
+            {
+              sh "cp /home/dealii/build/Testing/*/*.xml $WORKSPACE/.xml || true"
+              xunit tools: [CTest(pattern: '*.xml')]
+              sh "cp /home/dealii/build/detailed.log $WORKSPACE/detailed-mpi.log || true"
+              archiveArtifacts artifacts: 'detailed-mpi.log', fingerprint: true
+            }
+           
+            failure
+            {
+              githubNotify context: 'Jenkins: MPI', description: 'build failed',  status: 'FAILURE'
+            }
+          }
+        }
+
+      }
+    }
+  }
+}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.