Skip to content

Commit

Permalink
Add per-package configuration for release binary job weight (#1063)
Browse files Browse the repository at this point in the history
This new configuration parameter will allow us to specify a larger job
weight for a manually curated list of binary package jobs.
  • Loading branch information
cottsay authored Oct 7, 2024
1 parent a024014 commit 7f7659f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/configuration_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ The following options are valid in version ``2`` (beside the generic options):
* ``jenkins_source_job_priority``: the job priority of *source* jobs.
* ``jenkins_source_job_timeout``: the job timeout for *source* jobs.

* ``jenkins_binary_job_weight_override``: per-package override of the number of
executors on a worker which are required to execute a job.
All jobs default to ``1``.
Uses the Jenkins Heavy Job plugin.

* ``notifications``: a dictionary with the following keys:

* ``emails``: a list of static email addresses.
Expand Down
5 changes: 5 additions & 0 deletions ros_buildfarm/config/release_build_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ def __init__(self, name, data): # noqa: D107
self.jenkins_source_job_timeout = \
int(data['jenkins_source_job_timeout'])

self.jenkins_binary_job_weight_overrides = {}
if 'jenkins_binary_job_weight_overrides' in data:
self.jenkins_binary_job_weight_overrides = data['jenkins_binary_job_weight_overrides']
assert isinstance(self.jenkins_binary_job_weight_overrides, dict)

self.package_whitelist = []
if 'package_whitelist' in data and data['package_whitelist']:
self.package_whitelist = data['package_whitelist']
Expand Down
1 change: 1 addition & 0 deletions ros_buildfarm/release_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ def _get_binarydeb_job_config(
'github_url': get_github_project_url(release_repository.url),

'job_priority': build_file.jenkins_binary_job_priority,
'job_weight': build_file.jenkins_binary_job_weight_overrides.get(pkg_name),
'node_label': get_node_label(
build_file.jenkins_binary_job_label,
get_default_node_label('%s_%s%s_%s' % (
Expand Down
1 change: 1 addition & 0 deletions ros_buildfarm/templates/release/deb/binarypkg_job.xml.em
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ but disabled since the package is blacklisted (or not whitelisted) in the config
))@
@(SNIPPET(
'property_job-weight',
weight=job_weight,
))@
</properties>
@(SNIPPET(
Expand Down

0 comments on commit 7f7659f

Please sign in to comment.