Skip to content
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

Migrate xpack packetbeat #38135

Merged
merged 67 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
2b5dd7b
migrate xpack-metricbeat
Feb 21, 2024
cf44101
change pre-command
Feb 21, 2024
e432525
add mage_version
Feb 21, 2024
0783eee
add mage_version
Feb 21, 2024
2a1de26
disable some trigger steps
Feb 21, 2024
7e55863
change command with mage
Feb 21, 2024
cf55e5b
add ASDF_MAGE_VERSION
Feb 21, 2024
def5673
fix arm image name
Feb 21, 2024
85bfec8
fix macos
Feb 21, 2024
5af9510
test arm packaging
Feb 22, 2024
90bec63
test aws/macos
Feb 22, 2024
bd038c2
test macos
Feb 22, 2024
77b29b2
test macos
Feb 22, 2024
5b41d3b
test macos
Feb 22, 2024
2751e38
test macos
Feb 22, 2024
88800c8
test macos
Feb 22, 2024
4805ccb
fix macos declare
Feb 22, 2024
e242568
add export MODULE
Feb 23, 2024
d41b68d
test aws
Feb 23, 2024
5319753
test aws
Feb 23, 2024
32229ce
add withModule
Feb 23, 2024
a09803e
move withModule to pre-command
Feb 23, 2024
271c788
move withModule to pre-command
Feb 23, 2024
cd2282d
move withModule to command
Feb 23, 2024
8eba9dc
fix withModule
Feb 23, 2024
1781fc0
test aws changes
Feb 23, 2024
c12fe5a
test aws changes
Feb 23, 2024
dd1e93e
change the are_changed_only_paths
Feb 24, 2024
d0f433b
revert aws changes and test
Feb 24, 2024
751403b
Merge branch 'main' into migrate-xpack-metricbeat
sharbuz Feb 26, 2024
39caa7b
Merge branch 'main' of github.com:sharbuz/beats into migrate-xpack-me…
Feb 26, 2024
2c4eb33
Merge branch 'main' of github.com:elastic/beats into migrate-xpack-me…
Feb 26, 2024
5696ea2
test with 240min timeout
Feb 26, 2024
b6347ec
Merge branch 'migrate-xpack-metricbeat' of github.com:sharbuz/beats i…
Feb 26, 2024
c3f04b3
migrate-xpack-packetbeat
Feb 26, 2024
420cd1b
add retry
Feb 26, 2024
2711e89
comment out GCP auth and update dynamic pipelines
Feb 26, 2024
dfe71d0
add reference fot xpack_packetbeat_changeset
Feb 26, 2024
91e7176
test
Feb 27, 2024
d48fd20
change pre-command
Feb 27, 2024
ebf072a
update magefile.go and GCP credentials
Feb 27, 2024
577a435
update pre-command
Feb 27, 2024
7c9fcd8
test
Feb 27, 2024
3de4774
test
Feb 27, 2024
fc5d80a
test
Feb 27, 2024
86bf174
update windows script
Feb 28, 2024
fbc0703
update windows script
Feb 28, 2024
a158886
update windows script
Feb 28, 2024
781181b
update windows script
Feb 28, 2024
e202bb7
full test
Feb 28, 2024
67ff799
update windows script and dynamic pipelines
Feb 28, 2024
2a1eb07
cleanup
Feb 28, 2024
d0d786e
Merge branch 'main' of github.com:elastic/beats into migrate-xpack-pa…
Mar 12, 2024
74a4d1f
update setenv.sh
Mar 12, 2024
70bf4de
solving merge conflicts
Mar 12, 2024
426014f
conflict solving
Mar 12, 2024
1a839aa
conflict solving
Mar 12, 2024
5543e57
fix dinamic pipeline's condition
Mar 13, 2024
554c3a5
Update .buildkite/scripts/generate_xpack_packetbeat_pipeline.sh
sharbuz Mar 13, 2024
d02580b
add gcp_credentials_cleanup
Mar 13, 2024
31358c9
Merge branch 'migrate-xpack-packetbeat' of github.com:sharbuz/beats i…
Mar 13, 2024
b23146a
test removing gcp credentials
Mar 13, 2024
2954618
add gcp credentials
Mar 13, 2024
e2e12d1
add gcp credentials
Mar 13, 2024
37b956a
remove debug and cleanup
Mar 13, 2024
9585c26
Merge branch 'main' into migrate-xpack-packetbeat
jlind23 Mar 13, 2024
5aa00de
Merge branch 'main' into migrate-xpack-packetbeat
jlind23 Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "filebeat" || "$BUILDKITE_PIPELINE_SLUG" ==
fi
fi

