Skip to content

Commit 69f7080

Browse files
committed
Move worker downtime configuration to workers.py
The `canStartBuild=no_builds_between(...)` configuration is used for regular maintenance windows (restarts/reprovisions) and quiet periods for benchmark runs. - Rename to `downtime`; canStartBuild & quarantining are implementation details. - Move configuration to workers.py. - Move implementation to new module, worker_downtime.py
1 parent 451bed4 commit 69f7080

2 files changed

Lines changed: 26 additions & 30 deletions

File tree

master/custom/workers.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
# vim:set ts=8 sw=4 sts=4 et:
44

55
from functools import partial
6+
from zoneinfo import ZoneInfo
67

78
from buildbot.plugins import worker as _worker
89

910
from custom.factories import MAIN_BRANCH_NAME
11+
from custom.worker_downtime import no_builds_between
1012

1113

1214
# By default, the buildmaster sends a simple, non-blocking message to each
@@ -32,6 +34,7 @@ def __init__(
3234
parallel_tests=None,
3335
timeout_factor=1,
3436
exclude_test_resources=None,
37+
downtime=None
3538
):
3639
self.name = name
3740
self.tags = tags or set()
@@ -41,6 +44,7 @@ def __init__(
4144
self.parallel_tests = parallel_tests
4245
self.timeout_factor = timeout_factor
4346
self.exclude_test_resources = exclude_test_resources or []
47+
self.downtime = downtime
4448

4549
worker_settings = settings.workers[name]
4650
owner = name.split("-")[0]
@@ -55,6 +59,12 @@ def __init__(
5559
notify_on_missing=emails,
5660
keepalive_interval=KEEPALIVE)
5761

62+
# Some of Itamar's workers are reprovisioned every Wednesday at 9am PT.
63+
# Builds scheduled between 8am - 10am PT on Wednesdays will be delayed to
64+
# 10am PT.
65+
itamaro_downtime = no_builds_between(
66+
"8:00", "10:00", day_of_week=2, tz=ZoneInfo("America/Los_Angeles")
67+
)
5868

5969
def get_workers(settings):
6070
cpw = partial(CPythonWorker, settings)
@@ -160,6 +170,10 @@ def get_workers(settings):
160170
tags=['linux', 'unix', 'ubuntu', 'arm', 'arm64', 'aarch64', 'bigmem'],
161171
not_branches=['3.10', '3.11', '3.12', '3.13', '3.14'],
162172
parallel_tests=8,
173+
# This worker runs pyperformance at 12am UTC.
174+
# If a build is scheduled between 10pm UTC and 2am UTC,
175+
# it will be delayed to 2am UTC.
176+
downtime=no_builds_between("22:00", "2:00")
163177
),
164178
cpw(
165179
name="cstratak-fedora-rawhide-s390x",
@@ -294,20 +308,28 @@ def get_workers(settings):
294308
tags=['windows', 'win11', 'amd64', 'x86-64', 'bigmem'],
295309
not_branches=['3.10', '3.11', '3.12', '3.13', '3.14'],
296310
parallel_tests=4,
311+
# This worker restarts every day at 9am UTC to work around issues
312+
# stemming from failing bigmem tests trashing disk space and
313+
# fragmenting RAM.
314+
# Builds scheduled between 07:20am - 9:20am UTC will be delayed
315+
# to 9:20am UTC.
316+
downtime=no_builds_between("7:20", "9:20")
297317
),
298318
cpw(
299319
name="itamaro-centos-aws",
300320
tags=['linux', 'unix', 'rhel', 'amd64', 'x86-64'],
301321
not_branches=['3.10', '3.11', '3.12'],
302322
parallel_tests=10,
303323
parallel_builders=2,
324+
downtime=itamaro_downtime,
304325
),
305326
cpw(
306327
name="itamaro-win64-srv-22-aws",
307328
tags=['windows', 'win-srv-22', 'amd64', 'x86-64'],
308329
not_branches=['3.10', '3.11', '3.12'],
309330
parallel_tests=10,
310331
parallel_builders=2,
332+
downtime=itamaro_downtime,
311333
),
312334
cpw(
313335
name="itamaro-macos-intel-aws",

master/master.cfg

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -265,24 +265,8 @@ for git_url, branchname, git_branch in git_branches:
265265
locks=[cpulock.access("counting")],
266266
)
267267

268-
# This worker runs pyperformance at 12am UTC. If a build is scheduled between
269-
# 10pm UTC and 2am UTC, it will be delayed to 2am UTC.
270-
if worker.name == "diegorusso-aarch64-bigmem":
271-
builder.canStartBuild = no_builds_between("22:00", "2:00")
272-
273-
# This worker restarts every day at 9am UTC to work around issues stemming from
274-
# failing bigmem tests trashing disk space and fragmenting RAM. Builds scheduled
275-
# between 07:20am - 9:20am UTC will be delayed to 9:20am UTC.
276-
if worker.name == "ambv-bb-win11":
277-
builder.canStartBuild = no_builds_between("7:20", "9:20")
278-
279-
# These workers are reprovisioned every Wednesday at 9am PT. Builds
280-
# scheduled between 8am - 10am PT on Wednesdays will be delayed to
281-
# 10am PT.
282-
if worker.name in ("itamaro-win64-srv-22-aws", "itamaro-centos-aws"):
283-
builder.canStartBuild = no_builds_between(
284-
"8:00", "10:00", day_of_week=2, tz=ZoneInfo("America/Los_Angeles")
285-
)
268+
if worker.downtime:
269+
builder.canStartBuild = worker.downtime
286270

287271
c["builders"].append(builder)
288272

@@ -354,18 +338,8 @@ for name, worker, buildfactory, stability, tier in BUILDERS:
354338
locks=[cpulock.access("counting")],
355339
)
356340

357-
# This worker runs pyperformance at 12am. If a build is scheduled between
358-
# 10pm and 2am, it will be delayed at 2am.
359-
if worker.name == "diegorusso-aarch64-bigmem":
360-
builder.canStartBuild = no_builds_between("22:00", "2:00")
361-
362-
# These workers are reprovisioned every Wednesday at 9am PT. Builds
363-
# scheduled between 8am - 10am PT on Wednesdays will be delayed to
364-
# 10am PT.
365-
if worker.name in ("itamaro-win64-srv-22-aws", "itamaro-centos-aws"):
366-
builder.canStartBuild = no_builds_between(
367-
"8:00", "10:00", day_of_week=2, tz=ZoneInfo("America/Los_Angeles")
368-
)
341+
if worker.downtime:
342+
builder.canStartBuild = worker.downtime
369343

370344
c["builders"].append(builder)
371345

0 commit comments

Comments
 (0)