Skip to content

Commit 286aa17

Browse files
ManciukicShadowCurse
authored andcommitted
chore(buildkite): add pipeline definition for release QA
Adds a definition for release QA pipeline to also define it as code in our repository. This also adds a test mode when VERSION=dev where "make_release" is used to generate the artifacts instead of downloading them from S3. Signed-off-by: Riccardo Mancini <[email protected]>
1 parent 5dde18c commit 286aa17

File tree

2 files changed

+78
-2
lines changed

2 files changed

+78
-2
lines changed

.buildkite/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ def __init__(self, with_build_step=True, **kwargs):
275275
self.per_arch["instances"] = ["m6i.metal", "m7g.metal"]
276276
self.per_arch["platforms"] = [("al2023", "linux_6.1")]
277277
self.binary_dir = args.binary_dir
278-
# Build sharing
279-
if with_build_step:
278+
# Build sharing, if a binary dir wasn't already supplied
279+
if not args.binary_dir and with_build_step:
280280
build_cmds, self.shared_build = shared_build()
281281
self.build_group_per_arch(
282282
"🏗️ Build", build_cmds, depends_on_build=False, set_key=self.shared_build

.buildkite/pipeline_release_qa.py

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/usr/bin/env python3
2+
# Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
"""
6+
Buildkite pipeline for release QA
7+
"""
8+
9+
from common import BKPipeline
10+
11+
pipeline = BKPipeline(with_build_step=False)
12+
13+
# NOTE: we need to escape $ using $$ otherwise buildkite tries to replace it instead of the shell
14+
15+
pipeline.add_step(
16+
{
17+
"label": "Download release",
18+
"if": 'build.env("VERSION") != "dev"',
19+
"command": [
20+
"aws s3 sync --no-sign-request s3://spec.ccfc.min/firecracker-ci/firecracker/$$VERSION release-$$VERSION",
21+
'buildkite-agent artifact upload "release-$$VERSION/**/*"',
22+
],
23+
},
24+
depends_on_build=False,
25+
)
26+
27+
pipeline.build_group_per_arch(
28+
":building_construction: Make release",
29+
# if is a keyword for python, so we need this workaround to expand it as a kwarg
30+
**{"if": 'build.env("VERSION") == "dev"'},
31+
command=[
32+
"./tools/devtool -y make_release",
33+
"RELEASE_DIR=$$(echo release-*dev-$$(uname -m))",
34+
"RELEASE_SUFFIX=$${{RELEASE_DIR#release}}",
35+
"OUT_DIR=release-$$VERSION/$$(uname -m)",
36+
"mkdir -p $$OUT_DIR",
37+
(
38+
"for f in $$RELEASE_DIR/*-$$(uname -m); do"
39+
" mv $$f $$OUT_DIR/$$(basename $$f $$RELEASE_SUFFIX);"
40+
" mv $$f.debug $$OUT_DIR/$$(basename $$f $$RELEASE_SUFFIX).debug;"
41+
"done"
42+
),
43+
'buildkite-agent artifact upload "release-$$VERSION/**/*"',
44+
],
45+
depends_on_build=False,
46+
)
47+
48+
# The devtool expects the examples to be in the same folder as the binaries to run some tests
49+
# (for example, uffd handler tests). Build them and upload them in the same folder.
50+
pipeline.build_group_per_arch(
51+
":hammer_and_wrench: Build examples",
52+
command=[
53+
"CARGO_TARGET=$$(uname -m)-unknown-linux-musl",
54+
"./tools/devtool -y sh cargo build --target $$CARGO_TARGET --release --examples",
55+
"mkdir -p release-$$VERSION/$$(uname -m)/",
56+
"cp -R build/cargo_target/$$CARGO_TARGET/release/examples release-$$VERSION/$$(uname -m)/",
57+
'buildkite-agent artifact upload "release-$$VERSION/**/*"',
58+
],
59+
depends_on_build=False,
60+
)
61+
62+
pipeline.add_step("wait", depends_on_build=False)
63+
64+
pipeline.add_step(
65+
{
66+
"label": ":pipeline: PR",
67+
"command": (
68+
".buildkite/pipeline_pr.py --binary-dir release-$$VERSION "
69+
"| jq '(..|select(.priority? != null).priority) += 100' "
70+
"| buildkite-agent pipeline upload"
71+
),
72+
},
73+
depends_on_build=False,
74+
)
75+
76+
print(pipeline.to_json())

0 commit comments

Comments
 (0)