Skip to content

Commit

Permalink
Add dependency branch parameters to CI jobs (#477)
Browse files Browse the repository at this point in the history
* Update common.groovy

* Add dependency branch parameters to precheckin

* Add dependency branch parameters to static library job

* correct to use auxiliary

* remove reference to nonexistent project variable

* refactor dependency list

* correct getDependenciesCommand

* undo refactor, incompatible with loader
  • Loading branch information
lawruble13 authored Oct 25, 2024
1 parent 8e71e3d commit d9d8e6e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 20 deletions.
12 changes: 10 additions & 2 deletions .jenkins/common.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s
//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 getRocPRIM = auxiliary.getLibrary('rocPRIM', platform.jenkinsLabel, null, sameOrg)
def getDependenciesCommand = ""
if (project.installLibraryDependenciesFromCI)
{
project.libraryDependencies.each
{
libraryName ->
getDependenciesCommand += auxiliary.getLibrary(libraryName, platform.jenkinsLabel, 'develop', sameOrg)
}
}

def command = """#!/usr/bin/env bash
set -x
${getRocPRIM}
${getDependenciesCommand}
cd ${project.paths.project_build_prefix}
mkdir -p build/${buildTypeDir} && cd build/${buildTypeDir}
${auxiliary.gfxTargetParser()}
Expand Down
22 changes: 12 additions & 10 deletions .jenkins/precheckin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import com.amd.project.*
import com.amd.docker.*
import java.nio.file.Path;

def runCI =
def runCI =
{
nodeDetails, jobName->

def prj = new rocProject('rocThrust', 'precheckin')

prj.defaults.ccache = true
prj.timeout.compile = 420
prj.libraryDependencies = ["rocPRIM"]

// Define test architectures, optional rocm version argument is available
def nodes = new dockerNodes(nodeDetails, jobName, prj)
Expand All @@ -43,37 +44,39 @@ def runCI =
def packageCommand =
{
platform, project->

commonGroovy.runPackageCommand(platform, project)
}

buildProject(prj, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand)
}

ci: {
ci: {
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)

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

Set standardJobNameSet = ["compute-rocm-dkms-no-npi", "compute-rocm-dkms-no-npi-hipclang", "rocm-docker"]

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

propertyList.each
auxiliary.registerDependencyBranchParameter(["rocPRIM"])

propertyList.each
{
jobName, property->
if (urlJobName == jobName)
properties(auxiliary.addCommonProperties(property))
}

Set seenJobNames = []
jobNameList.each
jobNameList.each
{
jobName, nodeDetails->
seenJobNames.add(jobName)
Expand All @@ -85,7 +88,6 @@ ci: {
if(!seenJobNames.contains(urlJobName))
{
properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * *')])]))
runCI([ubuntu16:['gfx906']], urlJobName)
runCI([ubuntu16:['gfx906']], urlJobName)
}
}

19 changes: 11 additions & 8 deletions .jenkins/staticlibrary.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ import java.nio.file.Path;
def runCI =
{
nodeDetails, jobName->

def prj = new rocProject('rocThrust', 'Static Library PreCheckin')

prj.defaults.ccache = true
prj.timeout.compile = 420
prj.libraryDependencies = ["rocPRIM"]

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

def commonGroovy

boolean formatCheck = false

def compileCommand =
{
platform, project->
Expand All @@ -27,7 +28,7 @@ def runCI =
commonGroovy.runCompileCommand(platform, project, jobName, false, true)
}


def testCommand =
{
platform, project->
Expand All @@ -45,20 +46,22 @@ def runCI =
buildProject(prj, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand)
}

ci: {
ci: {
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)

def propertyList = ["compute-rocm-dkms-no-npi":[pipelineTriggers([cron('0 1 * * 0')])],
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":([ubuntu16:['gfx900'],centos7:['gfx906'],sles15sp1:['gfx908']]),
"compute-rocm-dkms-no-npi-hipclang":([ubuntu16:['gfx900'],centos7:['gfx906'],sles15sp1:['gfx908']]),
def jobNameList = ["compute-rocm-dkms-no-npi":([ubuntu16:['gfx900'],centos7:['gfx906'],sles15sp1:['gfx908']]),
"compute-rocm-dkms-no-npi-hipclang":([ubuntu16:['gfx900'],centos7:['gfx906'],sles15sp1:['gfx908']]),
"rocm-docker":([ubuntu16:['gfx900'],centos7:['gfx906'],sles15sp1:['gfx908']])]
jobNameList = auxiliary.appendJobNameList(jobNameList)

propertyList.each
auxiliary.registerDependencyBranchParameter(["rocPRIM"])

propertyList.each
{
jobName, property->
if (urlJobName == jobName)
Expand Down

0 comments on commit d9d8e6e

Please sign in to comment.