diff --git a/.buildkite/pipelines/upload_dra_to_gcs.yml.sh b/.buildkite/pipelines/upload_dra_to_gcs.yml.sh index fe26e653f8..7b64c7c21e 100755 --- a/.buildkite/pipelines/upload_dra_to_gcs.yml.sh +++ b/.buildkite/pipelines/upload_dra_to_gcs.yml.sh @@ -8,20 +8,51 @@ # 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 [ -n "${VERSION_QUALIFIER:-}" ] ; then + STACK_VERSION="${STACK_VERSION}-${VERSION_QUALIFIER}" +fi + +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 </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 diff --git a/dev-tools/ingest_build_timings.py b/dev-tools/ingest_build_timings.py index cbc0d2f219..76958ddbef 100755 --- a/dev-tools/ingest_build_timings.py +++ b/dev-tools/ingest_build_timings.py @@ -46,7 +46,7 @@ "clone_eigen": "linux-x86_64", "create_dra_artifacts": "linux-x86_64", "upload_dra_artifacts": "linux-x86_64", - "upload_dra_artifacts_to_gcs": "linux-x86_64", + "dra-prep": "linux-x86_64", }