Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate network-setup to nftables and improve it into a better state #4877

Closed
wants to merge 77 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
a8cd106
Migrate network-setup to nftables except for cleaning up
kanpov Oct 28, 2024
55b0586
Update "Cleaning Up"
kanpov Oct 28, 2024
c8fba11
Add guest ip boot arg section and multiple guests section
kanpov Oct 28, 2024
5582ddf
Slightly alter Multiple guests section, add IPv6 section
kanpov Oct 28, 2024
64e1eb8
Minor factual correction
kanpov Oct 29, 2024
5154147
Remove IPv6 section due to its fragility
kanpov Oct 29, 2024
24c2ee6
Update test_deflate_on_oom test
JackThomson2 Oct 29, 2024
73c2562
build(deps): Bump the firecracker group across 1 directory with 22 up…
dependabot[bot] Oct 29, 2024
e41f4af
chore: adjust to api changes in rust-vmm crates
roypat Oct 29, 2024
9c1f03e
test: add Ubuntu 24.10 to popular test
pb8o Oct 29, 2024
889b13d
test: drop support for unsupported versions
pb8o Oct 21, 2024
cead6be
feat(IovDeque): configurable queue len
ShadowCurse Oct 28, 2024
fa26074
feat(virtio-net): increase max queue size to 512
ShadowCurse Oct 28, 2024
b65d236
chore: update CHANGELOG with virtio-net changes
ShadowCurse Oct 30, 2024
f07a345
Apply recommendations
kanpov Nov 1, 2024
7cffa67
Remove redundant mention of bridge-based routing, clarify on the Adva…
kanpov Nov 1, 2024
f87d9a3
feat(gdb): Support config over api
JackThomson2 Oct 22, 2024
ef05c4f
Add changelog entry for GDB debugging
JackThomson2 Oct 22, 2024
55d676f
test: refactor: Simplify CpuMap._cpus
roypat Oct 28, 2024
52aa865
test: replace ventored chdir context manager with contextlib
roypat Oct 29, 2024
50979d0
test: do not set host_os dimension to `None`
roypat Oct 29, 2024
65151e9
test: fix: stop doing PR A/B-tests across host commands
roypat Oct 28, 2024
e8d57ee
test: ab: Add function for A/B-Tests across precompiled binaries
roypat Oct 29, 2024
24f588a
test: ab: operate on directories instead of commit SHAs
roypat Oct 28, 2024
0286a91
devtool: Add flag to build to allow compiling arbitrary revisions
roypat Oct 29, 2024
0dea3fe
doc: Update A/B-testing documentation
roypat Oct 29, 2024
9b30c64
test: stop compiling firecracker inside A/B-tests
roypat Oct 29, 2024
8a9bda6
test: do pre-PR A/B-test checkout into temporary directory
roypat Oct 29, 2024
a95c7ed
test: remove `@tag` parsing from `record_props` fixture
roypat Oct 30, 2024
77fc94c
test: use pytest.raises in `test_empty_jailer_id`
roypat Oct 30, 2024
352fca1
test(aarch64): add host vs guest cpu feature test
ShadowCurse Oct 30, 2024
20fb58b
test(x86_64): add host vs guest cpu feature test
ShadowCurse Nov 1, 2024
6b0e167
chore(tests): rename file with cpu feature tests for x86_64
ShadowCurse Nov 4, 2024
290145d
build(deps): Bump the firecracker group with 7 updates
dependabot[bot] Nov 4, 2024
16b4474
chore: Update release policy
JackThomson2 Nov 6, 2024
2308c83
net: revert virtio-net queue size to 256
bchalios Nov 6, 2024
b8df9de
chore: bump version to 1.11.0-dev
JackThomson2 Nov 7, 2024
3996275
test(net): check output in test_high_ingress_traffic
kalyazin Nov 7, 2024
87fae71
test(net): use iperf3-vsock in test_high_ingress_traffic
kalyazin Nov 7, 2024
21c1983
fix(test): Handle ssbs correctly in host/guest feature comparison
zulinx86 Nov 7, 2024
c15931d
fix(test): Remove flush_l1d from host/guest feature diff on kernel v6.4+
zulinx86 Nov 7, 2024
0c512f7
fix(test): Handle invpcid_single in guest/host feature comparison
zulinx86 Nov 7, 2024
630a49e
chore: Update changelog with v1.10.0 section
JackThomson2 Nov 8, 2024
3936447
chore(test): Double refill time for RX rate limiter
zulinx86 Nov 8, 2024
dc88ba1
fix(net): use correct constant for preallocation
ShadowCurse Nov 4, 2024
ff8fbe1
fix(iovec): update default used constants
ShadowCurse Nov 4, 2024
6b5a70d
chore: Bump snapshot version
JackThomson2 Nov 12, 2024
851ed01
build(deps): Bump the firecracker group with 10 updates
dependabot[bot] Nov 11, 2024
b04ba30
fix: Adjust for thiserror 2.0
roypat Nov 12, 2024
5299f8a
chore: update PR checklist
Manciukic Nov 12, 2024
ecd35e7
test: test ARM CPU templates in Linux host 5.10
pb8o Nov 13, 2024
14fed3f
chore: Update to v1.10.1 patch
JackThomson2 Nov 13, 2024
69a6aec
snapshot: Remove max_connections and max_pending_resets fields
zulinx86 Nov 13, 2024
3fdd15a
test(mmds): Do not use MmdsNetworkStack::new() in tests
zulinx86 Nov 13, 2024
316a0ae
chore: Clarify user action
zulinx86 Nov 14, 2024
df61998
ci: generate ext4 image after downloading artifacts
pb8o Sep 6, 2024
e1c7a28
ci: build debug kernels
pb8o Sep 17, 2024
ca21cd9
ci: compress squashfs with zstd
pb8o Sep 6, 2024
4cb86c5
fix: workaround socat 1.8.0 bug
pb8o Oct 17, 2024
fc7da1d
chore(rootfs): update rootfs to Ubuntu 24.04
pb8o Jun 20, 2024
98acad6
ci: generate SSH key after downloading artifacts
pb8o Oct 9, 2024
c777491
tests: add Microvm.ssh.Popen command
pb8o Jun 19, 2024
c292c84
devctr: add trace-cmd
pb8o Oct 16, 2024
e0906a5
tests: add a trace-cmd helper
pb8o Oct 16, 2024
58ca732
ci: use new CI rootfs 24.04
pb8o Oct 17, 2024
40ecc8f
ci: move create_snapshot_artifact to a test
pb8o Oct 18, 2024
c6b34cc
ci: reduce storage of snapshots in cross-restore test
pb8o Oct 18, 2024
f2aced7
doc: fix downloading kernel for ARM instances
pb8o Oct 21, 2024
65d3f1f
test: drop ubuntu version from rootfs fixture name
pb8o Oct 23, 2024
d9b85d9
devctr: add zstd
pb8o Oct 29, 2024
fdcaf14
test: add debug information to debug kernels
pb8o Oct 29, 2024
57075cf
devctr: pin cargo-deny until we upgrade Rust version
pb8o Nov 18, 2024
e5d4de3
build(deps): Bump the firecracker group with 13 updates
dependabot[bot] Nov 18, 2024
415fbf0
build(deps): Bump aiohttp from 3.10.5 to 3.10.11 in /tools/devctr
dependabot[bot] Nov 18, 2024
88b59f6
fix: devtool install --path broken
mpbb Nov 11, 2024
2d0bbc6
ci: infer instance architecture from a heuristic
pb8o Nov 20, 2024
bf71223
Fix style issues
kanpov Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 17 additions & 21 deletions .buildkite/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,26 @@
import subprocess
from pathlib import Path

