diff --git a/projects/rocrand/.jenkins/common.groovy b/projects/rocrand/.jenkins/common.groovy deleted file mode 100644 index d4cad14e141..00000000000 --- a/projects/rocrand/.jenkins/common.groovy +++ /dev/null @@ -1,124 +0,0 @@ -// This file is for internal AMD use. -// If you are interested in running your own Jenkins, please raise a github issue for assistance. - -def runCompileCommand(platform, project, jobName, boolean debug=false, boolean staticLibrary=false, boolean codeCoverage=false) -{ - project.paths.construct_build_prefix() - - project.paths.build_command = './install -c' - String buildTypeArg = debug ? '-DCMAKE_BUILD_TYPE=Debug' : '-DCMAKE_BUILD_TYPE=Release' - String buildTypeDir = debug ? 'debug' : 'release' - String buildStatic = staticLibrary ? '-DBUILD_SHARED_LIBS=OFF' : '-DBUILD_SHARED_LIBS=ON' - String codeCovFlag = codeCoverage ? '-DCODE_COVERAGE=ON' : '' - String cmake = platform.jenkinsLabel.contains('centos') ? 'cmake3' : 'cmake' - String cmakePrefixPath = '-DCMAKE_PREFIX_PATH="/opt/rocm;/opt/rocm/llvm;/opt/rocm/bin"' - //Set CI node's gfx arch as target if PR, otherwise use default targets of the library - String amdgpuTargets = env.BRANCH_NAME.startsWith('PR-') ? '-DAMDGPU_TARGETS=\$gfx_arch' : '' - - def command = """#!/usr/bin/env bash - set -x - cd ${project.paths.project_build_prefix} - mkdir -p build/${buildTypeDir} && cd build/${buildTypeDir} - # gfxTargetParser reads gfxarch and adds target features such as xnack - ${auxiliary.gfxTargetParser()} - ${cmake} --toolchain=toolchain-linux.cmake ${cmakePrefixPath} ${buildTypeArg} ${buildStatic} ${amdgpuTargets} ${codeCovFlag} -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON ../.. - make -j\$(nproc) - """ - - platform.runCommand(this, command) -} - -def runTestCommand (platform, project, boolean rocmExamples=false) -{ - String sudo = auxiliary.sudo(platform.jenkinsLabel) - // String centos = platform.jenkinsLabel.contains('centos') ? '3' : '' - // Disable xorwow test for now as it is a known failure with gfx90a. - // def testCommand = "ctest${centos} --output-on-failure" - def testCommand = "ctest --output-on-failure" - - def command = """#!/usr/bin/env bash - set -x - cd ${project.paths.project_build_prefix}/build/release - make -j4 - ${sudo} LD_LIBRARY_PATH=/opt/rocm/lib/ ${testCommand} - """ - - platform.runCommand(this, command) - //ROCM Examples - if (rocmExamples){ - String buildString = "" - if (platform.os.contains("ubuntu")){ - buildString += "sudo dpkg -i *.deb" - } - else { - buildString += "sudo rpm -i *.rpm" - } - testCommand = """#!/usr/bin/env bash - set -ex - cd ${project.paths.project_build_prefix}/build/release/package - ${buildString} - cd ../../.. - testDirs=("Libraries/rocRAND") - git clone https://github.com/ROCm/rocm-examples.git - rocm_examples_dir=\$(readlink -f rocm-examples) - for testDir in \${testDirs[@]}; do - cd \${rocm_examples_dir}/\${testDir} - cmake -S . -B build - cmake --build build - cd ./build - ctest --output-on-failure - done - """ - platform.runCommand(this, testCommand, "ROCM Examples") - - } -} - -def runPackageCommand(platform, project) -{ - def packageHelper = platform.makePackage(platform.jenkinsLabel,"${project.paths.project_build_prefix}/build/release") - - platform.runCommand(this, packageHelper[0]) - platform.archiveArtifacts(this, packageHelper[1]) -} - -def runCodeCovTestCommand(platform, project, jobName) -{ - withCredentials([string(credentialsId: 'mathlibs-codecov-token-rocrand', variable: 'CODECOV_TOKEN')]) - { - String prflag = env.CHANGE_ID ? "--pr \"${env.CHANGE_ID}\"" : '' - - String objectFlags = "-object ./library/librocrand.so" - - String profdataFile = "./rocRand.profdata" - String reportFile = "./code_cov_rocRand.report" - String coverageFile = "./code_cov_rocRand.txt" - String coverageFilter = "(.*googletest-src.*)|(.*/yaml-cpp-src/.*)|(.*hip/include.*)|(.*/include/llvm/.*)|(.*test/unit.*)|(.*/spdlog/.*)|(.*/msgpack-src/.*)" - - def command = """#!/usr/bin/env bash - set -ex - cd ${project.paths.project_build_prefix}/build/release - #Remove any preexisting prof files. - rm -rf ./test/*.profraw - - #The `%m` creates a different prof file for each object file. - LLVM_PROFILE_FILE=./rocRand_%m.profraw ctest --output-on-failure - - #this combines them back together. - /opt/rocm/llvm/bin/llvm-profdata merge -sparse ./test/*.profraw -o ${profdataFile} - - #For some reason, with the -object flag, we can't just specify the source directory, so we have to filter out the files we don't want. - /opt/rocm/llvm/bin/llvm-cov report ${objectFlags} -instr-profile=${profdataFile} -ignore-filename-regex="${coverageFilter}" > ${reportFile} - cat ${reportFile} - /opt/rocm/llvm/bin/llvm-cov show -Xdemangler=/opt/rocm/llvm/bin/llvm-cxxfilt ${objectFlags} -instr-profile=${profdataFile} -ignore-filename-regex="${coverageFilter}" > ${coverageFile} - - #Upload report to codecov - curl -Os https://uploader.codecov.io/latest/linux/codecov - chmod +x codecov - ./codecov -t ${CODECOV_TOKEN} ${prflag} --flags "${platform.gpu}" --sha \$(git rev-parse HEAD) --name "CI: ${jobName}" --file ${coverageFile} -v - """ - platform.runCommand(this, command) - } -} - -return this diff --git a/projects/rocrand/.jenkins/precheckin.groovy b/projects/rocrand/.jenkins/precheckin.groovy deleted file mode 100644 index 02a84826007..00000000000 --- a/projects/rocrand/.jenkins/precheckin.groovy +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env groovy -@Library('rocJenkins@pong') _ -import com.amd.project.* -import com.amd.docker.* -import java.nio.file.Path; - -def runCI = -{ - nodeDetails, jobName-> - - def prj = new rocProject('rocRAND', 'PreCheckin') - - def nodes = new dockerNodes(nodeDetails, jobName, prj) - - def commonGroovy - - boolean formatCheck = false - - def compileCommand = - { - platform, project-> - - commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy" - commonGroovy.runCompileCommand(platform, project, jobName) - } - - - def testCommand = - { - platform, project-> - - commonGroovy.runTestCommand(platform, project, true) - } - - def packageCommand = - { - platform, project-> - - commonGroovy.runPackageCommand(platform, project) - } - - buildProject(prj, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand) -} - -ci: { - String urlJobName = auxiliary.getTopJobName(env.BUILD_URL) - - def propertyList = ["compute-rocm-dkms-no-npi-hipclang":[pipelineTriggers([cron('0 1 * * 0')])]] - propertyList = auxiliary.appendPropertyList(propertyList) - - def jobNameList = ["compute-rocm-dkms-no-npi-hipclang":([ubuntu18:['gfx900'],centos7:['gfx906'],centos8:['gfx906'],sles15sp1:['gfx908']])] - jobNameList = auxiliary.appendJobNameList(jobNameList) - - propertyList.each - { - jobName, property-> - if (urlJobName == jobName) - properties(auxiliary.addCommonProperties(property)) - } - - jobNameList.each - { - jobName, nodeDetails-> - if (urlJobName == jobName) - stage(jobName) { - runCI(nodeDetails, jobName) - } - } - - // For url job names that are not listed by the jobNameList i.e. compute-rocm-dkms-no-npi-1901 - if(!jobNameList.keySet().contains(urlJobName)) - { - properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * *')])])) - stage(urlJobName) { - runCI([ubuntu16:['gfx906']], urlJobName) - } - } -} \ No newline at end of file diff --git a/projects/rocrand/.jenkins/static.groovy b/projects/rocrand/.jenkins/static.groovy deleted file mode 100644 index cee8d3def84..00000000000 --- a/projects/rocrand/.jenkins/static.groovy +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env groovy -@Library('rocJenkins@pong') _ -import com.amd.project.* -import com.amd.docker.* -import java.nio.file.Path; - -def runCI = -{ - nodeDetails, jobName-> - - def prj = new rocProject('rocRAND', 'static') - - def nodes = new dockerNodes(nodeDetails, jobName, prj) - - def commonGroovy - - boolean formatCheck = false - - def compileCommand = - { - platform, project-> - - commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy" - commonGroovy.runCompileCommand(platform, project, jobName, debug=false, staticLibrary=true) - } - - def testCommand = - { - platform, project-> - - commonGroovy.runTestCommand(platform, project) - } - - def packageCommand = - { - platform, project-> - - commonGroovy.runPackageCommand(platform, project) - } - - buildProject(prj, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand) -} - -ci: { - String urlJobName = auxiliary.getTopJobName(env.BUILD_URL) - - def propertyList = ["compute-rocm-dkms-no-npi-hipclang":[pipelineTriggers([cron('0 1 * * 0')])]] - propertyList = auxiliary.appendPropertyList(propertyList) - - def jobNameList = ["compute-rocm-dkms-no-npi-hipclang":([ubuntu18:['gfx900'],centos7:['gfx906'],centos8:['gfx906'],sles15sp1:['gfx908']])] - jobNameList = auxiliary.appendJobNameList(jobNameList) - - propertyList.each - { - jobName, property-> - if (urlJobName == jobName) - properties(auxiliary.addCommonProperties(property)) - } - - jobNameList.each - { - jobName, nodeDetails-> - if (urlJobName == jobName) - stage(jobName) { - runCI(nodeDetails, jobName) - } - } - - // For url job names that are not listed by the jobNameList i.e. compute-rocm-dkms-no-npi-1901 - if(!jobNameList.keySet().contains(urlJobName)) - { - properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * *')])])) - stage(urlJobName) { - runCI([ubuntu16:['gfx906']], urlJobName) - } - } -} diff --git a/projects/rocrand/.jenkins/staticanalysis.groovy b/projects/rocrand/.jenkins/staticanalysis.groovy deleted file mode 100644 index c41e309f893..00000000000 --- a/projects/rocrand/.jenkins/staticanalysis.groovy +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env groovy -// This shared library is available at https://github.com/ROCmSoftwarePlatform/rocJENKINS/ -@Library('rocJenkins@pong') _ - -// 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.* -import java.nio.file.Path - -def runCompileCommand(platform, project, jobName, boolean debug=false) -{ - project.paths.construct_build_prefix() -} - -def runCI = -{ - nodeDetails, jobName-> - - def prj = new rocProject('rocRAND', 'StaticAnalysis') - - // Define test architectures, optional rocm version argument is available - def nodes = new dockerNodes(nodeDetails, jobName, prj) - - boolean formatCheck = false - boolean staticAnalysis = true - - def compileCommand = - { - platform, project-> - - runCompileCommand(platform, project, jobName, false) - } - - buildProject(prj , formatCheck, nodes.dockerArray, compileCommand, null, null, staticAnalysis) -} - -ci: { - String urlJobName = auxiliary.getTopJobName(env.BUILD_URL) - - properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * 6')])])) - - def jobNameList = ["main":([ubuntu22:['any']])] - jobNameList = auxiliary.appendJobNameList(jobNameList, 'rocBLAS') - - jobNameList.each - { - jobName, nodeDetails-> - if (urlJobName == jobName) - stage(jobName) { - runCI(nodeDetails, jobName) - } - } -}