Skip to content

Commit

Permalink
ci: add option to use a different Firecracker binary
Browse files Browse the repository at this point in the history
  • Loading branch information
pb8o committed Nov 7, 2023
1 parent 0b334af commit 4336317
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .buildkite/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,10 @@ def __call__(self, parser, namespace, value, option_string=None):
default={},
type=str,
)
COMMON_PARSER.add_argument(
"--binary-dir",
help="Use the Firecracker binaries from this path",
required=False,
default=None,
type=str,
)
14 changes: 13 additions & 1 deletion .buildkite/pipeline_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@
defaults_once_per_architecture["platforms"] = [("al2", "linux_5.10")]


def devtool_test(cmd, binary_dir=None):
cmds = []
parts = ["./tools/devtool -y test --"]
if binary_dir is not None:
cmds.append(f"buildkite-agent artifact download \"{binary_dir}/$(uname -m)/*\" .")
cmds.append(f"chmod -v a+x {binary_dir}/**/*")
parts.append(f"--binary-dir=../{binary_dir}/$(uname -m)")
parts.append(cmd)
cmds.append(" ".join(parts))
return cmds


devctr_grp = group(
"🐋 Dev Container Sanity Build",
"./tools/devtool -y build_devctr",
Expand All @@ -61,7 +73,7 @@

functional_grp = group(
"⚙ Functional and security 🔒",
"./tools/devtool -y test -- -n 8 --dist worksteal integration_tests/{{functional,security}}",
devtool_test("-n 8 --dist worksteal integration_tests/{{functional,security}}", args.binary_dir),
**defaults,
)

Expand Down
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ def microvm_factory(fc_tmp_path, bin_cloner_path, request):
if binary_dir := request.config.getoption("--binary-dir"):
fc_binary_path = Path(binary_dir) / "firecracker"
jailer_binary_path = Path(binary_dir) / "jailer"
if not fc_binary_path.exists():
raise RuntimeError("Firecracker binary does not exist")
else:
fc_binary_path, jailer_binary_path = build_tools.get_firecracker_binaries()

Expand Down

0 comments on commit 4336317

Please sign in to comment.