From 0d3a8b68d95e472f4ab8e9e643a21e482c898cca Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Thu, 18 Apr 2024 11:53:10 +0200 Subject: [PATCH] [CI] x-pack/heartbeat monorepo (#38845) Use mono repo plugin for xpack/heartbeat Relates: https://github.com/elastic/ingest-dev/issues/3072 --------- Co-authored-by: Dimitrios Liappis --- .buildkite/pipeline.yml | 27 ++ .buildkite/scripts/common.sh | 18 +- .../generate_xpack_heartbeat_pipeline.sh | 213 -------------- .buildkite/scripts/install_macos_tools.sh | 5 + .buildkite/scripts/setenv.sh | 12 +- .../x-pack/pipeline.xpack.heartbeat.yml | 261 +++++++++++++++--- 6 files changed, 273 insertions(+), 263 deletions(-) delete mode 100755 .buildkite/scripts/generate_xpack_heartbeat_pipeline.sh diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index ddca6e022d7b..63acda710aa6 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -312,3 +312,30 @@ steps: - BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST} - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + + - label: "Trigger x-pack/heartbeat" + plugins: + - monorepo-diff#v1.0.1: + diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" + watch: + - path: + - x-pack/heartbeat/ + - .buildkite/x-pack/pipeline.xpack.heartbeat.yml + - .buildkite/scripts/ + - .buildkite/hooks/ + # x-pack + - go.mod + - pytest.ini + - dev-tools/ + - libbeat/ + - testing/ + - x-pack/libbeat/ + config: + trigger: "beats-xpack-heartbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + env: + - BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST} + - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} + - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} diff --git a/.buildkite/scripts/common.sh b/.buildkite/scripts/common.sh index c99eb6ec998c..cf323739e7a5 100755 --- a/.buildkite/scripts/common.sh +++ b/.buildkite/scripts/common.sh @@ -18,7 +18,12 @@ XPACK_MODULE_PATTERN="^x-pack\\/[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*" [ -z "${run_xpack_libbeat+x}" ] && run_xpack_libbeat="$(buildkite-agent meta-data get run_xpack_libbeat --default "false")" [ -z "${run_xpack_metricbeat+x}" ] && run_xpack_metricbeat="$(buildkite-agent meta-data get run_xpack_metricbeat --default "false")" [ -z "${run_xpack_packetbeat+x}" ] && run_xpack_packetbeat="$(buildkite-agent meta-data get run_xpack_packetbeat --default "false")" +<<<<<<< HEAD +[ -z "${run_xpack_filebeat+x}" ] && run_xpack_filebeat="$(buildkite-agent meta-data get run_xpack_filebeat --default "false")" + +======= [ -z "${run_xpack_heartbeat+x}" ] && run_xpack_heartbeat="$(buildkite-agent meta-data get run_xpack_heartbeat --default "false")" +>>>>>>> main # define if needed run ARM platform-specific tests for the particular beat [ -z "${run_filebeat_arm_tests+x}" ] && run_filebeat_arm_tests="$(buildkite-agent meta-data get run_filebeat_arm_tests --default "false")" [ -z "${run_packetbeat_arm_tests+x}" ] && run_packetbeat_arm_tests="$(buildkite-agent meta-data get run_packetbeat_arm_tests --default "false")" @@ -28,7 +33,6 @@ XPACK_MODULE_PATTERN="^x-pack\\/[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*" [ -z "${run_packetbeat_macos_tests+x}" ] && run_packetbeat_macos_tests="$(buildkite-agent meta-data get run_packetbeat_macos_tests --default "false")" [ -z "${run_xpack_metricbeat_macos_tests+x}" ] && run_xpack_metricbeat_macos_tests="$(buildkite-agent meta-data get run_xpack_metricbeat_macos_tests --default "false")" [ -z "${run_xpack_packetbeat_macos_tests+x}" ] && run_xpack_packetbeat_macos_tests="$(buildkite-agent meta-data get run_xpack_packetbeat_macos_tests --default "false")" -[ -z "${run_xpack_heartbeat_macos_tests+x}" ] && run_xpack_heartbeat_macos_tests="$(buildkite-agent meta-data get run_xpack_heartbeat_macos_tests --default "false")" # define if needed run cloud-specific tests for the particular beat [ -z "${run_xpack_metricbeat_aws_tests+x}" ] && run_xpack_metricbeat_aws_tests="$(buildkite-agent meta-data get run_xpack_metricbeat_aws_tests --default "false")" @@ -49,8 +53,13 @@ xpack_dockerlogbeat_changeset=( "^x-pack/dockerlogbeat/.*" ) +<<<<<<< HEAD +xpack_filebeat_changeset=( + "^x-pack/filebeat/.*" +======= xpack_heartbeat_changeset=( "^x-pack/heartbeat/.*" +>>>>>>> main ) xpack_libbeat_changeset=( @@ -106,8 +115,13 @@ case "${BUILDKITE_PIPELINE_SLUG}" in "beats-winlogbeat") BEAT_CHANGESET_REFERENCE=${winlogbeat_changeset[@]} ;; +<<<<<<< HEAD + "beats-xpack-filebeat") + BEAT_CHANGESET_REFERENCE=${xpack_filebeat_changeset[@]} +======= "beats-xpack-heartbeat") BEAT_CHANGESET_REFERENCE=${xpack_heartbeat_changeset[@]} +>>>>>>> main ;; "beats-xpack-libbeat") BEAT_CHANGESET_REFERENCE=${xpack_libbeat_changeset[@]} @@ -368,7 +382,7 @@ are_conditions_met_arm_tests() { are_conditions_met_macos_tests() { if are_conditions_met_mandatory_tests; then #from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/Jenkinsfile#L145-L171 - if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-packetbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-metricbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-heartbeat" ]] ; then + if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-packetbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-metricbeat" ]]; then if [[ "${GITHUB_PR_TRIGGER_COMMENT}" == "${BEATS_GH_MACOS_COMMENT}" || "${GITHUB_PR_LABELS}" =~ ${BEATS_GH_MACOS_LABEL} || "${!TRIGGER_SPECIFIC_MACOS_TESTS}" == "true" ]]; then # from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/metricbeat/Jenkinsfile.yml#L3-L12 return 0 fi diff --git a/.buildkite/scripts/generate_xpack_heartbeat_pipeline.sh b/.buildkite/scripts/generate_xpack_heartbeat_pipeline.sh deleted file mode 100755 index 94eed4f7c6a7..000000000000 --- a/.buildkite/scripts/generate_xpack_heartbeat_pipeline.sh +++ /dev/null @@ -1,213 +0,0 @@ -#!/usr/bin/env bash - -source .buildkite/scripts/common.sh - -set -euo pipefail - -pipelineName="pipeline.xpack-heartbeat-dynamic.yml" - -echo "Add the mandatory and extended tests without additional conditions into the pipeline" -if are_conditions_met_mandatory_tests; then - cat > $pipelineName <<- YAML -steps: - - group: "Mandatory Tests" - key: "mandatory-tests" - steps: - - label: ":linux: Ubuntu Unit Tests" - key: "mandatory-linux-unit-test" - command: "cd $BEATS_PROJECT_NAME && mage build unitTest" - agents: - provider: "gcp" - image: "${IMAGE_UBUNTU_X86_64}" - machineType: "${GCP_DEFAULT_MACHINE_TYPE}" - artifact_paths: - - "$BEATS_PROJECT_NAME/build/*.xml" - - "$BEATS_PROJECT_NAME/build/*.json" - notify: - - github_commit_status: - context: "$BEATS_PROJECT_NAME: Ubuntu Unit Tests" - - - label: ":go: Go Integration Tests" - key: "mandatory-int-test" - command: "cd $BEATS_PROJECT_NAME && mage goIntegTest" - agents: - provider: "gcp" - image: "${IMAGE_UBUNTU_X86_64}" - machineType: "${GCP_HI_PERF_MACHINE_TYPE}" - artifact_paths: - - "$BEATS_PROJECT_NAME/build/*.xml" - - "$BEATS_PROJECT_NAME/build/*.json" - notify: - - github_commit_status: - context: "$BEATS_PROJECT_NAME: Go Integration Tests" - - ####### skip: "see elastic/beats#23957 and elastic/beats#23958" - # - label: ":windows: Windows 2016 Unit Tests" - # command: | - # Set-Location -Path $BEATS_PROJECT_NAME - # mage build unitTest - # key: "mandatory-win-2016-unit-tests" - # agents: - # provider: "gcp" - # image: "${IMAGE_WIN_2016}" - # machine_type: "${GCP_WIN_MACHINE_TYPE}" - # disk_size: 100 - # disk_type: "pd-ssd" - # artifact_paths: - # - "$BEATS_PROJECT_NAME/build/*.xml" - # - "$BEATS_PROJECT_NAME/build/*.json" - # notify: - # - github_commit_status: - # context: "$BEATS_PROJECT_NAME: Windows 2016 Unit Tests" - - # - label: ":windows: Windows 2022 Unit Tests" - # command: | - # Set-Location -Path $BEATS_PROJECT_NAME - # mage build unitTest - # key: "mandatory-win-2022-unit-tests" - # agents: - # provider: "gcp" - # image: "${IMAGE_WIN_2022}" - # machine_type: "${GCP_WIN_MACHINE_TYPE}" - # disk_size: 100 - # disk_type: "pd-ssd" - # artifact_paths: - # - "$BEATS_PROJECT_NAME/build/*.xml" - # - "$BEATS_PROJECT_NAME/build/*.json" - # notify: - # - github_commit_status: - # context: "$BEATS_PROJECT_NAME: Windows 2022 Unit Tests" - - # - group: "Extended Windows Tests" ## TODO: this condition will be changed in the Phase 3 - # key: "extended-win-tests" - # steps: - # - label: ":windows: Windows 10 Unit Tests" - # command: | - # Set-Location -Path $BEATS_PROJECT_NAME - # mage build unitTest - # key: "extended-win-10-unit-tests" - # agents: - # provider: "gcp" - # image: "${IMAGE_WIN_10}" - # machineType: "${GCP_WIN_MACHINE_TYPE}" - # disk_size: 100 - # disk_type: "pd-ssd" - # artifact_paths: - # - "$BEATS_PROJECT_NAME/build/*.xml" - # - "$BEATS_PROJECT_NAME/build/*.json" - # notify: - # - github_commit_status: - # context: "$BEATS_PROJECT_NAME: Windows 10 Unit Tests" - - # - label: ":windows: Windows 11 Unit Tests" - # command: | - # Set-Location -Path $BEATS_PROJECT_NAME - # mage build unitTest - # key: "extended-win-11-unit-tests" - # agents: - # provider: "gcp" - # image: "${IMAGE_WIN_11}" - # machineType: "${GCP_WIN_MACHINE_TYPE}" - # disk_size: 100 - # disk_type: "pd-ssd" - # artifact_paths: - # - "$BEATS_PROJECT_NAME/build/*.xml" - # - "$BEATS_PROJECT_NAME/build/*.json" - # notify: - # - github_commit_status: - # context: "$BEATS_PROJECT_NAME: Windows 11 Unit Tests" - - # - label: ":windows: Windows 2019 Unit Tests" - # command: | - # Set-Location -Path $BEATS_PROJECT_NAME - # mage build unitTest - # key: "extended-win-2019-unit-tests" - # agents: - # provider: "gcp" - # image: "${IMAGE_WIN_2019}" - # machineType: "${GCP_WIN_MACHINE_TYPE}" - # disk_size: 100 - # disk_type: "pd-ssd" - # artifact_paths: - # - "$BEATS_PROJECT_NAME/build/*.xml" - # - "$BEATS_PROJECT_NAME/build/*.json" - # notify: - # - github_commit_status: - # context: "$BEATS_PROJECT_NAME: Windows 2019 Unit Tests" - ####### skip: "see elastic/beats#23957 and elastic/beats#23958" - -YAML -else - echo "The conditions don't match to requirements for generating pipeline steps." - exit 0 -fi - -if are_conditions_met_macos_tests; then - cat >> $pipelineName <<- YAML - - group: "Extended Tests" - key: "extended-tests" - steps: - - label: ":mac: MacOS Unit Tests" - key: "extended-macos-unit-tests" - command: ".buildkite/scripts/unit_tests.sh" - agents: - provider: "orka" - imagePrefix: "${IMAGE_MACOS_X86_64}" - artifact_paths: - - "$BEATS_PROJECT_NAME/build/*.xml" - - "$BEATS_PROJECT_NAME/build/*.json" - notify: - - github_commit_status: - context: "$BEATS_PROJECT_NAME: MacOS Unit Tests" - -YAML -fi - -echo "Check and add the Packaging into the pipeline" -if are_conditions_met_packaging; then - cat >> $pipelineName <<- YAML - - wait: ~ - depends_on: - - step: "mandatory-tests" - allow_failure: false - - - group: "Packaging" # TODO: check conditions for future the main pipeline migration: https://github.com/elastic/beats/pull/28589 - key: "packaging" - steps: - - label: ":linux: Packaging Linux" - key: "packaging-linux" - command: "cd $BEATS_PROJECT_NAME && mage package" - agents: - provider: "gcp" - image: "${IMAGE_UBUNTU_X86_64}" - machineType: "${GCP_HI_PERF_MACHINE_TYPE}" - disk_size: 100 - disk_type: "pd-ssd" - env: - PLATFORMS: "${PACKAGING_PLATFORMS}" - notify: - - github_commit_status: - context: "$BEATS_PROJECT_NAME: Packaging Linux" - - - label: ":linux: Packaging ARM" - key: "packaging-arm" - command: "cd $BEATS_PROJECT_NAME && mage package" - agents: - provider: "aws" - imagePrefix: "${IMAGE_UBUNTU_ARM_64}" - instanceType: "${AWS_ARM_INSTANCE_TYPE}" - env: - PLATFORMS: "${PACKAGING_ARM_PLATFORMS}" - PACKAGES: "docker" - notify: - - github_commit_status: - context: "$BEATS_PROJECT_NAME: Packaging Linux ARM" - -YAML -fi - -echo "+++ Printing dynamic steps" -yq . -P -e $pipelineName || (echo "Yaml formatting error, below is the YAML"; cat $pipelineName; exit 1) - -echo "--- Loading dynamic steps" -buildkite-agent pipeline upload $pipelineName diff --git a/.buildkite/scripts/install_macos_tools.sh b/.buildkite/scripts/install_macos_tools.sh index 124025b4a5ad..4572afb4cdc5 100755 --- a/.buildkite/scripts/install_macos_tools.sh +++ b/.buildkite/scripts/install_macos_tools.sh @@ -133,3 +133,8 @@ with_go "${GO_VERSION}" with_mage with_python config_git + +# prevent "OSError: [Errno 24] Too many open files" on macOS +ulimit -Sn 150000 +echo "~~~ Setting ulimit: $(ulimit)" +echo "~~~ Resuming commands" diff --git a/.buildkite/scripts/setenv.sh b/.buildkite/scripts/setenv.sh index 81d00eb5dea4..f806b131a7a1 100755 --- a/.buildkite/scripts/setenv.sh +++ b/.buildkite/scripts/setenv.sh @@ -49,18 +49,8 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-metricbeat" || "$BUILDKITE_PIPELINE_S export TEST_TAGS="${TEST_TAGS:+$TEST_TAGS,}oracle" fi -if [[ "$BUILDKITE_STEP_KEY" == "xpack-winlogbeat-pipeline" || "$BUILDKITE_STEP_KEY" == "xpack-metricbeat-pipeline" || "$BUILDKITE_STEP_KEY" == "xpack-dockerlogbeat-pipeline" || "$BUILDKITE_STEP_KEY" == "metricbeat-pipeline" || "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-heartbeat" ]]; then +if [[ "$BUILDKITE_STEP_KEY" == "xpack-winlogbeat-pipeline" || "$BUILDKITE_STEP_KEY" == "xpack-metricbeat-pipeline" || "$BUILDKITE_STEP_KEY" == "xpack-dockerlogbeat-pipeline" || "$BUILDKITE_STEP_KEY" == "metricbeat-pipeline" ]]; then source .buildkite/scripts/common.sh - if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-heartbeat" ]]; then - export ELASTIC_SYNTHETICS_CAPABLE=true - else - # Set the MODULE env variable if possible, it should be defined before generating pipeline's steps. It is used in multiple pipelines. - defineModuleFromTheChangeSet "${BEATS_PROJECT_NAME}" - fi -fi - -if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-heartbeat" ]]; then # Set the MODULE env variable if possible, it should be defined before generating pipeline's steps. It is used in multiple pipelines. - source .buildkite/scripts/common.sh defineModuleFromTheChangeSet "${BEATS_PROJECT_NAME}" fi diff --git a/.buildkite/x-pack/pipeline.xpack.heartbeat.yml b/.buildkite/x-pack/pipeline.xpack.heartbeat.yml index 1b04fcf99225..107dfa65f1b2 100644 --- a/.buildkite/x-pack/pipeline.xpack.heartbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.heartbeat.yml @@ -3,10 +3,11 @@ name: "beats-xpack-heartbeat" env: AWS_ARM_INSTANCE_TYPE: "t4g.xlarge" - BEATS_PROJECT_NAME: "x-pack/heartbeat" + GCP_DEFAULT_MACHINE_TYPE: "c2d-highcpu-8" GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16" GCP_WIN_MACHINE_TYPE: "n2-standard-8" + IMAGE_MACOS_ARM: "generic-13-ventura-arm" IMAGE_MACOS_X86_64: "generic-13-ventura-x64" IMAGE_RHEL9_X86_64: "family/platform-ingest-beats-rhel-9" @@ -18,46 +19,232 @@ env: IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019" IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022" - #Packaging - PACKAGING_ARM_PLATFORMS: "linux/arm64" - PACKAGING_PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64 darwin/arm64" + # pipeline specific + ELASTIC_SYNTHETICS_CAPABLE: "true" - #Deps + # Other deps ASDF_MAGE_VERSION: 1.15.0 + ASDF_NODEJS_VERSION: 18.17.1 steps: + - group: "x-pack/heartbeat Mandatory Tests" + key: "x-pack-heartbeat-mandatory-tests" + steps: + - label: ":linux: Ubuntu Unit Tests" + key: "mandatory-linux-unit-test" + command: | + set -euo pipefail + echo "~~~ Installing @elastic/synthetics" + npm install -g @elastic/synthetics + echo "~~~ Running tests" + cd x-pack/heartbeat + mage build unitTest + agents: + provider: "gcp" + image: "${IMAGE_UBUNTU_X86_64}" + machineType: "${GCP_DEFAULT_MACHINE_TYPE}" + artifact_paths: + - "x-pack/heartbeat/build/*.xml" + - "x-pack/heartbeat/build/*.json" + notify: + - github_commit_status: + context: "x-pack/heartbeat: Ubuntu Unit Tests" + + - label: ":go: Go Integration Tests" + key: "mandatory-int-test" + command: | + set -euo pipefail + echo "~~~ Installing @elastic/synthetics" + npm install -g @elastic/synthetics + echo "~~~ Running tests" + cd x-pack/heartbeat + mage goIntegTest + agents: + provider: "gcp" + image: "${IMAGE_UBUNTU_X86_64}" + machineType: "${GCP_HI_PERF_MACHINE_TYPE}" + artifact_paths: + - "x-pack/heartbeat/build/*.xml" + - "x-pack/heartbeat/build/*.json" + notify: + - github_commit_status: + context: "x-pack/heartbeat: Go Integration Tests" + + - label: ":windows: Windows 2016 Unit Tests" + key: "mandatory-win-2016-unit-tests" + skip: "skipping due to elastic/beats#23957 and elastic/beats#23958" + command: | + Set-Location -Path x-pack/heartbeat + mage build unitTest + agents: + provider: "gcp" + image: "${IMAGE_WIN_2016}" + machine_type: "${GCP_WIN_MACHINE_TYPE}" + disk_size: 100 + disk_type: "pd-ssd" + artifact_paths: + - "x-pack/heartbeat/build/*.xml" + - "x-pack/heartbeat/build/*.json" + notify: + - github_commit_status: + context: "x-pack/heartbeat: Windows 2016 Unit Tests" + + - label: ":windows: Windows 2022 Unit Tests" + key: "mandatory-win-2022-unit-tests" + skip: "skipping due to elastic/beats#23957 and elastic/beats#23958" + command: | + Set-Location -Path x-pack/heartbeat + mage build unitTest + agents: + provider: "gcp" + image: "${IMAGE_WIN_2022}" + machine_type: "${GCP_WIN_MACHINE_TYPE}" + disk_size: 100 + disk_type: "pd-ssd" + artifact_paths: + - "x-pack/heartbeat/build/*.xml" + - "x-pack/heartbeat/build/*.json" + notify: + - github_commit_status: + context: "x-pack/heartbeat: Windows 2022 Unit Tests" - - input: "Input Parameters" - key: "force-run-stages" - fields: - - select: "Heartbeat - run_xpack_heartbeat" - key: "run_xpack_heartbeat" - options: - - label: "True" - value: "true" - - label: "False" - value: "false" - default: "false" - - select: "Heartbeat - run_xpack_heartbeat_macos_tests" - key: "run_xpack_heartbeat_macos_tests" - options: - - label: "True" - value: "true" - - label: "False" - value: "false" - default: "false" - - if: "build.source == 'ui'" + - group: "x-pack/heartbeat Extended Windows Tests" + key: "x-pack-heartbeat-extended-win-tests" + if: build.env("BUILDKITE_PULL_REQUEST") == "false" || build.env("GITHUB_PR_LABELS") =~ /.*[Ww]indows.*/ + skip: "skipping due to elastic/beats#23957 and elastic/beats#23958" + steps: + - label: ":windows: Windows 10 Unit Tests" + command: | + Set-Location -Path x-pack/heartbeat + mage build test + key: "extended-win-10-unit-tests" + agents: + provider: "gcp" + image: "${IMAGE_WIN_10}" + machineType: "${GCP_WIN_MACHINE_TYPE}" + disk_size: 100 + disk_type: "pd-ssd" + artifact_paths: + - "x-pack/heartbeat/build/*.xml" + - "x-pack/heartbeat/build/*.json" + notify: + - github_commit_status: + context: "x-pack/heartbeat: Windows 10 Unit Tests" + + - label: ":windows: Windows 11 Unit Tests" + command: | + Set-Location -Path x-pack/heartbeat + mage build test + key: "extended-win-11-unit-tests" + agents: + provider: "gcp" + image: "${IMAGE_WIN_11}" + machineType: "${GCP_WIN_MACHINE_TYPE}" + disk_size: 100 + disk_type: "pd-ssd" + artifact_paths: + - "x-pack/heartbeat/build/*.xml" + - "x-pack/heartbeat/build/*.json" + notify: + - github_commit_status: + context: "x-pack/heartbeat: Windows 11 Unit Tests" + + - label: ":windows: Windows 2019 Unit Tests" + command: | + Set-Location -Path x-pack/heartbeat + mage build test + key: "extended-win-2019-unit-tests" + agents: + provider: "gcp" + image: "${IMAGE_WIN_2019}" + machineType: "${GCP_WIN_MACHINE_TYPE}" + disk_size: 100 + disk_type: "pd-ssd" + artifact_paths: + - "x-pack/heartbeat/build/*.xml" + - "x-pack/heartbeat/build/*.json" + notify: + - github_commit_status: + context: "x-pack/heartbeat: Windows 2019 Unit Tests" + + - group: "x-pack/heartbeat MacOS Extended Tests" + key: "x-pack-heartbeat-extended-tests-macos" + if: build.env("BUILDKITE_PULL_REQUEST") == "false" || build.env("GITHUB_PR_LABELS") =~ /.*macOS.*/ + steps: + - label: ":mac: MacOS x86_64 Unit Tests" + command: | + set -euo pipefail + source .buildkite/scripts/install_macos_tools.sh + withNodeJSEnv $ASDF_NODEJS_VERSION + installNodeJsDependencies + cd x-pack/heartbeat + mage build unitTest + agents: + provider: "orka" + imagePrefix: "${IMAGE_MACOS_X86_64}" + artifact_paths: + - "x-pack/heartbeat/build/*.xml" + - "x-pack/heartbeat/build/*.json" + notify: + - github_commit_status: + context: "x-pack/heartbeat: MacOS x86_64 Extended Tests" + + - label: ":mac: MacOS arm64 Unit Tests" + command: | + set -euo pipefail + source .buildkite/scripts/install_macos_tools.sh + withNodeJSEnv $ASDF_NODEJS_VERSION + installNodeJsDependencies + cd x-pack/heartbeat + mage build unitTest + agents: + provider: "orka" + imagePrefix: "${IMAGE_MACOS_ARM}" + artifact_paths: + - "x-pack/heartbeat/build/*.xml" + - "x-pack/heartbeat/build/*.json" + notify: + - github_commit_status: + context: "x-pack/heartbeat: MacOS arm64 Extended Tests" - wait: ~ - if: "build.source == 'ui'" - allow_dependency_failure: false - - - label: ":linux: Load dynamic x-pack heartbeat pipeline" - key: "xpack-heartbeat-pipeline" - command: ".buildkite/scripts/generate_xpack_heartbeat_pipeline.sh" - agents: - image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci:latest" - notify: - - github_commit_status: - context: "${BEATS_PROJECT_NAME}: Load dynamic pipeline's steps" + if: build.env("BUILDKITE_PULL_REQUEST") != "false" + depends_on: + - step: "x-pack-heartbeat-mandatory-tests" + + - group: "Packaging" + key: "packaging" + if: build.env("BUILDKITE_PULL_REQUEST") != "false" + steps: + - label: ":linux: Packaging Linux" + key: "packaging-linux" + command: | + cd x-pack/heartbeat + mage package + agents: + provider: "gcp" + image: "${IMAGE_UBUNTU_X86_64}" + machineType: "${GCP_HI_PERF_MACHINE_TYPE}" + disk_size: 100 + disk_type: "pd-ssd" + env: + PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64 darwin/arm64" + notify: + - github_commit_status: + context: "x-pack/heartbeat: Packaging Linux" + + - label: ":linux: Packaging ARM" + key: "packaging-arm" + command: | + cd x-pack/heartbeat + mage package + agents: + provider: "aws" + imagePrefix: "${IMAGE_UBUNTU_ARM_64}" + instanceType: "${AWS_ARM_INSTANCE_TYPE}" + env: + PLATFORMS: "linux/arm64" + PACKAGES: "docker" + notify: + - github_commit_status: + context: "x-pack/heartbeat: Packaging Linux ARM"