Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test_require_gpu to ci jobs #1059

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions doc/configuration_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ The following options are valid in version ``1`` (beside the generic options):
By default, the resulting archives are only available to other jobs within
Jenkins.

* ``tests_require_gpu``: a boolean flag to indicate if software tests needs gpu
support to run correctly.
The following options are valid as keys in the ``_config`` dict under
``targets``:

Expand Down
2 changes: 2 additions & 0 deletions ros_buildfarm/ci_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ def _get_ci_job_config(
'ros_version': ros_version,
'build_environment_variables': build_environment_variables,

'require_gpu_support': build_file.tests_require_gpu_default,

'timeout_minutes': build_file.jenkins_job_timeout,

'repos_file_urls': repos_files,
Expand Down
5 changes: 5 additions & 0 deletions ros_buildfarm/config/ci_build_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ def __init__(self, name, data): # noqa: D107
self.show_plots[plot_group].append(
PlotConfig(name, plot_config_data))

self.tests_require_gpu_default = False
if 'tests_require_gpu' in data:
self.tests_require_gpu_default = bool(
data['tests_require_gpu'])

self.benchmark_patterns = []
if 'benchmark_patterns' in data:
self.benchmark_patterns = data['benchmark_patterns']
Expand Down
7 changes: 6 additions & 1 deletion ros_buildfarm/scripts/ci/build_task_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ def main(argv=sys.argv[1:]):
for k, v in remainder_args.items():
setattr(args, k, v)

if args.require_gpu_support:
print(
'WARNING: using the --require-gpu-support argument is deprecated.'
'Can be removed without changing functionality.',
file=sys.stderr)

apt_cache = Cache()

debian_pkg_names = set(['build-essential'])
Expand Down Expand Up @@ -132,7 +138,6 @@ def main(argv=sys.argv[1:]):

'testing': args.testing,
'run_abichecker': args.run_abichecker,
'require_gpu_support': args.require_gpu_support,
'workspace_root': mapped_workspaces[-1][1],
'parent_result_space': [mapping[1] for mapping in mapped_workspaces[:-1]],
}
Expand Down
6 changes: 6 additions & 0 deletions ros_buildfarm/scripts/devel/build_and_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ def main(argv=sys.argv[1:]):
for k, v in remainder_args.items():
setattr(args, k, v)

if args.require_gpu_support:
print(
'WARNING: using the --require-gpu-support argument is deprecated.'
'Can be removed without changing functionality.',
file=sys.stderr)

ensure_workspace_exists(args.workspace_root)

if args.clean_before:
Expand Down
2 changes: 2 additions & 0 deletions ros_buildfarm/templates/ci/ci_job.xml.em
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,13 @@ parameters = [
'export UNDERLAY%d_JOB_SPACE=$WORKSPACE/underlay%d/ros%d-linux' % (i + 1, i + 1, local_ros_version)
for i, local_ros_version in zip(range(len(underlay_source_jobs)), [ros_version] * len(underlay_source_jobs))
] + [
('if [ ! -c /dev/nvidia[0-9] ]; then echo "--require-gpu-support is enabled but can not detect nvidia support installed" && exit 1; fi' if require_gpu_support else ''),
'rm -fr $WORKSPACE/ws/test_results',
'mkdir -p $WORKSPACE/ws/test_results',
'# If using Podman, change the user namespace to preserve UID. No effect if using Docker.',
'export PODMAN_USERNS=keep-id',
'docker run' +
(' --env=DISPLAY=:0.0 --env=QT_X11_NO_MITSHM=1 --volume=/tmp/.X11-unix:/tmp/.X11-unix:rw --gpus all' if require_gpu_support else '') +
' --rm ' +
' --cidfile=$WORKSPACE/docker_build_and_test/docker.cid' +
((' -e CCACHE_DIR=/home/buildfarm/.ccache' +
Expand Down
2 changes: 0 additions & 2 deletions ros_buildfarm/templates/devel/devel_task.Dockerfile.em
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ else:
' /tmp/ros_buildfarm/scripts/devel/build_and_test.py' + \
' --rosdistro-name %s' % (rosdistro_name or "''") + \
' --ros-version ' + str(ros_version)
if require_gpu_support:
cmd += ' --require-gpu-support'
cmd += \
' --build-tool ' + build_tool + \
' --workspace-root ' + workspace_root + \
Expand Down
Loading