Skip to content

Commit d9d8e6e

Browse files
authored
Add dependency branch parameters to CI jobs (#477)
* 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
1 parent 8e71e3d commit d9d8e6e

File tree

3 files changed

+33
-20
lines changed

3 files changed

+33
-20
lines changed

.jenkins/common.groovy

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,19 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s
1111
//Set CI node's gfx arch as target if PR, otherwise use default targets of the library
1212
String amdgpuTargets = env.BRANCH_NAME.startsWith('PR-') ? '-DAMDGPU_TARGETS=\$gfx_arch' : ''
1313

14-
def getRocPRIM = auxiliary.getLibrary('rocPRIM', platform.jenkinsLabel, null, sameOrg)
14+
def getDependenciesCommand = ""
15+
if (project.installLibraryDependenciesFromCI)
16+
{
17+
project.libraryDependencies.each
18+
{
19+
libraryName ->
20+
getDependenciesCommand += auxiliary.getLibrary(libraryName, platform.jenkinsLabel, 'develop', sameOrg)
21+
}
22+
}
1523

1624
def command = """#!/usr/bin/env bash
1725
set -x
18-
${getRocPRIM}
26+
${getDependenciesCommand}
1927
cd ${project.paths.project_build_prefix}
2028
mkdir -p build/${buildTypeDir} && cd build/${buildTypeDir}
2129
${auxiliary.gfxTargetParser()}

.jenkins/precheckin.groovy

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ import com.amd.project.*
99
import com.amd.docker.*
1010
import java.nio.file.Path;
1111

12-
def runCI =
12+
def runCI =
1313
{
1414
nodeDetails, jobName->
1515

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

1818
prj.defaults.ccache = true
1919
prj.timeout.compile = 420
20+
prj.libraryDependencies = ["rocPRIM"]
2021

2122
// Define test architectures, optional rocm version argument is available
2223
def nodes = new dockerNodes(nodeDetails, jobName, prj)
@@ -43,37 +44,39 @@ def runCI =
4344
def packageCommand =
4445
{
4546
platform, project->
46-
47+
4748
commonGroovy.runPackageCommand(platform, project)
4849
}
4950

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

53-
ci: {
54+
ci: {
5455
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)
5556

56-
def propertyList = ["compute-rocm-dkms-no-npi":[pipelineTriggers([cron('0 1 * * 0')])],
57+
def propertyList = ["compute-rocm-dkms-no-npi":[pipelineTriggers([cron('0 1 * * 0')])],
5758
"compute-rocm-dkms-no-npi-hipclang":[pipelineTriggers([cron('0 1 * * 0')])],
5859
"rocm-docker":[]]
5960
propertyList = auxiliary.appendPropertyList(propertyList)
6061

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

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

68-
propertyList.each
69+
auxiliary.registerDependencyBranchParameter(["rocPRIM"])
70+
71+
propertyList.each
6972
{
7073
jobName, property->
7174
if (urlJobName == jobName)
7275
properties(auxiliary.addCommonProperties(property))
7376
}
7477

7578
Set seenJobNames = []
76-
jobNameList.each
79+
jobNameList.each
7780
{
7881
jobName, nodeDetails->
7982
seenJobNames.add(jobName)
@@ -85,7 +88,6 @@ ci: {
8588
if(!seenJobNames.contains(urlJobName))
8689
{
8790
properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * *')])]))
88-
runCI([ubuntu16:['gfx906']], urlJobName)
91+
runCI([ubuntu16:['gfx906']], urlJobName)
8992
}
9093
}
91-

.jenkins/staticlibrary.groovy

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ import java.nio.file.Path;
77
def runCI =
88
{
99
nodeDetails, jobName->
10-
10+
1111
def prj = new rocProject('rocThrust', 'Static Library PreCheckin')
1212

1313
prj.defaults.ccache = true
1414
prj.timeout.compile = 420
15+
prj.libraryDependencies = ["rocPRIM"]
1516

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

1819
def commonGroovy
1920

2021
boolean formatCheck = false
21-
22+
2223
def compileCommand =
2324
{
2425
platform, project->
@@ -27,7 +28,7 @@ def runCI =
2728
commonGroovy.runCompileCommand(platform, project, jobName, false, true)
2829
}
2930

30-
31+
3132
def testCommand =
3233
{
3334
platform, project->
@@ -45,20 +46,22 @@ def runCI =
4546
buildProject(prj, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand)
4647
}
4748

48-
ci: {
49+
ci: {
4950
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)
5051

51-
def propertyList = ["compute-rocm-dkms-no-npi":[pipelineTriggers([cron('0 1 * * 0')])],
52+
def propertyList = ["compute-rocm-dkms-no-npi":[pipelineTriggers([cron('0 1 * * 0')])],
5253
"compute-rocm-dkms-no-npi-hipclang":[pipelineTriggers([cron('0 1 * * 0')])],
5354
"rocm-docker":[]]
5455
propertyList = auxiliary.appendPropertyList(propertyList)
5556

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

61-
propertyList.each
62+
auxiliary.registerDependencyBranchParameter(["rocPRIM"])
63+
64+
propertyList.each
6265
{
6366
jobName, property->
6467
if (urlJobName == jobName)

0 commit comments

Comments
 (0)