From f7a75690d8a1d9137300828019a7f0c64ccff1d6 Mon Sep 17 00:00:00 2001 From: Olga Naidjonoka Date: Mon, 14 Oct 2024 11:46:05 +0300 Subject: [PATCH] updated scripts && enbaled macos step --- .buildkite/hooks/pre-command | 5 +- .../scripts/agentbeat/setup_agentbeat.py | 2 +- .../x-pack/pipeline.xpack.agentbeat.yml | 110 +++++++++--------- 3 files changed, 60 insertions(+), 57 deletions(-) diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index a6e5cd8750ef..a6755d9df3c1 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -18,7 +18,10 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-packetbeat" && "$BUILDKITE_STEP export PRIVATE_CI_GCS_CREDENTIALS_SECRET fi -if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-agentbeat" ]]; then +if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-agentbeat" && "$BUILDKITE_STEP_KEY" == *"agentbeat-it"* ]]; then + if [[ "$BUILDKITE_STEP_KEY" == *"macos"* ]]; then + ulimit -Sn 10000 + fi AGENTBEAT_PATH=$(.buildkite/scripts/agentbeat/setup_agentbeat.py) export AGENTBEAT_PATH fi diff --git a/.buildkite/scripts/agentbeat/setup_agentbeat.py b/.buildkite/scripts/agentbeat/setup_agentbeat.py index 62e8c3bbd2cd..0c82c16021f5 100755 --- a/.buildkite/scripts/agentbeat/setup_agentbeat.py +++ b/.buildkite/scripts/agentbeat/setup_agentbeat.py @@ -48,7 +48,7 @@ def download_agentbeat(pattern, path) -> str: try: subprocess.run( ['buildkite-agent', 'artifact', 'download', pattern, '.', - '--build', '01924d2b-b061-45ae-a106-e885584ff26f', + # '--build', '01924d2b-b061-45ae-a106-e885584ff26f', '--step', 'agentbeat-package-linux'], check=True, stdout=sys.stdout, stderr=sys.stderr, text=True) except subprocess.CalledProcessError: diff --git a/.buildkite/x-pack/pipeline.xpack.agentbeat.yml b/.buildkite/x-pack/pipeline.xpack.agentbeat.yml index 95c091fe0530..4cf23fdffd0c 100644 --- a/.buildkite/x-pack/pipeline.xpack.agentbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.agentbeat.yml @@ -15,19 +15,19 @@ env: AGENTBEAT_SPEC: "./agentbeat.spec.yml" steps: -# - group: "Check/Update" -# key: "x-pack-agentbeat-check-update" -# -# steps: -# - label: "agentbeat: Run pre-commit" -# command: "pre-commit run --all-files" -# agents: -# image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" -# memory: "2Gi" -# useCustomGlobalHooks: true -# notify: -# - github_commit_status: -# context: "agentbeat: pre-commit" + - group: "Check/Update" + key: "x-pack-agentbeat-check-update" + + steps: + - label: "agentbeat: Run pre-commit" + command: "pre-commit run --all-files" + agents: + image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}" + memory: "2Gi" + useCustomGlobalHooks: true + notify: + - github_commit_status: + context: "agentbeat: pre-commit" # - wait: ~ # # with PRs, we want to run mandatory tests only if check/update step succeed @@ -40,32 +40,32 @@ steps: key: "agentbeat-mandatory-tests" steps: -# - label: ":linux: Agentbeat packaging Linux" -# key: "agentbeat-package-linux" -# env: -# PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64 darwin/arm64" -# SNAPSHOT: true -# command: | -# set -euo pipefail -# cd x-pack/agentbeat -# mage package -# artifact_paths: -# - x-pack/agentbeat/build/distributions/**/* -# - "x-pack/agentbeat/build/*.xml" -# - "x-pack/agentbeat/build/*.json" -# retry: -# automatic: -# - limit: 2 -# timeout_in_minutes: 60 -# agents: -# provider: "gcp" -# image: "${IMAGE_UBUNTU_X86_64}" -# machineType: "${GCP_HI_PERF_MACHINE_TYPE}" -# disk_size: 100 -# disk_type: "pd-ssd" -# notify: -# - github_commit_status: -# context: "agentbeat: Packaging" + - label: ":linux: Agentbeat packaging Linux" + key: "agentbeat-package-linux" + env: + PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64 darwin/arm64" + SNAPSHOT: true + command: | + set -euo pipefail + cd x-pack/agentbeat + mage package + artifact_paths: + - x-pack/agentbeat/build/distributions/**/* + - "x-pack/agentbeat/build/*.xml" + - "x-pack/agentbeat/build/*.json" + retry: + automatic: + - limit: 2 + timeout_in_minutes: 60 + agents: + provider: "gcp" + image: "${IMAGE_UBUNTU_X86_64}" + machineType: "${GCP_HI_PERF_MACHINE_TYPE}" + disk_size: 100 + disk_type: "pd-ssd" + notify: + - github_commit_status: + context: "agentbeat: Packaging" # - label: ":linux: Agentbeat/Integration tests Linux" # key: "agentbeat-it-linux" @@ -113,8 +113,8 @@ steps: key: "agentbeat-it-linux" env: PLATFORM: "linux/amd64" -# depends_on: -# - agentbeat-package-linux + depends_on: + - agentbeat-package-linux command: | cd x-pack/agentbeat mage -v testWithSpec @@ -129,8 +129,8 @@ steps: key: "agentbeat-it-windows" env: PLATFORM: "windows/amd64" -# depends_on: -# - agentbeat-package-linux + depends_on: + - agentbeat-package-linux command: | Set-Location -Path x-pack/agentbeat mage -v testWithSpec @@ -140,18 +140,18 @@ steps: machine_type: "${GCP_WIN_MACHINE_TYPE}" disk_size: 200 disk_type: "pd-ssd" -# -# - label: ":linux: Agentbeat/Integration tests macOS" -# key: "agentbeat-it-macos" -# depends_on: -# - agentbeat-package-linux -# command: | -# set -euo pipefail -# ./.buildkite/scripts/agentbeat/setup_agentbeat.py -# agents: -# provider: "orka" -# imagePrefix: "${IMAGE_MACOS_X86_64}" -# + + - label: ":macos: x-pack/agentbeat: macOS x86_64 Spec tests" + key: "agentbeat-it-macos" + depends_on: + - agentbeat-package-linux + command: | + cd x-pack/agentbeat + mage -v testWithSpec + agents: + provider: "orka" + imagePrefix: "${IMAGE_MACOS_X86_64}" + # - label: ":linux: Agentbeat/Integration tests macOS arm64" # key: "agentbeat-it-macos-arm" # depends_on: