Skip to content

Commit 8a0493f

Browse files
committed
Merge tag 'v1.2.1' into uffd-superbranch-3
Changed * Upgraded Rust toolchain from 1.64.0 to 1.66.1. Fixed * A race condition that has been identified between the API thread and the VMM thread due to a misconfiguration of the `api_event_fd`.
2 parents d8a9bed + c7f20f1 commit 8a0493f

File tree

100 files changed

+2053
-1297
lines changed

Some content is hidden

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

100 files changed

+2053
-1297
lines changed

.buildkite/common.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
"""
5+
Common helpers to create Buildkite pipelines
6+
"""
7+
8+
import json
9+
10+
DEFAULT_INSTANCES = [
11+
"m5d.metal",
12+
"m6i.metal",
13+
"m6a.metal",
14+
"m6g.metal",
15+
]
16+
17+
DEFAULT_PLATFORMS = [("al2", "linux_4.14"), ("al2", "linux_5.10")]
18+
19+
DEFAULT_QUEUE = "public-prod-us-east-1"
20+
21+
22+
def group(label, command, instances, platforms, agent_tags=None, **kwargs):
23+
"""
24+
Generate a group step with specified parameters, for each instance+kernel
25+
combination
26+
27+
https://buildkite.com/docs/pipelines/group-step
28+
"""
29+
if agent_tags is None:
30+
agent_tags = []
31+
# Use the 1st character of the group name (should be an emoji)
32+
label1 = label[0]
33+
steps = []
34+
for instance in instances:
35+
for (os, kv) in platforms:
36+
agents = [f"instance={instance}", f"kv={kv}", f"os={os}"] + agent_tags
37+
step = {
38+
"command": command,
39+
"label": f"{label1} {instance} {os} {kv}",
40+
"agents": agents,
41+
**kwargs,
42+
}
43+
steps.append(step)
44+
45+
return {"group": label, "steps": steps}
46+
47+
48+
def pipeline_to_json(pipeline):
49+
"""Serialize a pipeline dictionary to JSON"""
50+
return json.dumps(pipeline, indent=4, sort_keys=True, ensure_ascii=False)

.buildkite/pipeline_pr.py

Lines changed: 44 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,103 +4,90 @@
44

55
"""Generate Buildkite pipelines dynamically"""
66

7-
import json
7+
import subprocess
8+
from pathlib import Path
89

9-
INSTANCES = [
10-
"m5d.metal",
11-
"m6i.metal",
12-
"m6a.metal",
13-
"m6gd.metal",
14-
]
10+
from common import DEFAULT_INSTANCES, DEFAULT_PLATFORMS, DEFAULT_QUEUE, group, pipeline_to_json
1511

16-
KERNELS = ["4.14", "5.10"]
12+
# Buildkite default job priority is 0. Setting this to 1 prioritizes PRs over
13+
# scheduled jobs and other batch jobs.
14+
DEFAULT_PRIORITY = 1
1715

1816

19-
def group(group_name, command, agent_tags=None, priority=0, timeout=30):
17+
def get_changed_files(branch):
2018
"""
21-
Generate a group step with specified parameters, for each instance+kernel
22-
combination
23-
24-
https://buildkite.com/docs/pipelines/group-step
19+
Get all files changed since `branch`
2520
"""
26-
if agent_tags is None:
27-
agent_tags = []
28-
# Use the 1st character of the group name (should be an emoji)
29-
label1 = group_name[0]
30-
steps = []
31-
for instance in INSTANCES:
32-
for kv in KERNELS:
33-
agents = [
34-
f"type={instance}",
35-
f"kv={kv}",
36-
]
37-
agents.extend(agent_tags)
38-
step = {
39-
"command": command,
40-
"label": f"{label1} {instance} kv={kv}",
41-
"priority": priority,
42-
"timeout": timeout,
43-
"agents": agents,
44-
}
45-
steps.append(step)
46-
47-
return {"group": group_name, "steps": steps}
48-
49-
50-
step_block_unless_maintainer = {
51-
"block": "Waiting for approval to run",
52-
"if": '(build.creator.teams includes "prod-compute-capsule") == false',
53-
}
21+
stdout = subprocess.check_output(["git", "diff", "--name-only", branch])
22+
return [Path(line) for line in stdout.decode().splitlines()]
23+
5424

