Skip to content

Check platform properties and match on them

Richard Kennedy requested to merge richken/check_platform_keys into master

Description

Currently, buildgrid will not pick up on any platform properties specified in the config file. This MR will have buildgrid reject any jobs which have platform requirements not specified in the config file.

There is a minor race condition, where a job gets queued. Then buildgrid gets brought down, and has platform keys removed. When it is brought back up, and restores jobs from its database. It is possible jobs end up in the queue which will never match with any worker (since it now has a platform key which is not registered with buildgrid). I did not check for this race condition since it seemed relatively minor. But maybe we can evict jobs when restoring them from the database, if their keys are no longer valid?

Changes proposed in this merge request:

  • Pick up config file property keys
  • Reject jobs that have different platform requirements (that aren't standard keys)
  • Match jobs and workers only if a job's requirements are a subset of the workers requirements for all keys (previously we were just making intersection wasn't empty, given duplicate keys).
  • Return empty list instead of None, in sql implementation (for consistency)

This merge request, when merged, will address issue/bug:

#203 (closed)

Edited by Richard Kennedy

Merge request reports