Skip to content

Commit 1a76753

Browse files
committed
speed up skipped build processing
1 parent cdcc294 commit 1a76753

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

buildbot_nix/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from collections.abc import Generator, Iterable
1212
from dataclasses import dataclass
1313
from datetime import UTC, datetime
14+
from multiprocessing import cpu_count
1415
from pathlib import Path
1516
from typing import TYPE_CHECKING, Any
1617

@@ -61,7 +62,7 @@
6162
from .oauth2_proxy_auth import OAuth2ProxyAuth
6263
from .projects import GitBackend, GitProject
6364

64-
SKIPPED_BUILDER_NAME = "skipped-builds"
65+
SKIPPED_BUILDER_NAMES = [f"skipped-builds-{n}" for n in range(cpu_count())]
6566

6667
log = Logger()
6768

@@ -1330,10 +1331,10 @@ def config_for_project(
13301331
outputs_path=outputs_path,
13311332
post_build_steps=post_build_steps,
13321333
),
1333-
nix_skipped_build_config(project, [SKIPPED_BUILDER_NAME], outputs_path),
1334-
nix_failed_eval_config(project, [SKIPPED_BUILDER_NAME]),
1335-
nix_dependency_failed_config(project, [SKIPPED_BUILDER_NAME]),
1336-
nix_cached_failure_config(project, [SKIPPED_BUILDER_NAME]),
1334+
nix_skipped_build_config(project, SKIPPED_BUILDER_NAMES, outputs_path),
1335+
nix_failed_eval_config(project, SKIPPED_BUILDER_NAMES),
1336+
nix_dependency_failed_config(project, SKIPPED_BUILDER_NAMES),
1337+
nix_cached_failure_config(project, SKIPPED_BUILDER_NAMES),
13371338
nix_register_gcroot_config(project, worker_names),
13381339
],
13391340
)
@@ -1548,7 +1549,7 @@ def configure(self, config: dict[str, Any]) -> None:
15481549
outputs_path=self.config.outputs_path,
15491550
)
15501551

1551-
config["workers"].append(worker.LocalWorker(SKIPPED_BUILDER_NAME))
1552+
config["workers"].extend(worker.LocalWorker(w) for w in SKIPPED_BUILDER_NAMES)
15521553

15531554
for backend in backends.values():
15541555
# Reload backend projects

0 commit comments

Comments
 (0)