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

Add diegorusso-aarch64-bigmem worker #546

Merged
merged 4 commits into from
Oct 29, 2024
Merged
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
3 changes: 3 additions & 0 deletions master/custom/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
FedoraRawhideFreedthreadingBuild,
UnixAsanBuild,
UnixAsanDebugBuild,
UnixBigmemBuild,
UnixTraceRefsBuild,
UnixVintageParserBuild,
UnixRefleakBuild,
Expand Down Expand Up @@ -240,6 +241,8 @@
("PPC64LE CentOS9 LTO + PGO", "cstratak-CentOS9-ppc64le", LTOPGONonDebugBuild),

# Linux aarch64 GCC/Clang
("aarch64 Ubuntu 22.04 BigMem", "diegorusso-aarch64-bigmem", UnixBigmemBuild),

# Fedora Rawhide is unstable
("aarch64 Fedora Rawhide", "cstratak-fedora-rawhide-aarch64", FedoraRawhideBuild),
("aarch64 Fedora Rawhide Refleaks", "cstratak-fedora-rawhide-aarch64", UnixRefleakBuild),
Expand Down
6 changes: 6 additions & 0 deletions master/custom/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ class UnixBuildWithoutDocStrings(UnixBuild):
configureFlags = ["--with-pydebug", "--without-doc-strings"]


class UnixBigmemBuild(UnixBuild):
buildersuffix = ".bigmem"
testFlags = ["-M60g", "-j4", "-uall,extralargefile"]
factory_tags = ["bigmem"]


class AIXBuild(UnixBuild):
configureFlags = [
"--with-pydebug",
Expand Down
6 changes: 6 additions & 0 deletions master/custom/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ def get_workers(settings):
tags=['linux', 'unix', 'rhel', 'arm', 'arm64', 'aarch64'],
parallel_tests=40,
),
cpw(
name="diegorusso-aarch64-bigmem",
tags=['linux', 'unix', 'ubuntu', 'arm', 'arm64', 'aarch64', 'bigmem'],
not_branches=['3.9', '3.10', '3.11', '3.12', '3.13'],
zware marked this conversation as resolved.
Show resolved Hide resolved
parallel_tests=4,
),
cpw(
name="cstratak-rhel8-s390x",
tags=['linux', 'unix', 'rhel', 's390x'],
Expand Down
95 changes: 74 additions & 21 deletions master/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import os
import subprocess
import sys

from datetime import timedelta
from datetime import datetime, timedelta
from functools import partial

from buildbot.plugins import reporters, schedulers, util
Expand Down Expand Up @@ -182,6 +182,46 @@ def is_important_change(change):
return any(is_important_file(filename) for filename in change.files)


def is_within_time_range(now, start, end):
if start <= end:
return start <= now <= end
else:
return now >= start or now <= end


def get_delay(now, end):
today = datetime.today()
now = datetime.combine(today, now)
end = datetime.combine(today, end)

if now > end:
end += timedelta(days=1)

difference = end - now
return difference.total_seconds()


# Avoid a build to be started between start and end time and delay such build
# at end time
def no_builds_between(start, end):
now = datetime.now().time()
start = datetime.strptime(start, "%H:%M").time()
end = datetime.strptime(end, "%H:%M").time()
def f(builder, requests):
if is_within_time_range(now, start, end):
delay = get_delay(now, end)
# Schedule the build later
builder.master.reactor.callLater(
int(delay),
builder.buildset_manager.submitBuildSet,
Copy link
Member

Choose a reason for hiding this comment

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

We're getting an exception here:

    Traceback (most recent call last):
      File "/srv/buildbot/venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 980, in _startRunCallbacks
        self._runCallbacks()
      File "/srv/buildbot/venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 1074, in _runCallbacks
        current.result = callback(  # type: ignore[misc]
      File "/srv/buildbot/venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 1960, in _gotResultInlineCallbacks
        _inlineCallbacks(r, gen, status, context)
      File "/srv/buildbot/venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 2014, in _inlineCallbacks
        result = context.run(gen.send, result)
    --- <exception caught here> ---
      File "/srv/buildbot/venv/lib/python3.9/site-packages/buildbot/process/buildrequestdistributor.py", line 262, in _getNextUnclaimedBuildRequest
        nextBreq = yield self.nextBuild(self.bldr, breqs)
      File "/srv/buildbot/master/master.cfg", line 216, in f
        builder.buildset_manager.submitBuildSet,
    builtins.AttributeError: 'Builder' object has no attribute 'buildset_manager'

Copy link
Member

Choose a reason for hiding this comment

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

If I'm reading the nextBuild and Twisted docs correctly, this should return a Deferred like this:

from twisted.internet import defer
...
            deferred = defer.Deferred()
            builder.master.reactor.callLater(
                int(delay),
                deferred.callback,
                requests[0],
            )
            return deferred

But, it would be nice to get confirmation from someone who's used Twisted before :)

Copy link
Member

Choose a reason for hiding this comment

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

I filed #553

requests[0],
)
return None
# Schedule the build now
return requests[0]
return f


github_status_builders = []
release_status_builders = []
mail_status_builders = []
Expand Down Expand Up @@ -247,17 +287,24 @@ for branch_num, (git_url, branchname, git_branch) in enumerate(git_branches):
mail_status_builders.append(buildername)
github_status_builders.append(buildername)
release_status_builders.append(buildername)
c["builders"].append(
util.BuilderConfig(
name=buildername,
workernames=[worker_name],
builddir="%s.%s%s"
% (branchname, worker_name, getattr(f, "buildersuffix", "")),
factory=f,
tags=tags,
locks=[cpulock.access("counting")],
)

builder = util.BuilderConfig(
name=buildername,
workernames=[worker_name],
builddir="%s.%s%s"
% (branchname, worker_name, getattr(f, "buildersuffix", "")),
factory=f,
tags=tags,
locks=[cpulock.access("counting")],
)

# This worker runs pyperformance at 12am. If a build is scheduled between
# 10pm and 2am, it will be delayed at 2am.
if worker_name == "diegorusso-aarch64-bigmem":
builder.nextBuild = no_builds_between("22:00", "2:00")

c["builders"].append(builder)

c["schedulers"].append(
schedulers.SingleBranchScheduler(
name=branchname,
Expand Down Expand Up @@ -315,18 +362,24 @@ for name, worker_name, buildfactory, stability, tier in BUILDERS:
tags = ["PullRequest", stability, *getattr(f, "tags", [])]
if tier:
tags.append(tier)
c["builders"].append(
util.BuilderConfig(
name=buildername,
workernames=[worker_name],
builddir="%s.%s%s"
% ("pull_request", worker_name, getattr(f, "buildersuffix", "")),
factory=f,
tags=tags,
locks=[cpulock.access("counting")],
)

builder = util.BuilderConfig(
name=buildername,
workernames=[worker_name],
builddir="%s.%s%s"
% ("pull_request", worker_name, getattr(f, "buildersuffix", "")),
factory=f,
tags=tags,
locks=[cpulock.access("counting")],
)

# This worker runs pyperformance at 12am. If a build is scheduled between
# 10pm and 2am, it will be delayed at 2am.
if worker_name == "diegorusso-aarch64-bigmem":
builder.nextBuild = no_builds_between("22:00", "2:00")

c["builders"].append(builder)

zware marked this conversation as resolved.
Show resolved Hide resolved
c["schedulers"].append(
GitHubPrScheduler(
name="pull-request-scheduler",
Expand Down
Loading