From 483169df74ccd6aa8439d4d7f7ab69c169b8c202 Mon Sep 17 00:00:00 2001 From: Sean Talts Date: Mon, 16 Jul 2018 12:48:54 -0400 Subject: [PATCH 1/6] No more travis; use Jenkins. --- .travis.yml | 175 ---------------------------------------------------- Jenkinsfile | 25 +++++++- 2 files changed, 23 insertions(+), 177 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5223e41605a..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,175 +0,0 @@ -language: cpp - -git: - depth: 2 - -before_script: - - eval "${MATRIX_EVAL}" - - echo ${CXX} - - ${CXX} --version - - echo "CC=$CXX" > make/local - - echo "CXXFLAGS+=$CXXFLAGS" >> make/local - -osx_clang: &osx_clang - os: osx - compiler: "clang" - osx_image: xcode9.3 - -linux_clang: &linux_clang - os: linux - compiler: "clang-3.8" - addons: - apt: - sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8' ] - packages: [ 'clang-3.8', 'libc++-dev' ] - -linux_gcc: &linux_gcc - os: linux - compiler: "gcc-4.9" - addons: - apt: - sources: [ 'ubuntu-toolchain-r-test' ] - packages: [ 'g++-4.9' ] - -mpi_linux_clang: &mpi_linux_clang - os: linux - compiler: "clang-3.8" - addons: - apt: - sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8' ] - packages: [ 'clang-3.8', 'libc++-dev', 'mpich', 'libmpich-dev' ] - -mpi_linux_gcc: &mpi_linux_gcc - os: linux - compiler: "gcc-4.9" - addons: - apt: - sources: [ 'ubuntu-toolchain-r-test' ] - packages: [ 'g++-4.9', 'mpich', 'libmpich-dev' ] - -matrix: - fast_finish: true - include: - - <<: *osx_clang - env: - - MATRIX_EVAL="CXX=\"clang++ -DSTAN_THREADS\"" - TESTFOLDER="test/unit/math/rev/core test/unit/math/rev/mat/functor" - - <<: *mpi_linux_clang - env: - - MATRIX_EVAL="CXX=\"mpicxx -cxx=clang++-3.8\" && CXXFLAGS=-stdlib=libc++" - STAN_MPI=true - TESTFOLDER="test/unit/math/rev/mat/functor test/unit/math/prim/mat/functor test/unit/math/prim/arr/functor" - - - <<: *mpi_linux_gcc - env: - - MATRIX_EVAL="CXX=\"mpicxx -cxx=g++-4.9\"" - STAN_MPI=true - TESTFOLDER="test/unit/math/rev/mat/functor test/unit/math/prim/mat/functor test/unit/math/prim/arr/functor" - - <<: *linux_clang - env: - # For Travis's Ubuntu 14.04, the libstdc++ is broken with clang - - MATRIX_EVAL="CXX=\"clang++-3.8 -stdlib=libc++\"" - TESTFOLDER="test/unit/math/memory test/unit/math/prim/scal test/unit/math/prim/arr" - - <<: *linux_clang - env: - - MATRIX_EVAL="CXX=\"clang++-3.8 -stdlib=libc++\"" - TESTFOLDER="test/unit/math/prim/mat/err test/unit/math/prim/mat/meta test/unit/math/prim/mat/vectorize" - - <<: *linux_clang - env: - - MATRIX_EVAL="CXX=\"clang++-3.8 -stdlib=libc++\"" - TESTFOLDER=test/unit/math/prim/mat/prob - - <<: *linux_clang - env: - - MATRIX_EVAL="CXX=\"clang++-3.8 -stdlib=libc++\"" - TESTFOLDER="test/unit/math/prim/mat/fun test/unit/math/prim/mat/functor" - - <<: *linux_clang - env: - - MATRIX_EVAL="CXX=\"clang++-3.8 -stdlib=libc++\"" - TESTFOLDER="test/unit/math/rev/scal test/unit/math/rev/arr" - - <<: *linux_clang - env: - - MATRIX_EVAL="CXX=\"clang++-3.8 -stdlib=libc++\"" - TESTFOLDER=test/unit/math/rev/mat/fun - - <<: *linux_clang - env: - - MATRIX_EVAL="CXX=\"clang++-3.8 -stdlib=libc++\"" - TESTFOLDER="test/unit/math/rev/mat/err test/unit/math/rev/mat/functor test/unit/math/rev/mat/vectorize" - - <<: *linux_clang - env: - - MATRIX_EVAL="CXX=\"clang++-3.8 -stdlib=libc++\"" - TESTFOLDER="test/unit/math/rev/mat/meta test/unit/math/rev/mat/prob" - - <<: *linux_clang - env: - - MATRIX_EVAL="CXX=\"clang++-3.8 -stdlib=libc++\"" - TESTFOLDER=test/unit/math/fwd/mat - - <<: *linux_clang - env: - - MATRIX_EVAL="CXX=\"clang++-3.8 -stdlib=libc++\"" - TESTFOLDER="test/unit/math/fwd/arr test/unit/math/fwd/core test/unit/math/fwd/scal" - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER="test/unit/math/memory test/unit/math/prim/scal test/unit/math/prim/arr" - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER="test/unit/math/prim/mat/err test/unit/math/prim/mat/meta test/unit/math/prim/mat/vectorize" - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER=test/unit/math/prim/mat/prob - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER=test/unit/math/prim/mat/fun - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER="test/unit/math/rev/scal test/unit/math/rev/arr" - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - STAN_NUM_THREADS="-1" - TESTFOLDER="test/unit/math/rev/mat/fun test/unit/math/prim/mat/functor" - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - STAN_NUM_THREADS="-1" - TESTFOLDER="test/unit/math/rev/mat/err test/unit/math/rev/mat/functor test/unit/math/rev/mat/vectorize" - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER="test/unit/math/rev/mat/meta test/unit/math/rev/mat/prob" - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER=test/unit/math/fwd/mat - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER="test/unit/math/fwd/arr test/unit/math/fwd/core test/unit/math/fwd/scal" - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER="test/unit/math/mix/arr test/unit/math/mix/core" - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER="test/unit/math/mix/mat/fun/[A-l]*" - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER="test/unit/math/mix/mat/fun/[m-z]*" - - <<: *linux_gcc - env: - - MATRIX_EVAL="CXX=\"g++-4.9 -DSTAN_THREADS\"" - TESTFOLDER="test/unit/math/mix/scal test/unit/math/mix/mat/functor test/unit/math/mix/mat/meta test/unit/math/mix/mat/prob test/unit/math/mix/mat/util test/unit/math/mix/mat/vectorize" - - # - TESTFOLDER=test/unit/math/mix # times out on travis - -script: - - if [ ! -z ${STAN_MPI} ]; then echo "STAN_MPI=true" >> make/local; echo "Testing MPI"; fi - - PARALLEL=2 ./runTests.py -j2 $TESTFOLDER - -sudo: false -dist: trusty diff --git a/Jenkinsfile b/Jenkinsfile index 2a90aa1f6bb..088a21a7e72 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -146,8 +146,18 @@ pipeline { } stage('Vanilla tests') { parallel { - stage('Unit') { - agent any + stage('Linux Unit') { + agent { label 'linux' } + steps { + deleteDir() + unstash 'MathSetup' + sh setupCC() + runTests("test/unit") + } + post { always { retry(3) { deleteDir() } } } + } + stage('Mac Unit') { + agent { label 'osx' } steps { deleteDir() unstash 'MathSetup' @@ -211,6 +221,17 @@ pipeline { } post { always { retry(3) { deleteDir() } } } } + stage('Unit with threading') { + agent any + steps { + deleteDir() + unstash 'MathSetup' + sh setupCC() + sh "echo CXXFLAGS+=-DSTAN_THREADS >> make/local" + runTests("test/unit") + } + post { always { retry(3) { deleteDir() } } } + } } } stage('Upstream tests') { From 6bd9304848763395297a18dced1b4154d07ca00e Mon Sep 17 00:00:00 2001 From: Sean Talts Date: Mon, 16 Jul 2018 13:22:39 -0400 Subject: [PATCH 2/6] Reorder to allow Mac to be used --- Jenkinsfile | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 088a21a7e72..b81d039f165 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -146,26 +146,6 @@ pipeline { } stage('Vanilla tests') { parallel { - stage('Linux Unit') { - agent { label 'linux' } - steps { - deleteDir() - unstash 'MathSetup' - sh setupCC() - runTests("test/unit") - } - post { always { retry(3) { deleteDir() } } } - } - stage('Mac Unit') { - agent { label 'osx' } - steps { - deleteDir() - unstash 'MathSetup' - sh setupCC() - runTests("test/unit") - } - post { always { retry(3) { deleteDir() } } } - } stage('Distribution tests') { agent { label "distribution-tests" } steps { @@ -193,6 +173,26 @@ pipeline { } } } + stage('Linux Unit') { + agent { label 'linux' } + steps { + deleteDir() + unstash 'MathSetup' + sh setupCC() + runTests("test/unit") + } + post { always { retry(3) { deleteDir() } } } + } + stage('Mac Unit') { + agent { label 'osx' } + steps { + deleteDir() + unstash 'MathSetup' + sh setupCC() + runTests("test/unit") + } + post { always { retry(3) { deleteDir() } } } + } } } stage('Modded tests') { From 178e788b862c2813ca4caf9c9667d68858a2a119 Mon Sep 17 00:00:00 2001 From: Sean Talts Date: Thu, 19 Jul 2018 14:35:55 -0400 Subject: [PATCH 3/6] Use GCC on Linux. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b81d039f165..b7b6ecdd987 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -178,7 +178,7 @@ pipeline { steps { deleteDir() unstash 'MathSetup' - sh setupCC() + writeFile(file: "make/local", text: "CC=${GCC}") runTests("test/unit") } post { always { retry(3) { deleteDir() } } } From 4d654c8afa639a20445ba7c9ce4f0eb3b1254a4d Mon Sep 17 00:00:00 2001 From: Sean Talts Date: Sat, 21 Jul 2018 01:11:14 -0400 Subject: [PATCH 4/6] Use new test plan: http://discourse.mc-stan.org/t/one-compiler-per-os/4899/91 --- Jenkinsfile | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b7b6ecdd987..ca6b8b4817c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -125,6 +125,7 @@ pipeline { post { always { warnings consoleParsers: [[parserName: 'CppLint']], canRunOnFailed: true + warnings consoleParsers: [[parserName: 'math-dependencies']], canRunOnFailed: true deleteDir() } } @@ -139,11 +140,22 @@ pipeline { } post { always { - warnings consoleParsers: [[parserName: 'math-dependencies']], canRunOnFailed: true + warnings canRunOnFailed: true, consoleParsers: [[parserName: 'GNU C Compiler 4 (gcc)'], [parserName: 'Clang (LLVM based)']] deleteDir() } } } + stage('Linux Unit with MPI') { + agent { label 'linux' } + steps { + deleteDir() + unstash 'MathSetup' + sh "echo CC=${MPICXX} >> make/local" + sh "echo STAN_MPI=true >> make/local" + runTests("test/unit") + } + post { always { retry(3) { deleteDir() } } } + } stage('Vanilla tests') { parallel { stage('Distribution tests') { @@ -173,29 +185,21 @@ pipeline { } } } - stage('Linux Unit') { - agent { label 'linux' } - steps { - deleteDir() - unstash 'MathSetup' - writeFile(file: "make/local", text: "CC=${GCC}") - runTests("test/unit") - } - post { always { retry(3) { deleteDir() } } } - } - stage('Mac Unit') { + stage('Mac Unit with Threading') { agent { label 'osx' } steps { deleteDir() unstash 'MathSetup' sh setupCC() + sh "echo CXXFLAGS+=-DSTAN_THREADS >> make/local" runTests("test/unit") } post { always { retry(3) { deleteDir() } } } } } } - stage('Modded tests') { + stage('Additional merge tests') { + when { anyOf { branch 'develop'; branch 'master' } } parallel { stage('Unit with GPU') { agent { label "gelman-group-mac" } @@ -210,19 +214,8 @@ pipeline { } post { always { retry(3) { deleteDir() } } } } - stage('Unit with MPI') { - agent any - steps { - deleteDir() - unstash 'MathSetup' - sh "echo CC=${MPICXX} >> make/local" - sh "echo STAN_MPI=true >> make/local" - runTests("test/unit") - } - post { always { retry(3) { deleteDir() } } } - } - stage('Unit with threading') { - agent any + stage('Linux Unit with Threading') { + agent { label 'linux' } steps { deleteDir() unstash 'MathSetup' From 6ad2dfb75f63035ab33f48ec7dccd5799046dbd1 Mon Sep 17 00:00:00 2001 From: Sean Talts Date: Sat, 21 Jul 2018 11:54:26 -0400 Subject: [PATCH 5/6] Use GCC on all Linux tests; change name --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ca6b8b4817c..ffc09e66680 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -156,7 +156,7 @@ pipeline { } post { always { retry(3) { deleteDir() } } } } - stage('Vanilla tests') { + stage('Always-run tests') { parallel { stage('Distribution tests') { agent { label "distribution-tests" } @@ -219,7 +219,7 @@ pipeline { steps { deleteDir() unstash 'MathSetup' - sh setupCC() + sh "echo CC=${GCC} >> make/local" sh "echo CXXFLAGS+=-DSTAN_THREADS >> make/local" runTests("test/unit") } From d5627ab1b6f435b992f6c37d501b4089074a5588 Mon Sep 17 00:00:00 2001 From: Sean Talts Date: Tue, 24 Jul 2018 15:36:02 -0400 Subject: [PATCH 6/6] More easily see what compilers are being used. --- Jenkinsfile | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ffc09e66680..e6785018d22 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,18 +2,6 @@ @Library('StanUtils') import org.stan.Utils -def setupCC(Boolean failOnError = true) { - errorStr = failOnError ? "-Werror " : "" - "echo CC=${env.CXX} ${errorStr}> make/local" -} - -def setup(Boolean failOnError = true) { - sh """ - git clean -xffd - ${setupCC(failOnError)} - """ -} - def runTests(String testPath) { sh "./runTests.py -j${env.PARALLEL} ${testPath} --make-only" try { sh "./runTests.py -j${env.PARALLEL} ${testPath}" } @@ -112,9 +100,9 @@ pipeline { script { deleteDir() retry(3) { checkout scm } - setup(false) + sh "git clean -xffd" stash 'MathSetup' - sh setupCC() + sh "echo CC=${env.CXX} -Werror > make/local" parallel( CppLint: { sh "make cpplint" }, Dependencies: { sh 'make test-math-dependencies' } , @@ -135,7 +123,7 @@ pipeline { steps { deleteDir() unstash 'MathSetup' - sh setupCC() + sh "echo CC=${env.CXX} -Werror > make/local" sh "make -j${env.PARALLEL} test-headers" } post { @@ -164,7 +152,7 @@ pipeline { deleteDir() unstash 'MathSetup' sh """ - ${setupCC(false)} + echo CC=${env.CXX} > make/local echo 'O=0' >> make/local echo N_TESTS=${env.N_TESTS} >> make/local """ @@ -190,7 +178,7 @@ pipeline { steps { deleteDir() unstash 'MathSetup' - sh setupCC() + sh "echo CC=${env.CXX} -Werror > make/local" sh "echo CXXFLAGS+=-DSTAN_THREADS >> make/local" runTests("test/unit") } @@ -206,7 +194,7 @@ pipeline { steps { deleteDir() unstash 'MathSetup' - sh setupCC() + sh "echo CC=${env.CXX} -Werror > make/local" sh "echo STAN_OPENCL=true>> make/local" sh "echo OPENCL_PLATFORM_ID=0>> make/local" sh "echo OPENCL_DEVICE_ID=0>> make/local"