Skip to content

Commit 1af6780

Browse files
committed
test out the OOM testing pipeline integration
1 parent d264ed4 commit 1af6780

File tree

3 files changed

+114
-17
lines changed

3 files changed

+114
-17
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
PACKAGE_VERSION=$(yq -r '.version' ./packages/security_detection_engine/manifest.yml)
6+
EPR_INSTANCE_NAME="bk-epr-prebuilt-rules-oom-testing-$BUILDKITE_BUILD_NUMBER"
7+
EPR_VM_IMAGE="projects/elastic-kibana-184716/global/images/rule-management-epr-oct-28"
8+
9+
# gcloud compute instances create "$EPR_INSTANCE_NAME" \
10+
# --zone=us-west2-a \
11+
# --machine-type=e2-small \
12+
# --network-interface=network-tier=PREMIUM,stack-type=IPV4_ONLY,subnet=default \
13+
# # --maintenance-policy=MIGRATE \
14+
# --provisioning-model=STANDARD \
15+
# # --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/trace.append \
16+
# --tags=https-server \
17+
# --create-disk=auto-delete=yes,boot=yes,device-name=instance-20251031-131502,image="$EPR_VM_IMAGE",mode=rw,size=10,type=pd-standard \
18+
# --no-shielded-secure-boot \
19+
# --no-shielded-vtpm \
20+
# --no-shielded-integrity-monitoring \
21+
# --labels=goog-ec-src=vm_add-gcloud \
22+
# --reservation-affinity=any
23+
# --quiet
24+
# echo "--- Deploy EPR instance: $EPR_INSTANCE_NAME (Mock)"
25+
26+
# Upload the tested package
27+
28+
# Trigger the OOM testing pipeline
29+
cat <<YAML | buildkite-agent pipeline upload
30+
steps:
31+
- key: 'deploy-epr-instance-$BUILDKITE_BUILD_NUMBER'
32+
label: ':package::sparkles: [security_detection_engine] Deploying EPR instance'
33+
agents:
34+
provider: gcp
35+
image: ${IMAGE_UBUNTU_X86_64}
36+
plugins:
37+
# This plugin authenticates to Google Cloud using the OIDC token.
38+
- elastic/oblt-google-auth#v1.3.0:
39+
lifetime: 10800 # seconds
40+
project-id: "elastic-kibana-184716"
41+
project-number: "261553193300"
42+
command: |
43+
gcloud compute instances create "$EPR_INSTANCE_NAME" \
44+
--zone=us-west2-a \
45+
--machine-type=e2-small \
46+
--network-interface=network-tier=PREMIUM,stack-type=IPV4_ONLY,subnet=default \
47+
--provisioning-model=STANDARD \
48+
--tags=https-server \
49+
--create-disk=auto-delete=yes,boot=yes,device-name=instance-20251031-131502,image="$EPR_VM_IMAGE",mode=rw,size=10,type=pd-standard \
50+
--no-shielded-secure-boot \
51+
--no-shielded-vtpm \
52+
--no-shielded-integrity-monitoring \
53+
--labels=goog-ec-src=vm_add-gcloud \
54+
--reservation-affinity=any
55+
--quiet
56+
- key: 'run-oom-testing-$BUILDKITE_BUILD_NUMBER'
57+
label: ":bar_chart: [security_detection_engine] Trigger OOM testing pipeline"
58+
depends_on:
59+
- step: 'deploy-epr-instance-$BUILDKITE_BUILD_NUMBER'
60+
allow_failure: false
61+
trigger: "appex-qa-stateful-security-prebuilt-rules-ftr-oom-testing"
62+
async: false
63+
build:
64+
env:
65+
EC_PLAN_PROP_FLEET_REGISTRY_URL: unknown
66+
EC_PLAN_PROP_PREBUILT_RULES_PACKAGE_VERSION: unknown
67+
- key: 'remove-epr-instance-$BUILDKITE_BUILD_NUMBER'
68+
label: ":broom::sparkles: [security_detection_engine] Removing EPR instance"
69+
depends_on:
70+
- step: 'run-oom-testing-$BUILDKITE_BUILD_NUMBER'
71+
allow_failure: true
72+
agents:
73+
provider: gcp
74+
image: ${IMAGE_UBUNTU_X86_64}
75+
plugins:
76+
# This plugin authenticates to Google Cloud using the OIDC token.
77+
- elastic/oblt-google-auth#v1.3.0:
78+
lifetime: 10800 # seconds
79+
project-id: "elastic-kibana-184716"
80+
project-number: "261553193300"
81+
command: |
82+
gcloud compute instances delete $EPR_INSTANCE_NAME --zone=us-west2-a --delete-disks=all --quiet
83+
YAML
84+
85+
# echo "--- :broom::sparkles: Remove EPR instance: $EPR_INSTANCE_NAME (Mock)"
86+
# gcloud compute instances delete $EPR_INSTANCE_NAME --zone=us-west2-a --delete-disks=all --quiet

.buildkite/scripts/test_one_package.sh

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,28 @@ add_bin_path
1919

2020
with_yq
2121
with_mage
22-
with_docker
23-
with_docker_compose_plugin
24-
with_kubernetes
22+
# with_docker
23+
# with_docker_compose_plugin
24+
# with_kubernetes
2525

2626
use_elastic_package
2727

28-
pushd packages > /dev/null
29-
exit_code=0
30-
if ! process_package "${package}" ; then
31-
# keep this message as a collapsed group in Buildkite, so it
32-
# is not hidden by the previous collapsed group.
33-
echo "--- [${package}] failed"
34-
exit_code=1
28+
# pushd packages > /dev/null
29+
# exit_code=0
30+
# if ! process_package "${package}" ; then
31+
# # keep this message as a collapsed group in Buildkite, so it
32+
# # is not hidden by the previous collapsed group.
33+
# echo "--- [${package}] failed"
34+
# exit_code=1
35+
# fi
36+
# popd > /dev/null
37+
38+
if [ -x "./.buildkite/scripts/packages/$package.sh" ]; then
39+
echo "--- [${package}] Run individual package checker"
40+
"./.buildkite/scripts/packages/$package.sh"
41+
else
42+
echo "--- [${package}] Individual package checker ./packages/$package.sh is not found, continuing..."
3543
fi
36-
popd > /dev/null
3744

45+
exit_code=0
3846
exit "${exit_code}"

.buildkite/scripts/trigger_integrations_in_parallel.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,21 @@ fi
5151

5252
packages_to_test=0
5353

54+
PACKAGE_LIST="security_detection_engine"
55+
5456
for package in ${PACKAGE_LIST}; do
5557
# check if needed to create an step for this package
5658
echo "--- [$package] check if it is required to be tested"
5759
pushd "packages/${package}" > /dev/null
5860
skip_package="false"
5961
failure="false"
60-
if ! reason=$(is_pr_affected "${package}" "${from}" "${to}") ; then
61-
skip_package="true"
62-
if [[ "${reason}" == "${FATAL_ERROR}" ]]; then
63-
failure=true
64-
fi
65-
fi
62+
reason="-"
63+
# if ! reason=$(is_pr_affected "${package}" "${from}" "${to}") ; then
64+
# skip_package="true"
65+
# if [[ "${reason}" == "${FATAL_ERROR}" ]]; then
66+
# failure=true
67+
# fi
68+
# fi
6669
popd > /dev/null
6770
if [[ "${failure}" == "true" ]]; then
6871
echo "Unexpected failure checking ${package}"

0 commit comments

Comments
 (0)