Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept new requests on SVE builders only if idle #81

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions buildbot/osuosl/master/config/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@
'tags' : ["clang"],
'workernames' : ["linaro-g3-01", "linaro-g3-02", "linaro-g3-03", "linaro-g3-04"],
'builddir': "clang-aarch64-sve-vla",
'max_simultaneous_builds' : 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there are any documentation comments somewhere that we can add an explanation of this to.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly to mention that the "default" is unlimited jobs per builder.

'factory' : ClangBuilder.getClangCMakeBuildFactory(
clean=False,
checkout_flang=True,
Expand All @@ -465,6 +466,7 @@
'tags' : ["clang"],
'workernames' : ["linaro-g3-01", "linaro-g3-02", "linaro-g3-03", "linaro-g3-04"],
'builddir': "clang-aarch64-sve-vla-2stage",
'max_simultaneous_builds' : 1,
'factory' : ClangBuilder.getClangCMakeBuildFactory(
clean=False,
checkout_flang=True,
Expand All @@ -490,6 +492,7 @@
'tags' : ["clang"],
'workernames' : ["linaro-g3-01", "linaro-g3-02", "linaro-g3-03", "linaro-g3-04"],
'builddir': "clang-aarch64-sve-vls",
'max_simultaneous_builds' : 1,
'factory' : ClangBuilder.getClangCMakeBuildFactory(
clean=False,
checkout_flang=True,
Expand All @@ -513,6 +516,7 @@
'tags' : ["clang"],
'workernames' : ["linaro-g3-01", "linaro-g3-02", "linaro-g3-03", "linaro-g3-04"],
'builddir': "clang-aarch64-sve-vls-2stage",
'max_simultaneous_builds' : 1,
'factory' : ClangBuilder.getClangCMakeBuildFactory(
clean=False,
checkout_flang=True,
Expand Down
22 changes: 20 additions & 2 deletions buildbot/osuosl/master/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,34 @@ c['collapseRequests'] = buildrequest.collapseRequests

from buildbot.plugins import util

class SimultaneousBuildLimiter:
def __init__(self, max_simultaneous_builds):
assert isinstance(max_simultaneous_builds, int), \
"max_simultaneous_builds must be int"
self.max_simultaneous_builds = max_simultaneous_builds

def __call__(self, builder, reqs):
if len(builder.building) >= self.max_simultaneous_builds:
return False
return min(reqs, key=lambda req: req.submittedAt)

def getBuilderConfig(builder):
if 'max_simultaneous_builds' in builder:
builder['nextBuild'] = \
SimultaneousBuildLimiter(builder['max_simultaneous_builds'])
del builder['max_simultaneous_builds']
return util.BuilderConfig(**builder)

c['builders'] = builders = [
util.BuilderConfig(**b) for b in config.builders.all
getBuilderConfig(b) for b in config.builders.all
]

for rb in config.release_builders.all:
# Make sure a release builder has the "release" tag.
tags = rb.get('tags', [])
if 'release' not in tags:
rb['tags'] = tags + ['release']
builders.append(util.BuilderConfig(**rb))
builders.append(getBuilderConfig(rb))

####### SCHEDULERS

Expand Down