File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
buildbot_nix/buildbot_nix Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,11 @@ class WorkerConfig:
25
25
worker_name : str = field (
26
26
default_factory = lambda : os .environ .get ("WORKER_NAME" , socket .gethostname ())
27
27
)
28
- worker_count : int = int (
29
- os .environ .get ("WORKER_COUNT" , str (multiprocessing .cpu_count ())),
30
- )
28
+ worker_count_str : str | None = os .environ .get ("WORKER_COUNT" )
29
+ if worker_count_str is not None :
30
+ worker_count = int (worker_count_str )
31
+ else :
32
+ worker_count = multiprocessing .cpu_count ()
31
33
buildbot_dir : Path = field (
32
34
default_factory = lambda : Path (require_env ("BUILDBOT_DIR" ))
33
35
)
Original file line number Diff line number Diff line change 3
3
services . buildbot-nix . worker = {
4
4
enable = true ;
5
5
workerPasswordFile = pkgs . writeText "worker-password-file" "XXXXXXXXXXXXXXXXXXXX" ;
6
+ # The number of workers to start (default: 0 == the number of CPU cores).
7
+ # If you experience flaky builds under high load, try to reduce this value.
8
+ # workers = 0;
6
9
} ;
7
10
}
Original file line number Diff line number Diff line change 56
56
default = pkgs . nix-eval-jobs ;
57
57
description = "nix-eval-jobs to use for evaluation" ;
58
58
} ;
59
+ workers = lib . mkOption {
60
+ type = lib . types . int ;
61
+ default = 0 ;
62
+ description = ''
63
+ The number of workers to start (default: 0 == to the number of CPU cores).
64
+ If you experience flaky builds under high load, try to reduce this value.
65
+ '' ;
66
+ } ;
59
67
masterUrl = lib . mkOption {
60
68
type = lib . types . str ;
61
69
default = "tcp:host=localhost:port=9989" ;
114
122
} /${ packages . python . sitePackages } " ;
115
123
environment . MASTER_URL = cfg . masterUrl ;
116
124
environment . BUILDBOT_DIR = buildbotDir ;
125
+ environment . WORKER_COUNT = builtins . toString cfg . workers ;
117
126
118
127
serviceConfig = {
119
128
# We rather want the CI job to fail on OOM than to have a broken buildbot worker.
You can’t perform that action at this time.
0 commit comments