buildgrid.server.bots.job_assigner module

class buildgrid.server.bots.job_assigner.JobAssigner(data_store: SQLDataStore, job_assignment_interval: float = 1.0)

Bases: object

start() None
stop() None
listener_count() int
assignment_context(bot_session: BotSession) Iterator[Event]
assign_jobs(shutdown_requested: Event) None

Assign jobs to the currently connected workers

This method iterates over the buckets of currently connected workers, and requests a number of job assignments from the data store to cover the number of workers in each bucket. Empty buckets are skipped.

begin(shutdown_requested: Event) None
buildgrid.server.bots.job_assigner.get_partial_capabilities(capabilities: Dict[str, List[str]]) Iterable[Dict[str, List[str]]]

Given a capabilities dictionary with all values as lists, yield all partial capabilities dictionaries.

buildgrid.server.bots.job_assigner.get_partial_capabilities_hashes(capabilities: Dict[str, Set[str]]) List[str]

Given a list of configurations, obtain each partial configuration for each configuration, obtain the hash of each partial configuration, compile these into a list, and return the result.

buildgrid.server.bots.job_assigner.bot_capabilities(bot_session: BotSession) Dict[str, Set[str]]