Skip to content

Commit 36790c7

Browse files
dianpopapb8o
authored andcommitted
[CI][snap_perf]: re-gather baselines
Gather baselines for all combinations of setup that we currently support: 4.14 Sync, 5.10 Sync and Async. Signed-off-by: Diana Popa <dpopa@amazon.com>
1 parent 714016a commit 36790c7

File tree

1 file changed

+63
-16
lines changed

1 file changed

+63
-16
lines changed

tests/integration_tests/performance/test_snapshot_perf.py

Lines changed: 63 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import logging
77
import os
88
import platform
9+
import pytest
10+
911
from conftest import _test_images_s3_bucket
1012
from framework.artifacts import ArtifactCollection, ArtifactSet
1113
from framework.defs import DEFAULT_TEST_IMAGES_S3_BUCKET
@@ -28,6 +30,10 @@
2830
SAMPLE_COUNT = 3
2931
USEC_IN_MSEC = 1000
3032
PLATFORM = platform.machine()
33+
ENGINES = ["Sync"]
34+
35+
if is_io_uring_supported():
36+
ENGINES.append("Async")
3137

3238
# Latencies in milliseconds.
3339
# The latency for snapshot creation has high variance due to scheduler noise.
@@ -60,12 +66,40 @@
6066
# TODO: Update the table after fix. Target is < 5ms.
6167
LOAD_LATENCY_BASELINES = {
6268
"x86_64": {
63-
"2vcpu_256mb.json": {"target": 9},
64-
"2vcpu_512mb.json": {"target": 9},
69+
"4.14": {
70+
"sync": {
71+
"2vcpu_256mb.json": {"target": 9},
72+
"2vcpu_512mb.json": {"target": 9},
73+
}
74+
},
75+
"5.10": {
76+
"sync": {
77+
"2vcpu_256mb.json": {"target": 60},
78+
"2vcpu_512mb.json": {"target": 60},
79+
},
80+
"async": {
81+
"2vcpu_256mb.json": {"target": 190},
82+
"2vcpu_512mb.json": {"target": 190},
83+
},
84+
},
6585
},
6686
"aarch64": {
67-
"2vcpu_256mb.json": {"target": 3},
68-
"2vcpu_512mb.json": {"target": 3},
87+
"4.14": {
88+
"sync": {
89+
"2vcpu_256mb.json": {"target": 2},
90+
"2vcpu_512mb.json": {"target": 2},
91+
}
92+
},
93+
"5.10": {
94+
"sync": {
95+
"2vcpu_256mb.json": {"target": 2},
96+
"2vcpu_512mb.json": {"target": 2},
97+
},
98+
"async": {
99+
"2vcpu_256mb.json": {"target": 125},
100+
"2vcpu_512mb.json": {"target": 130},
101+
},
102+
},
69103
},
70104
}
71105

@@ -88,9 +122,11 @@ def snapshot_create_measurements(vm_type, snapshot_type):
88122
return [latency]
89123

90124

91-
def snapshot_resume_measurements(vm_type):
125+
def snapshot_resume_measurements(vm_type, io_engine):
92126
"""Define measurements for snapshot resume tests."""
93-
load_latency = LOAD_LATENCY_BASELINES[platform.machine()][vm_type]
127+
load_latency = LOAD_LATENCY_BASELINES[platform.machine()][
128+
get_kernel_version(level=1)
129+
][io_engine][vm_type]
94130

95131
latency = types.MeasurementDef.create_measurement(
96132
"latency",
@@ -278,6 +314,7 @@ def _test_snapshot_resume_latency(context):
278314
vm_builder = context.custom["builder"]
279315
snapshot_type = context.custom["snapshot_type"]
280316
file_dumper = context.custom["results_file_dumper"]
317+
io_engine = context.custom["io_engine"]
281318
diff_snapshots = snapshot_type == SnapshotType.DIFF
282319

283320
logger.info(
@@ -302,6 +339,7 @@ def _test_snapshot_resume_latency(context):
302339
config=context.microvm,
303340
diff_snapshots=diff_snapshots,
304341
use_ramdisk=True,
342+
io_engine=io_engine,
305343
)
306344
basevm = vm_instance.vm
307345
basevm.start()
@@ -341,7 +379,8 @@ def _test_snapshot_resume_latency(context):
341379
func_kwargs={},
342380
)
343381
eager_map(
344-
cons.set_measurement_def, snapshot_resume_measurements(context.microvm.name())
382+
cons.set_measurement_def,
383+
snapshot_resume_measurements(context.microvm.name(), io_engine.lower()),
345384
)
346385

347386
st_core.add_pipe(producer=prod, consumer=cons, tag=context.microvm.name())
@@ -360,6 +399,7 @@ def _test_older_snapshot_resume_latency(context):
360399
logger = context.custom["logger"]
361400
snapshot_type = context.custom["snapshot_type"]
362401
file_dumper = context.custom["results_file_dumper"]
402+
io_engine = context.custom["io_engine"]
363403

