@@ -54,15 +54,14 @@ class GitHubActionPackage(TypedDict):
54
54
55
55
BUILD_RUNNER_MAP : Dict [str , RunsOnConfig ] = {
56
56
"aarch64-linux" : {
57
- "group" : "self-hosted-runners-nix" ,
58
- "labels" : ["aarch64-linux" ],
57
+ "labels" : ["blacksmith-8vcpu-ubuntu-2404-arm" ],
59
58
},
60
59
"aarch64-darwin" : {
61
60
"group" : "self-hosted-runners-nix" ,
62
61
"labels" : ["aarch64-darwin" ],
63
62
},
64
63
"x86_64-linux" : {
65
- "labels" : ["blacksmith-32vcpu -ubuntu-2404" ],
64
+ "labels" : ["blacksmith-8vcpu -ubuntu-2404" ],
66
65
},
67
66
}
68
67
@@ -162,6 +161,30 @@ def sort_pkgs_by_closures(jobs: List[NixEvalJobsOutput]) -> List[NixEvalJobsOutp
162
161
return sorted_jobs
163
162
164
163
164
+ def is_large_pkg (pkg : NixEvalJobsOutput ) -> bool :
165
+ """Determine if a package is considered large based on its attribute path."""
166
+ RUST_EXTENSIONS = ["exts.wrappers" , "exts.pg_jsonschema" , "exts.pg_graphql" ]
167
+ LARGE_C_EXTENSION = ["exts.postgis" ]
168
+ return any (
169
+ indicator in pkg ["attr" ] for indicator in RUST_EXTENSIONS + LARGE_C_EXTENSION
170
+ )
171
+
172
+
173
+ def get_runner_for_package (pkg : NixEvalJobsOutput ) -> RunsOnConfig :
174
+ """Determine the appropriate GitHub Actions runner for a package."""
175
+ system = pkg ["system" ]
176
+ if is_large_pkg (pkg ):
177
+ # Use larger runners for large packages for x86_64-linux and aarch64-linux
178
+ if system == "x86_64-linux" :
179
+ return {"labels" : ["blacksmith-32vcpu-ubuntu-2404" ]}
180
+ elif system == "aarch64-linux" :
181
+ return {"labels" : ["blacksmith-32vcpu-ubuntu-2404-arm" ]}
182
+ if system in BUILD_RUNNER_MAP :
183
+ return BUILD_RUNNER_MAP [system ]
184
+ else :
185
+ raise ValueError (f"No runner configuration for system: { system } " )
186
+
187
+
165
188
def main () -> None :
166
189
parser = argparse .ArgumentParser (
167
190
description = "Generate GitHub Actions matrix for Nix builds"
@@ -184,6 +207,7 @@ def clean_package_for_output(pkg: NixEvalJobsOutput) -> GitHubActionPackage:
184
207
"attr" : pkg ["attr" ],
185
208
"name" : pkg ["name" ],
186
209
"system" : pkg ["system" ],
210
+ "runs_on" : get_runner_for_package (pkg ),
187
211
}
188
212
if is_extension_pkg (pkg ):
189
213
# Extract PostgreSQL version from attribute path
0 commit comments