Skip to content

Commit 3a61a54

Browse files
authored
Add GPU requirements to Windows jobs: adapt Linux job tags (#1258)
* Add GPU requirement to Windows jobs * Add a check to avoid non platform tags * Define docker + reliable when needed for linux jobs --------- Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com>
1 parent 116bf30 commit 3a61a54

8 files changed

+47
-18
lines changed

jenkins-scripts/dsl/debian.dsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ OSRFLinuxBase.create(ratt_pkg_job)
88
ratt_pkg_job.with
99
{
1010
// use only the most powerful nodes
11-
label Globals.nontest_label("large-memory")
11+
label Globals.nontest_label("docker && large-memory")
1212

1313
parameters
1414
{

jenkins-scripts/dsl/dsl_checks.bash

+15
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,18 @@ if [[ -n ${avoid_infinite_build_archive} ]]; then
101101
echo "${avoid_infinite_build_archive}"
102102
exit 1
103103
fi
104+
105+
check_tag_without_platforms()
106+
{
107+
tag=${1}
108+
echo $(awk -v tag="$tag" 'FNR==1{filename=FILENAME} /<assignedNode>/ && $0 ~ tag && !/win/ && !/docker/ {print filename ": " $0}' *.xml)
109+
}
110+
111+
for tag in gpu-reliable large-memory; do
112+
no_tag_without_platforms=$(check_tag_without_platforms ${tag})
113+
if [[ -n ${no_tag_without_platforms} ]]; then
114+
echo "Found jobs with the ${tag}"
115+
echo "${no_tag_without_platforms}"
116+
exit 1
117+
fi
118+
done

jenkins-scripts/dsl/extra.dsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ release_repo_debbuilds.each { software ->
2323
build_pkg_job.with
2424
{
2525
// use only the most powerful nodes
26-
label Globals.nontest_label("large-memory")
26+
label Globals.nontest_label("docker && large-memory")
2727

2828
steps {
2929
shell("""\
@@ -43,7 +43,7 @@ gbp_repo_debbuilds.each { software ->
4343
build_pkg_job.with
4444
{
4545
// use only the most powerful nodes
46-
label Globals.nontest_label("large-memory")
46+
label Globals.nontest_label("docker && large-memory")
4747

4848
parameters
4949
{

jenkins-scripts/dsl/gazebo_libs.dsl

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ String get_windows_distro_sortname(ci_config)
2929
+ ci_config.system.version.split('_').collect { it[0] }.join('')
3030
}
3131

32-
void generate_label_by_requirements(job, lib_name, requirements)
32+
void generate_label_by_requirements(job, lib_name, requirements, base_label)
3333
{
3434

3535
if (requirements.nvidia_gpu.contains(lib_name) &&
3636
requirements.large_memory.contains(lib_name)) {
37-
println ("ERROR: more than one label is generated by requirements")
37+
println ("ERROR: more than one label is not supported by requirements")
3838
exit(1)
3939
}
4040

@@ -46,7 +46,7 @@ void generate_label_by_requirements(job, lib_name, requirements)
4646

4747
job.with
4848
{
49-
label Globals.nontest_label(label)
49+
label Globals.nontest_label("${base_label} && ${label}")
5050

5151
if (requirements.nvidia_gpu.contains(lib_name)) {
5252
// unstable build if missing valid gpu display
@@ -127,7 +127,7 @@ void generate_ci_job(gz_ci_job, lib_name, branch, ci_config,
127127
"gazebosim/${lib_name}",
128128
branch,
129129
ws_checkout_dir)
130-
generate_label_by_requirements(gz_ci_job, lib_name, ci_config.requirements)
130+
generate_label_by_requirements(gz_ci_job, lib_name, ci_config.requirements, 'docker')
131131
gz_ci_job.with
132132
{
133133
steps {
@@ -217,7 +217,7 @@ void generate_win_ci_job(gz_win_ci_job, lib_name, branch, ci_config)
217217
"gazebosim/${lib_name}",
218218
branch,
219219
ws_checkout_dir)
220-
220+
generate_label_by_requirements(gz_win_ci_job, lib_name, ci_config.requirements, 'win')
221221
add_win_devel_bat_call(gz_win_ci_job,
222222
lib_name,
223223
ws_checkout_dir,
@@ -446,7 +446,7 @@ branch_index.each { lib_name, distro_configs ->
446446
is_testing_enabled(lib_name, ci_config),
447447
ENABLE_CPPCHECK,
448448
branch_names)
449-
generate_label_by_requirements(gz_ci_any_job, lib_name, ci_config.requirements)
449+
generate_label_by_requirements(gz_ci_any_job, lib_name, ci_config.requirements, 'docker')
450450
gz_ci_any_job.with
451451
{
452452
steps
@@ -527,7 +527,7 @@ branch_index.each { lib_name, distro_configs ->
527527
GenericAnyJobGitHub.create(abi_job,
528528
"gazebosim/${lib_name}",
529529
branch_names)
530-
generate_label_by_requirements(abi_job, lib_name, ci_config.requirements)
530+
generate_label_by_requirements(abi_job, lib_name, ci_config.requirements, 'docker')
531531
abi_job.with
532532
{
533533
steps {

jenkins-scripts/dsl/gz-collections.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,13 @@ ci_configs:
595595
version: legacy
596596
arch: amd64
597597
requirements:
598+
large_memory:
599+
- gz-physics
600+
nvidia_gpu:
601+
- gz-sim
602+
- gz-gui
603+
- gz-rendering
604+
- gz-sensors
598605
exclude:
599606
all:
600607
- gz-fortress
@@ -624,6 +631,13 @@ ci_configs:
624631
version: legacy_ogre23
625632
arch: amd64
626633
requirements:
634+
large_memory:
635+
- gz-physics
636+
nvidia_gpu:
637+
- gz-sim
638+
- gz-gui
639+
- gz-rendering
640+
- gz-sensors
627641
exclude:
628642
all:
629643
- gz-harmonic

jenkins-scripts/dsl/gzdev.dsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ supported_distros.each { distro ->
1818
gzdev_ci_job.with
1919
{
2020

21-
label Globals.nontest_label("large-memory")
21+
label Globals.nontest_label("docker && large-memory")
2222

2323
scm {
2424
git {
@@ -56,7 +56,7 @@ supported_distros.each { distro ->
5656

5757
gzdev_any_job.with
5858
{
59-
label Globals.nontest_label("large-memory")
59+
label Globals.nontest_label("docker && large-memory")
6060

6161
steps {
6262
shell("""\

jenkins-scripts/dsl/ignition_collection.dsl

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void generate_install_job(prefix, gz_collection_name, distro, arch)
4040
def dev_package = "${prefix}-${gz_collection_name}"
4141
def job_name = 'gz_launch-install-test-job.bash'
4242

43-
label Globals.nontest_label("gpu-reliable")
43+
label Globals.nontest_label("docker && gpu-reliable")
4444

4545
steps {
4646
shell("""\
@@ -98,12 +98,12 @@ gz_collections_yaml.collections.each { collection ->
9898
stringParam("ARCH", arch, "Architecture to build packages for")
9999
labelParam('JENKINS_NODE_TAG') {
100100
description('Jenkins node or group to run the build on')
101-
defaultValue('gpu-reliable')
101+
defaultValue('docker && gpu-reliable')
102102
}
103103
}
104104

105105
// Designed to be run manually. No triggers.
106-
label Globals.nontest_label("gpu-reliable")
106+
label Globals.nontest_label("docker && gpu-reliable")
107107

108108
steps {
109109
systemGroovyCommand("""\
@@ -127,7 +127,7 @@ gz_collections_yaml.collections.each { collection ->
127127
if [[ ${gz_collection_name} == 'citadel' || ${gz_collection_name} == 'fortress' ]]; then
128128
export GZ_SIM_RUNTIME_TEST_USE_IGN=true
129129
fi
130-
if [[ \${JENKINS_NODE_TAG} == 'gpu-reliable' ]]; then
130+
if [[ \${JENKINS_NODE_TAG} == '*gpu-reliable*' ]]; then
131131
export ENABLE_GZ_SIM_RUNTIME_TEST=true
132132
fi
133133
/bin/bash -x ./scripts/jenkins-scripts/docker/gz_launch-install-test-job.bash

jenkins-scripts/dsl/ros_gz_bridge.dsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ void generate_install_test_job(Job install_test_job)
155155
stringParam("OSRF_REPOS_TO_USE", 'stable', "Repositories to add to the testing install")
156156
labelParam('JENKINS_NODE_TAG') {
157157
description('Jenkins node or group to run the build on')
158-
defaultValue('gpu-reliable')
158+
defaultValue('docker && gpu-reliable')
159159
}
160160
}
161161

162162
// Designed to be run manually. No triggers.
163-
label Globals.nontest_label("gpu-reliable")
163+
label Globals.nontest_label("docker && gpu-reliable")
164164

165165
steps {
166166
systemGroovyCommand("""\

0 commit comments

Comments
 (0)