Skip to content

Commit 731a4c3

Browse files
committed
Fix #363: Don't include all machines in 'all'
1 parent 97dfb70 commit 731a4c3

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

bench_runner/runners.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def __init__(
2020
# Override the Github self-hosted runner name if different from
2121
# os-arch-nickname
2222
github_runner_name: str | None,
23+
include_in_all: bool = True,
2324
):
2425
self.nickname = nickname
2526
self.os = os
@@ -30,6 +31,7 @@ def __init__(
3031
if github_runner_name is None:
3132
github_runner_name = self.name
3233
self.github_runner_name = github_runner_name
34+
self.include_in_all = include_in_all
3335

3436
@property
3537
def name(self) -> str:
@@ -54,6 +56,7 @@ def get_runners() -> list[Runner]:
5456
section.get("available", True),
5557
section.get("env", {}),
5658
section.get("github_runner_name"),
59+
section.get("include_in_all", True),
5760
)
5861
)
5962

bench_runner/scripts/install.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,15 @@ def generate__benchmark(src: Any) -> Any:
147147
runner_template["steps"].insert(0, setup_environment)
148148

149149
runner_template["runs-on"].append(runner.github_runner_name)
150-
runner_template["if"] = (
151-
f"${{{{ (inputs.machine == '{runner.name}' || inputs.machine == 'all') }}}}"
152-
)
150+
151+
machine_clauses = [
152+
f"inputs.machine == '{runner.name}'",
153+
"inputs.machine == '__really_all'",
154+
]
155+
if runner.include_in_all:
156+
machine_clauses.append("inputs.machine == 'all'")
157+
runner_template["if"] = f"${{{{ ({' || '.join(machine_clauses)}) }}}}"
158+
153159
dst["jobs"][f"benchmark-{runner.name}"] = runner_template
154160

155161
add_flag_env(dst["jobs"])

bench_runner/templates/_weekly.src.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
with:
3535
fork: python
3636
ref: ${{ needs.determine_head.outputs.commit }}
37-
machine: all
37+
machine: __really_all
3838
benchmarks: all_and_excluded
3939
pgo: true
4040
tier2: false
@@ -46,7 +46,7 @@ jobs:
4646
with:
4747
fork: python
4848
ref: ${{ needs.determine_head.outputs.commit }}
49-
machine: all
49+
machine: __really_all
5050
benchmarks: all_and_excluded
5151
pgo: true
5252
tier2: false
@@ -59,7 +59,7 @@ jobs:
5959
with:
6060
fork: python
6161
ref: ${{ needs.determine_head.outputs.commit }}
62-
machine: all
62+
machine: __really_all
6363
benchmarks: all_and_excluded
6464
pgo: true
6565
tier2: false
@@ -73,7 +73,7 @@ jobs:
7373
with:
7474
fork: python
7575
ref: ${{ needs.determine_head.outputs.commit }}
76-
machine: all
76+
machine: __really_all
7777
benchmarks: all_and_excluded
7878
pgo: true
7979
tier2: false

0 commit comments

Comments
 (0)