if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-metricbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-libbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-packetbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-winlogbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-libbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-metricbeat" ]]; then
if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-metricbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-libbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-packetbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-winlogbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-libbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-metricbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-packetbeat" ]]; then
source .buildkite/scripts/setenv.sh
if [[ "${BUILDKITE_COMMAND}" =~ ^buildkite-agent ]]; then
echo "Skipped pre-command when running the Upload pipeline"
Expand Down
5 changes: 5 additions & 0 deletions .buildkite/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ XPACK_MODULE_PATTERN="^x-pack\\/[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*"
[ -z "${run_xpack_libbeat_arm_tests+x}" ] && run_xpack_libbeat_arm_tests="$(buildkite-agent meta-data get run_xpack_libbeat_arm_tests --default "false")"
[ -z "${run_xpack_metricbeat_aws_tests+x}" ] && run_xpack_metricbeat_aws_tests="$(buildkite-agent meta-data get run_xpack_metricbeat_aws_tests --default "false")"
[ -z "${run_xpack_metricbeat_macos_tests+x}" ] && run_xpack_metricbeat_macos_tests="$(buildkite-agent meta-data get run_xpack_metricbeat_macos_tests --default "false")"
[ -z "${run_xpack_packetbeat_arm_tests+x}" ] && run_xpack_packetbeat_arm_tests="$(buildkite-agent meta-data get run_xpack_packetbeat_arm_tests --default "false")"
[ -z "${run_xpack_packetbeat_macos_tests+x}" ] && run_xpack_packetbeat_macos_tests="$(buildkite-agent meta-data get run_xpack_packetbeat_macos_tests --default "false")"

metricbeat_changeset=(
"^metricbeat/.*"
Expand Down Expand Up @@ -105,6 +107,9 @@ case "${BUILDKITE_PIPELINE_SLUG}" in
"beats-xpack-metricbeat")
BEAT_CHANGESET_REFERENCE=${xpack_metricbeat_changeset[@]}
;;
"beats-xpack-packetbeat")
BEAT_CHANGESET_REFERENCE=${xpack_packetbeat_changeset[@]}
;;
*)
echo "The changeset for the ${BUILDKITE_PIPELINE_SLUG} pipeline hasn't been defined yet."
;;
Expand Down
3 changes: 1 addition & 2 deletions .buildkite/scripts/generate_xpack_metricbeat_pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ else
fi

#TODO: replace by commented-out below condition when issues mentioned in the PR https://github.com/elastic/beats/pull/38081 are resolved
if [[ are_conditions_met_aws_tests || are_conditions_met_macos_tests ]]; then
# if [[ are_conditions_met_macos_tests ]]; then
if are_conditions_met_aws_tests || are_conditions_met_macos_tests ; then
cat >> $pipelineName <<- YAML

- group: "Extended Tests"
Expand Down
193 changes: 193 additions & 0 deletions .buildkite/scripts/generate_xpack_packetbeat_pipeline.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
#!/usr/bin/env bash

source .buildkite/scripts/common.sh

set -euo pipefail

pipelineName="pipeline.xpack-packetbeat-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: "cd $BEATS_PROJECT_NAME && mage build unitTest"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.xml"

- label: ":linux: Ubuntu System Tests"
key: "mandatory-linux-system-test"
command: "cd $BEATS_PROJECT_NAME && mage systemTest"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.xml"

- label: ":rhel: RHEL-9 Unit Tests"
key: "mandatory-rhel9-unit-test"
command: ".buildkite/scripts/unit_tests.sh"
agents:
provider: "gcp"
image: "${IMAGE_RHEL9_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"


