Skip to content

Commit

Permalink
Add diegorusso-aarch64-bigmem worker (#546)
Browse files Browse the repository at this point in the history
This worker avoids builds to be started between 10pm and 2am. They will
be scheduled at 2am.
  • Loading branch information
diegorusso authored Oct 29, 2024
1 parent cef8b34 commit d5e7bc5
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 21 deletions.
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'],
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,
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)

c["schedulers"].append(
GitHubPrScheduler(
name="pull-request-scheduler",
Expand Down

0 comments on commit d5e7bc5

Please sign in to comment.