Skip to content

Commit a101628

Browse files
pb8oroypat
authored andcommitted
ci: infer instance architecture from a heuristic
This helps the script work for instances it doesn't know about, which is helpful while onboarding new instances. Only Graviton metal instances are aarch64 at the moment. Fixes: c33bc6c Signed-off-by: Pablo Barbáchano <[email protected]>
1 parent 5487c06 commit a101628

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

.buildkite/common.py

+16-11
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,26 @@
1313
import subprocess
1414
from pathlib import Path
1515

16-
DEFAULT_INSTANCES = {
17-
"c5n.metal": "x86_64", # Intel Skylake
18-
"m5n.metal": "x86_64", # Intel Cascade Lake
19-
"m6i.metal": "x86_64", # Intel Icelake
20-
"m6a.metal": "x86_64", # AMD Milan
21-
"m6g.metal": "aarch64", # Graviton2
22-
"m7g.metal": "aarch64", # Graviton3
23-
}
16+
DEFAULT_INSTANCES = [
17+
"c5n.metal", # Intel Skylake
18+
"m5n.metal", # Intel Cascade Lake
19+
"m6i.metal", # Intel Icelake
20+
"m6a.metal", # AMD Milan
21+
"m6g.metal", # Graviton2
22+
"m7g.metal", # Graviton3
23+
]
2424

2525
DEFAULT_PLATFORMS = [
2626
("al2", "linux_5.10"),
2727
("al2023", "linux_6.1"),
2828
]
2929

3030

31+
def get_arch_for_instance(instance):
32+
"""Return instance architecture"""
33+
return "x86_64" if instance[2] != "g" else "aarch64"
34+
35+
3136
def overlay_dict(base: dict, update: dict):
3237
"""Overlay a dict over a base one"""
3338
base = base.copy()
@@ -145,7 +150,7 @@ def __call__(self, parser, namespace, value, option_string=None):
145150
"--instances",
146151
required=False,
147152
nargs="+",
148-
default=DEFAULT_INSTANCES.keys(),
153+
default=DEFAULT_INSTANCES,
149154
)
150155
COMMON_PARSER.add_argument(
151156
"--platforms",
@@ -288,7 +293,7 @@ def _adapt_group(self, group):
288293
step["command"] = prepend + step["command"]
289294
if self.shared_build is not None:
290295
step["depends_on"] = self.build_key(
291-
DEFAULT_INSTANCES[step["agents"]["instance"]]
296+
get_arch_for_instance(step["agents"]["instance"])
292297
)
293298
return group
294299

@@ -323,7 +328,7 @@ def build_group_per_arch(self, label, *args, **kwargs):
323328
if set_key:
324329
for step in grp["steps"]:
325330
step["key"] = self.build_key(
326-
DEFAULT_INSTANCES[step["agents"]["instance"]]
331+
get_arch_for_instance(step["agents"]["instance"])
327332
)
328333
return self.add_step(grp, depends_on_build=depends_on_build)
329334

.buildkite/pipeline_cpu_template.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class BkStep(str, Enum):
3434
"tools/devtool -y test --no-build -- -m no_block_pr integration_tests/functional/test_cpu_template_helper.py -k test_guest_cpu_config_change",
3535
],
3636
BkStep.LABEL: "🖐️ fingerprint",
37-
"instances": DEFAULT_INSTANCES.keys(),
37+
"instances": DEFAULT_INSTANCES,
3838
"platforms": DEFAULT_PLATFORMS,
3939
},
4040
"cpuid_wrmsr": {

0 commit comments

Comments
 (0)