Skip to content

Commit

Permalink
Merge pull request #293 from nix-community/speed-up-skip-builders
Browse files Browse the repository at this point in the history
speed up skipped build processing
  • Loading branch information
Mic92 authored Sep 23, 2024
2 parents f58f581 + 1a76753 commit 3ac54ba
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions buildbot_nix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from collections.abc import Generator, Iterable
from dataclasses import dataclass
from datetime import UTC, datetime
from multiprocessing import cpu_count
from pathlib import Path
from typing import TYPE_CHECKING, Any

Expand Down Expand Up @@ -61,7 +62,7 @@
from .oauth2_proxy_auth import OAuth2ProxyAuth
from .projects import GitBackend, GitProject

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

log = Logger()

Expand Down Expand Up @@ -1330,10 +1331,10 @@ def config_for_project(
outputs_path=outputs_path,
post_build_steps=post_build_steps,
),
nix_skipped_build_config(project, [SKIPPED_BUILDER_NAME], outputs_path),
nix_failed_eval_config(project, [SKIPPED_BUILDER_NAME]),
nix_dependency_failed_config(project, [SKIPPED_BUILDER_NAME]),
nix_cached_failure_config(project, [SKIPPED_BUILDER_NAME]),
nix_skipped_build_config(project, SKIPPED_BUILDER_NAMES, outputs_path),
nix_failed_eval_config(project, SKIPPED_BUILDER_NAMES),
nix_dependency_failed_config(project, SKIPPED_BUILDER_NAMES),
nix_cached_failure_config(project, SKIPPED_BUILDER_NAMES),
nix_register_gcroot_config(project, worker_names),
],
)
Expand Down Expand Up @@ -1548,7 +1549,7 @@ def configure(self, config: dict[str, Any]) -> None:
outputs_path=self.config.outputs_path,
)

config["workers"].append(worker.LocalWorker(SKIPPED_BUILDER_NAME))
config["workers"].extend(worker.LocalWorker(w) for w in SKIPPED_BUILDER_NAMES)

for backend in backends.values():
# Reload backend projects
Expand Down

0 comments on commit 3ac54ba

Please sign in to comment.