Skip to content

Commit

Permalink
Merge branch 'main' into main-live-migration-pvm
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivanshVij authored Nov 28, 2024
2 parents 36dadb7 + 4c33853 commit cf7c0f6
Show file tree
Hide file tree
Showing 142 changed files with 6,065 additions and 2,349 deletions.
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ test_results/*
*.profraw
.DS_Store
*.bin
/resources/linux
/resources/x86_64
/resources/aarch64
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,58 @@ and this project adheres to

### 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

- [#4921](https://github.com/firecracker-microvm/firecracker/pull/4921): Fixed
swagger `CpuConfig` definition to include missing aarch64-specific fields.

## \[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
management which in turn improves RX and TX performance.
- [#4460](https://github.com/firecracker-microvm/firecracker/pull/4460): Add a
call to
[`KVM_KVMCLOCK_CTRL`](https://docs.kernel.org/virt/kvm/api.html#kvm-kvmclock-ctrl)
after pausing vCPUs on x86_64 architectures. This ioctl sets a flag in the KVM
state of the vCPU indicating that it has been paused by the host userspace. In
guests that use kvmclock, the soft lockup watchdog checks this flag. If it is
set, it won't trigger the lockup condition. Calling the ioctl for guests that
don't use kvmclock will fail. These failures are not fatal. We log the failure
and increase the `vcpu.kvmclock_ctrl_fails` metric.
- [#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

0 comments on commit cf7c0f6

Please sign in to comment.