- label: ":windows: Windows Unit Tests - {{matrix.image}}"
command: ".buildkite/scripts/win_unit_tests.ps1"
key: "mandatory-win-unit-tests"
agents:
provider: "gcp"
image: "{{matrix.image}}"
machineType: "${GCP_WIN_MACHINE_TYPE}"
disk_size: 100
disk_type: "pd-ssd"
matrix:
setup:
image:
- "${IMAGE_WIN_2016}"
- "${IMAGE_WIN_2022}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"

## TODO: uncomment when the issue https://github.com/elastic/beats/issues/38142 is solved
# - label: ":windows: Windows 2022 System Tests"
# key: "mandatory-win-2022-system-tests"
# command: ".buildkite/scripts/win_unit_tests.ps1 systemtest"
# agents:
# provider: "gcp"
# image: "${IMAGE_WIN_2022}"
# machineType: "${GCP_WIN_MACHINE_TYPE}"
# disk_size: 100
# disk_type: "pd-ssd"
# artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"

## TODO: this condition will be changed in the Phase 3 of the Migration Plan https://docs.google.com/document/d/1IPNprVtcnHlem-uyGZM0zGzhfUuFAh4LeSl9JFHMSZQ/edit#heading=h.sltz78yy249h

- group: "Extended Windows Tests"
key: "extended-win-tests"
steps:

- label: ":windows: Windows Unit Tests - {{matrix.image}}"
command: ".buildkite/scripts/win_unit_tests.ps1"
key: "extended-win-unit-tests"
agents:
provider: "gcp"
image: "{{matrix.image}}"
machineType: "${GCP_WIN_MACHINE_TYPE}"
disk_size: 100
disk_type: "pd-ssd"
matrix:
setup:
image:
- "${IMAGE_WIN_10}"
- "${IMAGE_WIN_11}"
- "${IMAGE_WIN_2019}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"

## TODO: uncomment when the issue https://github.com/elastic/beats/issues/38142 is solved
# - label: ":windows: Windows 10 System Tests"
# key: "extended-win-10-system-tests"
# command: ".buildkite/scripts/win_unit_tests.ps1 systemtest"
# agents:
# provider: "gcp"
# image: "${IMAGE_WIN_10}"
# machineType: "${GCP_WIN_MACHINE_TYPE}"
# disk_size: 100
# disk_type: "pd-ssd"
# artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"

YAML
else
echo "The conditions don't match to requirements for generating pipeline steps."
exit 0
fi

if are_conditions_met_arm_tests || are_conditions_met_macos_tests ; then
cat >> $pipelineName <<- YAML

- group: "Extended Tests"
key: "extended-tests"
steps:

YAML
fi

if are_conditions_met_macos_tests; then
cat >> $pipelineName <<- YAML

- label: ":mac: MacOS Unit Tests"
key: "extended-macos-unit-tests"
command: ".buildkite/scripts/unit_tests.sh"
agents:
provider: "orka"
imagePrefix: "${IMAGE_MACOS_X86_64}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"

YAML
fi

if are_conditions_met_arm_tests; then
cat >> $pipelineName <<- YAML
- label: ":linux: ARM Ubuntu Unit Tests"
key: "extended-arm64-unit-test"
command: "cd $BEATS_PROJECT_NAME && mage build unitTest"
agents:
provider: "aws"
imagePrefix: "${IMAGE_UBUNTU_ARM_64}"
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"

YAML
fi

echo "Check and add the Packaging into the pipeline"
if are_conditions_met_packaging; then
cat >> $pipelineName <<- YAML

- wait: ~
depends_on:
- step: "mandatory-tests"
allow_failure: false

- group: "Packaging" # TODO: check conditions for future the main pipeline migration: https://github.com/elastic/beats/pull/28589
key: "packaging"
steps:
- label: ":linux: Packaging Linux"
key: "packaging-linux"
command: "cd $BEATS_PROJECT_NAME && mage package"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_HI_PERF_MACHINE_TYPE}"
env:
PLATFORMS: "${PACKAGING_PLATFORMS}"

