Skip to content

Commit 7b43fe4

Browse files
MDBF-1142 Hide worker / build prioritization from user-facing settings
Worker selection (canStartBuild) and queue prioritization by branch (nextBuild) should not concern the user. These are considered internal mechanisms, and allowing users to modify them when configuring a builder could lead to unexpected behavior in the master.
1 parent 3e8654a commit 7b43fe4

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

configuration/builders/base.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from buildbot.process.buildrequest import BuildRequest
77
from buildbot.process.factory import BuildFactory
88
from buildbot.process.workerforbuilder import AbstractWorkerForBuilder
9+
from configuration.builders.callables import canStartBuild, nextBuild
910
from configuration.builders.infra.runtime import BuildSequence
1011
from configuration.steps.processors import (
1112
processor_docker_cleanup,
@@ -101,11 +102,7 @@ def get_factory(self) -> BuildFactory:
101102
def get_config(
102103
self,
103104
workers: Iterable[WorkerBase],
104-
can_start_build: Callable[
105-
[Builder, AbstractWorkerForBuilder, BuildRequest], bool
106-
],
107105
jobs: int,
108-
next_build: Callable[[Builder, Iterable[BuildRequest]], BuildRequest],
109106
tags: list[str] = [],
110107
properties: dict[str, str] = None,
111108
) -> util.BuilderConfig:
@@ -118,7 +115,6 @@ def get_config(
118115
can_start_build (Callable): A callable that determines if a build can
119116
start on a worker.
120117
jobs (int): The number of CPU's to allocate for commands that support parallel execution.
121-
next_build (Callable): A callable that determines the next build request.
122118
tags (list[str], optional): A list of tags associated with the builder.
123119
Defaults to an empty list.
124120
properties (dict[str, str], optional): Additional properties for the builder.
@@ -127,7 +123,6 @@ def get_config(
127123
- jobs is a measure of how many CPU's are used for the build, for commands that support parallel execution (e.g. make, mtr).
128124
- provide a value greater or equal to 1
129125
- jobs should never exceed the number of CPU's available on the worker, given by the worker total_jobs property.
130-
- canStartBuild will determine at runtime if the builder can start on any of the workers assigned to it, based on what other jobs were claimed (currently running) by other builders.
131126
Returns:
132127
util.BuilderConfig: A BuilderConfig object containing the builder's configuration.
133128
"""
@@ -145,8 +140,8 @@ def get_config(
145140
name=self.name,
146141
workernames=[worker.name for worker in workers],
147142
tags=tags,
148-
nextBuild=next_build,
149-
canStartBuild=can_start_build,
143+
nextBuild=nextBuild,
144+
canStartBuild=canStartBuild,
150145
factory=self.get_factory(),
151146
properties=properties,
152147
)

configuration/builders/common.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import Union
44

55
from configuration.builders.base import GenericBuilder
6-
from configuration.builders.callables import canStartBuild, nextBuild
76
from configuration.builders.infra.runtime import DockerConfig
87
from configuration.builders.sequences.release import deb_autobake, rpm_autobake
98

@@ -72,8 +71,6 @@ def deb_release_builder(
7271
],
7372
).get_config(
7473
workers=worker_pool,
75-
next_build=nextBuild,
76-
can_start_build=canStartBuild,
7774
tags=["release_packages", "autobake", "deb"],
7875
jobs=DEFAULT_BUILDER_JOBS,
7976
properties={
@@ -127,8 +124,6 @@ def rpm_release_builder(
127124
],
128125
).get_config(
129126
workers=worker_pool,
130-
next_build=nextBuild,
131-
can_start_build=canStartBuild,
132127
tags=["release_packages", "autobake", "rpm"],
133128
jobs=DEFAULT_BUILDER_JOBS,
134129
properties={

master-migration/master.cfg

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import os
66
import yaml
77

88
from configuration.builders.base import GenericBuilder
9-
from configuration.builders.callables import canStartBuild, nextBuild
109
from configuration.builders.common import (
1110
deb_release_builder,
1211
docker_config,
@@ -109,8 +108,6 @@ c["builders"].extend(
109108
],
110109
).get_config(
111110
workers=DEFAULT_AMD64_WORKER_POOL,
112-
next_build=nextBuild,
113-
can_start_build=canStartBuild,
114111
tags=["compile-only", "protected"],
115112
jobs=compile_only_jobs,
116113
)
@@ -134,8 +131,6 @@ c["builders"].append(
134131
],
135132
).get_config(
136133
workers=DEFAULT_AMD64_WORKER_POOL,
137-
next_build=nextBuild,
138-
can_start_build=canStartBuild,
139134
tags=[
140135
"debug",
141136
],
@@ -165,8 +160,6 @@ def ubasan_builder(name: str, debug: bool) -> GenericBuilder:
165160
],
166161
).get_config(
167162
workers=DEFAULT_AMD64_WORKER_POOL,
168-
next_build=nextBuild,
169-
can_start_build=canStartBuild,
170163
tags=list(tags_ubasan),
171164
jobs=jobs,
172165
)
@@ -194,8 +187,6 @@ def msan_builder(name: str, debug: bool) -> GenericBuilder:
194187
],
195188
).get_config(
196189
workers=DEFAULT_AMD64_WORKER_POOL,
197-
next_build=nextBuild,
198-
can_start_build=canStartBuild,
199190
tags=list(tags_msan),
200191
jobs=jobs,
201192
)

0 commit comments

Comments
 (0)