buildgrid.server.scheduler.properties module

buildgrid.server.scheduler.properties.hash_from_dict(dictionary: Dict[str, List[str]]) str

Get the hash represntation of a dictionary

class buildgrid.server.scheduler.properties.PropertySet(*args, **kwargs)

Bases: Protocol

execution_properties(platform: Platform) Tuple[str, Dict[str, List[str]]]

Parses a platform value and returns the match properties used for scheduling. Returns a label which can be used for applying metrics.

worker_properties(bot_session: BotSession) List[Dict[str, List[str]]]

Find all the valid property combinations which can be used to assign work to a bot.

class buildgrid.server.scheduler.properties.DynamicPropertySet(*, unique_property_keys: Set[str], match_property_keys: Set[str], wildcard_property_keys: Set[str], label_key: str | None = None)

Bases: object

execution_properties(platform: Platform) Tuple[str, Dict[str, List[str]]]
worker_properties(bot_session: BotSession) List[Dict[str, List[str]]]
class buildgrid.server.scheduler.properties.PropertyLabel(label: str, properties: Set[Tuple[str, str]])

Bases: object

label: str
properties: Set[Tuple[str, str]]
class buildgrid.server.scheduler.properties.StaticPropertySet(*, property_labels: List[PropertyLabel], wildcard_property_keys: Set[str])

Bases: object

execution_properties(platform: Platform) Tuple[str, Dict[str, List[str]]]
worker_properties(bot_session: BotSession) List[Dict[str, List[str]]]
buildgrid.server.scheduler.properties.bot_properties(bot_session: BotSession) Dict[str, Set[str]]
buildgrid.server.scheduler.properties.partial_bot_properties(properties: Dict[str, Set[str]]) List[Dict[str, List[str]]]
buildgrid.server.scheduler.properties.flatten_properties(properties: Dict[str, Set[str]]) List[Tuple[str, str]]
buildgrid.server.scheduler.properties.merge_property_pairs(property_pairs: Iterable[Tuple[str, str]]) Dict[str, List[str]]