From fa0e113c9b27e589ec3e8d72ffc86b5812ae70c3 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Fri, 19 Jul 2024 16:02:33 +0200 Subject: [PATCH] Debug --- .buildkite/pipeline.yml | 534 +++++++++++++++++------------------ .buildkite/scripts/common.sh | 4 +- 2 files changed, 270 insertions(+), 268 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d92d10db541..494fcffaa2f 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -13,285 +13,285 @@ steps: retry: manual: allowed: true - - group: "Unit tests" - key: "unit-tests" - steps: - - label: "Unit tests - Ubuntu 22.04" - key: "unit-tests-2204" - command: ".buildkite/scripts/steps/unit-tests.sh" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "gcp" - image: "family/core-ubuntu-2204" - retry: - manual: - allowed: true + # - group: "Unit tests" + # key: "unit-tests" + # steps: + # - label: "Unit tests - Ubuntu 22.04" + # key: "unit-tests-2204" + # command: ".buildkite/scripts/steps/unit-tests.sh" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: "gcp" + # image: "family/core-ubuntu-2204" + # retry: + # manual: + # allowed: true - - label: "Unit tests - Ubuntu 22.04 ARM64" - key: "unit-tests-2204-arm64" - command: ".buildkite/scripts/steps/unit-tests.sh" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "aws" - imagePrefix: "core-ubuntu-2204-aarch64" - diskSizeGb: 200 - instanceType: "m6g.xlarge" - retry: - manual: - allowed: true + # - label: "Unit tests - Ubuntu 22.04 ARM64" + # key: "unit-tests-2204-arm64" + # command: ".buildkite/scripts/steps/unit-tests.sh" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: "aws" + # imagePrefix: "core-ubuntu-2204-aarch64" + # diskSizeGb: 200 + # instanceType: "m6g.xlarge" + # retry: + # manual: + # allowed: true - - label: "Unit tests - Windows 2022" - key: "unit-tests-win2022" - command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "gcp" - image: "family/core-windows-2022" - machine_type: "n2-standard-8" - disk_size: 200 - disk_type: "pd-ssd" - retry: - manual: - allowed: true + # - label: "Unit tests - Windows 2022" + # key: "unit-tests-win2022" + # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: "gcp" + # image: "family/core-windows-2022" + # machine_type: "n2-standard-8" + # disk_size: 200 + # disk_type: "pd-ssd" + # retry: + # manual: + # allowed: true - - label: "Unit tests - Windows 2016" - key: "unit-tests-win2016" - command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "gcp" - image: "family/core-windows-2016" - machine_type: "n2-standard-8" - disk_size: 200 - disk_type: "pd-ssd" - retry: - manual: - allowed: true + # - label: "Unit tests - Windows 2016" + # key: "unit-tests-win2016" + # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: "gcp" + # image: "family/core-windows-2016" + # machine_type: "n2-standard-8" + # disk_size: 200 + # disk_type: "pd-ssd" + # retry: + # manual: + # allowed: true - # Runs inly on the main branch - - label: "Unit tests - MacOS 13 ARM" - key: "unit-tests-macos-13-arm" - command: ".buildkite/scripts/steps/unit-tests.sh" - branches: main - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: orka - imagePrefix: generic-13-ventura-arm - retry: - manual: - allowed: true + # # Runs inly on the main branch + # - label: "Unit tests - MacOS 13 ARM" + # key: "unit-tests-macos-13-arm" + # command: ".buildkite/scripts/steps/unit-tests.sh" + # branches: main + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: orka + # imagePrefix: generic-13-ventura-arm + # retry: + # manual: + # allowed: true - - label: "Unit tests - MacOS 13" - key: "unit-tests-macos-13" - command: ".buildkite/scripts/steps/unit-tests.sh" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: orka - imagePrefix: generic-13-ventura-x64 - retry: - manual: - allowed: true + # - label: "Unit tests - MacOS 13" + # key: "unit-tests-macos-13" + # command: ".buildkite/scripts/steps/unit-tests.sh" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: orka + # imagePrefix: generic-13-ventura-x64 + # retry: + # manual: + # allowed: true - - group: "Desktop Windows tests" - key: "extended-windows" - steps: - - label: "Unit tests - Windows 10" - key: "unit-tests-win10" - command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "gcp" - # TODO create own image - image: "family/general-windows-10" - machine_type: "n2-standard-8" - disk_type: "pd-ssd" - retry: - manual: - allowed: true - - label: "Unit tests - Windows 11" - key: "unit-tests-win11" - command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "gcp" - # TODO create own image - image: "family/general-windows-11" - machine_type: "n2-standard-8" - disk_type: "pd-ssd" - retry: - manual: - allowed: true + # - group: "Desktop Windows tests" + # key: "extended-windows" + # steps: + # - label: "Unit tests - Windows 10" + # key: "unit-tests-win10" + # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: "gcp" + # # TODO create own image + # image: "family/general-windows-10" + # machine_type: "n2-standard-8" + # disk_type: "pd-ssd" + # retry: + # manual: + # allowed: true + # - label: "Unit tests - Windows 11" + # key: "unit-tests-win11" + # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: "gcp" + # # TODO create own image + # image: "family/general-windows-11" + # machine_type: "n2-standard-8" + # disk_type: "pd-ssd" + # retry: + # manual: + # allowed: true - - label: "Merge coverage reports" - key: "merge-coverage" - env: - BUILDKITE_REPO: "" - command: " - .buildkite/scripts/steps/merge.sh - unit-tests-2204 - unit-tests-2204-arm64 - unit-tests-win2016 - unit-tests-win2022 - unit-tests-macos-13 - unit-tests-win10 - unit-tests-win11 - " - artifact_paths: - - "build/TEST-go-unit.cov" - agents: - image: "golang:1.20.10" - depends_on: - - unit-tests - - extended-windows - allow_dependency_failure: true + # - label: "Merge coverage reports" + # key: "merge-coverage" + # env: + # BUILDKITE_REPO: "" + # command: " + # .buildkite/scripts/steps/merge.sh + # unit-tests-2204 + # unit-tests-2204-arm64 + # unit-tests-win2016 + # unit-tests-win2022 + # unit-tests-macos-13 + # unit-tests-win10 + # unit-tests-win11 + # " + # artifact_paths: + # - "build/TEST-go-unit.cov" + # agents: + # image: "golang:1.20.10" + # depends_on: + # - unit-tests + # - extended-windows + # allow_dependency_failure: true - - group: "K8s tests" - key: "k8s-tests" - steps: - - label: "K8s tests: {{matrix.k8s_version}}" - env: - K8S_VERSION: "v{{matrix.k8s_version}}" - KIND_VERSION: "v0.20.0" - command: ".buildkite/scripts/steps/k8s-tests.sh" - agents: - provider: "gcp" - image: "family/core-ubuntu-2204" - matrix: - setup: - k8s_version: - - "1.30.0" - - "1.29.4" - - "1.28.9" - - "1.27.13" - retry: - manual: - allowed: true - - label: "K8s integration tests" - key: "k8s-integration-tests" - env: - K8S_VERSION: "v1.30.2,v1.29.4,v1.28.9" - KIND_VERSION: "v0.20.0" - command: ".buildkite/scripts/steps/k8s-extended-tests.sh" - artifact_paths: - - "build/TEST-**" - - "build/diagnostics/*" - agents: - provider: "gcp" - image: "family/core-ubuntu-2204" - retry: - manual: - allowed: true + # - group: "K8s tests" + # key: "k8s-tests" + # steps: + # - label: "K8s tests: {{matrix.k8s_version}}" + # env: + # K8S_VERSION: "v{{matrix.k8s_version}}" + # KIND_VERSION: "v0.20.0" + # command: ".buildkite/scripts/steps/k8s-tests.sh" + # agents: + # provider: "gcp" + # image: "family/core-ubuntu-2204" + # matrix: + # setup: + # k8s_version: + # - "1.30.0" + # - "1.29.4" + # - "1.28.9" + # - "1.27.13" + # retry: + # manual: + # allowed: true + # - label: "K8s integration tests" + # key: "k8s-integration-tests" + # env: + # K8S_VERSION: "v1.30.2,v1.29.4,v1.28.9" + # KIND_VERSION: "v0.20.0" + # command: ".buildkite/scripts/steps/k8s-extended-tests.sh" + # artifact_paths: + # - "build/TEST-**" + # - "build/diagnostics/*" + # agents: + # provider: "gcp" + # image: "family/core-ubuntu-2204" + # retry: + # manual: + # allowed: true - - label: ":sonarqube: Continuous Code Inspection" - env: - VAULT_SONAR_TOKEN_PATH: "kv/ci-shared/platform-ingest/elastic/elastic-agent/sonar-analyze-token" - agents: - image: "docker.elastic.co/cloud-ci/sonarqube/buildkite-scanner:latest" - command: - - "buildkite-agent artifact download --step merge-coverage build/TEST-go-unit.cov ." - - "/scan-source-code.sh" - depends_on: - - "merge-coverage" - retry: - manual: - allowed: true + # - label: ":sonarqube: Continuous Code Inspection" + # env: + # VAULT_SONAR_TOKEN_PATH: "kv/ci-shared/platform-ingest/elastic/elastic-agent/sonar-analyze-token" + # agents: + # image: "docker.elastic.co/cloud-ci/sonarqube/buildkite-scanner:latest" + # command: + # - "buildkite-agent artifact download --step merge-coverage build/TEST-go-unit.cov ." + # - "/scan-source-code.sh" + # depends_on: + # - "merge-coverage" + # retry: + # manual: + # allowed: true - # Triggers a dynamic step: Sync K8s - # Runs only on main and if k8s files are changed - - label: "Trigger k8s sync" - branches: main - plugins: - - monebag/monorepo-diff#v2.5.9: - diff: "git diff --name-only HEAD~1" - watch: - - path: - - deploy/kubernetes/* - - version/docs/version.asciidoc - config: - label: "Sync K8s" - command: ".buildkite/scripts/steps/sync-k8s.sh" - agents: - provider: "gcp" - image: "family/core-ubuntu-2204" - env: - - GH_VERSION=2.4.0 + # # Triggers a dynamic step: Sync K8s + # # Runs only on main and if k8s files are changed + # - label: "Trigger k8s sync" + # branches: main + # plugins: + # - monebag/monorepo-diff#v2.5.9: + # diff: "git diff --name-only HEAD~1" + # watch: + # - path: + # - deploy/kubernetes/* + # - version/docs/version.asciidoc + # config: + # label: "Sync K8s" + # command: ".buildkite/scripts/steps/sync-k8s.sh" + # agents: + # provider: "gcp" + # image: "family/core-ubuntu-2204" + # env: + # - GH_VERSION=2.4.0 - # Trigger for pull requests - - label: "Trigger Integration tests for Pull request" - if: | - (build.pull_request.id != null && !build.env("GITHUB_PR_LABELS") =~ /skip-it/) || - build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /.*extended.*/ + # # Trigger for pull requests + # - label: "Trigger Integration tests for Pull request" + # if: | + # (build.pull_request.id != null && !build.env("GITHUB_PR_LABELS") =~ /skip-it/) || + # build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /.*extended.*/ - plugins: - - monorepo-diff#v1.0.1: - diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" - watch: - - path: - - internal/ - - dev-tools/ - - pkg/ - - testing/ - - version/ - - specs/ - - .agent-versions.json - - .go-version - - .package-version - - go.mod - - go.sum - - magefile.go - - main.go + # plugins: + # - monorepo-diff#v1.0.1: + # diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" + # watch: + # - path: + # - internal/ + # - dev-tools/ + # - pkg/ + # - testing/ + # - version/ + # - specs/ + # - .agent-versions.json + # - .go-version + # - .package-version + # - go.mod + # - go.sum + # - magefile.go + # - main.go - - .buildkite/integration.pipeline.yml - - .buildkite/pipeline.yml - - .buildkite/scripts/ - - .buildkite/hooks/ + # - .buildkite/integration.pipeline.yml + # - .buildkite/pipeline.yml + # - .buildkite/scripts/ + # - .buildkite/hooks/ - config: - trigger: "elastic-agent-extended-testing" - 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} + # config: + # trigger: "elastic-agent-extended-testing" + # 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} - # Trigger for branches - - label: "Triggering Integration tests for branches" - if: build.pull_request.id == null - trigger: "elastic-agent-extended-testing" - build: - commit: "${BUILDKITE_COMMIT}" - branch: "${BUILDKITE_BRANCH}" + # # Trigger for branches + # - label: "Triggering Integration tests for branches" + # if: build.pull_request.id == null + # trigger: "elastic-agent-extended-testing" + # build: + # commit: "${BUILDKITE_COMMIT}" + # branch: "${BUILDKITE_BRANCH}" diff --git a/.buildkite/scripts/common.sh b/.buildkite/scripts/common.sh index ff4b890ff39..9fddd505b67 100644 --- a/.buildkite/scripts/common.sh +++ b/.buildkite/scripts/common.sh @@ -69,7 +69,8 @@ mage() { go(){ # Search for the go in the Path if ! [ -x "$(type -P go | sed 's/go is //g')" ]; - then + then + set -x getOSOptions echo "installing golang "${GO_VERSION}" for "${AGENT_OS_NAME}/${AGENT_OS_ARCH}" " local _bin="${WORKSPACE}/bin" @@ -79,6 +80,7 @@ go(){ eval "$(command "${_bin}/gvm" "${GO_VERSION}" )" export GOPATH=$(command go env GOPATH) export PATH="${PATH}:${GOPATH}/bin" + set +x fi pushd "$WORKSPACE" command go "$@"