From 9c615bdea28b79ce3fb1508b42686f21bfb42288 Mon Sep 17 00:00:00 2001 From: Vincent Deuschle Date: Mon, 17 Aug 2026 14:19:10 +0200 Subject: [PATCH 1/5] [ML] Migrate DRA GCS publishing from Release Manager to dra-prep plugin Replaces the `docker.elastic.co/infra/release-manager` Docker step with the `elastic/dra-prep-buildkite-plugin` + `unified-release-dra-processing` trigger, as part of the platform-wide Release Manager deprecation. Co-Authored-By: Claude Sonnet 4.6 --- .buildkite/pipelines/upload_dra_to_gcs.yml.sh | 37 ++++++++-- .buildkite/scripts/stage_artifacts.sh | 36 ++++++++++ .buildkite/scripts/steps/upload_dra_to_gcs.sh | 70 ------------------- 3 files changed, 66 insertions(+), 77 deletions(-) create mode 100755 .buildkite/scripts/stage_artifacts.sh delete mode 100755 .buildkite/scripts/steps/upload_dra_to_gcs.sh diff --git a/.buildkite/pipelines/upload_dra_to_gcs.yml.sh b/.buildkite/pipelines/upload_dra_to_gcs.yml.sh index fe26e653f8..1b81e4cef4 100755 --- a/.buildkite/pipelines/upload_dra_to_gcs.yml.sh +++ b/.buildkite/pipelines/upload_dra_to_gcs.yml.sh @@ -8,20 +8,43 @@ # compliance with the Elastic License 2.0 and the foregoing additional # limitation. # -# Upload all artifacts, both platform-specific and all-platforms, to -# GCS, where release manager builds will download them from. +# Stage DRA artifacts and trigger unified-release DRA processing via the +# elastic/dra-prep-buildkite-plugin (replaces the Release Manager Docker step). # . .buildkite/scripts/common/base.sh +STACK_VERSION=$(awk -F= '/^elasticsearchVersion/ {print $2}' gradle.properties | xargs echo) + +if [ "${BUILD_SNAPSHOT:-true}" = "false" ] ; then + DRA_WORKFLOW=staging +else + DRA_WORKFLOW=snapshot +fi + cat </dev/null || true + +if ! ls artifacts/* 1>/dev/null 2>&1; then + echo "ERROR: no ${WORKFLOW} artifacts found in artifacts/." >&2 + exit 1 +fi + +echo "Staged artifacts:" +ls -1 artifacts/ diff --git a/.buildkite/scripts/steps/upload_dra_to_gcs.sh b/.buildkite/scripts/steps/upload_dra_to_gcs.sh deleted file mode 100755 index 407a99926b..0000000000 --- a/.buildkite/scripts/steps/upload_dra_to_gcs.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the following additional limitation. Functionality enabled by the -# files subject to the Elastic License 2.0 may only be used in production when -# invoked by an Elasticsearch process with a license key installed that permits -# use of machine learning features. You may not use this file except in -# compliance with the Elastic License 2.0 and the foregoing additional -# limitation. -# -# Upload all artifacts, both platform-specific and all-platforms, to -# GCS, where release manager builds will download them from. -# - -. ./dev-tools/docker/prefetch_docker_image.sh - -# Default to a snapshot build -if [ -z "$BUILD_SNAPSHOT" ] ; then - BUILD_SNAPSHOT=true -fi - -# The "branch" here selects which "$BRANCH.gradle" file of release manager is used -VERSION=$(awk -F= '/elasticsearchVersion/ {print $2}' gradle.properties) -MAJOR=$(echo $VERSION | awk -F. '{ print $1 }') -MINOR=$(echo $VERSION | awk -F. '{ print $2 }') -if [ -n "$(git ls-remote --heads origin $MAJOR.$MINOR)" ] ; then - BRANCH=$MAJOR.$MINOR -elif [ -n "$(git ls-remote --heads origin $MAJOR.x)" ] ; then - BRANCH=$MAJOR.x -else - BRANCH=main -fi - -if [ "$BUILD_SNAPSHOT" = false ] ; then - WORKFLOW=staging -else - WORKFLOW=snapshot -fi - -# Allow other users access to read the artifacts so they are readable in the -# container -chmod a+r build/distributions/* - -# Allow other users write access to create checksum files -chmod a+w build/distributions - -# Variables named *_ACCESS_KEY & *_SECRET_KEY are redacted in BuildKite’s environment -# so we store the vault role and secret id values in them for security -VAULT_ACCESS_KEY=`vault read -field=role_id secret/ci/elastic-ml-cpp/gcs/creds/prelertartifacts` -VAULT_SECRET_KEY=`vault read -field=secret_id secret/ci/elastic-ml-cpp/gcs/creds/prelertartifacts` - -IMAGE=docker.elastic.co/infra/release-manager:latest -prefetch_docker_image "$IMAGE" - -# Generate checksum files and upload to GCS -docker run --rm \ - --name release-manager \ - -e VAULT_ADDR='https://secrets.elastic.co:8200' \ - -e VAULT_ROLE_ID=$VAULT_ACCESS_KEY \ - -e VAULT_SECRET_ID=$VAULT_SECRET_KEY \ - --mount type=bind,readonly=false,src="$PWD",target=/artifacts \ - "$IMAGE" \ - cli collect \ - --project ml-cpp \ - --branch "$BRANCH" \ - --version "$VERSION" \ - --commit `git rev-parse HEAD` \ - --workflow "$WORKFLOW" \ - --qualifier "$VERSION_QUALIFIER" \ - --artifact-set main From ceaa860ae7707e988cc52094df8b4b5677cdba36 Mon Sep 17 00:00:00 2001 From: Navya Uppalapati <119856217+navyau09@users.noreply.github.com> Date: Tue, 18 Aug 2026 14:21:28 +0530 Subject: [PATCH 2/5] buildkite: fail loudly if dependencies.csv is missing in stage_artifacts.sh --- .buildkite/scripts/stage_artifacts.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/scripts/stage_artifacts.sh b/.buildkite/scripts/stage_artifacts.sh index eb6645e971..1aabd46cdc 100755 --- a/.buildkite/scripts/stage_artifacts.sh +++ b/.buildkite/scripts/stage_artifacts.sh @@ -19,13 +19,13 @@ echo "--- :compression: Downloading ${WORKFLOW} artifacts from create_dra_artifa mkdir -p build/distributions/ buildkite-agent artifact download 'build/distributions/*.zip' . --step create_dra_artifacts -buildkite-agent artifact download 'build/distributions/*.csv' . --step create_dra_artifacts || true +buildkite-agent artifact download 'build/distributions/*.csv' . --step create_dra_artifacts echo "--- :package: Staging ${WORKFLOW} artifacts" mkdir -p artifacts cp build/distributions/*.zip artifacts/ -cp build/distributions/*.csv artifacts/ 2>/dev/null || true +cp build/distributions/*.csv artifacts/ if ! ls artifacts/* 1>/dev/null 2>&1; then echo "ERROR: no ${WORKFLOW} artifacts found in artifacts/." >&2 From a441df630e584b53daeff087818038859fdb5a29 Mon Sep 17 00:00:00 2001 From: vincentDeuschle <167105996+vincentDeuschle@users.noreply.github.com> Date: Tue, 18 Aug 2026 13:43:42 +0200 Subject: [PATCH 3/5] Copilot fix Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .buildkite/pipelines/upload_dra_to_gcs.yml.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.buildkite/pipelines/upload_dra_to_gcs.yml.sh b/.buildkite/pipelines/upload_dra_to_gcs.yml.sh index 1b81e4cef4..81ccca9006 100755 --- a/.buildkite/pipelines/upload_dra_to_gcs.yml.sh +++ b/.buildkite/pipelines/upload_dra_to_gcs.yml.sh @@ -16,10 +16,15 @@ STACK_VERSION=$(awk -F= '/^elasticsearchVersion/ {print $2}' gradle.properties | xargs echo) +if [ -n "${VERSION_QUALIFIER:-}" ] ; then + STACK_VERSION="${STACK_VERSION}-${VERSION_QUALIFIER}" +fi + if [ "${BUILD_SNAPSHOT:-true}" = "false" ] ; then DRA_WORKFLOW=staging else DRA_WORKFLOW=snapshot + STACK_VERSION="${STACK_VERSION}-SNAPSHOT" fi cat < Date: Tue, 18 Aug 2026 13:43:54 +0200 Subject: [PATCH 4/5] Copilot fix Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .buildkite/scripts/stage_artifacts.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.buildkite/scripts/stage_artifacts.sh b/.buildkite/scripts/stage_artifacts.sh index 1aabd46cdc..e0d383d738 100755 --- a/.buildkite/scripts/stage_artifacts.sh +++ b/.buildkite/scripts/stage_artifacts.sh @@ -16,14 +16,13 @@ set -euo pipefail WORKFLOW="${DRA_WORKFLOW:?DRA_WORKFLOW is required}" echo "--- :compression: Downloading ${WORKFLOW} artifacts from create_dra_artifacts step" -mkdir -p build/distributions/ +rm -rf build/distributions artifacts +mkdir -p build/distributions artifacts buildkite-agent artifact download 'build/distributions/*.zip' . --step create_dra_artifacts buildkite-agent artifact download 'build/distributions/*.csv' . --step create_dra_artifacts echo "--- :package: Staging ${WORKFLOW} artifacts" -mkdir -p artifacts - cp build/distributions/*.zip artifacts/ cp build/distributions/*.csv artifacts/ From 4f66619316ed3e7166b39f6766b9f52c54644430 Mon Sep 17 00:00:00 2001 From: Vincent Deuschle Date: Wed, 19 Aug 2026 14:23:49 +0200 Subject: [PATCH 5/5] [ML] Fix BUILD_SNAPSHOT logic and dra-prep step key in DRA pipeline Align BUILD_SNAPSHOT handling in upload_dra_to_gcs.yml.sh with create_dra.sh: use an explicit empty-check to default to true, then test for = "true" rather than != "false". Rename the upload_dra_artifacts_to_gcs step key in ingest_build_timings.py to dra-prep to match the new pipeline step key. Co-Authored-By: Claude Sonnet 4.6 --- .buildkite/pipelines/upload_dra_to_gcs.yml.sh | 9 ++++++--- dev-tools/ingest_build_timings.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.buildkite/pipelines/upload_dra_to_gcs.yml.sh b/.buildkite/pipelines/upload_dra_to_gcs.yml.sh index 81ccca9006..7b64c7c21e 100755 --- a/.buildkite/pipelines/upload_dra_to_gcs.yml.sh +++ b/.buildkite/pipelines/upload_dra_to_gcs.yml.sh @@ -20,11 +20,14 @@ if [ -n "${VERSION_QUALIFIER:-}" ] ; then STACK_VERSION="${STACK_VERSION}-${VERSION_QUALIFIER}" fi -if [ "${BUILD_SNAPSHOT:-true}" = "false" ] ; then - DRA_WORKFLOW=staging -else +if [ -z "$BUILD_SNAPSHOT" ] ; then + BUILD_SNAPSHOT=true +fi +if [ "$BUILD_SNAPSHOT" = "true" ] ; then DRA_WORKFLOW=snapshot STACK_VERSION="${STACK_VERSION}-SNAPSHOT" +else + DRA_WORKFLOW=staging fi cat <