Skip to content

Commit 39f8dc2

Browse files
committed
Merge upstream/HEAD@main
2 parents 28d0b6e + 52ea507 commit 39f8dc2

File tree

454 files changed

+26178
-19040
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

454 files changed

+26178
-19040
lines changed

.buildkite/common.py

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,41 @@
66
"""
77

88
import argparse
9+
import ast
910
import json
1011
import os
1112
import random
1213
import string
1314
import subprocess
1415
from pathlib import Path
1516

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-
}
17+
# fmt: off
18+
DEFAULT_INSTANCES = [
19+
"c5n.metal", # Intel Skylake
20+
"m5n.metal", # Intel Cascade Lake
21+
"m6i.metal", # Intel Icelake
22+
"m7i.metal-24xl", # Intel Sapphire Rapids
23+
"m7i.metal-48xl", # Intel Sapphire Rapids
24+
"m6a.metal", # AMD Milan
25+
"m7a.metal-48xl", # AMD Genoa
26+
"m6g.metal", # Graviton2
27+
"m7g.metal", # Graviton3
28+
"m8g.metal-24xl", # Graviton4 1 socket
29+
"m8g.metal-48xl", # Graviton4 2 sockets
30+
]
31+
# fmt: on
2432

2533
DEFAULT_PLATFORMS = [
2634
("al2", "linux_5.10"),
2735
("al2023", "linux_6.1"),
2836
]
2937

3038

39+
def get_arch_for_instance(instance):
40+
"""Return instance architecture"""
41+
return "x86_64" if instance[2] != "g" else "aarch64"
42+
43+
3144
def overlay_dict(base: dict, update: dict):
3245
"""Overlay a dict over a base one"""
3346
base = base.copy()
@@ -133,7 +146,8 @@ def __call__(self, parser, namespace, value, option_string=None):
133146
res = getattr(namespace, self.dest, {})
134147
key_str, val = value.split("=", maxsplit=1)
135148
keys = key_str.split("/")
136-
update = {keys[-1]: val}
149+
# Interpret it as a literal iff it starts like one
150+
update = {keys[-1]: ast.literal_eval(val) if val[0] in "[{'" else val}
137151
for key in list(reversed(keys))[1:]:
138152
update = {key: update}
139153
res = overlay_dict(res, update)
@@ -145,7 +159,7 @@ def __call__(self, parser, namespace, value, option_string=None):
145159
"--instances",
146160
required=False,
147161
nargs="+",
148-
default=DEFAULT_INSTANCES.keys(),
162+
default=DEFAULT_INSTANCES,
149163
)
150164
COMMON_PARSER.add_argument(
151165
"--platforms",
@@ -171,6 +185,12 @@ def __call__(self, parser, namespace, value, option_string=None):
171185
default=None,
172186
type=str,
173187
)
188+
COMMON_PARSER.add_argument(
189+
"--no-kani",
190+
help="Don't add kani step",
191+
action="store_true",
192+
default=False,
193+
)
174194

175195

176196
def random_str(k: int):
@@ -180,16 +200,7 @@ def random_str(k: int):
180200

181201
def ab_revision_build(revision):
182202
"""Generate steps for building an A/B-test revision"""
183-
# Copied from framework/ab_test. Double dollar signs needed for Buildkite (otherwise it will try to interpolate itself)
184-
return [
185-
f"commitish={revision}",
186-
f"if ! git cat-file -t $$commitish; then commitish=origin/{revision}; fi",
187-
"branch_name=tmp-$$commitish",
188-
"git branch $$branch_name $$commitish",
189-
f"git clone -b $$branch_name . build/{revision}",
190-
f"cd build/{revision} && ./tools/devtool -y build --release && cd -",
191-
"git branch -D $$branch_name",
192-
]
203+
return [f"./tools/devtool -y build --rev {revision} --release"]
193204

194205

195206
def shared_build():
@@ -252,7 +263,7 @@ def __init__(self, with_build_step=True, **kwargs):
252263
self.per_instance = overlay_dict(per_instance, args.step_param)
253264
self.per_arch = self.per_instance.copy()
254265
self.per_arch["instances"] = ["m6i.metal", "m7g.metal"]
255-
self.per_arch["platforms"] = [("al2", "linux_5.10")]
266+
self.per_arch["platforms"] = [("al2023", "linux_6.1")]
256267
self.binary_dir = args.binary_dir
257268
# Build sharing
258269
if with_build_step:
@@ -297,7 +308,7 @@ def _adapt_group(self, group):
297308
step["command"] = prepend + step["command"]
298309
if self.shared_build is not None:
299310
step["depends_on"] = self.build_key(
300-
DEFAULT_INSTANCES[step["agents"]["instance"]]
311+
get_arch_for_instance(step["agents"]["instance"])
301312
)
302313
return group
303314

@@ -332,7 +343,7 @@ def build_group_per_arch(self, label, *args, **kwargs):
332343
if set_key:
333344
for step in grp["steps"]:
334345
step["key"] = self.build_key(
335-
DEFAULT_INSTANCES[step["agents"]["instance"]]
346+
get_arch_for_instance(step["agents"]["instance"])
336347
)
337348
return self.add_step(grp, depends_on_build=depends_on_build)
338349

.buildkite/pipeline_cpu_template.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from enum import Enum
88

9-
from common import DEFAULT_INSTANCES, DEFAULT_PLATFORMS, BKPipeline, group
9+
from common import DEFAULT_PLATFORMS, BKPipeline, group
1010

1111

1212
class BkStep(str, Enum):
@@ -23,24 +23,29 @@ class BkStep(str, Enum):
2323
cpu_template_test = {
2424
"rdmsr": {
2525
BkStep.COMMAND: [
26-
"tools/devtool -y test --no-build -- -m nonci -n4 --dist worksteal integration_tests/functional/test_cpu_features.py -k 'test_cpu_rdmsr' "
26+
"tools/devtool -y test --no-build -- -m nonci -n4 --dist worksteal integration_tests/functional/test_cpu_features_x86_64.py -k 'test_cpu_rdmsr' "
2727
],
2828
BkStep.LABEL: "📖 rdmsr",
29-
"instances": ["c5n.metal", "m5n.metal", "m6a.metal", "m6i.metal"],
30-
"platforms": DEFAULT_PLATFORMS,
29+
"instances": [
30+
"c5n.metal",
31+
"m5n.metal",
32+
"m6i.metal",
33+
"m7i.metal-24xl",
34+
"m7i.metal-48xl",
35+
"m6a.metal",
36+
"m7a.metal-48xl",
37+
],
3138
},
3239
"fingerprint": {
3340
BkStep.COMMAND: [
3441
"tools/devtool -y test --no-build -- -m no_block_pr integration_tests/functional/test_cpu_template_helper.py -k test_guest_cpu_config_change",
3542
],
3643
BkStep.LABEL: "🖐️ fingerprint",
37-
"instances": DEFAULT_INSTANCES.keys(),
38-
"platforms": DEFAULT_PLATFORMS,
3944
},
4045
"cpuid_wrmsr": {
4146
"snapshot": {
4247
BkStep.COMMAND: [
43-
"tools/devtool -y test --no-build -- -m nonci -n4 --dist worksteal integration_tests/functional/test_cpu_features.py -k 'test_cpu_wrmsr_snapshot or test_cpu_cpuid_snapshot'",
48+
"tools/devtool -y test --no-build -- -m nonci -n4 --dist worksteal integration_tests/functional/test_cpu_features_x86_64.py -k 'test_cpu_wrmsr_snapshot or test_cpu_cpuid_snapshot'",
4449
"mkdir -pv tests/snapshot_artifacts_upload/{instance}_{os}_{kv}",
4550
"sudo mv tests/snapshot_artifacts/* tests/snapshot_artifacts_upload/{instance}_{os}_{kv}",
4651
],
@@ -52,7 +57,7 @@ class BkStep(str, Enum):
5257
BkStep.COMMAND: [
5358
"buildkite-agent artifact download tests/snapshot_artifacts_upload/{instance}_{os}_{kv}/**/* .",
5459
"mv tests/snapshot_artifacts_upload/{instance}_{os}_{kv} tests/snapshot_artifacts",
55-
"tools/devtool -y test --no-build -- -m nonci -n4 --dist worksteal integration_tests/functional/test_cpu_features.py -k 'test_cpu_wrmsr_restore or test_cpu_cpuid_restore'",
60+
"tools/devtool -y test --no-build -- -m nonci -n4 --dist worksteal integration_tests/functional/test_cpu_features_x86_64.py -k 'test_cpu_wrmsr_restore or test_cpu_cpuid_restore'",
5661
],
5762
BkStep.LABEL: "📸 load snapshot artifacts created on {instance} {snapshot_os} {snapshot_kv} to {restore_instance} {restore_os} {restore_kv}",
5863
BkStep.TIMEOUT: 30,
@@ -62,7 +67,14 @@ class BkStep(str, Enum):
6267
"c5n.metal": ["m5n.metal", "m6i.metal"],
6368
"m6i.metal": ["m5n.metal", "c5n.metal"],
6469
},
65-
"instances": ["c5n.metal", "m5n.metal", "m6i.metal", "m6a.metal"],
70+
"instances": [
71+
"c5n.metal",
72+
"m5n.metal",
73+
"m6i.metal",
74+
"m7i.metal-24xl",
75+
"m7i.metal-48xl",
76+
"m6a.metal",
77+
],
6678
},
6779
}
6880

.buildkite/pipeline_cross.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,23 @@
1818
per_instance = pipeline.per_instance.copy()
1919
per_instance.pop("instances")
2020
per_instance.pop("platforms")
21-
instances_x86_64 = ["c5n.metal", "m5n.metal", "m6i.metal", "m6a.metal"]
21+
instances_x86_64 = [
22+
"c5n.metal",
23+
"m5n.metal",
24+
"m6i.metal",
25+
"m7i.metal-24xl",
26+
"m7i.metal-48xl",
27+
"m6a.metal",
28+
"m7a.metal-48xl",
29+
]
2230
instances_aarch64 = ["m7g.metal"]
2331
commands = [
24-
"./tools/devtool -y sh ./tools/create_snapshot_artifact/main.py",
25-
"mkdir -pv snapshots/{instance}_{kv}",
26-
"sudo chown -Rc $USER: snapshot_artifacts",
27-
"mv -v snapshot_artifacts/* snapshots/{instance}_{kv}",
32+
"./tools/devtool -y test --no-build -- -m nonci -n4 integration_tests/functional/test_snapshot_phase1.py",
33+
# punch holes in mem snapshot tiles and tar them so they are preserved in S3
34+
"find test_results/test_snapshot_phase1 -type f -name mem |xargs -P4 -t -n1 fallocate -d",
35+
"mv -v test_results/test_snapshot_phase1 snapshot_artifacts",
36+
"mkdir -pv snapshots",
37+
"tar cSvf snapshots/{instance}_{kv}.tar snapshot_artifacts",
2838
]
2939
pipeline.build_group(
3040
"📸 create snapshots",
@@ -80,10 +90,10 @@
8090
k_val = pytest_keyword_for_instance.get(dst_instance, "")
8191
step = {
8292
"command": [
83-
f"buildkite-agent artifact download snapshots/{src_instance}_{src_kv}/* .",
84-
f"mv -v snapshots/{src_instance}_{src_kv} snapshot_artifacts",
93+
f"buildkite-agent artifact download snapshots/{src_instance}_{src_kv}.tar .",
94+
f"tar xSvf snapshots/{src_instance}_{src_kv}.tar",
8595
*pipeline.devtool_test(
86-
pytest_opts=f"-m nonci {k_val} integration_tests/functional/test_snapshot_restore_cross_kernel.py",
96+
pytest_opts=f"-m nonci -n8 --dist worksteal {k_val} integration_tests/functional/test_snapshot_restore_cross_kernel.py",
8797
),
8898
],
8999
"label": f"🎬 {src_instance} {src_kv} ➡️ {dst_instance} {dst_kv}",

.buildkite/pipeline_perf.py

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,48 @@
1616
# the operating system sometimes uses it for book-keeping tasks. The memory node (-m parameter)
1717
# has to be the node associated with the NUMA node from which we picked CPUs.
1818
perf_test = {
19-
"virtio-block": {
20-
"label": "💿 Virtio Block Performance",
21-
"test_path": "integration_tests/performance/test_block_ab.py::test_block_performance",
19+
"virtio-block-sync": {
20+
"label": "💿 Virtio Sync Block Performance",
21+
"tests": "integration_tests/performance/test_block_ab.py::test_block_performance -k 'not Async'",
22+
"devtool_opts": "-c 1-10 -m 0",
23+
},
24+
"virtio-block-async": {
25+
"label": "💿 Virtio Async Block Performance",
26+
"tests": "integration_tests/performance/test_block_ab.py::test_block_performance -k Async",
2227
"devtool_opts": "-c 1-10 -m 0",
2328
},
2429
"vhost-user-block": {
2530
"label": "💿 vhost-user Block Performance",
26-
"test_path": "integration_tests/performance/test_block_ab.py::test_block_vhost_user_performance",
31+
"tests": "integration_tests/performance/test_block_ab.py::test_block_vhost_user_performance",
2732
"devtool_opts": "-c 1-10 -m 0",
2833
"ab_opts": "--noise-threshold 0.1",
2934
},
30-
"network-latency": {
31-
"label": "📠 Network Latency",
32-
"test_path": "integration_tests/performance/test_network_ab.py::test_network_latency",
35+
"network": {
36+
"label": "📠 Network Latency and Throughput",
37+
"tests": "integration_tests/performance/test_network_ab.py",
3338
"devtool_opts": "-c 1-10 -m 0",
3439
# Triggers if delta is > 0.01ms (10µs) or default relative threshold (5%)
40+
# only relevant for latency test, throughput test will always be magnitudes above this anyway
3541
"ab_opts": "--absolute-strength 0.010",
3642
},
37-
"network-throughput": {
38-
"label": "📠 Network TCP Throughput",
39-
"test_path": "integration_tests/performance/test_network_ab.py::test_network_tcp_throughput",
40-
"devtool_opts": "-c 1-10 -m 0",
41-
},
4243
"snapshot-latency": {
4344
"label": "📸 Snapshot Latency",
44-
"test_path": "integration_tests/performance/test_snapshot_ab.py",
45+
"tests": "integration_tests/performance/test_snapshot_ab.py::test_restore_latency integration_tests/performance/test_snapshot_ab.py::test_post_restore_latency",
46+
"devtool_opts": "-c 1-12 -m 0",
47+
},
48+
"population-latency": {
49+
"label": "📸 Memory Population Latency",
50+
"tests": "integration_tests/performance/test_snapshot_ab.py::test_population_latency",
4551
"devtool_opts": "-c 1-12 -m 0",
4652
},
4753
"vsock-throughput": {
4854
"label": "🧦 Vsock Throughput",
49-
"test_path": "integration_tests/performance/test_vsock_ab.py",
55+
"tests": "integration_tests/performance/test_vsock_ab.py",
5056
"devtool_opts": "-c 1-10 -m 0",
5157
},
5258
"memory-overhead": {
5359
"label": "💾 Memory Overhead and 👢 Boottime",
54-
"test_path": "integration_tests/performance/test_memory_overhead.py integration_tests/performance/test_boottime.py::test_boottime",
60+
"tests": "integration_tests/performance/test_memory_overhead.py integration_tests/performance/test_boottime.py::test_boottime",
5561
"devtool_opts": "-c 1-10 -m 0",
5662
},
5763
}
@@ -92,21 +98,21 @@
9298
tests = [perf_test[test] for test in pipeline.args.test or perf_test.keys()]
9399
for test in tests:
94100
devtool_opts = test.pop("devtool_opts")
95-
test_path = test.pop("test_path")
101+
test_selector = test.pop("tests")
96102
ab_opts = test.pop("ab_opts", "")
97103
devtool_opts += " --performance"
98-
pytest_opts = ""
104+
test_script_opts = ""
99105
if REVISION_A:
100106
devtool_opts += " --ab"
101-
pytest_opts = f"{ab_opts} run {REVISION_A} {REVISION_B} --test {test_path}"
107+
test_script_opts = f'{ab_opts} run build/{REVISION_A}/ build/{REVISION_B} --pytest-opts "{test_selector}"'
102108
else:
103109
# Passing `-m ''` below instructs pytest to collect tests regardless of
104110
# their markers (e.g. it will collect both tests marked as nonci, and
105111
# tests without any markers).
106-
pytest_opts += f" -m '' {test_path}"
112+
test_script_opts += f" -m '' {test_selector}"
107113

108114
pipeline.build_group(
109-
command=pipeline.devtool_test(devtool_opts, pytest_opts),
115+
command=pipeline.devtool_test(devtool_opts, test_script_opts),
110116
# and the rest can be command arguments
111117
**test,
112118
)
@@ -119,10 +125,7 @@
119125
# }
120126
# will pin steps running on instances "m6i.metal" with kernel version tagged "linux_6.1"
121127
# to a new kernel version tagged "linux_6.1-pinned"
122-
pins = {
123-
# TODO: Unpin when performance instability on m6i/5.10 has gone.
124-
"linux_5.10-pinned": {"instance": "m6i.metal", "kv": "linux_5.10"},
125-
}
128+
pins = {}
126129

127130

128131
def apply_pins(steps):

.buildkite/pipeline_pr.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,18 @@
4848
"./tools/devtool -y make_release",
4949
)
5050

51-
if not changed_files or any(
52-
x.suffix in [".rs", ".toml", ".lock"] for x in changed_files
51+
if not pipeline.args.no_kani and (
52+
not changed_files
53+
or any(x.suffix in [".rs", ".toml", ".lock"] for x in changed_files)
54+
or any(x.parent.name == "devctr" for x in changed_files)
5355
):
5456
kani_grp = pipeline.build_group(
5557
"🔍 Kani",
5658
"./tools/devtool -y test --no-build -- ../tests/integration_tests/test_kani.py -n auto",
5759
# Kani step default
5860
# Kani runs fastest on m6a.metal
5961
instances=["m6a.metal", "m7g.metal"],
60-
platforms=[("al2", "linux_5.10")],
62+
platforms=[("al2023", "linux_6.1")],
6163
timeout_in_minutes=300,
6264
**DEFAULTS_PERF,
6365
depends_on_build=False,
@@ -76,7 +78,7 @@
7678
pipeline.build_group(
7779
"⚙ Functional and security 🔒",
7880
pipeline.devtool_test(
79-
pytest_opts="-n 8 --dist worksteal integration_tests/{{functional,security}}",
81+
pytest_opts="-n 16 --dist worksteal integration_tests/{{functional,security}}",
8082
),
8183
)
8284

.cargo/audit.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
[advisories]
2+
# The `paste` dependency is transitively included via `gdbstub`.
3+
# While the crate is archived/unmaintained, the author considers it feature-complete
4+
# and functionally stable. gdbstub will be update once they migrate
5+
# to an alternative solution.
6+
# See https://github.com/daniel5151/gdbstub/issues/168
7+
ignore = ["RUSTSEC-2024-0436"]

0 commit comments

Comments
 (0)