Skip to content
Closed
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
10 changes: 9 additions & 1 deletion master/custom/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs):
oot_kwargs = {}
configure_cmd = [configure_cmd, "--prefix", "$(PWD)/target"]
configure_cmd += self.configureFlags
configure_cmd += worker.get_configure_flags(branch)
self.addStep(
Configure(command=configure_cmd, **oot_kwargs)
)
Expand Down Expand Up @@ -225,6 +226,7 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs):
Configure(
command=["./configure", "--prefix", "$(PWD)/target"]
+ self.configureFlags
+ worker.get_configure_flags(branch)
)
)

Expand Down Expand Up @@ -819,6 +821,7 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs):
configure_cmd = list(self.host_configure_cmd)
configure_cmd += ["--prefix", "$(PWD)/target/host"]
configure_cmd += self.configureFlags + self.extra_configure_flags
configure_cmd += worker.get_configure_flags(branch)
configure_cmd += [util.Interpolate("--build=%(prop:build_triple)s")]
configure_cmd += [f"--host={self.host}"]
configure_cmd += ["--with-build-python=../build/python"]
Expand Down Expand Up @@ -1142,6 +1145,7 @@ def py313_setup(self, branch, worker, test_with_PTY=False, **kwargs):
configure_cmd = list(self.host_configure_cmd)
configure_cmd += self.configureFlags
configure_cmd += self.extra_configure_flags
configure_cmd += worker.get_configure_flags(branch)
configure_cmd += [
f"--with-openssl={support_path}/openssl",
f"--build={self.arch}-apple-darwin",
Expand Down Expand Up @@ -1365,7 +1369,11 @@ class ValgrindBuild(UnixBuild):
def setup(self, branch, worker, **kwargs):
self.addStep(
Configure(
command=["./configure", "--prefix", "$(PWD)/target"] + self.configureFlags
command=(
["./configure", "--prefix", "$(PWD)/target"]
+ self.configureFlags
+ worker.get_configure_flags(branch)
)
)
)

Expand Down
90 changes: 90 additions & 0 deletions master/custom/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,44 @@
KEEPALIVE = 60


class BranchConfigureFlags:
def __init__(
self,
flags,
*,
branches=None,
min_branch=None,
max_branch=None,
):
if isinstance(flags, str):
self.flags = (flags,)
else:
self.flags = tuple(flags)
if isinstance(branches, str):
self.branches = (branches,)
elif branches is not None:
self.branches = tuple(branches)
else:
self.branches = None
self.min_branch = min_branch
self.max_branch = max_branch

def applies_to(self, branch):
if self.branches is not None and branch.name not in self.branches:
return False

if self.min_branch is None and self.max_branch is None:
return True

if branch.version_tuple is None:
return False
if self.min_branch is not None and branch.version_tuple < self.min_branch:
return False
if self.max_branch is not None and branch.version_tuple > self.max_branch:
return False
return True


class CPythonWorker:
def __init__(
self,
Expand All @@ -34,6 +72,7 @@ def __init__(
tags=None,
branches=None,
not_branches=None,
configure_flags=(),
parallel_builders=1,
parallel_tests=None,
timeout_factor=1,
Expand All @@ -45,6 +84,7 @@ def __init__(
self.tags = tags or set()
self.branches = branches
self.not_branches = not_branches
self.configure_flags = tuple(configure_flags)
self.parallel_tests = parallel_tests
self.timeout_factor = timeout_factor
self.exclude_test_resources = exclude_test_resources or []
Expand All @@ -68,6 +108,14 @@ def __init__(
max_builds=parallel_builders,
)

def get_configure_flags(self, branch):
configure_flags = []
for configure_flag in self.configure_flags:
if configure_flag.applies_to(branch):
configure_flags.extend(configure_flag.flags)
return configure_flags


# Some of Itamar's workers are reprovisioned every Wednesday at 9am PT.
# Builds scheduled between 8am - 10am PT on Wednesdays will be delayed to
# 10am PT.
Expand Down Expand Up @@ -101,11 +149,17 @@ def get_workers(settings):
cpw(
name="cstratak-fedora-rawhide-x86_64",
tags=['linux', 'unix', 'fedora', 'amd64', 'x86-64'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=10,
),
cpw(
name="cstratak-fedora-stable-x86_64",
tags=['linux', 'unix', 'fedora', 'amd64', 'x86-64'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=10,
),
cpw(
Expand All @@ -124,24 +178,36 @@ def get_workers(settings):
cpw(
name="cstratak-CentOS9-x86_64",
tags=['linux', 'unix', 'rhel', 'amd64', 'x86-64'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=6,
),
cpw(
name="cstratak-CentOS9-fips-x86_64",
tags=['linux', 'unix', 'rhel', 'amd64', 'x86-64', 'fips'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=6,
# Only 3.12+ for FIPS builder
not_branches=["3.10", "3.11"],
),
cpw(
name="cstratak-fedora-rawhide-ppc64le",
tags=['linux', 'unix', 'fedora', 'ppc64le'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=10,
timeout_factor=2, # Increase the timeout on this slow worker
),
cpw(
name="cstratak-fedora-stable-ppc64le",
tags=['linux', 'unix', 'fedora', 'ppc64le'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=10,
timeout_factor=2, # Increase the timeout on this slow worker
),
Expand All @@ -155,17 +221,26 @@ def get_workers(settings):
cpw(
name="cstratak-CentOS9-ppc64le",
tags=['linux', 'unix', 'rhel', 'ppc64le'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=10,
timeout_factor=2, # Increase the timeout on this slow worker
),
cpw(
name="cstratak-fedora-rawhide-aarch64",
tags=['linux', 'unix', 'fedora', 'arm', 'arm64', 'aarch64'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=32,
),
cpw(
name="cstratak-fedora-stable-aarch64",
tags=['linux', 'unix', 'fedora', 'arm', 'arm64', 'aarch64'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=32,
),
cpw(
Expand All @@ -177,11 +252,17 @@ def get_workers(settings):
cpw(
name="cstratak-CentOS9-aarch64",
tags=['linux', 'unix', 'rhel', 'arm', 'arm64', 'aarch64'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=32,
),
cpw(
name="cstratak-CentOS10-aarch64",
tags=['linux', 'unix', 'rhel', 'arm', 'arm64', 'aarch64'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=32,
),
cpw(
Expand All @@ -200,11 +281,17 @@ def get_workers(settings):
cpw(
name="cstratak-fedora-rawhide-s390x",
tags=['linux', 'unix', 'fedora', 's390x'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=10,
),
cpw(
name="cstratak-fedora-stable-s390x",
tags=['linux', 'unix', 'fedora', 's390x'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=10,
),
cpw(
Expand All @@ -216,6 +303,9 @@ def get_workers(settings):
cpw(
name="cstratak-rhel9-s390x",
tags=['linux', 'unix', 'rhel', 's390x'],
configure_flags=[
BranchConfigureFlags("--with-dtrace", min_branch=(3, 15)),
],
parallel_tests=10,
),
cpw(
Expand Down