- label: ":linux: Packaging ARM"
key: "packaging-arm"
command: "cd $BEATS_PROJECT_NAME && mage package"
agents:
provider: "aws"
imagePrefix: "${IMAGE_UBUNTU_ARM_64}"
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
env:
PLATFORMS: "${PACKAGING_ARM_PLATFORMS}"
PACKAGES: "docker"

YAML
fi

echo "--- Printing dynamic steps" #TODO: remove if the pipeline is public
cat $pipelineName

echo "--- Loading dynamic steps"
buildkite-agent pipeline upload $pipelineName
2 changes: 2 additions & 0 deletions .buildkite/scripts/setenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ SETUP_WIN_PYTHON_VERSION="3.11.0"
NMAP_WIN_VERSION="7.12" # Earlier versions of NMap provide WinPcap (the winpcap packages don't install nicely because they pop-up a UI)
GO_VERSION=$(cat .go-version)
ASDF_MAGE_VERSION="1.15.0"
PACKAGING_PLATFORMS="+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64 darwin/arm64"
PACKAGING_ARM_PLATFORMS="linux/arm64"
ASDF_TERRAFORM_VERSION="1.0.2"
PACKAGING_PLATFORMS="+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64 darwin/arm64"
PACKAGING_ARM_PLATFORMS="linux/arm64"
Expand Down
29 changes: 25 additions & 4 deletions .buildkite/scripts/win_unit_tests.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
param(
[string]$testType = "unittest"
)

$ErrorActionPreference = "Stop" # set -e
$WorkFolder = $env:BEATS_PROJECT_NAME
$WORKSPACE = Get-Location
Expand Down Expand Up @@ -120,6 +124,14 @@ function withNmap($version) {
}
Start-Process -FilePath $nmapDownloadPath -ArgumentList "/S" -Wait
}
function google_cloud_auth {
$tempFileName = "google-cloud-credentials.json"
$secretFileLocation = Join-Path $env:TEMP $tempFileName
$null = New-Item -ItemType File -Path $secretFileLocation
Set-Content -Path $secretFileLocation -Value $env:PRIVATE_CI_GCS_CREDENTIALS_SECRET
gcloud auth activate-service-account --key-file $secretFileLocation > $null 2>&1
$env:GOOGLE_APPLICATION_CREDENTIALS = $secretFileLocation
}

fixCRLF

Expand All @@ -142,10 +154,19 @@ $env:MAGEFILE_CACHE = $magefile

New-Item -ItemType Directory -Force -Path "build"

if ($env:BUILDKITE_PIPELINE_SLUG -eq "beats-xpack-libbeat") {
mage -w reader/etw build goUnitTest
} else {
mage build unitTest
if ($testType -eq "unittest") {
if ($env:BUILDKITE_PIPELINE_SLUG -eq "beats-xpack-libbeat") {
mage -w reader/etw build goUnitTest
} else {
mage build unitTest
}
}
elseif ($testType -eq "systemtest") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the file .buildkite/scripts/win_unit_tests.ps1 is specific about unit_tests while it also runs mage systemTest.

What do you think about this proposal that can avoid maintaining the .buildkite/scripts/win_unit_tests.ps1 but the pipeline itself?

rename the file for buildkite/scripts/win_mage.ps1, it's more generic and could accept different mage goals.

testType to be renamed for mageGoals and then simplify the script with the below snippet:

if ($mageGoals -eq "systemTest") {
    google_cloud_auth
}

mage $mageGoals

Change the pipeline stages with:

# .buildkite/scripts/generate_xpack_packetbeat_pipeline.sh
      - label: ":windows: Windows Unit Tests - {{matrix.image}}"
        command: ".buildkite/scripts/win_mage.ps1 build unitTest"
     ...
      ##  TODO: uncomment when the issue https://github.com/elastic/beats/issues/38142 is solved
      # - label: ":windows: Windows 10 System Tests"
      #   key: "extended-win-10-system-tests"
      #.  command: ".buildkite/scripts/win_mage.ps1 systemTest"
# .buildkite/scripts/generate_xpack_ libbeat_pipeline.sh
      - label: ":windows: Windows 11 Unit Tests"
        command: ".buildkite/scripts/win_mage.ps1 -w reader/etw build goUnitTest"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you that it could be done as you suggest. There is only one remark. We gonna decline to use Windows scripts soon (I hope in 1 week). If it's possible to avoid additional changes right now, let's do that. @v1v WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the file .buildkite/scripts/win_unit_tests.ps1 will not be used anymore soon? I still think the name of the file is not correct for the nature of what it does, so .buildkite/scripts/win_tests.ps1 could be more meaningful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.
We are going to use our own BK Windows images and @dliappis is working on it.
When it's ready we are going to use command steps with 1-3 commands without using PowerShell scripts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming this script requires a lot of changes in the already prepared dynamic pipelines.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll then wait for @dliappis 's feedback; if he has no concerns, I'm happy with this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @v1v for the great feedback (as usual!) The custom Windows images are now ready, so I am good with letting this as is and get rid of many custom scripts and snippets, including the one discussed here, ASAP.

google_cloud_auth
mage systemTest
}
else {
Write-Host "Unknown test type. Please specify 'unittest' or 'systemtest'."
}

