From 1a969c3e67d6ebc6afc38f8cb895791a64b38b73 Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Tue, 3 Oct 2023 13:29:37 -0400 Subject: [PATCH] Enable Buildkite DRA workflows and delete Jenkins ones (#100213) --- .buildkite/scripts/dra-workflow.sh | 2 - .../elastic+elasticsearch+dra-snapshot.yml | 66 ---------------- ...stic+elasticsearch+dra-staging-trigger.yml | 6 -- ...astic+elasticsearch+dra-staging-update.yml | 51 ------------ .../elastic+elasticsearch+dra-staging.yml | 77 ------------------- 5 files changed, 202 deletions(-) delete mode 100644 .ci/jobs.t/elastic+elasticsearch+dra-snapshot.yml delete mode 100644 .ci/jobs.t/elastic+elasticsearch+dra-staging-trigger.yml delete mode 100644 .ci/jobs.t/elastic+elasticsearch+dra-staging-update.yml delete mode 100644 .ci/jobs.t/elastic+elasticsearch+dra-staging.yml diff --git a/.buildkite/scripts/dra-workflow.sh b/.buildkite/scripts/dra-workflow.sh index 02c8d9bc722b4..4611379009a08 100755 --- a/.buildkite/scripts/dra-workflow.sh +++ b/.buildkite/scripts/dra-workflow.sh @@ -71,8 +71,6 @@ find "$WORKSPACE" -type d -path "*/build/distributions" -exec chmod a+w {} \; echo --- Running release-manager -exit 0 - # Artifacts should be generated docker run --rm \ --name release-manager \ diff --git a/.ci/jobs.t/elastic+elasticsearch+dra-snapshot.yml b/.ci/jobs.t/elastic+elasticsearch+dra-snapshot.yml deleted file mode 100644 index 475ac37d236bf..0000000000000 --- a/.ci/jobs.t/elastic+elasticsearch+dra-snapshot.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -- job: - name: elastic+elasticsearch+%BRANCH%+dra-snapshot - workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+dra-snapshot - display-name: "elastic / elasticsearch # %BRANCH% - DRA snapshot" - description: "Publishing Daily Releasable Artifacts (DRAs) of Elasticsearch %BRANCH% snapshots.\n" - node: "ubuntu-20.04" - builders: - - inject: - properties-file: '.ci/java-versions.properties' - properties-content: | - JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA - - shell: | - #!/usr/local/bin/runbld --redirect-stderr - WORKFLOW="snapshot" - RM_BRANCH="%BRANCH%" && [[ "%BRANCH%" == "main" ]] && RM_BRANCH=master - ES_VERSION=$(cat build-tools-internal/version.properties \ - | grep elasticsearch \ - | sed "s/elasticsearch *= *//g") - VERSION_SUFFIX="" && [[ "$WORKFLOW" == "snapshot" ]] && VERSION_SUFFIX="-SNAPSHOT" - BEATS_BUILD_ID="$(./.ci/scripts/resolve-dra-manifest.sh beats $RM_BRANCH $ES_VERSION $WORKFLOW)" - ML_CPP_BUILD_ID="$(./.ci/scripts/resolve-dra-manifest.sh ml-cpp $RM_BRANCH $ES_VERSION $WORKFLOW)" - set -euo pipefail - set +x - VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id=$VAULT_ROLE_ID secret_id=$VAULT_SECRET_ID) - export VAULT_TOKEN - $WORKSPACE/.ci/scripts/run-gradle.sh -Ddra.artifacts=true \ - -Ddra.artifacts.dependency.beats=${BEATS_BUILD_ID} \ - -Ddra.artifacts.dependency.ml-cpp=${ML_CPP_BUILD_ID} \ - -Ddra.workflow=$WORKFLOW \ - -Dcsv=$WORKSPACE/build/distributions/dependencies-${ES_VERSION}${VERSION_SUFFIX}.csv \ - buildReleaseArtifacts \ - exportCompressedDockerImages \ - :distribution:generateDependenciesReport - - unset VAULT_TOKEN - set -x - $WORKSPACE/x-pack/plugin/sql/connectors/tableau/package.sh asm qualifier="$VERSION_SUFFIX" - - # we regenerate this file as part of the release manager invocation - rm $WORKSPACE/build/distributions/elasticsearch-jdbc-${ES_VERSION}${VERSION_SUFFIX}.taco.sha512 - - # Allow other users access to read the artifacts so they are readable in the - # container - find $WORKSPACE -type f -path "*/build/distributions/*" -exec chmod a+r {} \; - - # Allow other users write access to create checksum files - find $WORKSPACE -type d -path "*/build/distributions" -exec chmod a+w {} \; - - # Artifacts should be generated - docker run --rm \ - --name release-manager \ - -e VAULT_ADDR \ - -e VAULT_ROLE_ID \ - -e VAULT_SECRET_ID \ - --mount type=bind,readonly=false,src="$PWD",target=/artifacts \ - docker.elastic.co/infra/release-manager:latest \ - cli collect \ - --project elasticsearch \ - --branch "$RM_BRANCH" \ - --commit "$GIT_COMMIT" \ - --workflow "$WORKFLOW" \ - --version "$ES_VERSION" \ - --artifact-set main \ - --dependency beats:https://artifacts-${WORKFLOW}.elastic.co/beats/${BEATS_BUILD_ID}/manifest-${ES_VERSION}${VERSION_SUFFIX}.json \ - --dependency ml-cpp:https://artifacts-${WORKFLOW}.elastic.co/ml-cpp/${ML_CPP_BUILD_ID}/manifest-${ES_VERSION}${VERSION_SUFFIX}.json diff --git a/.ci/jobs.t/elastic+elasticsearch+dra-staging-trigger.yml b/.ci/jobs.t/elastic+elasticsearch+dra-staging-trigger.yml deleted file mode 100644 index 87df5e07c2e45..0000000000000 --- a/.ci/jobs.t/elastic+elasticsearch+dra-staging-trigger.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -jjbb-template: periodic-trigger-lgc.yml -vars: - - periodic-job: elastic+elasticsearch+%BRANCH%+dra-staging - - lgc-job: elastic+elasticsearch+%BRANCH%+intake - - cron: "H H/12 * * *" diff --git a/.ci/jobs.t/elastic+elasticsearch+dra-staging-update.yml b/.ci/jobs.t/elastic+elasticsearch+dra-staging-update.yml deleted file mode 100644 index 8e7410e82dab1..0000000000000 --- a/.ci/jobs.t/elastic+elasticsearch+dra-staging-update.yml +++ /dev/null @@ -1,51 +0,0 @@ ---- -- job: - name: elastic+elasticsearch+%BRANCH%+dra-staging-update - display-name: "elastic / elasticsearch # %BRANCH% - DRA staging update" - description: "Scheduled job to check for staging dependency updates" - node: master - scm: [] - properties: [] - parameters: [] - publishers: [] - triggers: - - timed: "*/30 * * * *" - builders: - - conditional-step: - condition-kind: shell - condition-command: | - #!/usr/bin/env bash - set -e - # Don't publish main branch to staging - if [ "%BRANCH%" == "main" ]; then - exit 1 - fi - - RM_BRANCH="%BRANCH%" && [[ "%BRANCH%" == "main" ]] && RM_BRANCH=master - BEATS_MANIFEST=$(curl -sS https://artifacts-staging.elastic.co/beats/latest/${RM_BRANCH}.json | jq -r '.manifest_url') - ML_MANIFEST=$(curl -sS https://artifacts-staging.elastic.co/ml-cpp/latest/${RM_BRANCH}.json | jq -r '.manifest_url') - ES_MANIFEST=$(curl -sS https://artifacts-staging.elastic.co/elasticsearch/latest/${RM_BRANCH}.json | jq -r '.manifest_url') - ES_BEATS_DEPENDENCY=$(curl -sS $ES_MANIFEST | jq -r '.projects.elasticsearch.dependencies[] | select(.prefix == "beats") | .build_uri') - ES_ML_DEPENDENCY=$(curl -sS $ES_MANIFEST | jq -r '.projects.elasticsearch.dependencies[] | select(.prefix == "ml-cpp") | .build_uri') - - if [ "$BEATS_MANIFEST" = "$ES_BEATS_DEPENDENCY" ]; then - echo "ES has the latest beats" - else - echo "Need to trigger a build, $BEATS_MANIFEST available but ES has $ES_BEATS_DEPENDENCY" - exit 0 - fi - - if [ "$ML_MANIFEST" = "$ES_ML_DEPENDENCY" ]; then - echo "ES has the latest ml-cpp" - else - echo "Need to trigger a build, $ML_MANIFEST available but ES has $ES_ML_DEPENDENCY" - exit 0 - fi - - # A non-zero exit value means the trigger step will be skipped - exit 1 - steps: - - trigger-builds: - - project: "elastic+elasticsearch+%BRANCH%+triggers/elastic+elasticsearch+%BRANCH%+dra-staging-trigger" - current-parameters: false - git-revision: false diff --git a/.ci/jobs.t/elastic+elasticsearch+dra-staging.yml b/.ci/jobs.t/elastic+elasticsearch+dra-staging.yml deleted file mode 100644 index cfbfec0ce21a5..0000000000000 --- a/.ci/jobs.t/elastic+elasticsearch+dra-staging.yml +++ /dev/null @@ -1,77 +0,0 @@ ---- -- job: - name: elastic+elasticsearch+%BRANCH%+dra-staging - workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+dra-staging - display-name: "elastic / elasticsearch # %BRANCH% - DRA staging" - description: "Publishing Daily Releasable Artifacts (DRAs) of Elasticsearch %BRANCH% staging.\n" - node: "ubuntu-20.04" - builders: - - inject: - properties-file: '.ci/java-versions.properties' - properties-content: | - JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA - - shell: | - #!/usr/local/bin/runbld --redirect-stderr - - # Don't publish main branch to staging - if [ "%BRANCH%" == "main" ]; then - exit 0 - fi - - WORKFLOW="staging" - RM_BRANCH="%BRANCH%" && [[ "%BRANCH%" == "main" ]] && RM_BRANCH=master - ES_VERSION=$(cat build-tools-internal/version.properties \ - | grep elasticsearch \ - | sed "s/elasticsearch *= *//g") - VERSION_SUFFIX="" && [[ "$WORKFLOW" == "snapshot" ]] && VERSION_SUFFIX="-SNAPSHOT" - BEATS_BUILD_ID="$(./.ci/scripts/resolve-dra-manifest.sh beats $RM_BRANCH $ES_VERSION $WORKFLOW)" - ML_CPP_BUILD_ID="$(./.ci/scripts/resolve-dra-manifest.sh ml-cpp $RM_BRANCH $ES_VERSION $WORKFLOW)" - set -euo pipefail - set +x - VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id=$VAULT_ROLE_ID secret_id=$VAULT_SECRET_ID) - LICENSE_KEY=$(mktemp -d)/license.key - export VAULT_TOKEN - vault read -field pubkey secret/elasticsearch-ci/license | base64 --decode > $LICENSE_KEY - unset VAULT_TOKEN - - $WORKSPACE/.ci/scripts/run-gradle.sh -Ddra.artifacts=true \ - -Ddra.artifacts.dependency.beats=${BEATS_BUILD_ID} \ - -Ddra.artifacts.dependency.ml-cpp=${ML_CPP_BUILD_ID} \ - -Ddra.workflow=$WORKFLOW \ - -Dcsv=$WORKSPACE/build/distributions/dependencies-${ES_VERSION}${VERSION_SUFFIX}.csv \ - -Dbuild.snapshot=false \ - -Dlicense.key=$LICENSE_KEY \ - buildReleaseArtifacts \ - exportCompressedDockerImages \ - :distribution:generateDependenciesReport - - set -x - $WORKSPACE/x-pack/plugin/sql/connectors/tableau/package.sh asm qualifier="$VERSION_SUFFIX" - - # we regenerate this file as part of the release manager invocation - rm $WORKSPACE/build/distributions/elasticsearch-jdbc-${ES_VERSION}${VERSION_SUFFIX}.taco.sha512 - - # Allow other users access to read the artifacts so they are readable in the - # container - find $WORKSPACE -type f -path "*/build/distributions/*" -exec chmod a+r {} \; - - # Allow other users write access to create checksum files - find $WORKSPACE -type d -path "*/build/distributions" -exec chmod a+w {} \; - - # Artifacts should be generated - docker run --rm \ - --name release-manager \ - -e VAULT_ADDR \ - -e VAULT_ROLE_ID \ - -e VAULT_SECRET_ID \ - --mount type=bind,readonly=false,src="$PWD",target=/artifacts \ - docker.elastic.co/infra/release-manager:latest \ - cli collect \ - --project elasticsearch \ - --branch "$RM_BRANCH" \ - --commit "$GIT_COMMIT" \ - --workflow "$WORKFLOW" \ - --version "$ES_VERSION" \ - --artifact-set main \ - --dependency beats:https://artifacts-${WORKFLOW}.elastic.co/beats/${BEATS_BUILD_ID}/manifest-${ES_VERSION}${VERSION_SUFFIX}.json \ - --dependency ml-cpp:https://artifacts-${WORKFLOW}.elastic.co/ml-cpp/${ML_CPP_BUILD_ID}/manifest-${ES_VERSION}${VERSION_SUFFIX}.json