5525
step_style = {
5626
"command": "./tools/devtool -y test -- ../tests/integration_tests/style/",
5727
"label": "🪶 Style",
58-
# we only install the required dependencies in x86_64
59-
"agents": ["platform=x86_64.metal"]
28+
"priority": DEFAULT_PRIORITY,
29+
}
30+
31+
defaults = {
32+
"instances": DEFAULT_INSTANCES,
33+
"platforms": DEFAULT_PLATFORMS,
34+
# buildkite step parameters
35+
"priority": DEFAULT_PRIORITY,
36+
"timeout_in_minutes": 30,
6037
}
6138

6239
build_grp = group(
6340
"📦 Build",
6441
"./tools/devtool -y test -- ../tests/integration_tests/build/",
65-
priority=1,
42+
**defaults
6643
)
6744

6845
functional_1_grp = group(
6946
"⚙ Functional [a-n]",
7047
"./tools/devtool -y test -- `cd tests; ls integration_tests/functional/test_[a-n]*.py`",
71-
priority=1,
48+
**defaults
7249
)
7350

7451
functional_2_grp = group(
7552
"⚙ Functional [o-z]",
7653
"./tools/devtool -y test -- `cd tests; ls integration_tests/functional/test_[o-z]*.py`",
77-
priority=1,
54+
**defaults
7855
)
7956

8057
security_grp = group(
8158
"🔒 Security",
8259
"./tools/devtool -y test -- ../tests/integration_tests/security/",
83-
priority=1,
60+
**defaults
61+
)
62+
63+
defaults_for_performance = defaults.copy()
64+
defaults_for_performance.update(
65+
# We specify higher priority so the ag=1 jobs get picked up before the ag=n
66+
# jobs in ag=1 agents
67+
priority=DEFAULT_PRIORITY + 1,
68+
agent_tags=["ag=1"],
8469
)
8570

8671
performance_grp = group(
8772
"⏱ Performance",
8873
"./tools/devtool -y test -- ../tests/integration_tests/performance/",
89-
priority=1,
90-
agent_tags=["ag=1"],
74+
**defaults_for_performance,
9175
)
9276

93-
pipeline = {
94-
"agents": {"queue": "default"},
95-
"steps": [
96-
step_block_unless_maintainer,
97-
step_style,
77+
steps = [step_style]
78+
changed_files = get_changed_files("main")
79+
if any(x.suffix != ".md" for x in changed_files):
80+
steps += [
9881
build_grp,
9982
functional_1_grp,
10083
functional_2_grp,
10184
security_grp,
10285
performance_grp,
103-
],
104-
}
86+
]
10587

106-
print(json.dumps(pipeline, indent=4, sort_keys=True, ensure_ascii=False))
88+
pipeline = {
89+
"env": {},
90+
"agents": {"queue": DEFAULT_QUEUE},
91+
"steps": steps,
92+
}
93+
print(pipeline_to_json(pipeline))

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ __pycache__
99
.vscode
1010
test_results/*
1111
*.core
12+
*.profraw

.gitlint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[title-max-length]
2-
line-length=50
2+
line-length=72
33

44
[body-max-line-length]
55
line-length=72

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [1.2.1]
4+
5+
### Changed
6+
7+
- Upgraded Rust toolchain from 1.64.0 to 1.66.1.
8+
9+
### Fixed
10+
11+
- A race condition that has been identified between the API thread and the VMM
12+
thread due to a misconfiguration of the `api_event_fd`.
13+
314
## [1.2.0]
415

516
### Added

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Your contribution needs to meet the following standards:
7979
- A good commit message may look like
8080

8181
```
82-
A descriptive title of 50 characters or fewer
82+
A descriptive title of 72 characters or fewer
8383
8484
A concise description where each line is 72 characters or fewer.
8585

0 commit comments

Comments
 (0)