$EXITCODE=$LASTEXITCODE
Expand Down
60 changes: 58 additions & 2 deletions .buildkite/x-pack/pipeline.xpack.packetbeat.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,61 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
name: "beats-xpack-packetbeat"

env:
IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204"
IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2204-aarch64"
IMAGE_RHEL9_X86_64: "family/platform-ingest-beats-rhel-9"
IMAGE_WIN_10: "family/general-windows-10"
IMAGE_WIN_11: "family/general-windows-11"
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: "t4g.xlarge"
BEATS_PROJECT_NAME: "x-pack/packetbeat"

steps:
- label: "Example test"
command: echo "Hello!"

- input: "Input Parameters"
key: "force-run-stages"
fields:
- select: "Packetbeat - run_xpack_packetbeat"
key: "run_xpack_packetbeat"
options:
- label: "True"
value: "true"
- label: "False"
value: "false"
default: "false"
- select: "Packetbeat - run_xpack_packetbeat_macos_tests"
key: "run_xpack_packetbeat_macos_tests"
options:
- label: "True"
value: "true"
- label: "False"
value: "false"
default: "false"
- select: "Packetbeat - run_xpack_packetbeat_arm_tests"
key: "run_xpack_packetbeat_arm_tests"
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 x-pack packetbeat pipeline"
key: "packetbeat-pipeline"
command: ".buildkite/scripts/generate_xpack_packetbeat_pipeline.sh"
notify:
- github_commit_status:
context: "${BEATS_PROJECT_NAME}: Load dynamic pipeline's steps"
10 changes: 9 additions & 1 deletion x-pack/packetbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ func SystemTest(ctx context.Context) error {
return devtools.GoTest(ctx, args)
}

func getBucketName() string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sharbuz if we haven't it yet, let's create a post migration ticket in the usual repo and link it to https://github.com/elastic/ingest-dev/issues/2794 to remind us that the conditional behavior here should be removed once Jenkins has been sunset (I realize that it should be possible to run the tests locally by devs too but I believe they have access to it already).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if os.Getenv("BUILDKITE") == "true" {
return "ingest-buildkite-ci"
}
return "obs-ci-cache"
}

// getNpcapInstaller gets the installer from the Google Cloud Storage service.
//
// On Windows platforms, if getNpcapInstaller is invoked with the environment variables
Expand All @@ -198,7 +205,8 @@ func getNpcapInstaller() error {
return err
}
}
ciBucketName := getBucketName()

fmt.Printf("getting %s from private cache\n", installer)
return sh.RunV("gsutil", "cp", "gs://obs-ci-cache/private/"+installer, dstPath)
return sh.RunV("gsutil", "cp", "gs://"+ciBucketName+"/private/"+installer, dstPath)
}
Loading