-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small reproducer for go vcs issues with filebeat/arm packaging
- Loading branch information
Showing
8 changed files
with
125 additions
and
202 deletions.
There are no files selected for viewing
This file contains 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 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 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,140 +1,23 @@ | ||
# 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" | ||
BEATS_PROJECT_NAME: "filebeat" | ||
IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204" | ||
AWS_IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2204-aarch64" | ||
IMAGE_WIN_2016: "family/core-windows-2016" | ||
IMAGE_WIN_2019: "family/core-windows-2019" | ||
IMAGE_WIN_2022: "family/core-windows-2022" | ||
IMAGE_MACOS_X86_64: "generic-13-ventura-x64" | ||
|
||
GCP_DEFAULT_MACHINE_TYPE: "c2d-highcpu-8" | ||
GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16" | ||
GCP_WIN_MACHINE_TYPE: "n2-standard-8" | ||
AWS_ARM_INSTANCE_TYPE: "m6g.xlarge" | ||
steps: | ||
- group: "Filebeat Mandatory Testing" | ||
key: "mandatory-tests" | ||
if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "filebeat" || build.env("BUILDKITE_PULL_REQUEST") != "false" | ||
|
||
steps: | ||
- label: ":ubuntu: Unit Tests" | ||
command: | ||
- ".buildkite/filebeat/scripts/unit-tests.sh" | ||
notify: | ||
- github_commit_status: | ||
context: "Filebeat: linux/Unit Tests" | ||
agents: | ||
provider: "gcp" | ||
image: "${IMAGE_UBUNTU_X86_64}" | ||
machineType: "c2-standard-16" | ||
artifact_paths: | ||
- "filebeat/build/*.xml" | ||
- "filebeat/build/*.json" | ||
|
||
- label: ":ubuntu: Go Integration Tests" | ||
command: | ||
- ".buildkite/filebeat/scripts/integration-gotests.sh" | ||
notify: | ||
- github_commit_status: | ||
context: "Filebeat: Go Integration Tests" | ||
agents: | ||
provider: "gcp" | ||
image: "${IMAGE_UBUNTU_X86_64}" | ||
machineType: "c2-standard-16" | ||
artifact_paths: | ||
- "filebeat/build/*.xml" | ||
- "filebeat/build/*.json" | ||
|
||
- label: ":ubuntu: Python Integration Tests" | ||
command: | ||
- ".buildkite/filebeat/scripts/integration-pytests.sh" | ||
notify: | ||
- github_commit_status: | ||
context: "Filebeat: Python Integration Tests" | ||
agents: | ||
provider: "gcp" | ||
image: "${IMAGE_UBUNTU_X86_64}" | ||
machineType: "c2-standard-16" | ||
artifact_paths: | ||
- "filebeat/build/*.xml" | ||
- "filebeat/build/*.json" | ||
|
||
- label: ":windows:-{{matrix.image}} Unit Tests" | ||
command: ".buildkite/filebeat/scripts/unit-tests-win.ps1" | ||
notify: | ||
- github_commit_status: | ||
context: "Filebeat: windows/Unit Tests" | ||
agents: | ||
provider: "gcp" | ||
image: "{{matrix.image}}" | ||
machine_type: "n2-standard-8" | ||
disk_size: 200 | ||
disk_type: "pd-ssd" | ||
matrix: | ||
setup: | ||
image: | ||
- "${IMAGE_WIN_2016}" | ||
- "${IMAGE_WIN_2022}" | ||
artifact_paths: | ||
- "filebeat/build/*.xml" | ||
- "filebeat/build/*.json" | ||
|
||
- group: "Extended Testing" | ||
key: "extended-tests" | ||
if: build.env("BUILDKITE_PULL_REQUEST") != "false" || build.env("GITHUB_PR_TRIGGER_COMMENT") == "filebeat for extended support" | ||
|
||
steps: | ||
- label: ":linux: ARM64 Unit Tests" | ||
key: "arm-extended" | ||
if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "filebeat for arm" || build.env("GITHUB_PR_LABELS") =~ /.*arm.*/ | ||
command: | ||
- ".buildkite/filebeat/scripts/unit-tests.sh" | ||
notify: | ||
- github_commit_status: | ||
context: "Filebeat/Extended: Unit Tests ARM" | ||
agents: | ||
provider: "aws" | ||
imagePrefix: "${IMAGE_UBUNTU_ARM_64}" | ||
instanceType: "t4g.large" | ||
artifact_paths: "filebeat/build/*.xml" | ||
|
||
- label: ":mac: MacOS Unit Tests" | ||
key: "macos-extended" | ||
if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "filebeat for macos" || build.env("GITHUB_PR_LABELS") =~ /.*macOS.*/ | ||
command: | ||
- ".buildkite/filebeat/scripts/unit-tests.sh" | ||
notify: | ||
- github_commit_status: | ||
context: "Filebeat/Extended: MacOS Unit Tests" | ||
agents: | ||
provider: "orka" | ||
imagePrefix: "${IMAGE_MACOS_X86_64}" | ||
artifact_paths: "filebeat/build/*.xml" | ||
|
||
- group: "Windows Extended Testing" | ||
key: "extended-tests-win" | ||
if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "filebeat for windows" || build.env("GITHUB_PR_LABELS") =~ /.*windows.*/ | ||
|
||
steps: | ||
- label: ":windows: Win 2019 Unit Tests" | ||
key: "win-extended-2019" | ||
command: ".buildkite/filebeat/scripts/unit-tests-win.ps1" | ||
notify: | ||
- github_commit_status: | ||
context: "Filebeat/Extended: Win-2019 Unit Tests" | ||
agents: | ||
provider: "gcp" | ||
image: "${IMAGE_WIN_2019}" | ||
machine_type: "n2-standard-8" | ||
disk_size: 200 | ||
disk_type: "pd-ssd" | ||
artifact_paths: | ||
- "filebeat/build/*.xml" | ||
- "filebeat/build/*.json" | ||
|
||
- group: "Packaging" | ||
key: "packaging" | ||
if: build.env("BUILDKITE_PULL_REQUEST") != "false" | ||
depends_on: | ||
- "mandatory-tests" | ||
|
||
# depends_on: | ||
# - "mandatory-tests" | ||
steps: | ||
- label: Package pipeline | ||
commands: ".buildkite/filebeat/scripts/package-step.sh" | ||
commands: ".buildkite/filebeat/scripts/packaging/package-step.sh" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
source .buildkite/env-scripts/util.sh | ||
|
||
changeset="^${BEATS_PROJECT_NAME}/ | ||
^go.mod | ||
^pytest.ini | ||
^dev-tools/ | ||
^libbeat/ | ||
^testing/ | ||
^\.buildkite/${BEATS_PROJECT_NAME}/" | ||
|
||
if are_files_changed "$changeset"; then | ||
bk_pipeline=$(cat <<-YAML | ||
steps: | ||
- label: ":linux: ${BEATS_PROJECT_NAME}/Packaging Linux ARM" | ||
key: "package-${BEATS_PROJECT_NAME}-linux-arm" | ||
env: | ||
PLATFORMS: "linux/arm64" | ||
PACKAGES: "docker" | ||
SNAPSHOT: true | ||
GOX_FLAGS: "-arch arm" | ||
command: ".buildkite/filebeat/scripts/packaging/package.sh" | ||
notify: | ||
- github_commit_status: | ||
context: "${BEATS_PROJECT_NAME}/Packaging: ARM" | ||
agents: | ||
provider: "aws" | ||
imagePrefix: "${AWS_IMAGE_UBUNTU_ARM_64}" | ||
instanceType: "${AWS_ARM_INSTANCE_TYPE}" | ||
YAML | ||
) | ||
echo "--- Printing steps" | ||
echo "${bk_pipeline}" | ||
echo "--- Uploading pipeline" | ||
echo "${bk_pipeline}" | buildkite-agent pipeline upload | ||
else | ||
buildkite-agent annotate "No required files changed. Skipped packaging" --style 'warning' --context 'ctx-warning' | ||
exit 0 | ||
fi |
This file contains 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,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
is_pr() { | ||
if [[ $BUILDKITE_PULL_REQUEST != false ]]; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
define_tags() { | ||
aliasVersion="${VERSION%.*}${IMG_POSTFIX}" | ||
tags=("${BUILDKITE_COMMIT}") | ||
|
||
if is_pr; then | ||
tags+=("pr-${GITHUB_PR_NUMBER}") | ||
else | ||
tags+=("${SOURCE_TAG}" "${aliasVersion}") | ||
fi | ||
} | ||
|
||
check_is_arm() { | ||
if [[ ${HW_TYPE} == "aarch64" || ${HW_TYPE} == "arm64" ]]; then | ||
is_arm="-arm64" | ||
else | ||
is_arm="" | ||
fi | ||
} |
This file contains 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,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
source .buildkite/scripts/packaging/package-util.sh | ||
|
||
IMG_POSTFIX="-SNAPSHOT" | ||
VARIANTS=("" "-ubi" "-oss") | ||
VERSION="$(make get-version)" | ||
SOURCE_TAG+="${VERSION}${IMG_POSTFIX}" | ||
TARGET="observability-ci/${BEATS_PROJECT_NAME}" | ||
|
||
echo "--- Creating package" | ||
mage -d "${BEATS_PROJECT_NAME}" package | ||
|
||
echo "--- Distribution list" | ||
dir="${BEATS_PROJECT_NAME}/build/distributions" | ||
buildkite-agent artifact upload "$dir/*.tar.gz;$dir/*.tar.gz.sha512" | ||
|