Skip to content

Commit

Permalink
removed asdf setup (#39907)
Browse files Browse the repository at this point in the history
Updated metricbeat pipeline to match common styling && steps from Jenkins
  • Loading branch information
oakrizan authored Jun 17, 2024
1 parent 7948ba4 commit b398af8
Showing 1 changed file with 49 additions and 51 deletions.
100 changes: 49 additions & 51 deletions .buildkite/metricbeat/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
name: "beats-metricbeat"

env:
AWS_ARM_INSTANCE_TYPE: "t4g.xlarge"
AWS_ARM_INSTANCE_TYPE: "m6g.xlarge"
AWS_IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2204-aarch64"

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_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2204-aarch64"
IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204"
IMAGE_WIN_10: "family/platform-ingest-beats-windows-10"
IMAGE_WIN_11: "family/platform-ingest-beats-windows-11"
Expand All @@ -32,10 +32,13 @@ env:
steps:
- group: "Metricbeat Mandatory Tests"
key: "metricbeat-mandatory-tests"

steps:
- label: ":linux: Ubuntu Unit Tests"
- label: ":ubuntu: Metricbeat Unit Tests"
key: "mandatory-linux-unit-test"
command: "cd metricbeat && mage build unitTest"
command: |
cd metricbeat
mage build unitTest
retry:
automatic:
- limit: 3
Expand All @@ -48,27 +51,20 @@ steps:
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Ubuntu Unit Tests"
context: "metricbeat: Linux x86_64 Unit Tests"

- label: ":go: Go Integration Tests"
- label: ":ubuntu: Metricbeat Go Integration Tests"
key: "mandatory-int-test"
command: |
set -euo pipefail
# defines the MODULE env var based on what's changed in a PR
source .buildkite/scripts/changesets.sh
defineModuleFromTheChangeSet metricbeat
echo "~~~ Running tests"
# TODO move this section to base image / pre-command hook
echo "~~~ Installing kind"
asdf plugin add kind
asdf install kind $ASDF_KIND_VERSION
.buildkite/deploy/kubernetes/scripts/kind-setup.sh
echo "~~~ Running tests"
export KUBECONFIG="$$PWD/kubecfg"
cd metricbeat && mage goIntegTest
cd metricbeat
mage goIntegTest
retry:
automatic:
- limit: 3
Expand All @@ -83,25 +79,18 @@ steps:
- github_commit_status:
context: "metricbeat: Go Integration Tests"

- label: ":python: Python Integration Tests"
- label: ":ubuntu: Metricbeat Python Integration Tests"
key: "mandatory-python-int-test"
command: |
set -euo pipefail
# defines the MODULE env var based on what's changed in a PR
source .buildkite/scripts/changesets.sh
defineModuleFromTheChangeSet metricbeat
echo "~~~ Running tests"
# TODO move this section to base image / pre-command hook
echo "~~~ Installing kind"
asdf plugin add kind
asdf install kind $ASDF_KIND_VERSION
.buildkite/deploy/kubernetes/scripts/kind-setup.sh
echo "~~~ Running tests"
export KUBECONFIG="$$PWD/kubecfg"
cd metricbeat && mage pythonIntegTest
cd metricbeat
mage pythonIntegTest
retry:
automatic:
- limit: 3
Expand All @@ -116,7 +105,7 @@ steps:
- github_commit_status:
context: "metricbeat: Python Integration Tests"

- label: ":negative_squared_cross_mark: Cross compile"
- label: ":ubuntu: Metricbeat Crosscompile"
key: "mandatory-cross-compile"
command: "make -C metricbeat crosscompile"
retry:
Expand All @@ -131,9 +120,9 @@ steps:
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Cross compile"
context: "metricbeat: Crosscompile"

- label: ":windows: Windows 2016 Unit Tests"
- label: ":windows: Metricbeat Win-2016 Unit Tests"
command: |
Set-Location -Path metricbeat
mage build unitTest
Expand All @@ -152,9 +141,9 @@ steps:
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Windows 2016 Unit Tests"
context: "metricbeat: Win-2016 Unit Tests"

- label: ":windows: Windows 2022 Unit Tests"
- label: ":windows: Metricbeat Win-2022 Unit Tests"
command: |
Set-Location -Path metricbeat
mage build unitTest
Expand All @@ -173,13 +162,14 @@ steps:
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Windows 2022 Unit Tests"
context: "metricbeat: Win-2022 Unit Tests"

- group: "Metricbeat Extended Windows Tests"
key: "metricbeat-extended-win-tests"
if: build.env("BUILDKITE_PULL_REQUEST") == "false" || build.env("GITHUB_PR_LABELS") =~ /.*[Ww]indows.*/

steps:
- label: ":windows: Windows 10 Unit Tests"
- label: ":windows: Metricbeat Win 10 Unit Tests"
command: |
Set-Location -Path metricbeat
mage build unitTest
Expand All @@ -198,9 +188,9 @@ steps:
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Extended Windows 10 Unit Tests"
context: "metricbeat: Win 10 Unit Tests"

- label: ":windows: Windows 11 Unit Tests"
- label: ":windows: Metricbeat Win 11 Unit Tests"
command: |
Set-Location -Path metricbeat
mage build unitTest
Expand All @@ -219,9 +209,9 @@ steps:
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Extended Windows 11 Unit Tests"
context: "metricbeat: Win 11 Unit Tests"

- label: ":windows: Windows 2019 Unit Tests"
- label: ":windows: Metricbeat Win-2019 Unit Tests"
command: |
Set-Location -Path metricbeat
mage build unitTest
Expand All @@ -240,18 +230,20 @@ steps:
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Extended Windows 2019 Unit Tests"
context: "metricbeat: Win-2019 Unit Tests"

- group: "Metricbeat Extended MacOS Tests"
- group: "Metricbeat Extended macOS Tests"
key: "metricbeat-extended-macos-tests"
if: build.env("BUILDKITE_PULL_REQUEST") == "false" || build.env("GITHUB_PR_LABELS") =~ /.*macOS.*/

steps:
- label: ":mac: MacOS x64_64 Unit Tests"
- label: ":mac: Metricbeat macOS x64_64 Unit Tests"
key: "extended-macos-x64-64-unit-tests"
command: |
set -euo pipefail
source .buildkite/scripts/install_macos_tools.sh
cd metricbeat && mage build unitTest
cd metricbeat
mage build unitTest
retry:
automatic:
- limit: 3
Expand All @@ -263,15 +255,17 @@ steps:
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Extended MacOS x86_64 Unit Tests"
context: "metricbeat: macOS x86_64 Unit Tests"

- label: ":mac: MacOS arm64 Unit Tests"
- label: ":mac: Metricbeat macOS arm64 Unit Tests"
key: "extended-macos-arm64-unit-tests"
skip: "due to https://github.com/elastic/beats/issues/33035"
skip: "Skipping due to elastic/beats#33035"
# https://github.com/elastic/beats/issues/33035
command: |
set -euo pipefail
source .buildkite/scripts/install_macos_tools.sh
cd metricbeat && mage build unitTest
cd metricbeat
mage build unitTest
retry:
automatic:
- limit: 3
Expand All @@ -283,7 +277,7 @@ steps:
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Extended MacOS arm64 Unit Tests"
context: "metricbeat: macOS arm64 Unit Tests"

- wait: ~
# with PRs, we want to run packaging only if mandatory tests succeed
Expand All @@ -295,9 +289,11 @@ steps:
- group: "Metricbeat Packaging"
key: "metricbeat-packaging"
steps:
- label: ":linux: Packaging Linux"
- label: ":ubuntu: Metricbeat Packaging Linux"
key: "packaging-linux"
command: "cd metricbeat && mage package"
command: |
cd metricbeat
mage package
retry:
automatic:
- limit: 3
Expand All @@ -314,20 +310,22 @@ steps:
- github_commit_status:
context: "metricbeat: Packaging Linux"

- label: ":linux: Packaging ARM"
- label: ":ubuntu: Metricbeat Packaging Linux arm64"
key: "packaging-arm"
command: "cd metricbeat && mage package"
command: |
cd metricbeat
mage package
retry:
automatic:
- limit: 3
timeout_in_minutes: 20
agents:
provider: "aws"
imagePrefix: "${IMAGE_UBUNTU_ARM_64}"
imagePrefix: "${AWS_IMAGE_UBUNTU_ARM_64}"
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
env:
PLATFORMS: "linux/arm64"
PACKAGES: "docker"
notify:
- github_commit_status:
context: "metricbeat: Packaging Linux ARM"
context: "metricbeat: Packaging Linux arm64"

0 comments on commit b398af8

Please sign in to comment.