364404
firecracker = context.firecracker
365405
jailer = firecracker.jailer()
@@ -410,7 +450,8 @@ def _test_older_snapshot_resume_latency(context):
410450
func_kwargs={},
411451
)
412452
eager_map(
413-
cons.set_measurement_def, snapshot_resume_measurements(context.microvm.name())
453+
cons.set_measurement_def,
454+
snapshot_resume_measurements(context.microvm.name(), io_engine.lower()),
414455
)
415456

416457
st_core.add_pipe(producer=prod, consumer=cons, tag=context.microvm.name())
@@ -439,8 +480,8 @@ def test_snapshot_create_full_latency(
439480
# - Rootfs: Ubuntu 18.04
440481
# - Microvm: 2vCPU with 256/512 MB RAM
441482
# TODO: Multiple microvm sizes must be tested in the async pipeline.
442-
microvm_artifacts = ArtifactSet(artifacts.microvms(keyword="2vcpu_512mb"))
443-
microvm_artifacts.insert(artifacts.microvms(keyword="2vcpu_256mb"))
483+
microvm_artifacts = ArtifactSet(artifacts.microvms(keyword="2vcpu_256mb"))
484+
microvm_artifacts.insert(artifacts.microvms(keyword="2vcpu_512mb"))
444485
kernel_artifacts = ArtifactSet(artifacts.kernels())
445486
disk_artifacts = ArtifactSet(artifacts.disks(keyword="ubuntu"))
446487

@@ -479,8 +520,8 @@ def test_snapshot_create_diff_latency(
479520
# - Rootfs: Ubuntu 18.04
480521
# - Microvm: 2vCPU with 256/512 MB RAM
481522
# TODO: Multiple microvm sizes must be tested in the async pipeline.
482-
microvm_artifacts = ArtifactSet(artifacts.microvms(keyword="2vcpu_512mb"))
483-
microvm_artifacts.insert(artifacts.microvms(keyword="2vcpu_256mb"))
523+
microvm_artifacts = ArtifactSet(artifacts.microvms(keyword="2vcpu_256mb"))
524+
microvm_artifacts.insert(artifacts.microvms(keyword="2vcpu_512mb"))
484525
kernel_artifacts = ArtifactSet(artifacts.kernels())
485526
disk_artifacts = ArtifactSet(artifacts.disks(keyword="ubuntu"))
486527

@@ -504,7 +545,10 @@ def test_snapshot_create_diff_latency(
504545
test_matrix.run_test(_test_snapshot_create_latency)
505546

506547

507-
def test_snapshot_resume_latency(network_config, bin_cloner_path, results_file_dumper):
548+
@pytest.mark.parametrize("io_engine", ENGINES)
549+
def test_snapshot_resume_latency(
550+
network_config, bin_cloner_path, results_file_dumper, io_engine
551+
):
508552
"""
509553
Test scenario: Snapshot load performance measurement.
510554
@@ -518,8 +562,8 @@ def test_snapshot_resume_latency(network_config, bin_cloner_path, results_file_d
518562
# - Rootfs: Ubuntu 18.04
519563
# - Microvm: 2vCPU with 256/512 MB RAM
520564
# TODO: Multiple microvm sizes must be tested in the async pipeline.
521-
microvm_artifacts = ArtifactSet(artifacts.microvms(keyword="2vcpu_512mb"))
522-
microvm_artifacts.insert(artifacts.microvms(keyword="2vcpu_256mb"))
565+
microvm_artifacts = ArtifactSet(artifacts.microvms(keyword="2vcpu_256mb"))
566+
microvm_artifacts.insert(artifacts.microvms(keyword="2vcpu_512mb"))
523567

524568
kernel_artifacts = ArtifactSet(artifacts.kernels())
525569
disk_artifacts = ArtifactSet(artifacts.disks(keyword="ubuntu"))
@@ -533,6 +577,7 @@ def test_snapshot_resume_latency(network_config, bin_cloner_path, results_file_d
533577
"snapshot_type": SnapshotType.FULL,
534578
"name": "resume_latency",
535579
"results_file_dumper": results_file_dumper,
580+
"io_engine": io_engine,
536581
}
537582

538583
# Create the test matrix.
@@ -544,7 +589,8 @@ def test_snapshot_resume_latency(network_config, bin_cloner_path, results_file_d
544589
test_matrix.run_test(_test_snapshot_resume_latency)
545590

546591

547-
def test_older_snapshot_resume_latency(bin_cloner_path, results_file_dumper):
592+
@pytest.mark.parametrize("io_engine", ENGINES)
593+
def test_older_snapshot_resume_latency(bin_cloner_path, results_file_dumper, io_engine):
548594
"""
549595
Test scenario: Older snapshot load performance measurement.
550596
@@ -570,6 +616,7 @@ def test_older_snapshot_resume_latency(bin_cloner_path, results_file_dumper):
570616
"snapshot_type": SnapshotType.FULL,
571617
"name": "old_snapshot_resume_latency",
572618
"results_file_dumper": results_file_dumper,
619+
"io_engine": io_engine,
573620
}
574621

575622
# Create the test matrix.

0 commit comments

Comments
 (0)