-
Notifications
You must be signed in to change notification settings - Fork 5k
migrate libbeat pipeline #37725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
migrate libbeat pipeline #37725
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
d85e193
migrate libbeat pipeline
35fa203
migrate libbeat pipeline
ac9ac7b
add hooks
8efb4f0
fix go-int tests
70bfa4e
fix go-int tests
9f5fd0d
revert mage dumpVariables
e76a97a
debug
bbe62dc
debug
4b9b801
debug
857f48d
debug
36ffb33
debug
22f4455
debug
e64c72c
debug Go Int Tests
6c1747f
debug Go Int Tests
6180a26
debug Go Int Tests
8282de0
debug Go Int Tests
01a3e61
debug Go Int Tests
383320e
full test
d95c25f
debug Python Int Tests
c1b2b35
debug Crosscompile
d688a5c
debug Crosscompile
7ab9718
debug Crosscompile
b23fc85
debug Crosscompile
dec018c
debug Crosscompile
3ffa0e7
full test
dff6341
Merge branch 'main' of github.com:sharbuz/beats into migrate-libbeat-…
0d5c9f8
debug stress tests
1fe6f20
debug stress tests
4af8233
debug stress tests
d1e5d55
full test
87ce234
full test
d684936
full test
da7b08a
full test - changed crosscompile options
0cf08cd
updates artifacts paths
ae8c545
Merge branch 'main' of github.com:sharbuz/beats into migrate-libbeat-…
9aa7c6c
conflict solving
411d9d4
change pre-command
708000d
add BEATS_PROJECT_NAME
af0b962
refactor libbeat
a562733
refactor libbeat/metricbeat conditions
b4efe61
fix dinamyc libbeat pipeline
6cd9880
change metricbeat dunamyc pipeline
a2c8826
full test
e03d2b3
full test
823a27c
full test
b1155e8
update catalog-info.yaml
0c4becf
change the instance type and fix typos
ca6c241
change instance types to c2d-highcpu-16
82ebbfa
Merge branch 'main' of github.com:sharbuz/beats into migrate-libbeat-…
3774483
change instance type for packaging
d5194bf
Update catalog-info.yaml
sharbuz f3317c6
fix remarks
b96a16c
Merge branch 'migrate-libbeat-pipeline' of github.com:sharbuz/beats i…
f151f98
revert makifile changes
6e57804
Merge branch 'main' into migrate-libbeat-pipeline
sharbuz 6ee43ff
Update catalog-info.yaml
sharbuz 5aaf276
Merge branch 'main' into migrate-libbeat-pipeline
sharbuz e2a2afb
windows 10 test
5d5ceb8
Merge branch 'migrate-libbeat-pipeline' of github.com:sharbuz/beats i…
adf168a
Merge branch 'main' into migrate-libbeat-pipeline
sharbuz 5bfd917
Merge branch 'main' into migrate-libbeat-pipeline
sharbuz b272833
Merge branch 'main' into migrate-libbeat-pipeline
sharbuz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,45 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json | ||
|
|
||
| env: | ||
| IMAGE_UBUNTU_X86_64: "family/core-ubuntu-2204" | ||
| IMAGE_UBUNTU_ARM_64: "core-ubuntu-2004-aarch64" | ||
| GCP_DEFAULT_MACHINE_TYPE: "c2d-highcpu-8" | ||
| GCP_HI_PERF_MASHINE_TYPE: "c2d-highcpu-16" | ||
| GCP_WIN_MACHINE_TYPE: "n2-standard-8" | ||
| AWS_ARM_INSTANCE_TYPE: "t4g.xlarge" | ||
| BEATS_PROJECT_NAME: "libbeat" | ||
|
|
||
| steps: | ||
| - label: "Example test" | ||
| command: echo "Hello!" | ||
|
|
||
| - input: "Input Parameters" | ||
| key: "input-run-all-stages" | ||
| fields: | ||
| - select: "Libbeat - runLibbeat" | ||
| key: "runLibbeat" | ||
| options: | ||
| - label: "True" | ||
| value: "true" | ||
| - label: "False" | ||
| value: "false" | ||
| default: "false" | ||
| - select: "Libbeat - runLibBeatArmTest" | ||
| key: "runLibBeatArmTest" | ||
| options: | ||
| - label: "True" | ||
| value: "true" | ||
| - label: "False" | ||
| value: "false" | ||
| default: "false" | ||
| if: "build.source == 'ui'" | ||
|
|
||
| - wait: ~ | ||
| if: "build.source == 'ui'" | ||
| allow_dependency_failure: false | ||
|
|
||
| - label: ":linux: Load dynamic Libbeat pipeline" | ||
| key: "libbeat-pipeline" | ||
| command: ".buildkite/scripts/generate_libbeat_pipeline.sh" | ||
| agents: | ||
| provider: "gcp" | ||
| image: "${IMAGE_UBUNTU_X86_64}" | ||
| machineType: "${GCP_DEFAULT_MACHINE_TYPE}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| WORKSPACE=${WORKSPACE:-"$(pwd)"} | ||
|
|
@@ -8,8 +8,11 @@ platform_type_lowercase=$(echo "$platform_type" | tr '[:upper:]' '[:lower:]') | |
| arch_type="$(uname -m)" | ||
| GITHUB_PR_TRIGGER_COMMENT=${GITHUB_PR_TRIGGER_COMMENT:-""} | ||
| ONLY_DOCS=${ONLY_DOCS:-"true"} | ||
| UI_MACOS_TESTS="$(buildkite-agent meta-data get UI_MACOS_TESTS --default ${UI_MACOS_TESTS:-"false"})" | ||
| runAllStages="$(buildkite-agent meta-data get runAllStages --default ${runAllStages:-"false"})" | ||
| runLibbeat="$(buildkite-agent meta-data get runLibbeat --default ${runLibbeat:-"false"})" | ||
| runMetricbeat="$(buildkite-agent meta-data get runMetricbeat --default ${runMetricbeat:-"false"})" | ||
| runLibBeatArmTest="$(buildkite-agent meta-data get runLibbeat --default ${runLibbeat:-"false"})" | ||
| runMetricbeatMacOsTests="$(buildkite-agent meta-data get runMetricbeatMacOsTests --default ${runMetricbeatMacOsTests:-"false"})" | ||
|
|
||
| metricbeat_changeset=( | ||
| "^metricbeat/.*" | ||
| "^go.mod" | ||
|
|
@@ -175,64 +178,54 @@ are_changed_only_paths() { | |
| local changed_files=$(git diff --name-only HEAD@{1} HEAD) | ||
| if [ -z "$changed_files" ] || grep -qE "$(IFS=\|; echo "${patterns[*]}")" <<< "$changed_files"; then | ||
| return 0 | ||
| else | ||
| return 1 | ||
| fi | ||
| return 1 | ||
| } | ||
|
|
||
| are_conditions_met_mandatory_tests() { | ||
| if [[ "${BUILDKITE_PULL_REQUEST}" == "" ]] || [[ "${runAllStages}" == "true" ]] || [[ "${ONLY_DOCS}" == "false" && "${BUILDKITE_PULL_REQUEST}" != "" ]]; then # from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/Jenkinsfile#L107-L137 | ||
| if are_paths_changed "${metricbeat_changeset[@]}" || are_paths_changed "${oss_changeset[@]}" || are_paths_changed "${ci_changeset[@]}" || [[ "${GITHUB_PR_TRIGGER_COMMENT}" == "/test metricbeat" ]] || [[ "${GITHUB_PR_LABELS}" =~ Metricbeat ]]; then # from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/metricbeat/Jenkinsfile.yml#L3-L12 | ||
| return 0 | ||
| else | ||
| return 1 | ||
| if are_paths_changed "${metricbeat_changeset[@]}" || are_paths_changed "${oss_changeset[@]}" || are_paths_changed "${ci_changeset[@]}" ]]; then # from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/metricbeat/Jenkinsfile.yml#L3-L12 | ||
| if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-metricbeat" ]]; then | ||
| if [[ "${GITHUB_PR_TRIGGER_COMMENT}" == "/test metricbeat" || "${GITHUB_PR_LABELS}" =~ Metricbeat || "${runMetricbeat}" == "true" ]]; then | ||
| return 0 | ||
| fi | ||
| elif [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-libbeat" ]]; then | ||
| if [[ "${GITHUB_PR_TRIGGER_COMMENT}" == "/test libbeat" || "${GITHUB_PR_LABELS}" =~ libbeat || "${runLibbeat}" == "true" ]]; then | ||
| return 0 | ||
| fi | ||
| fi | ||
| else | ||
| return 1 | ||
| fi | ||
| return 1 | ||
| } | ||
|
|
||
| are_conditions_met_extended_tests() { | ||
| are_conditions_met_libbeat_arm_tests() { | ||
| if are_conditions_met_mandatory_tests; then #from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/Jenkinsfile#L145-L171 | ||
| return 0 | ||
| else | ||
| return 1 | ||
| if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-libbeat" ]]; then | ||
| if [[ "${GITHUB_PR_TRIGGER_COMMENT}" == "/test libbeat for arm" || "${GITHUB_PR_LABELS}" =~ arm || "${runLibBeatArmTest}" == "true" ]]; then | ||
| return 0 | ||
| fi | ||
| fi | ||
| fi | ||
| return 1 | ||
| } | ||
|
|
||
| are_conditions_met_macos_tests() { | ||
| if are_conditions_met_mandatory_tests; then #from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/Jenkinsfile#L145-L171 | ||
| if [[ "${UI_MACOS_TESTS}" == true ]] || [[ "${GITHUB_PR_TRIGGER_COMMENT}" == "/test metricbeat for macos" ]] || [[ "${GITHUB_PR_LABELS}" =~ macOS ]]; then # from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/metricbeat/Jenkinsfile.yml#L3-L12 | ||
| return 0 | ||
| else | ||
| return 1 | ||
| fi | ||
| else | ||
| return 1 | ||
| are_conditions_met_metricbeat_macos_tests() { | ||
| if [[ "${runMetricbeatMacOsTests}" == true ]] || [[ "${GITHUB_PR_TRIGGER_COMMENT}" == "/test metricbeat for macos" ]] || [[ "${GITHUB_PR_LABELS}" =~ macOS ]]; then # from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/metricbeat/Jenkinsfile.yml#L3-L12 | ||
| return 0 | ||
| fi | ||
| return 1 | ||
| } | ||
|
|
||
| are_conditions_met_extended_windows_tests() { | ||
| if [[ "${ONLY_DOCS}" == "false" && "${BUILDKITE_PULL_REQUEST}" != "" ]] || [[ "${runAllStages}" == "true" ]]; then #from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/Jenkinsfile#L145-L171 | ||
| if are_paths_changed "${metricbeat_changeset[@]}" || are_paths_changed "${oss_changeset[@]}" || are_paths_changed "${ci_changeset[@]}" || [[ "${GITHUB_PR_TRIGGER_COMMENT}" == "/test metricbeat" ]] || [[ "${GITHUB_PR_LABELS}" =~ Metricbeat ]]; then # from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/metricbeat/Jenkinsfile.yml#L3-L12 | ||
| return 0 | ||
| else | ||
| return 1 | ||
| fi | ||
| else | ||
| return 1 | ||
| are_conditions_met_packaging() { | ||
| if are_paths_changed "${metricbeat_changeset[@]}" || are_paths_changed "${oss_changeset[@]}" || [[ "${BUILDKITE_TAG}" == "" ]] || [[ "${BUILDKITE_PULL_REQUEST}" != "" ]]; then # from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/metricbeat/Jenkinsfile.yml#L101-L103 | ||
| return 0 | ||
| fi | ||
| return 1 | ||
| } | ||
|
|
||
| are_conditions_met_packaging() { | ||
| if are_conditions_met_extended_windows_tests; then #from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/Jenkinsfile#L145-L171 | ||
| if are_paths_changed "${metricbeat_changeset[@]}" || are_paths_changed "${oss_changeset[@]}" || [[ "${BUILDKITE_TAG}" == "" ]] || [[ "${BUILDKITE_PULL_REQUEST}" != "" ]]; then # from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/metricbeat/Jenkinsfile.yml#L101-L103 | ||
| return 0 | ||
| else | ||
| return 1 | ||
| fi | ||
| else | ||
| return 1 | ||
| config_git() { | ||
| if [ -z "$(git config --get user.email)" ]; then | ||
| git config --global user.email "[email protected]" | ||
| git config --global user.name "beatsmachine" | ||
| fi | ||
| } | ||
|
|
||
|
|
@@ -249,4 +242,4 @@ fi | |
|
|
||
| if are_paths_changed "${packaging_changeset[@]}" ; then | ||
| PACKAGING_CHANGES="true" | ||
| fi | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| source .buildkite/scripts/common.sh | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| pipelineName="pipeline.libbeat-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: ".buildkite/scripts/unit_tests.sh" | ||
| agents: | ||
| provider: "gcp" | ||
| image: "${IMAGE_UBUNTU_X86_64}" | ||
| machineType: "${GCP_DEFAULT_MACHINE_TYPE}" | ||
| artifact_paths: "${BEATS_PROJECT_NAME}/build/*.xml" | ||
|
|
||
| - label: ":go: Go Integration Tests" | ||
| key: "mandatory-int-test" | ||
| command: ".buildkite/scripts/go_int_tests.sh" | ||
| agents: | ||
| provider: "gcp" | ||
| image: "${IMAGE_UBUNTU_X86_64}" | ||
| machineType: "${GCP_HI_PERF_MASHINE_TYPE}" | ||
| artifact_paths: "${BEATS_PROJECT_NAME}/build/*.xml" | ||
|
|
||
| - label: ":python: Python Integration Tests" | ||
| key: "mandatory-python-int-test" | ||
| command: ".buildkite/scripts/py_int_tests.sh" | ||
| agents: | ||
| provider: "gcp" | ||
| image: "${IMAGE_UBUNTU_X86_64}" | ||
| machineType: "${GCP_HI_PERF_MASHINE_TYPE}" | ||
| artifact_paths: "${BEATS_PROJECT_NAME}/build/*.xml" | ||
|
|
||
| - label: ":negative_squared_cross_mark: Cross compile" | ||
| key: "mandatory-cross-compile" | ||
| command: ".buildkite/scripts/crosscompile.sh" | ||
| agents: | ||
| provider: "gcp" | ||
| image: "${IMAGE_UBUNTU_X86_64}" | ||
| machineType: "${GCP_HI_PERF_MASHINE_TYPE}" | ||
| artifact_paths: " ${BEATS_PROJECT_NAME}/build/*.xml" | ||
|
|
||
| - label: ":testengine: Stress Tests" | ||
| key: "mandatory-stress-test" | ||
| command: ".buildkite/scripts/stress_tests.sh" | ||
| agents: | ||
| provider: "gcp" | ||
| image: "${IMAGE_UBUNTU_X86_64}" | ||
| machineType: "${GCP_DEFAULT_MACHINE_TYPE}" | ||
| artifact_paths: "${BEATS_PROJECT_NAME}/libbeat-stress-test.xml" | ||
|
|
||
| YAML | ||
| fi | ||
|
|
||
| echo "Check and add the Extended Tests into the pipeline" | ||
| if are_conditions_met_libbeat_arm_tests; then | ||
| cat >> $pipelineName <<- YAML | ||
|
|
||
| - group: "Extended Tests" | ||
| key: "extended-tests" | ||
| steps: | ||
| - label: ":linux: Arm64 Unit Tests" | ||
| key: "extended-arm64-unit-tests" | ||
| command: ".buildkite/scripts/unit_tests.sh" | ||
| agents: | ||
| provider: "aws" | ||
| imagePrefix: "${IMAGE_UBUNTU_ARM_64}" | ||
| instanceType: "${AWS_ARM_INSTANCE_TYPE}" | ||
| artifact_paths: "${BEATS_PROJECT_NAME}/build/*.xml" | ||
|
|
||
| YAML | ||
| fi | ||
|
|
||
| echo "--- Printing dynamic steps" #TODO: remove if the pipeline is public | ||
| cat $pipelineName | ||
|
|
||
| echo "--- Loading dynamic steps" | ||
| buildkite-agent pipeline upload $pipelineName | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.