Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions projects/rocprim/.jenkins/asan.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/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('rocPRIM', 'PreCheckin')
prj.paths.build_command = './install -c'
prj.timeout.compile = 600

def nodes = new dockerNodes(nodeDetails, jobName, prj)

def settings = [addressSanitizer: true,
debug:false]

def commonGroovy

boolean formatCheck = false

def compileCommand =
{
platform, project->

commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy"
commonGroovy.runCompileCommand(platform, project, jobName, settings)
}

def testCommand =
{
platform, project->

commonGroovy.runTestCommand(platform, project, settings)
}

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":[pipelineTriggers([cron('0 1 * * 0')])],
"compute-rocm-dkms-no-npi-hipclang":[pipelineTriggers([cron('0 1 * * 0')])],
"rocm-docker":[]]
propertyList = auxiliary.appendPropertyList(propertyList)

def jobNameList = ["compute-rocm-dkms-no-npi-hipclang":([ubuntu18:['gfx900'],centos7:['gfx906'],centos8:['gfx906'],sles15sp1:['gfx908']])]
jobNameList = auxiliary.appendJobNameList(jobNameList, 'rocPRIM')

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)
}
}
}
24 changes: 17 additions & 7 deletions projects/rocprim/.jenkins/common.groovy
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// 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)
def runCompileCommand(platform, project, jobName, settings)
{
project.paths.construct_build_prefix()

String buildTypeArg = debug ? '-DCMAKE_BUILD_TYPE=Debug' : '-DCMAKE_BUILD_TYPE=Release'
String buildStatic = staticLibrary ? '-DBUILD_SHARED_LIBS=OFF' : '-DBUILD_SHARED_LIBS=ON'
String buildTypeDir = debug ? 'debug' : 'release'
String buildTypeArg = settings.debug ? '-DCMAKE_BUILD_TYPE=Debug' : '-DCMAKE_BUILD_TYPE=Release'
String buildTypeDir = settings.debug ? 'debug' : 'release'
String asanFlag = settings.addressSanitizer ? '-DBUILD_ADDRESS_SANITIZER=ON' : ''
String buildStatic = settings.staticLibrary ? '-DBUILD_SHARED_LIBS=OFF' : '-DBUILD_SHARED_LIBS=ON'
String cmake = platform.jenkinsLabel.contains('centos') ? 'cmake3' : 'cmake'
//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' : ''
Expand All @@ -17,15 +18,15 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s
cd ${project.paths.project_build_prefix}
mkdir -p build/${buildTypeDir} && cd build/${buildTypeDir}
${auxiliary.gfxTargetParser()}
${cmake} --toolchain=toolchain-linux.cmake ${buildTypeArg} ${buildStatic} ${amdgpuTargets} -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON ../..
${cmake} --toolchain=toolchain-linux.cmake ${buildTypeArg} ${buildStatic} ${amdgpuTargets} ${asanFlag} -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON ../..
make -j\$(nproc)
"""

platform.runCommand(this, command)
}


def runTestCommand (platform, project, boolean rocmExamples=false)
def runTestCommand (platform, project, settings)
{
String sudo = auxiliary.sudo(platform.jenkinsLabel)

Expand All @@ -52,10 +53,19 @@ def runTestCommand (platform, project, boolean rocmExamples=false)
hmmTestCommand = ''
echo("TESTS DISABLED")
}
def LD_PATH = ''
if (settings.addressSanitizer)
{
LD_PATH = """
export ASAN_LIB_PATH=\$(/opt/rocm/llvm/bin/clang -print-file-name=libclang_rt.asan-x86_64.so)
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$(dirname "\${ASAN_LIB_PATH}")
"""
}
def command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}
cd ${project.testDirectory}
${LD_PATH}
${testCommand} ${testCommandExclude}
if (( \$? != 0 )); then
exit 1
Expand All @@ -64,7 +74,7 @@ def runTestCommand (platform, project, boolean rocmExamples=false)
"""
platform.runCommand(this, command)
//ROCM Examples
if (rocmExamples){
if (settings.rocmExamples){
String buildString = ""
if (platform.os.contains("ubuntu")){
buildString += "sudo dpkg -i *.deb"
Expand Down
6 changes: 4 additions & 2 deletions projects/rocprim/.jenkins/precheckin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def runCI =
def nodes = new dockerNodes(nodeDetails, jobName, prj)

def commonGroovy
def settings = [rocmExamples:true,
debug:false]

boolean formatCheck = false

Expand All @@ -23,14 +25,14 @@ def runCI =
platform, project->

commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy"
commonGroovy.runCompileCommand(platform, project, jobName)
commonGroovy.runCompileCommand(platform, project, jobName, settings)
}

def testCommand =
{
platform, project->

commonGroovy.runTestCommand(platform, project, true)
commonGroovy.runTestCommand(platform, project, settings)
}

def packageCommand =
Expand Down
7 changes: 4 additions & 3 deletions projects/rocprim/.jenkins/static.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@ def runCI =
def nodes = new dockerNodes(nodeDetails, jobName, prj)

def commonGroovy

def settings = [staticLibrary:true,
debug:false]
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)
commonGroovy.runCompileCommand(platform, project, jobName, settings)
}

def testCommand =
{
platform, project->

commonGroovy.runTestCommand(platform, project)
commonGroovy.runTestCommand(platform, project, settings)
}

def packageCommand =
Expand Down