Skip to content

Commit 4a10d4b

Browse files
Merge branch 'main' into fix-tracing-instrumentation-deadlocks
2 parents 0659747 + ae57b7a commit 4a10d4b

45 files changed

Lines changed: 1177 additions & 795 deletions

File tree

Some content is hidden

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

.buildkite/pipeline_cross.py

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@
2323
"m6i.metal",
2424
"m7i.metal-24xl",
2525
"m7i.metal-48xl",
26+
"m8i.metal-48xl",
2627
"m6a.metal",
2728
"m7a.metal-48xl",
2829
]
29-
instances_aarch64 = ["m7g.metal"]
30+
instances_aarch64 = ["m6g.metal", "m7g.metal", "m8g.metal-24xl"]
31+
restore_only_platforms = [("al2023", "linux_6.18")]
32+
x86_64_platforms = DEFAULT_PLATFORMS + restore_only_platforms
3033
commands = [
3134
"./tools/devtool -y test --no-build --no-archive -- -m nonci -n4 integration_tests/functional/test_snapshot_phase1.py",
3235
# punch holes in mem snapshot tiles and tar them so they are preserved in S3
@@ -35,31 +38,56 @@
3538
"mkdir -pv snapshots",
3639
"tar cSvf snapshots/{instance}_{kv}.tar snapshot_artifacts",
3740
]
38-
pipeline.build_group(
41+
42+
def create_step_key(instance, kv):
43+
"""Buildkite key for a snapshot-create step.
44+
45+
Keys may only contain [A-Za-z0-9_\\-:], so dots in instance names
46+
(m5n.metal) and kernel versions (linux_5.10) are sanitized to
47+
underscores. Tarball paths stay unchanged.
48+
"""
49+
return f"snap-create-{instance}-{kv}".replace(".", "_")
50+
51+
# Key each snapshot-create step so restore steps can depend on the
52+
# specific source snapshot they need, rather than waiting for every
53+
# snapshot-create step to finish. `build_group` doesn't sanitize
54+
# substituted key values, so we set the final key after it fans out.
55+
x86_create = pipeline.build_group(
3956
"snapshot-create",
4057
commands,
4158
timeout=30,
4259
artifact_paths="snapshots/**/*",
4360
instances=instances_x86_64,
4461
platforms=DEFAULT_PLATFORMS,
4562
)
46-
pipeline.add_step("wait")
4763

48-
# allow-list of what instances can be restores on what other instances (in
49-
# addition to itself)
64+
# https://github.com/firecracker-microvm/firecracker/blob/main/docs/snapshotting/snapshot-support.md#where-can-i-resume-my-snapshots
65+
aarch64_platforms = [("al2023", "linux_6.1")]
66+
aarch64_create = pipeline.build_group(
67+
"snapshot-create-aarch64",
68+
commands,
69+
timeout=30,
70+
artifact_paths="snapshots/**/*",
71+
instances=instances_aarch64,
72+
platforms=aarch64_platforms,
73+
)
74+
for grp in (x86_create, aarch64_create):
75+
for s in grp["steps"]:
76+
s["key"] = create_step_key(s["agents"]["instance"], s["agents"]["kv"])
77+
78+
# allow-list of what instances can be restored on what other instances (in
79+
# addition to itself). aarch64 is restricted to same-instance restores.
5080
supported = {
5181
"m5n.metal": ["m6i.metal"],
5282
"m6i.metal": ["m5n.metal"],
5383
}
54-
55-
# https://github.com/firecracker-microvm/firecracker/blob/main/docs/kernel-policy.md#experimental-snapshot-compatibility-across-kernel-versions
56-
aarch64_platforms = [("al2023", "linux_6.1")]
84+
aarch64_all_platforms = aarch64_platforms + restore_only_platforms
5785
perms_aarch64 = itertools.product(
58-
instances_aarch64, aarch64_platforms, instances_aarch64, aarch64_platforms
86+
instances_aarch64, aarch64_platforms, instances_aarch64, aarch64_all_platforms
5987
)
6088

6189
perms_x86_64 = itertools.product(
62-
instances_x86_64, DEFAULT_PLATFORMS, instances_x86_64, DEFAULT_PLATFORMS
90+
instances_x86_64, DEFAULT_PLATFORMS, instances_x86_64, x86_64_platforms
6391
)
6492
steps = []
6593
for (
@@ -74,6 +102,9 @@
74102
# newer -> older is not supported, and does not work
75103
if src_kv > dst_kv:
76104
continue
105+
# only test cross-kernel restore between adjacent kernel versions
106+
if src_kv == "linux_5.10" and dst_kv == "linux_6.18":
107+
continue
77108
if src_instance != dst_instance and dst_instance not in supported.get(
78109
src_instance, []
79110
):
@@ -96,6 +127,7 @@
96127
"label": f"snapshot-restore-src-{src_instance}-{src_kv}-dst-{dst_instance}-{dst_kv}",
97128
"timeout": 30,
98129
"agents": {"instance": dst_instance, "kv": dst_kv, "os": dst_os},
130+
"depends_on": [create_step_key(src_instance, src_kv)],
99131
**per_instance,
100132
}
101133
steps.append(step)

resources/rebuild.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ function compile_and_install {
5151
# Build a rootfs
5252
function build_ci_rootfs {
5353
local IMAGE_NAME=$1
54+
local SETUP_SCRIPT=$2
5455
prepare_docker
55-
build_rootfs "$IMAGE_NAME" "$OUTPUT_DIR" "$PWD/overlay" "chroot.sh"
56+
build_rootfs "$IMAGE_NAME" "$OUTPUT_DIR" "$PWD/rootfs/overlay" "$SETUP_SCRIPT"
5657
}
5758

5859

@@ -110,8 +111,8 @@ function get_tag {
110111
local KERNEL_VERSION=$1
111112

112113
# list all tags from newest to oldest
113-
(git --no-pager tag -l --sort=-creatordate | grep "microvm-kernel-$1\..*\.amzn2" \
114-
|| git --no-pager tag -l --sort=-creatordate | grep "kernel-$1\..*\.amzn2") | head -n1
114+
(git --no-pager tag -l --sort=-v:refname | grep "microvm-kernel-$1\..*\.amzn2" \
115+
|| git --no-pager tag -l --sort=-v:refname | grep "kernel-$1\..*\.amzn2") | head -n1
115116
}
116117

117118
function build_al_kernel {
@@ -174,7 +175,7 @@ function build_al_kernel {
174175
}
175176

176177
function prepare_and_build_rootfs {
177-
BIN_DIR=overlay/usr/local/bin
178+
BIN_DIR=rootfs/overlay/usr/local/bin
178179

179180
SRCS=(init.c fillmem.c fast_page_fault_helper.c readmem.c go_sdk_cred_provider.go go_sdk_cred_provider_with_custom_endpoint.go)
180181
if [ $ARCH == "aarch64" ]; then
@@ -185,7 +186,8 @@ function prepare_and_build_rootfs {
185186
compile_and_install $BIN_DIR/$SRC
186187
done
187188

188-
build_ci_rootfs ubuntu:24.04
189+
build_ci_rootfs ubuntu:24.04 "rootfs/setup-ubuntu-ci.sh"
190+
build_ci_rootfs amazonlinux:2023 "rootfs/setup-al2023-ci.sh"
189191
build_initramfs
190192

191193
for SRC in ${SRCS[@]}; do

resources/overlay/etc/systemd/system/fcnet.service renamed to resources/rootfs/overlay/etc/systemd/system/fcnet.service

File renamed without changes.

resources/overlay/etc/systemd/system/var-lib-systemd.mount renamed to resources/rootfs/overlay/etc/systemd/system/var-lib-systemd.mount

File renamed without changes.
File renamed without changes.

resources/overlay/usr/local/bin/fast_page_fault_helper.c renamed to resources/rootfs/overlay/usr/local/bin/fast_page_fault_helper.c

File renamed without changes.
File renamed without changes.
File renamed without changes.

resources/overlay/usr/local/bin/go_sdk_cred_provider.go/main.go renamed to resources/rootfs/overlay/usr/local/bin/go_sdk_cred_provider.go/main.go

File renamed without changes.

resources/overlay/usr/local/bin/go_sdk_cred_provider_with_custom_endpoint.go/main.go renamed to resources/rootfs/overlay/usr/local/bin/go_sdk_cred_provider_with_custom_endpoint.go/main.go

File renamed without changes.

0 commit comments

Comments
 (0)