From 247600961312fe8820b4232b31c63370881500e1 Mon Sep 17 00:00:00 2001 From: Babis Chalios Date: Thu, 25 Jul 2024 15:48:00 +0200 Subject: [PATCH] fix(test): do not use build step for optional pipeline Optional pipeline started failing during a build failure in the rust benchmarks tests. During the build step, we build REVISION_A (main) and REVISION_B (tip of the PR commit) and pass it over to the subsequent pipeline steps that run the test. However, 'test_benchmarks.py' needs to build the benchmarks, running `cargo bench`. That step started failing when building 'aws-lc-rs-sys' because CMake is complaining that its CMakeCache.txt file is not in the same path as the one initially created. Since we anyway run `cargo bench` in the test there's not really need to pre-build firecracker. So, modify the buildkite pipeline logic to allow defining pipelines without the build step, and change the pipeline_pr_no_block.py to not use it. Signed-off-by: Babis Chalios --- .buildkite/common.py | 25 ++++++++++++++++--------- .buildkite/pipeline_pr_no_block.py | 1 + 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.buildkite/common.py b/.buildkite/common.py index 1056f8e629f..59f1c5d2f16 100644 --- a/.buildkite/common.py +++ b/.buildkite/common.py @@ -229,7 +229,7 @@ class BKPipeline: parser = COMMON_PARSER - def __init__(self, initial_steps=None, **kwargs): + def __init__(self, initial_steps=None, with_build_step=True, **kwargs): self.steps = [] self.args = args = self.parser.parse_args() # Retry one time if agent was lost. This can happen if we terminate the @@ -252,9 +252,12 @@ def __init__(self, initial_steps=None, **kwargs): self.per_arch["platforms"] = [("al2", "linux_5.10")] self.binary_dir = args.binary_dir # Build sharing - build_cmds, self.shared_build = shared_build() - step_build = group("🏗️ Build", build_cmds, **self.per_arch) - self.steps += [step_build, "wait"] + if with_build_step: + build_cmds, self.shared_build = shared_build() + step_build = group("🏗️ Build", build_cmds, **self.per_arch) + self.steps += [step_build, "wait"] + else: + self.shared_build = None # If we run initial_steps before the "wait" step above, then a failure of the initial steps # would result in the build not progressing past the "wait" step (as buildkite only proceeds past a wait step @@ -284,10 +287,12 @@ def add_step(self, step, decorate=True): def _adapt_group(self, group): """""" - prepend = [ - f'buildkite-agent artifact download "{self.shared_build}" .', - f"tar xzf {self.shared_build}", - ] + prepend = [] + if self.shared_build is not None: + prepend = [ + f'buildkite-agent artifact download "{self.shared_build}" .', + f"tar xzf {self.shared_build}", + ] if self.binary_dir is not None: prepend.extend( [ @@ -327,7 +332,9 @@ def to_json(self): def devtool_test(self, devtool_opts=None, pytest_opts=None): """Generate a `devtool test` command""" cmds = [] - parts = ["./tools/devtool -y test", "--no-build"] + parts = ["./tools/devtool -y test"] + if self.shared_build is not None: + parts.append("--no-build") if devtool_opts: parts.append(devtool_opts) parts.append("--") diff --git a/.buildkite/pipeline_pr_no_block.py b/.buildkite/pipeline_pr_no_block.py index 09d62ed0477..3e34076b80c 100755 --- a/.buildkite/pipeline_pr_no_block.py +++ b/.buildkite/pipeline_pr_no_block.py @@ -11,6 +11,7 @@ DEFAULT_PRIORITY = 1 pipeline = BKPipeline( + with_build_step=False, timeout_in_minutes=45, # some non-blocking tests are performance, so make sure they get ag=1 instances priority=DEFAULT_PRIORITY + 1,