Skip to content

Commit 48c8ced

Browse files
authored
Merge branch 'main' into fdt_guest_memory
2 parents dd4a441 + 4bbbec0 commit 48c8ced

File tree

262 files changed

+11514
-15994
lines changed

Some content is hidden

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

262 files changed

+11514
-15994
lines changed

.buildkite/common.py

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
import subprocess
1414
from pathlib import Path
1515

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-
]
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+
}
2424

2525
DEFAULT_PLATFORMS = [
2626
("al2", "linux_5.10"),
@@ -145,7 +145,7 @@ def __call__(self, parser, namespace, value, option_string=None):
145145
"--instances",
146146
required=False,
147147
nargs="+",
148-
default=DEFAULT_INSTANCES,
148+
default=DEFAULT_INSTANCES.keys(),
149149
)
150150
COMMON_PARSER.add_argument(
151151
"--platforms",
@@ -188,6 +188,7 @@ def ab_revision_build(revision):
188188
"git branch $$branch_name $$commitish",
189189
f"git clone -b $$branch_name . build/{revision}",
190190
f"cd build/{revision} && ./tools/devtool -y build --release && cd -",
191+
"git branch -D $$branch_name",
191192
]
192193

193194

@@ -204,7 +205,9 @@ def shared_build():
204205
if rev_a is not None:
205206
rev_b = os.environ.get("REVISION_B")
206207
assert rev_b is not None, "REVISION_B environment variable not set"
207-
build_cmds = ab_revision_build(rev_a) + ab_revision_build(rev_b)
208+
build_cmds = ab_revision_build(rev_a)
209+
if rev_a != rev_b:
210+
build_cmds += ab_revision_build(rev_b)
208211
elif os.environ.get("BUILDKITE_PULL_REQUEST", "false") != "false":
209212
build_cmds = ab_revision_build(
210213
os.environ.get("BUILDKITE_PULL_REQUEST_BASE_BRANCH", "main")
@@ -229,7 +232,7 @@ class BKPipeline:
229232

230233
parser = COMMON_PARSER
231234

232-
def __init__(self, initial_steps=None, with_build_step=True, **kwargs):
235+
def __init__(self, with_build_step=True, **kwargs):
233236
self.steps = []
234237
self.args = args = self.parser.parse_args()
235238
# Retry one time if agent was lost. This can happen if we terminate the
@@ -254,33 +257,22 @@ def __init__(self, initial_steps=None, with_build_step=True, **kwargs):
254257
# Build sharing
255258
if with_build_step:
256259
build_cmds, self.shared_build = shared_build()
257-
step_build = group("🏗️ Build", build_cmds, **self.per_arch)
258-
self.steps += [step_build, "wait"]
260+
self.build_group_per_arch(
261+
"🏗️ Build", build_cmds, depends_on_build=False, set_key=True
262+
)
259263
else:
260264
self.shared_build = None
261265

262-
# If we run initial_steps before the "wait" step above, then a failure of the initial steps
263-
# would result in the build not progressing past the "wait" step (as buildkite only proceeds past a wait step
264-
# if everything before it passed). Thus put the initial steps after the "wait" step, but set `"depends_on": null`
265-
# to start running them immediately (e.g. without waiting for the "wait" step to unblock).
266-
#
267-
# See also https://buildkite.com/docs/pipelines/dependencies#explicit-dependencies-in-uploaded-steps
268-
if initial_steps:
269-
for step in initial_steps:
270-
step["depends_on"] = None
271-
272-
self.steps += initial_steps
273-
274-
def add_step(self, step, decorate=True):
266+
def add_step(self, step, depends_on_build=True):
275267
"""
276268
Add a step to the pipeline.
277269
278270
https://buildkite.com/docs/pipelines/step-reference
279271
280272
:param step: a Buildkite step
281-
:param decorate: inject needed commands for sharing builds
273+
:param depends_on_build: inject needed commands for sharing builds
282274
"""
283-
if decorate and isinstance(step, dict):
275+
if depends_on_build and isinstance(step, dict):
284276
step = self._adapt_group(step)
285277
self.steps.append(step)
286278
return step
@@ -303,6 +295,10 @@ def _adapt_group(self, group):
303295

304296
for step in group["steps"]:
305297
step["command"] = prepend + step["command"]
298+
if self.shared_build is not None:
299+
step["depends_on"] = self.build_key(
300+
DEFAULT_INSTANCES[step["agents"]["instance"]]
301+
)
306302
return group
307303

308304
def build_group(self, *args, **kwargs):
@@ -311,15 +307,34 @@ def build_group(self, *args, **kwargs):
311307
312308
https://buildkite.com/docs/pipelines/group-step
313309
"""
310+
depends_on_build = kwargs.pop("depends_on_build", True)
314311
combined = overlay_dict(self.per_instance, kwargs)
315-
return self.add_step(group(*args, **combined))
312+
return self.add_step(
313+
group(*args, **combined), depends_on_build=depends_on_build
314+
)
315+
316+
def build_key(self, arch):
317+
"""Return the Buildkite key for the build step, for the specified arch"""
318+
return self.shared_build.replace("$(uname -m)", arch).replace(".tar.gz", "")
316319

317-
def build_group_per_arch(self, *args, **kwargs):
320+
def build_group_per_arch(self, label, *args, **kwargs):
318321
"""
319322
Build a group, parametrizing over the architectures only.
323+
324+
kwargs consumed by this method and not passed down to `group`:
325+
- `depends_on_build` (default: `True`): Whether the steps in this group depend on the artifacts from the shared compilation steps
326+
- `set_key`: If True, causes the generated steps to have a "key" field
320327
"""
328+
depends_on_build = kwargs.pop("depends_on_build", True)
329+
set_key = kwargs.pop("set_key", None)
321330
combined = overlay_dict(self.per_arch, kwargs)
322-
return self.add_step(group(*args, **combined))
331+
grp = group(label, *args, **combined)
332+
if set_key:
333+
for step in grp["steps"]:
334+
step["key"] = self.build_key(
335+
DEFAULT_INSTANCES[step["agents"]["instance"]]
336+
)
337+
return self.add_step(grp, depends_on_build=depends_on_build)
323338

324339
def to_dict(self):
325340
"""Render the pipeline as a dictionary."""

.buildkite/pipeline_cpu_template.py

Lines changed: 6 additions & 6 deletions
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,
37+
"instances": DEFAULT_INSTANCES.keys(),
3838
"platforms": DEFAULT_PLATFORMS,
3939
},
4040
"cpuid_wrmsr": {
@@ -117,11 +117,11 @@ def group_snapshot_restore(test_step):
117117
BkStep.COMMAND: restore_commands,
118118
BkStep.LABEL: restore_label,
119119
BkStep.TIMEOUT: test_step["restore"][BkStep.TIMEOUT],
120-
"agents": [
121-
f"instance={restore_instance}",
122-
f"kv={restore_kv}",
123-
f"os={restore_os}",
124-
],
120+
"agents": {
121+
"instance": restore_instance,
122+
"kv": restore_kv,
123+
"os": restore_os,
124+
},
125125
}
126126
)
127127

.buildkite/pipeline_perf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@
119119
# }
120120
# will pin steps running on instances "m6i.metal" with kernel version tagged "linux_6.1"
121121
# to a new kernel version tagged "linux_6.1-pinned"
122-
pins = {
123-
"linux_5.10-pinned": {"instance": "m6i.metal", "kv": "linux_5.10"},
124-
}
122+
pins = {}
125123

126124

127125
def apply_pins(steps):

.buildkite/pipeline_pr.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,23 @@
1414
"agents": {"ag": 1},
1515
}
1616

17+
changed_files = get_changed_files()
18+
DOC_ONLY_CHANGE = False
19+
if changed_files and all(f.suffix == ".md" for f in changed_files):
20+
DOC_ONLY_CHANGE = True
1721
pipeline = BKPipeline(
1822
priority=DEFAULT_PRIORITY,
1923
timeout_in_minutes=45,
20-
initial_steps=[
21-
{
22-
"command": "./tools/devtool -y checkstyle",
23-
"label": "🪶 Style",
24-
},
25-
],
24+
with_build_step=not DOC_ONLY_CHANGE,
2625
)
2726

28-
changed_files = get_changed_files()
27+
pipeline.add_step(
28+
{
29+
"command": "./tools/devtool -y checkstyle",
30+
"label": "🪶 Style",
31+
},
32+
depends_on_build=False,
33+
)
2934

3035
# run sanity build of devtool if Dockerfile is changed
3136
if any(x.parent.name == "devctr" for x in changed_files):
@@ -48,13 +53,14 @@
4853
):
4954
kani_grp = pipeline.build_group(
5055
"🔍 Kani",
51-
"./tools/devtool -y test -- ../tests/integration_tests/test_kani.py -n auto",
56+
"./tools/devtool -y test --no-build -- ../tests/integration_tests/test_kani.py -n auto",
5257
# Kani step default
5358
# Kani runs fastest on m6a.metal
5459
instances=["m6a.metal"],
5560
platforms=[("al2", "linux_5.10")],
5661
timeout_in_minutes=300,
5762
**DEFAULTS_PERF,
63+
depends_on_build=False,
5864
)
5965
# modify Kani steps' label
6066
for step in kani_grp["steps"]:
@@ -64,6 +70,7 @@
6470
pipeline.build_group(
6571
"📦 Build",
6672
pipeline.devtool_test(pytest_opts="integration_tests/build/"),
73+
depends_on_build=False,
6774
)
6875

6976
pipeline.build_group(

.mailmap

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ Alexandru Cihodaru <[email protected]>
1818
Liviu Berciu <[email protected]>
1919
Jonathan Woollett-Light <[email protected]> <[email protected]>
2020
Jonathan Woollett-Light <[email protected]> <[email protected]>
21-
21+
22+
2223
karthik nedunchezhiyan <[email protected]>
2324
2425
Pablo Barbáchano <[email protected]>
2526
2627
Trăistaru Andrei Cristian <[email protected]>
2728
Trăistaru Andrei Cristian <[email protected]> <[email protected]>
28-
2929
30+
31+
32+
33+
Egor Lazarchuk <[email protected]>
34+
35+
Tomoya Iwata <[email protected]>

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10.14

CHANGELOG.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,52 @@ and this project adheres to
1010

1111
### Added
1212

13+
### Changed
14+
15+
### Deprecated
16+
17+
### Removed
18+
19+
- [#4804](https://github.com/firecracker-microvm/firecracker/pull/4804): Drop
20+
Support for guest kernel 4.14. Linux 4.14 reached end-of-life in
21+
[January 2024](https://lore.kernel.org/lkml/2024011046-ecology-tiptoeing-ce50@gregkh/)
22+
The minimum supported guest kernel now is 5.10.
23+
24+
### Fixed
25+
26+
- [#4796](https://github.com/firecracker-microvm/firecracker/pull/4796): Fixed
27+
Vsock not notifying guest about `TRANSPORT_RESET_EVENT` event after snapshot
28+
restore. This resulted in guest waiting indefinitely on a connection which was
29+
reset during snapshot creation.
30+
- [#4790](https://github.com/firecracker-microvm/firecracker/pull/4790): v1.9.0
31+
was missing most of the debugging information in the debuginfo file, due to a
32+
change in the Cargo defaults. This has been corrected.
33+
34+
## \[1.9.0\]
35+
36+
### Added
37+
1338
- [#4687](https://github.com/firecracker-microvm/firecracker/pull/4687): Added
1439
VMGenID support for microVMs running on ARM hosts with 6.1 guest kernels.
1540
Support for VMGenID via DeviceTree bindings exists only on mainline 6.10 Linux
1641
onwards. Users of Firecracker will need to backport the relevant patches on
1742
top of their 6.1 kernels to make use of the feature.
43+
- [#4732](https://github.com/firecracker-microvm/firecracker/pull/4732),
44+
[#4733](https://github.com/firecracker-microvm/firecracker/pull/4733),
45+
[#4741](https://github.com/firecracker-microvm/firecracker/pull/4741),
46+
[#4746](https://github.com/firecracker-microvm/firecracker/pull/4746): Added
47+
official support for 6.1 microVM guest kernels.
48+
- [#4743](https://github.com/firecracker-microvm/firecracker/pull/4743): Added
49+
support for `-h` help flag to the Jailer. The Jailer will now print the help
50+
message with either `--help` or `-h`.
1851

1952
### Changed
2053

2154
### Deprecated
2255

56+
- Support for guest kernel 4.14 is now deprecated. We will completely remove
57+
4.14 support with Firecracker version v1.10
58+
2359
### Removed
2460

2561
- [#4689](https://github.com/firecracker-microvm/firecracker/pull/4689): Drop
@@ -30,6 +66,15 @@ and this project adheres to
3066

3167
### Fixed
3268

69+
- [4680](https://github.com/firecracker-microvm/firecracker/pull/4680): Fixed an
70+
issue
71+
([#4659](https://github.com/firecracker-microvm/firecracker/issues/4659))
72+
where the virtio-net device implementation would always assume the guest
73+
accepts all VirtIO features the device offers. This is always true with the
74+
Linux guest kernels we are testing but other kernels, like FreeBSD make
75+
different assumptions. This PR fixes the emulation code to set the TAP
76+
features based on the features accepted by the guest.
77+
3378
## \[1.8.0\]
3479

3580
### Added
@@ -780,7 +825,9 @@ and this project adheres to
780825
`--show-level` and `--show-log-origin` that can be used for configuring the
781826
Logger when starting the process. When using this method for configuration,
782827
only `--log-path` is mandatory.
783-
- Added a [guide](docs/devctr-image.md) for updating the dev container image.
828+
- Added a
829+
[guide](https://github.com/firecracker-microvm/firecracker/blob/v0.22.0/docs/devctr-image.md)
830+
for updating the dev container image.
784831
- Added a new API call, `PUT /mmds/config`, for configuring the `MMDS` with a
785832
custom valid link-local IPv4 address.
786833
- Added experimental JSON response format support for MMDS guest applications

CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,32 @@ cargo install rusty-hook
6565
rusty-hook init
6666
```
6767

68+
This project also has linters for Python and Markdown. These will be called by
69+
the pre-commit when you modify any Python and Markdown files. In order to make
70+
sure you are setup we recommend you install
71+
[poetry](https://python-poetry.org/docs/) and
72+
[pyenv](https://github.com/pyenv/pyenv?tab=readme-ov-file#installation).
73+
74+
Poetry is used by this project and pyenv will help you make sure you have a
75+
Python version compatible with the poetry python project we use as part of
76+
`./tools/devctr`.
77+
78+
Once you have these two installed you can run the following to install the dev
79+
container poetry project:
80+
81+
```
82+
poetry -C ./tools/devctr install --no-root
83+
```
84+
85+
Then, you can activate the poetry virtual environment by running:
86+
87+
```
88+
poetry shell -C ./tools/devctr
89+
```
90+
91+
Which you will need to do after modifying python or markdown files so that the
92+
pre-commit can finish successfully.
93+
6894
Your contribution needs to meet the following standards:
6995

7096
- Separate each **logical change** into its own commit.

0 commit comments

Comments
 (0)