From 36f5ea19e4cffb26909762889e45bc37579758aa Mon Sep 17 00:00:00 2001 From: Saad Rahim Date: Wed, 21 Aug 2019 13:36:05 -0700 Subject: [PATCH 1/7] Adding Jenkins job to tests Tensile Develop latest --- Jenkinsfile.dependency | 169 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 Jenkinsfile.dependency diff --git a/Jenkinsfile.dependency b/Jenkinsfile.dependency new file mode 100644 index 000000000..e4f01f399 --- /dev/null +++ b/Jenkinsfile.dependency @@ -0,0 +1,169 @@ +#!/usr/bin/env groovy +// This shared library is available at https://github.com/ROCmSoftwarePlatform/rocJENKINS/ +@Library('rocJenkins') _ + +// This is file for internal AMD use. +// If you are interested in running your own Jenkins, please raise a github issue for assistance. + +import com.amd.project.* +import com.amd.docker.* + +//////////////////////////////////////////////////////////////////////// +// Mostly generated from snippet generator 'properties; set job properties' +// Time-based triggers added to execute nightly tests, eg '30 2 * * *' means 2:30 AM +properties([ + pipelineTriggers([cron('0 1 * * *'), [$class: 'PeriodicFolderTrigger', interval: '5m']]), + buildDiscarder(logRotator( + artifactDaysToKeepStr: '', + artifactNumToKeepStr: '', + daysToKeepStr: '', + numToKeepStr: '10')), + disableConcurrentBuilds(), + [$class: 'CopyArtifactPermissionProperty', projectNames: '*'] + ]) + +import java.nio.file.Path; + +rocBLASCI: +{ + + def rocblas = new rocProject('rocBLAS') + // customize for project + rocblas.paths.build_command = './install.sh -lasm_ci -c --b develop' + + // Define test architectures, optional rocm version argument is available + def nodes = new dockerNodes(['gfx900 && ubuntu', 'gfx906 && centos7'], rocblas) + + boolean formatCheck = true + + def compileCommand = + { + platform, project-> + + project.paths.construct_build_prefix() + + def command + + if(platform.jenkinsLabel.contains('hip-clang')) + { + command = """#!/usr/bin/env bash + set -x + cd ${project.paths.project_build_prefix} + LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX=/opt/rocm/bin/hipcc ${project.paths.build_command} --hip-clang + """ + } + else + { + command = """#!/usr/bin/env bash + set -x + cd ${project.paths.project_build_prefix} + LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX=/opt/rocm/bin/hcc ${project.paths.build_command} + """ + } + platform.runCommand(this, command) + } + + def testCommand = + { + platform, project-> + + def command + + if(platform.jenkinsLabel.contains('centos')) + { + if(auxiliary.isJobStartedByTimer()) + { + command = """#!/usr/bin/env bash + set -x + cd ${project.paths.project_build_prefix}/build/release/clients/staging + LD_LIBRARY_PATH=/opt/rocm/hcc/lib GTEST_LISTENER=NO_PASS_LINE_IN_LOG sudo ./rocblas-test --gtest_output=xml --gtest_color=yes --gtest_filter=*nightly*-*known_bug* #--gtest_filter=*nightly* + """ + + platform.runCommand(this, command) + junit "${project.paths.project_build_prefix}/build/release/clients/staging/*.xml" + } + else + { + command = """#!/usr/bin/env bash + set -x + cd ${project.paths.project_build_prefix}/build/release/clients/staging + LD_LIBRARY_PATH=/opt/rocm/hcc/lib ./example-sscal + LD_LIBRARY_PATH=/opt/rocm/hcc/lib GTEST_LISTENER=NO_PASS_LINE_IN_LOG sudo ./rocblas-test --gtest_output=xml --gtest_color=yes --gtest_filter=*quick*:*pre_checkin*-*known_bug* #--gtest_filter=*checkin* + """ + + platform.runCommand(this, command) + junit "${project.paths.project_build_prefix}/build/release/clients/staging/*.xml" + } + } + else + { + if(auxiliary.isJobStartedByTimer()) + { + command = """#!/usr/bin/env bash + set -x + cd ${project.paths.project_build_prefix}/build/release/clients/staging + LD_LIBRARY_PATH=/opt/rocm/hcc/lib GTEST_LISTENER=NO_PASS_LINE_IN_LOG ./rocblas-test --gtest_output=xml --gtest_color=yes --gtest_filter=*nightly*-*known_bug* #--gtest_filter=*nightly* + """ + + platform.runCommand(this, command) + junit "${project.paths.project_build_prefix}/build/release/clients/staging/*.xml" + } + else + { + command = """#!/usr/bin/env bash + set -x + cd ${project.paths.project_build_prefix}/build/release/clients/staging + LD_LIBRARY_PATH=/opt/rocm/hcc/lib ./example-sscal + LD_LIBRARY_PATH=/opt/rocm/hcc/lib GTEST_LISTENER=NO_PASS_LINE_IN_LOG ./rocblas-test --gtest_output=xml --gtest_color=yes --gtest_filter=*quick*:*pre_checkin*-*known_bug* #--gtest_filter=*checkin* + """ + + platform.runCommand(this, command) + junit "${project.paths.project_build_prefix}/build/release/clients/staging/*.xml" + } + } + } + + def packageCommand = + { + platform, project-> + + def command + + if(platform.jenkinsLabel.contains('centos')) + { + command = """ + set -x + cd ${project.paths.project_build_prefix}/build/release + make package + mkdir -p package + mv *.rpm package/ + rpm -qlp package/*.rpm + """ + + platform.runCommand(this, command) + platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/build/release/package/*.rpm""") + } + else if(platform.jenkinsLabel.contains('hip-clang')) + { + packageCommand = null + } + else + { + command = """ + set -x + cd ${project.paths.project_build_prefix}/build/release + make package + make package_clients + mkdir -p package + mv *.deb package/ + mv clients/*.deb package/ + """ + + platform.runCommand(this, command) + platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/build/release/package/*.deb""") + } + } + + buildProject(rocblas, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand) + +} From 9e7d07b1f11404f23a6b757d7b5ca3777e7afe91 Mon Sep 17 00:00:00 2001 From: Saad Rahim Date: Wed, 21 Aug 2019 13:44:09 -0700 Subject: [PATCH 2/7] fixing typo --- Jenkinsfile.dependency | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.dependency b/Jenkinsfile.dependency index e4f01f399..fd121d21a 100644 --- a/Jenkinsfile.dependency +++ b/Jenkinsfile.dependency @@ -29,7 +29,7 @@ rocBLASCI: def rocblas = new rocProject('rocBLAS') // customize for project - rocblas.paths.build_command = './install.sh -lasm_ci -c --b develop' + rocblas.paths.build_command = './install.sh -lasm_ci -c -b develop' // Define test architectures, optional rocm version argument is available def nodes = new dockerNodes(['gfx900 && ubuntu', 'gfx906 && centos7'], rocblas) From 1748a0ab084f4277b412d2d670ccd720a790f067 Mon Sep 17 00:00:00 2001 From: amdkila <47991923+amdkila@users.noreply.github.com> Date: Wed, 21 Aug 2019 15:06:32 -0600 Subject: [PATCH 3/7] Removed pre-checkin tests Also added -ex flag so compile stage will fail and not try to run tests --- Jenkinsfile.dependency | 62 +++++++++++------------------------------- 1 file changed, 16 insertions(+), 46 deletions(-) diff --git a/Jenkinsfile.dependency b/Jenkinsfile.dependency index fd121d21a..283dca69a 100644 --- a/Jenkinsfile.dependency +++ b/Jenkinsfile.dependency @@ -47,7 +47,7 @@ rocBLASCI: if(platform.jenkinsLabel.contains('hip-clang')) { command = """#!/usr/bin/env bash - set -x + set -ex cd ${project.paths.project_build_prefix} LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX=/opt/rocm/bin/hipcc ${project.paths.build_command} --hip-clang """ @@ -55,7 +55,7 @@ rocBLASCI: else { command = """#!/usr/bin/env bash - set -x + set -ex cd ${project.paths.project_build_prefix} LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX=/opt/rocm/bin/hcc ${project.paths.build_command} """ @@ -71,55 +71,25 @@ rocBLASCI: if(platform.jenkinsLabel.contains('centos')) { - if(auxiliary.isJobStartedByTimer()) - { - command = """#!/usr/bin/env bash - set -x - cd ${project.paths.project_build_prefix}/build/release/clients/staging - LD_LIBRARY_PATH=/opt/rocm/hcc/lib GTEST_LISTENER=NO_PASS_LINE_IN_LOG sudo ./rocblas-test --gtest_output=xml --gtest_color=yes --gtest_filter=*nightly*-*known_bug* #--gtest_filter=*nightly* - """ - - platform.runCommand(this, command) - junit "${project.paths.project_build_prefix}/build/release/clients/staging/*.xml" - } - else - { - command = """#!/usr/bin/env bash - set -x - cd ${project.paths.project_build_prefix}/build/release/clients/staging - LD_LIBRARY_PATH=/opt/rocm/hcc/lib ./example-sscal - LD_LIBRARY_PATH=/opt/rocm/hcc/lib GTEST_LISTENER=NO_PASS_LINE_IN_LOG sudo ./rocblas-test --gtest_output=xml --gtest_color=yes --gtest_filter=*quick*:*pre_checkin*-*known_bug* #--gtest_filter=*checkin* - """ + command = """#!/usr/bin/env bash + set -x + cd ${project.paths.project_build_prefix}/build/release/clients/staging + LD_LIBRARY_PATH=/opt/rocm/hcc/lib GTEST_LISTENER=NO_PASS_LINE_IN_LOG sudo ./rocblas-test --gtest_output=xml --gtest_color=yes --gtest_filter=*nightly*-*known_bug* #--gtest_filter=*nightly* + """ - platform.runCommand(this, command) - junit "${project.paths.project_build_prefix}/build/release/clients/staging/*.xml" - } + platform.runCommand(this, command) + junit "${project.paths.project_build_prefix}/build/release/clients/staging/*.xml" } else { - if(auxiliary.isJobStartedByTimer()) - { - command = """#!/usr/bin/env bash - set -x - cd ${project.paths.project_build_prefix}/build/release/clients/staging - LD_LIBRARY_PATH=/opt/rocm/hcc/lib GTEST_LISTENER=NO_PASS_LINE_IN_LOG ./rocblas-test --gtest_output=xml --gtest_color=yes --gtest_filter=*nightly*-*known_bug* #--gtest_filter=*nightly* - """ - - platform.runCommand(this, command) - junit "${project.paths.project_build_prefix}/build/release/clients/staging/*.xml" - } - else - { - command = """#!/usr/bin/env bash - set -x - cd ${project.paths.project_build_prefix}/build/release/clients/staging - LD_LIBRARY_PATH=/opt/rocm/hcc/lib ./example-sscal - LD_LIBRARY_PATH=/opt/rocm/hcc/lib GTEST_LISTENER=NO_PASS_LINE_IN_LOG ./rocblas-test --gtest_output=xml --gtest_color=yes --gtest_filter=*quick*:*pre_checkin*-*known_bug* #--gtest_filter=*checkin* - """ + command = """#!/usr/bin/env bash + set -x + cd ${project.paths.project_build_prefix}/build/release/clients/staging + LD_LIBRARY_PATH=/opt/rocm/hcc/lib GTEST_LISTENER=NO_PASS_LINE_IN_LOG ./rocblas-test --gtest_output=xml --gtest_color=yes --gtest_filter=*nightly*-*known_bug* #--gtest_filter=*nightly* + """ - platform.runCommand(this, command) - junit "${project.paths.project_build_prefix}/build/release/clients/staging/*.xml" - } + platform.runCommand(this, command) + junit "${project.paths.project_build_prefix}/build/release/clients/staging/*.xml" } } From dd1fc74daa1a97c985e87faff45d1fbb90119239 Mon Sep 17 00:00:00 2001 From: amdkila <47991923+amdkila@users.noreply.github.com> Date: Wed, 21 Aug 2019 17:07:07 -0600 Subject: [PATCH 4/7] Removed -e and Remote Triggers --- Jenkinsfile.dependency | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile.dependency b/Jenkinsfile.dependency index 283dca69a..663b869e4 100644 --- a/Jenkinsfile.dependency +++ b/Jenkinsfile.dependency @@ -12,7 +12,7 @@ import com.amd.docker.* // Mostly generated from snippet generator 'properties; set job properties' // Time-based triggers added to execute nightly tests, eg '30 2 * * *' means 2:30 AM properties([ - pipelineTriggers([cron('0 1 * * *'), [$class: 'PeriodicFolderTrigger', interval: '5m']]), + pipelineTriggers([cron('H 1 * * *')]), buildDiscarder(logRotator( artifactDaysToKeepStr: '', artifactNumToKeepStr: '', @@ -47,7 +47,7 @@ rocBLASCI: if(platform.jenkinsLabel.contains('hip-clang')) { command = """#!/usr/bin/env bash - set -ex + set -x cd ${project.paths.project_build_prefix} LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX=/opt/rocm/bin/hipcc ${project.paths.build_command} --hip-clang """ @@ -55,7 +55,7 @@ rocBLASCI: else { command = """#!/usr/bin/env bash - set -ex + set -x cd ${project.paths.project_build_prefix} LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX=/opt/rocm/bin/hcc ${project.paths.build_command} """ From fe7d59e4635e4ffbb19545a411af70ed6fda5b32 Mon Sep 17 00:00:00 2001 From: Saad Rahim Date: Thu, 22 Aug 2019 10:02:17 -0700 Subject: [PATCH 5/7] Changing to daily trigger --- Jenkinsfile.dependency | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile.dependency b/Jenkinsfile.dependency index 663b869e4..3c2dda024 100644 --- a/Jenkinsfile.dependency +++ b/Jenkinsfile.dependency @@ -8,11 +8,12 @@ import com.amd.project.* import com.amd.docker.* + //////////////////////////////////////////////////////////////////////// // Mostly generated from snippet generator 'properties; set job properties' // Time-based triggers added to execute nightly tests, eg '30 2 * * *' means 2:30 AM properties([ - pipelineTriggers([cron('H 1 * * *')]), + pipelineTriggers([$class: 'PeriodicFolderTrigger', interval: '1d']]), buildDiscarder(logRotator( artifactDaysToKeepStr: '', artifactNumToKeepStr: '', From f7b49d0483beef2ab6789c2bde47443ffa894978 Mon Sep 17 00:00:00 2001 From: Saad Rahim Date: Thu, 22 Aug 2019 10:04:35 -0700 Subject: [PATCH 6/7] Fixing brackets --- Jenkinsfile.dependency | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.dependency b/Jenkinsfile.dependency index 3c2dda024..c668975fb 100644 --- a/Jenkinsfile.dependency +++ b/Jenkinsfile.dependency @@ -13,7 +13,7 @@ import com.amd.docker.* // Mostly generated from snippet generator 'properties; set job properties' // Time-based triggers added to execute nightly tests, eg '30 2 * * *' means 2:30 AM properties([ - pipelineTriggers([$class: 'PeriodicFolderTrigger', interval: '1d']]), + pipelineTriggers([[$class: 'PeriodicFolderTrigger', interval: '1d']]), buildDiscarder(logRotator( artifactDaysToKeepStr: '', artifactNumToKeepStr: '', From eaa4618f930d59f7cbdf3202306bc2e93bc39a4d Mon Sep 17 00:00:00 2001 From: Saad Rahim Date: Fri, 23 Aug 2019 13:23:06 -0700 Subject: [PATCH 7/7] Adding .jenkins directory --- Jenkinsfile.dependency => .jenkins/Dependency | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Jenkinsfile.dependency => .jenkins/Dependency (100%) diff --git a/Jenkinsfile.dependency b/.jenkins/Dependency similarity index 100% rename from Jenkinsfile.dependency rename to .jenkins/Dependency