From b95840c562f04913e946d3a73a563bf575d6677e Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Fri, 10 May 2019 10:44:00 +0200 Subject: [PATCH 1/5] Create the Jenkinsfile --- Jenkinsfile | 12 ++++++++++++ sbatch_test.sh | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 Jenkinsfile create mode 100644 sbatch_test.sh diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..ce5dea9 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,12 @@ +pipeline { + agent {label 'scs_daintvm1'} + stages { + stage('test') { + steps { + sh '''#!/bin/bash -l + sbatch --wait sbatch_test.sh + cat test.out''' + } + } + } +} diff --git a/sbatch_test.sh b/sbatch_test.sh new file mode 100644 index 0000000..53dad32 --- /dev/null +++ b/sbatch_test.sh @@ -0,0 +1,19 @@ +#!/bin/bash -l +#SBATCH --time=00:10:00 +#SBATCH --nodes=1 +#SBATCH --constraint=gpu +#SBATCH --partition=cscsci +#SBATCH --output=test.out +#SBATCH --error=test.err + +source environment.sh +cd cmake/handson/3_installing_libs/solution/dotprod_with_export +mkdir build && cd build +cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/../install +make install +./tests/test_norm +cd ../../../exercise/dotprodcl +mkdir build && cd build +cmake .. -DDotprod_DIR=$(pwd)/../../../solution/dotprod_with_export/install/lib64/cmake +make +./src/dotprodcl --size=20 From 722b42865fb9e3523476839b717317a6686a36ea Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Fri, 10 May 2019 15:42:32 +0200 Subject: [PATCH 2/5] Archive the artifacts --- Jenkinsfile | 4 +++- sbatch_test.sh | 9 ++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ce5dea9..fd56fc6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,9 @@ pipeline { steps { sh '''#!/bin/bash -l sbatch --wait sbatch_test.sh - cat test.out''' + cat test.out + grep '100% tests passed'''' + archiveArtifacts 'test.out test.err' } } } diff --git a/sbatch_test.sh b/sbatch_test.sh index 53dad32..f4b97c2 100644 --- a/sbatch_test.sh +++ b/sbatch_test.sh @@ -7,13 +7,8 @@ #SBATCH --error=test.err source environment.sh -cd cmake/handson/3_installing_libs/solution/dotprod_with_export +cd cmake/handson/4_advanced/solution/dotprod mkdir build && cd build cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/../install make install -./tests/test_norm -cd ../../../exercise/dotprodcl -mkdir build && cd build -cmake .. -DDotprod_DIR=$(pwd)/../../../solution/dotprod_with_export/install/lib64/cmake -make -./src/dotprodcl --size=20 +make test From adba8671231067e9de14921a8f253a2cbd56d27b Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Fri, 10 May 2019 15:53:18 +0200 Subject: [PATCH 3/5] Bug fix --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fd56fc6..8afb659 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { sh '''#!/bin/bash -l sbatch --wait sbatch_test.sh cat test.out - grep '100% tests passed'''' + grep '100% tests passed' test.out''' archiveArtifacts 'test.out test.err' } } From 9a4195540b7e709f740f31f4c4a837e0a492b2c2 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Fri, 10 May 2019 16:06:03 +0200 Subject: [PATCH 4/5] Add deleteDir --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8afb659..bd087c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,8 +7,14 @@ pipeline { sbatch --wait sbatch_test.sh cat test.out grep '100% tests passed' test.out''' - archiveArtifacts 'test.out test.err' + + archiveArtifacts 'test.out,test.err' } } } + post { + always { + deleteDir() + } + } } From 6ea866ec2d64559d0dd47547719133f10fb94de1 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Mon, 13 May 2019 23:30:34 +0200 Subject: [PATCH 5/5] Rename Jenkinsfile --- Jenkinsfile => Jenkinsfile_cscs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Jenkinsfile => Jenkinsfile_cscs (100%) diff --git a/Jenkinsfile b/Jenkinsfile_cscs similarity index 100% rename from Jenkinsfile rename to Jenkinsfile_cscs