Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .buildkite/branch.json.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ def main():
".buildkite/pipelines/format_and_validation.yml.sh"))
config = buildConfig.Config()
config.parse()

build_step_keys = []
test_step_keys = []
if config.build_linux and config.build_aarch64:
build_step_keys.append("build_test_linux-aarch64-RelWithDebInfo")
test_step_keys.append("test_linux-aarch64-RelWithDebInfo")
if config.build_linux and config.build_x86_64:
build_step_keys.append("build_test_linux-x86_64-RelWithDebInfo")
test_step_keys.append("test_linux-x86_64-RelWithDebInfo")
if config.build_macos and config.build_aarch64:
build_step_keys.append("build_test_macos-aarch64-RelWithDebInfo")
test_step_keys.append("test_macos-aarch64-RelWithDebInfo")
if config.build_windows and config.build_x86_64:
build_step_keys.append("build_test_Windows-x86_64-RelWithDebInfo")
test_step_keys.append("test_Windows-x86_64-RelWithDebInfo")

env = {
"ML_BUILD_STEP_KEYS": ",".join(build_step_keys),
"ML_TEST_STEP_KEYS": ",".join(test_step_keys),
}

if config.build_windows:
build_windows = pipeline_steps.generate_step_template("Windows", "build", "", config.build_x86_64)
pipeline_steps.append(build_windows)
Expand All @@ -55,6 +76,7 @@ def main():
pipeline_steps.append(pipeline_steps.generate_step("Upload daily releasable artifacts to GCS",
".buildkite/pipelines/upload_dra_to_gcs.yml.sh"))

pipeline["env"] = env
pipeline["steps"] = pipeline_steps
print(json.dumps(pipeline, indent=2))

Expand Down
24 changes: 19 additions & 5 deletions .buildkite/pipeline.json.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
config as buildConfig,
)

# Ensure VERSION_QUALIFIER is always empty for PR builds
env = {
"VERSION_QUALIFIER": ""
}

def main():
pipeline = {}
pipeline_steps = step.PipelineStep([])
Expand All @@ -39,6 +34,25 @@ def main():
".buildkite/pipelines/format_and_validation.yml.sh"))
config = buildConfig.Config()
config.parse()

# Compute which build step keys will exist so that analytics steps
# can emit a correct depends_on list (not all platforms are built
# for every PR, depending on labels/comments).
build_step_keys = []
if config.build_linux and config.build_aarch64:
build_step_keys.append("build_test_linux-aarch64-RelWithDebInfo")
if config.build_linux and config.build_x86_64:
build_step_keys.append("build_test_linux-x86_64-RelWithDebInfo")
if config.build_macos and config.build_aarch64:
build_step_keys.append("build_test_macos-aarch64-RelWithDebInfo")
if config.build_windows and config.build_x86_64:
build_step_keys.append("build_test_Windows-x86_64-RelWithDebInfo")

env = {
"VERSION_QUALIFIER": "",
"ML_BUILD_STEP_KEYS": ",".join(build_step_keys),
}

if config.build_windows:
build_windows = pipeline_steps.generate_step_template("Windows", config.action, "", config.build_x86_64)
pipeline_steps.append(build_windows)
Expand Down
18 changes: 12 additions & 6 deletions .buildkite/pipelines/analyze_build_timings.yml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@
# compliance with the Elastic License 2.0 and the foregoing additional
# limitation.

cat <<EOL
cat <<'EOL'
steps:
- label: "Analyse build timings :chart_with_upwards_trend:"
key: "analyze_build_timings"
command:
- "python3 .buildkite/scripts/steps/analyze_build_timings.py"
depends_on:
- "test_linux-aarch64-RelWithDebInfo"
- "test_linux-x86_64-RelWithDebInfo"
- "test_macos-aarch64-RelWithDebInfo"
- "test_Windows-x86_64-RelWithDebInfo"
EOL

if [ -n "${ML_TEST_STEP_KEYS:-}" ]; then
echo ' depends_on:'
IFS=',' read -ra STEP_KEYS <<< "$ML_TEST_STEP_KEYS"
for key in "${STEP_KEYS[@]}"; do
echo " - \"${key}\""
done
fi

cat <<'EOL'
allow_dependency_failure: true
soft_fail: true
agents:
Expand Down
22 changes: 16 additions & 6 deletions .buildkite/pipelines/check_build_regression.yml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,27 @@
# compliance with the Elastic License 2.0 and the foregoing additional
# limitation.

cat <<EOL
cat <<'EOL'
steps:
- label: "Check build timing regressions :chart_with_downwards_trend:"
key: "check_build_regression"
command:
- "python3 dev-tools/check_build_regression.py --annotate"
depends_on:
- "build_test_linux-aarch64-RelWithDebInfo"
- "build_test_linux-x86_64-RelWithDebInfo"
- "build_test_macos-aarch64-RelWithDebInfo"
- "build_test_Windows-x86_64-RelWithDebInfo"
EOL

# Emit depends_on dynamically — ML_BUILD_STEP_KEYS is a comma-separated
# list of step keys set by the pipeline generator. Only keys that
# actually exist in this build are included, avoiding Buildkite errors
# when a platform is not built.
if [ -n "${ML_BUILD_STEP_KEYS:-}" ]; then
echo ' depends_on:'
IFS=',' read -ra STEP_KEYS <<< "$ML_BUILD_STEP_KEYS"
for key in "${STEP_KEYS[@]}"; do
echo " - \"${key}\""
done
fi

cat <<'EOL'
allow_dependency_failure: true
soft_fail: true
agents:
Expand Down
20 changes: 13 additions & 7 deletions .buildkite/pipelines/ingest_build_timings.yml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,24 @@
# compliance with the Elastic License 2.0 and the foregoing additional
# limitation.

cat <<EOL
cat <<'EOL'
steps:
- label: "Ingest build timings :elasticsearch:"
key: "ingest_build_timings"
command:
- "pip3 install --quiet requests 2>/dev/null || true"
- "python3 dev-tools/ingest_build_timings.py --pipeline \$BUILDKITE_PIPELINE_SLUG --build \$BUILDKITE_BUILD_NUMBER"
depends_on:
- "build_test_linux-aarch64-RelWithDebInfo"
- "build_test_linux-x86_64-RelWithDebInfo"
- "build_test_macos-aarch64-RelWithDebInfo"
- "build_test_Windows-x86_64-RelWithDebInfo"
- "python3 dev-tools/ingest_build_timings.py --pipeline $BUILDKITE_PIPELINE_SLUG --build $BUILDKITE_BUILD_NUMBER"
EOL

if [ -n "${ML_BUILD_STEP_KEYS:-}" ]; then
echo ' depends_on:'
IFS=',' read -ra STEP_KEYS <<< "$ML_BUILD_STEP_KEYS"
for key in "${STEP_KEYS[@]}"; do
echo " - \"${key}\""
done
fi

cat <<'EOL'
allow_dependency_failure: true
soft_fail: true
agents:
Expand Down
Loading