Skip to content

Commit 5778b59

Browse files
authored
Merge branch 'main' into main
2 parents 1ddbd1b + a101628 commit 5778b59

Some content is hidden

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

51 files changed

+799
-954
lines changed

.buildkite/common.py

Lines changed: 16 additions & 11 deletions
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

Lines changed: 1 addition & 1 deletion
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": {

.buildkite/pipeline_cross.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
instances_x86_64 = ["c5n.metal", "m5n.metal", "m6i.metal", "m6a.metal"]
2222
instances_aarch64 = ["m7g.metal"]
2323
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}",
24+
"./tools/devtool -y test --no-build -- -m nonci -n4 integration_tests/functional/test_snapshot_phase1.py",
25+
# punch holes in mem snapshot tiles and tar them so they are preserved in S3
26+
"find test_results/test_snapshot_phase1 -type f -name mem |xargs -P4 -t -n1 fallocate -d",
27+
"mv -v test_results/test_snapshot_phase1 snapshot_artifacts",
28+
"mkdir -pv snapshots",
29+
"tar cSvf snapshots/{instance}_{kv}.tar snapshot_artifacts",
2830
]
2931
pipeline.build_group(
3032
"📸 create snapshots",
@@ -80,10 +82,10 @@
8082
k_val = pytest_keyword_for_instance.get(dst_instance, "")
8183
step = {
8284
"command": [
83-
f"buildkite-agent artifact download snapshots/{src_instance}_{src_kv}/* .",
84-
f"mv -v snapshots/{src_instance}_{src_kv} snapshot_artifacts",
85+
f"buildkite-agent artifact download snapshots/{src_instance}_{src_kv}.tar .",
86+
f"tar xSvf snapshots/{src_instance}_{src_kv}.tar",
8587
*pipeline.devtool_test(
86-
pytest_opts=f"-m nonci {k_val} integration_tests/functional/test_snapshot_restore_cross_kernel.py",
88+
pytest_opts=f"-m nonci -n4 {k_val} integration_tests/functional/test_snapshot_restore_cross_kernel.py",
8789
),
8890
],
8991
"label": f"🎬 {src_instance} {src_kv} ➡️ {dst_instance} {dst_kv}",

Cargo.lock

Lines changed: 35 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ We test all combinations of:
132132

133133
| Instance | Host OS & Kernel | Guest Rootfs | Guest Kernel |
134134
| :-------- | :---------------- | :----------- | :----------- |
135-
| c5n.metal | al2 linux_5.10 | ubuntu 22.04 | linux_5.10 |
135+
| c5n.metal | al2 linux_5.10 | ubuntu 24.04 | linux_5.10 |
136136
| m5n.metal | al2023 linux_6.1 | | linux_6.1 |
137137
| m6i.metal | | | |
138138
| m6a.metal | | | |

docs/getting-started.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can check if your system meets the requirements by running
99
`firecracker/tools/devtool checkenv`.
1010

1111
An opinionated way to run Firecracker is to launch an
12-
[EC2](https://aws.amazon.com/ec2/) `c5.metal` instance with Ubuntu 22.04.
12+
[EC2](https://aws.amazon.com/ec2/) `c5.metal` instance with Ubuntu 24.04.
1313

1414
Firecracker requires [the KVM Linux kernel module](https://www.linux-kvm.org/)
1515
to perform its virtualization and emulation tasks.
@@ -95,24 +95,26 @@ For simplicity, this guide will not use the [`jailer`](../src/jailer/).
9595

9696
To successfully start a microVM, you will need an uncompressed Linux kernel
9797
binary, and an ext4 file system image (to use as rootfs). This guide uses a 5.10
98-
kernel image with a Ubuntu 22.04 rootfs from our CI:
98+
kernel image with a Ubuntu 24.04 rootfs from our CI:
9999

100100
```bash
101101
ARCH="$(uname -m)"
102102

103-
latest=$(wget "http://spec.ccfc.min.s3.amazonaws.com/?prefix=firecracker-ci/v1.10/x86_64/vmlinux-5.10&list-type=2" -O - 2>/dev/null | grep "(?<=<Key>)(firecracker-ci/v1.10/x86_64/vmlinux-5\.10\.[0-9]{3})(?=</Key>)" -o -P)
103+
latest=$(wget "http://spec.ccfc.min.s3.amazonaws.com/?prefix=firecracker-ci/v1.10/$ARCH/vmlinux-5.10&list-type=2" -O - 2>/dev/null | grep -oP "(?<=<Key>)(firecracker-ci/v1.10/$ARCH/vmlinux-5\.10\.[0-9]{1,3})(?=</Key>)")
104104

105105
# Download a linux kernel binary
106106
wget "https://s3.amazonaws.com/spec.ccfc.min/${latest}"
107107

108108
# Download a rootfs
109-
wget "https://s3.amazonaws.com/spec.ccfc.min/firecracker-ci/v1.10/${ARCH}/ubuntu-22.04.ext4"
110-
111-
# Download the ssh key for the rootfs
112-
wget "https://s3.amazonaws.com/spec.ccfc.min/firecracker-ci/v1.10/${ARCH}/ubuntu-22.04.id_rsa"
113-
114-
# Set user read permission on the ssh key
115-
chmod 400 ./ubuntu-22.04.id_rsa
109+
wget -O ubuntu-24.04.squashfs.upstream "https://s3.amazonaws.com/spec.ccfc.min/firecracker-ci/v1.10/${ARCH}/ubuntu-24.04.squashfs"
110+
111+
# Create an ssh key for the rootfs
112+
unsquashfs ubuntu-24.04.squashfs.upstream
113+
ssh-keygen -f id_rsa -N ""
114+
cp -v id_rsa.pub squashfs-root/root/.ssh/authorized_keys
115+
mv -v id_rsa ./ubuntu-24.04.id_rsa
116+
# re-squash
117+
mksquashfs squashfs-root ubuntu-24.04.squashfs -all-root -noappend -comp zstd
116118
```
117119

118120
### Getting a Firecracker Binary
@@ -238,7 +240,7 @@ sudo curl -X PUT --unix-socket "${API_SOCKET}" \
238240
}" \
239241
"http://localhost/boot-source"
240242

241-
ROOTFS="./ubuntu-22.04.ext4"
243+
ROOTFS="./ubuntu-24.04.ext4"
242244

243245
# Set rootfs
244246
sudo curl -X PUT --unix-socket "${API_SOCKET}" \
@@ -280,13 +282,13 @@ sudo curl -X PUT --unix-socket "${API_SOCKET}" \
280282
sleep 2s
281283

282284
# Setup internet access in the guest
283-
ssh -i ./ubuntu-22.04.id_rsa [email protected] "ip route add default via 172.16.0.1 dev eth0"
285+
ssh -i ./ubuntu-24.04.id_rsa [email protected] "ip route add default via 172.16.0.1 dev eth0"
284286

285287
# Setup DNS resolution in the guest
286-
ssh -i ./ubuntu-22.04.id_rsa [email protected] "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"
288+
ssh -i ./ubuntu-24.04.id_rsa [email protected] "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"
287289

288290
# SSH into the microVM
289-
ssh -i ./ubuntu-22.04.id_rsa [email protected]
291+
ssh -i ./ubuntu-24.04.id_rsa [email protected]
290292

291293
# Use `root` for both the login and password.
292294
# Run `reboot` to exit.

docs/snapshotting/snapshot-support.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,8 @@ booting, to avoid this issue.
642642

643643
We have a mechanism in place to experiment with snapshot compatibility across
644644
supported host kernel versions by generating snapshot artifacts through
645-
[this tool](../../tools/create_snapshot_artifact) and checking devices'
646-
functionality using
645+
[this test](../../tests/integration_tests/functional/test_snapshot_phase1.py)
646+
and checking devices' functionality using
647647
[this test](../../tests/integration_tests/functional/test_snapshot_restore_cross_kernel.py).
648648
The test restores the snapshot and ensures that all the devices set-up (network
649649
devices, disk, vsock, balloon and MMDS) are operational post-load.

0 commit comments

Comments
 (0)