DEFAULT_INSTANCES = {
"c5n.metal": "x86_64", # Intel Skylake
"m5n.metal": "x86_64", # Intel Cascade Lake
"m6i.metal": "x86_64", # Intel Icelake
"m6a.metal": "x86_64", # AMD Milan
"m6g.metal": "aarch64", # Graviton2
"m7g.metal": "aarch64", # Graviton3
}
DEFAULT_INSTANCES = [
"c5n.metal", # Intel Skylake
"m5n.metal", # Intel Cascade Lake
"m6i.metal", # Intel Icelake
"m6a.metal", # AMD Milan
"m6g.metal", # Graviton2
"m7g.metal", # Graviton3
]

DEFAULT_PLATFORMS = [
("al2", "linux_5.10"),
("al2023", "linux_6.1"),
]


def get_arch_for_instance(instance):
"""Return instance architecture"""
return "x86_64" if instance[2] != "g" else "aarch64"


def overlay_dict(base: dict, update: dict):
"""Overlay a dict over a base one"""
base = base.copy()
Expand Down Expand Up @@ -145,7 +150,7 @@ def __call__(self, parser, namespace, value, option_string=None):
"--instances",
required=False,
nargs="+",
default=DEFAULT_INSTANCES.keys(),
default=DEFAULT_INSTANCES,
)
COMMON_PARSER.add_argument(
"--platforms",
Expand Down Expand Up @@ -180,16 +185,7 @@ def random_str(k: int):

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


def shared_build():
Expand Down Expand Up @@ -297,7 +293,7 @@ def _adapt_group(self, group):
step["command"] = prepend + step["command"]
if self.shared_build is not None:
step["depends_on"] = self.build_key(
DEFAULT_INSTANCES[step["agents"]["instance"]]
get_arch_for_instance(step["agents"]["instance"])
)
return group

Expand Down Expand Up @@ -332,7 +328,7 @@ def build_group_per_arch(self, label, *args, **kwargs):
if set_key:
for step in grp["steps"]:
step["key"] = self.build_key(
DEFAULT_INSTANCES[step["agents"]["instance"]]
get_arch_for_instance(step["agents"]["instance"])
)
return self.add_step(grp, depends_on_build=depends_on_build)

Expand Down
8 changes: 4 additions & 4 deletions .buildkite/pipeline_cpu_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BkStep(str, Enum):
cpu_template_test = {
"rdmsr": {
BkStep.COMMAND: [
"tools/devtool -y test --no-build -- -m nonci -n4 --dist worksteal integration_tests/functional/test_cpu_features.py -k 'test_cpu_rdmsr' "
"tools/devtool -y test --no-build -- -m nonci -n4 --dist worksteal integration_tests/functional/test_cpu_features_x86_64.py -k 'test_cpu_rdmsr' "
],
BkStep.LABEL: "📖 rdmsr",
"instances": ["c5n.metal", "m5n.metal", "m6a.metal", "m6i.metal"],
Expand All @@ -34,13 +34,13 @@ class BkStep(str, Enum):
"tools/devtool -y test --no-build -- -m no_block_pr integration_tests/functional/test_cpu_template_helper.py -k test_guest_cpu_config_change",
],
BkStep.LABEL: "🖐️ fingerprint",
"instances": DEFAULT_INSTANCES.keys(),
"instances": DEFAULT_INSTANCES,
"platforms": DEFAULT_PLATFORMS,
},
"cpuid_wrmsr": {
"snapshot": {
BkStep.COMMAND: [
"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'",
"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'",
"mkdir -pv tests/snapshot_artifacts_upload/{instance}_{os}_{kv}",
"sudo mv tests/snapshot_artifacts/* tests/snapshot_artifacts_upload/{instance}_{os}_{kv}",
],
Expand All @@ -52,7 +52,7 @@ class BkStep(str, Enum):
BkStep.COMMAND: [
"buildkite-agent artifact download tests/snapshot_artifacts_upload/{instance}_{os}_{kv}/**/* .",
"mv tests/snapshot_artifacts_upload/{instance}_{os}_{kv} tests/snapshot_artifacts",
"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'",
"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'",
],
BkStep.LABEL: "📸 load snapshot artifacts created on {instance} {snapshot_os} {snapshot_kv} to {restore_instance} {restore_os} {restore_kv}",
BkStep.TIMEOUT: 30,
Expand Down
16 changes: 9 additions & 7 deletions .buildkite/pipeline_cross.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
instances_x86_64 = ["c5n.metal", "m5n.metal", "m6i.metal", "m6a.metal"]
instances_aarch64 = ["m7g.metal"]
commands = [
"./tools/devtool -y sh ./tools/create_snapshot_artifact/main.py",
"mkdir -pv snapshots/{instance}_{kv}",
"sudo chown -Rc $USER: snapshot_artifacts",
"mv -v snapshot_artifacts/* snapshots/{instance}_{kv}",
"./tools/devtool -y test --no-build -- -m nonci -n4 integration_tests/functional/test_snapshot_phase1.py",
# punch holes in mem snapshot tiles and tar them so they are preserved in S3
"find test_results/test_snapshot_phase1 -type f -name mem |xargs -P4 -t -n1 fallocate -d",
"mv -v test_results/test_snapshot_phase1 snapshot_artifacts",
"mkdir -pv snapshots",
"tar cSvf snapshots/{instance}_{kv}.tar snapshot_artifacts",
]
pipeline.build_group(
"📸 create snapshots",
Expand Down Expand Up @@ -80,10 +82,10 @@
k_val = pytest_keyword_for_instance.get(dst_instance, "")
step = {
"command": [
f"buildkite-agent artifact download snapshots/{src_instance}_{src_kv}/* .",
f"mv -v snapshots/{src_instance}_{src_kv} snapshot_artifacts",
f"buildkite-agent artifact download snapshots/{src_instance}_{src_kv}.tar .",
f"tar xSvf snapshots/{src_instance}_{src_kv}.tar",
*pipeline.devtool_test(
pytest_opts=f"-m nonci {k_val} integration_tests/functional/test_snapshot_restore_cross_kernel.py",
pytest_opts=f"-m nonci -n4 {k_val} integration_tests/functional/test_snapshot_restore_cross_kernel.py",
),
],
"label": f"🎬 {src_instance} {src_kv} ➡️ {dst_instance} {dst_kv}",
Expand Down
4 changes: 3 additions & 1 deletion .buildkite/pipeline_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@
pytest_opts = ""
if REVISION_A:
devtool_opts += " --ab"
pytest_opts = f"{ab_opts} run {REVISION_A} {REVISION_B} --test {test_path}"
pytest_opts = (
f"{ab_opts} run build/{REVISION_A}/ build/{REVISION_B} --test {test_path}"
)
else:
# Passing `-m ''` below instructs pytest to collect tests regardless of
# their markers (e.g. it will collect both tests marked as nonci, and
Expand Down
22 changes: 13 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,20 @@ Certificate of Origin and signing off your commits, please check

## PR Checklist

- [ ] I have read and understand [CONTRIBUTING.md][3].
- [ ] I have run `tools/devtool checkstyle` to verify that the PR passes the
automated style checks.
- [ ] I have described what is done in these changes, why they are needed, and
how they are solving the problem in a clear and encompassing way.
- [ ] I have updated any relevant documentation (both in code and in the docs)
in the PR.
- [ ] I have mentioned all user-facing changes in `CHANGELOG.md`.
- [ ] If a specific issue led to this PR, this PR closes the issue.
- [ ] The description of changes is clear and encompassing.
- [ ] Any required documentation changes (code and docs) are included in this
PR.
- [ ] API changes follow the [Runbook for Firecracker API changes][2].
- [ ] User-facing changes are mentioned in `CHANGELOG.md`.
- [ ] All added/changed functionality is tested.
- [ ] New `TODO`s link to an issue.
- [ ] Commits meet
[contribution quality standards](https://github.com/firecracker-microvm/firecracker/blob/main/CONTRIBUTING.md#contribution-quality-standards).
- [ ] When making API changes, I have followed the
[Runbook for Firecracker API changes][2].
- [ ] I have tested all new and changed functionalities in unit tests and/or
integration tests.
- [ ] I have linked an issue to every new `TODO`.

______________________________________________________________________

Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,30 @@ and this project adheres to

### Added

### Changed

- [#4913](https://github.com/firecracker-microvm/firecracker/pull/4913): Removed
unnecessary fields (`max_connections` and `max_pending_resets`) from the
snapshot format, bumping the snapshot version to 5.0.0. Users need to
regenerate snapshots.

### Deprecated

### Removed

### Fixed

## \[1.10.1\]

### Changed

- [#4907](https://github.com/firecracker-microvm/firecracker/pull/4907): Bumped
the snapshot version to 4.0.0, so users need to regenerate snapshots.

## \[1.10.0\]

### Added

- [#4834](https://github.com/firecracker-microvm/firecracker/pull/4834): Add
`VIRTIO_NET_F_RX_MRGBUF` support to the `virtio-net` device. When this feature
is negotiated, guest `virtio-net` driver can perform more efficient memory
Expand All @@ -26,9 +50,17 @@ and this project adheres to
- [#4869](https://github.com/firecracker-microvm/firecracker/pull/4869): Added
support for Aarch64 systems which feature CPU caches with a number of sets
higher than `u16::MAX`.
- [#4797](https://github.com/firecracker-microvm/firecracker/pull/4797),
[#4854](https://github.com/firecracker-microvm/firecracker/pull/4854): Added
GDB debugging support for a microVM guest kernel. Please see our
[GDB debugging documentation](docs/gdb-debugging.md) for more information.

### Changed

- [#4844](https://github.com/firecracker-microvm/firecracker/pull/4844): Upgrade
`virtio-net` device to use `readv` syscall to avoid unnecessary memory copies
on RX path, increasing the RX performance.

### Deprecated

### Removed
Expand Down
Loading