|
11 | 11 | from collections.abc import Generator, Iterable |
12 | 12 | from dataclasses import dataclass |
13 | 13 | from datetime import UTC, datetime |
| 14 | +from multiprocessing import cpu_count |
14 | 15 | from pathlib import Path |
15 | 16 | from typing import TYPE_CHECKING, Any |
16 | 17 |
|
|
61 | 62 | from .oauth2_proxy_auth import OAuth2ProxyAuth |
62 | 63 | from .projects import GitBackend, GitProject |
63 | 64 |
|
64 | | -SKIPPED_BUILDER_NAME = "skipped-builds" |
| 65 | +SKIPPED_BUILDER_NAMES = [f"skipped-builds-{n}" for n in range(cpu_count())] |
65 | 66 |
|
66 | 67 | log = Logger() |
67 | 68 |
|
@@ -1330,10 +1331,10 @@ def config_for_project( |
1330 | 1331 | outputs_path=outputs_path, |
1331 | 1332 | post_build_steps=post_build_steps, |
1332 | 1333 | ), |
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), |
1337 | 1338 | nix_register_gcroot_config(project, worker_names), |
1338 | 1339 | ], |
1339 | 1340 | ) |
@@ -1548,7 +1549,7 @@ def configure(self, config: dict[str, Any]) -> None: |
1548 | 1549 | outputs_path=self.config.outputs_path, |
1549 | 1550 | ) |
1550 | 1551 |
|
1551 | | - config["workers"].append(worker.LocalWorker(SKIPPED_BUILDER_NAME)) |
| 1552 | + config["workers"].extend(worker.LocalWorker(w) for w in SKIPPED_BUILDER_NAMES) |
1552 | 1553 |
|
1553 | 1554 | for backend in backends.values(): |
1554 | 1555 | # Reload backend projects |
|
0 commit comments