Skip to content

Commit 37ad488

Browse files
committed
Merge branch 'main' into nvidia-system-tests
2 parents 3c8957d + 6659e55 commit 37ad488

File tree

1,482 files changed

+85162
-5789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,482 files changed

+85162
-5789
lines changed

.buildkite/hooks/pre-command

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export REPO_BUILD_TAG
3333

3434
BUILDKITE_API_TOKEN_PATH=kv/ci-shared/platform-ingest/buildkite_token
3535

36-
EC_TOKEN_PATH=kv/ci-shared/platform-ingest/platform-ingest-ec-qa
3736
EC_DATA_PATH=secret/ci/elastic-integrations/ec_data
3837

3938
# variables required for terraform
@@ -117,10 +116,6 @@ if [[ "${BUILDKITE_PIPELINE_SLUG}" == "integrations-serverless" ]]; then
117116
BUILDKITE_API_TOKEN=$(retry 5 vault kv get -field buildkite_token "${BUILDKITE_API_TOKEN_PATH}")
118117
export BUILDKITE_API_TOKEN
119118

120-
EC_API_KEY_SECRET=$(retry 5 vault kv get -field apiKey "${EC_TOKEN_PATH}")
121-
export EC_API_KEY_SECRET
122-
EC_HOST_SECRET=$(retry 5 vault kv get -field url "${EC_TOKEN_PATH}")
123-
export EC_HOST_SECRET
124119
EC_REGION_SECRET=$(retry 5 vault read -field region_qa "${EC_DATA_PATH}")
125120
export EC_REGION_SECRET
126121
fi

.buildkite/hooks/pre-exit

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ source .buildkite/scripts/common.sh
44

55
set -euo pipefail
66

7-
if [[ "$BUILDKITE_PIPELINE_SLUG" =~ ^(integrations|integrations-test-stack)$ ]]; then
8-
# FIXME: update condition depending on the pipeline steps triggered
7+
if [[ "$BUILDKITE_PIPELINE_SLUG" == "integrations-backport" && "$BUILDKITE_STEP_KEY" == "create-backport-branch" ]]; then
8+
cd "${WORKSPACE}"
9+
git config remote.origin.url "https://github.com/elastic/integrations.git"
10+
fi
11+
12+
if [[ "$BUILDKITE_PIPELINE_SLUG" =~ ^(integrations|integrations-test-stack|integrations-serverless)$ ]]; then
13+
# it should match "^test-integration-" steps created in the integrations and integrations-test-stack pipelines (e.g. test-integration-apache or test-integration-aws)
14+
# as well as the step ID "test-integrations-serverless-project" from the "integrations-serverless" pipeline
915
if [[ "$BUILDKITE_STEP_KEY" =~ ^test-integrations- ]]; then
1016

1117
# Ensure that kind cluster is deleted
@@ -16,27 +22,13 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" =~ ^(integrations|integrations-test-stack)$ ]];
1622
echo "--- Take down the Elastic stack"
1723
${ELASTIC_PACKAGE_BIN} stack down -v
1824
fi
19-
fi
20-
fi
21-
22-
if [[ "$BUILDKITE_PIPELINE_SLUG" == "integrations-serverless" ]]; then
23-
if [[ "$BUILDKITE_STEP_KEY" == "test-integrations-serverless-project" ]]; then
2425

25-
# Ensure that kind cluster is deleted
26-
delete_kind_cluster
27-
28-
# Ensure elastic stack is stopped
29-
if [ -f "${ELASTIC_PACKAGE_BIN}" ]; then
30-
echo "--- Take down the Elastic stack"
31-
EC_API_KEY=${EC_API_KEY_SECRET} EC_HOST=${EC_HOST_SECRET} ${ELASTIC_PACKAGE_BIN} stack down -v
32-
fi
26+
echo "+++ :bookmark: Documentation to access logs"
27+
inline_link "https://docs.elastic.dev/ingest-dev-docs/elastic-packages/ecosystem-ci-pipelines#private-logs"
3328
fi
3429
fi
3530

31+
echo "--- Cleaning up"
3632
unset_secrets
3733
cleanup
3834

39-
if [[ "$BUILDKITE_PIPELINE_SLUG" == "integrations-backport" && "$BUILDKITE_STEP_KEY" == "create-backport-branch" ]]; then
40-
cd "${WORKSPACE}"
41-
git config remote.origin.url "https://github.com/elastic/integrations.git"
42-
fi

.buildkite/pipeline.serverless.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,16 @@ steps:
7373
- elastic/oblt-aws-auth#v0.1.0:
7474
duration: 10800 # seconds
7575
# See https://github.com/elastic/oblt-infra/blob/main/conf/resources/repos/integrations/01-gcp-buildkite-oidc.tf
76-
# This plugin authenticates to Google Cloud using the OIDC token.
76+
# This plugin authenticates to CI Google Cloud using the OIDC token.
7777
- elastic/oblt-google-auth#v1.3.0:
7878
lifetime: 10800 # seconds
7979
project-id: "elastic-observability-ci"
8080
project-number: "911195782929"
81+
lifetime: 10800 # seconds
82+
- avaly/gcp-secret-manager#v1.2.0:
83+
env:
84+
EC_API_KEY: elastic-cloud-observability-team-qa-api-key
85+
EC_HOST: elastic-cloud-observability-team-qa-endpoint
8186
artifact_paths:
8287
- "build/test-results/*.xml"
8388
- "build/elastic-stack-dump/*/logs/*.log"

.buildkite/pull-requests.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$|^/test benchmark fullreport$",
1414
"skip_ci_labels": [],
1515
"skip_target_branches": [],
16-
"skip_ci_on_only_changed": ["^.github/workflows/", "^.github/dependabot.yml", "^.github/ISSUE_TEMPLATE/", "^docs/"],
16+
"skip_ci_on_only_changed": ["^.github/workflows/", "^.github/dependabot.yml$", "^.github/ISSUE_TEMPLATE/", "^docs/", "^catalog-info.yaml$", "^.buildkite/pull-requests.json$"],
1717
"always_require_ci_on_changed": []
1818
},
1919
{

.buildkite/scripts/backport_branch.sh

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,16 @@ createLocalBackportBranch() {
9696

9797
removeOtherPackages() {
9898
local sourceFolder=$1
99+
local currentPackage=""
99100
for dir in "$sourceFolder"/*; do
100101
if [[ -d "$dir" ]] && [[ "$(basename "$dir")" != "$PACKAGE_NAME" ]]; then
101102
echo "Removing directory: $dir"
102103
rm -rf "$dir"
104+
105+
currentPackage=$(basename "${dir}")
106+
echo "Removing ${currentPackage} from .github/CODEOWNERS"
107+
sed -i "/^\/packages\/${currentPackage}\//d" .github/CODEOWNERS
108+
sed -i "/^\/packages\/${currentPackage} /d" .github/CODEOWNERS
103109
fi
104110
done
105111
}
@@ -116,70 +122,90 @@ updateBackportBranchContents() {
116122
local BUILDKITE_FOLDER_PATH=".buildkite"
117123
local JENKINS_FOLDER_PATH=".ci"
118124
local files_cached_num=""
125+
126+
git checkout "$BACKPORT_BRANCH_NAME"
127+
echo "Copying $BUILDKITE_FOLDER_PATH from $SOURCE_BRANCH..."
128+
git checkout $SOURCE_BRANCH -- $BUILDKITE_FOLDER_PATH
129+
git add $BUILDKITE_FOLDER_PATH
130+
119131
if git ls-tree -d --name-only main:.ci >/dev/null 2>&1; then
120-
git checkout $BACKPORT_BRANCH_NAME
121-
echo "Copying $BUILDKITE_FOLDER_PATH from $SOURCE_BRANCH..."
122-
git checkout $SOURCE_BRANCH -- $BUILDKITE_FOLDER_PATH
123132
echo "Copying $JENKINS_FOLDER_PATH from $SOURCE_BRANCH..."
124133
git checkout $SOURCE_BRANCH -- $JENKINS_FOLDER_PATH
134+
git add $JENKINS_FOLDER_PATH
125135
else
126-
git checkout $BACKPORT_BRANCH_NAME
127-
echo "Copying $BUILDKITE_FOLDER_PATH from $SOURCE_BRANCH..."
128-
git checkout $SOURCE_BRANCH -- $BUILDKITE_FOLDER_PATH
129-
echo "Removing $JENKINS_FOLDER_PATH from $BACKPORT_BRANCH_NAME..."
130-
rm -rf "$JENKINS_FOLDER_PATH"
136+
if [ -d "${JENKINS_FOLDER_PATH}" ]; then
137+
echo "Removing $JENKINS_FOLDER_PATH from $BACKPORT_BRANCH_NAME..."
138+
rm -rf "$JENKINS_FOLDER_PATH"
139+
git add "$JENKINS_FOLDER_PATH"
140+
fi
131141
fi
132142

133143
# Update scripts used by mage
134144
local MAGEFILE_SCRIPTS_FOLDER="dev/citools"
135145
local TESTSREPORTER_SCRIPTS_FOLDER="dev/testsreporter"
136146
local COVERAGE_SCRIPTS_FOLDER="dev/coverage"
147+
local CODEOWNERS_SCRIPTS_FOLDER="dev/codeowners"
148+
137149
if git ls-tree -d --name-only main:${MAGEFILE_SCRIPTS_FOLDER} > /dev/null 2>&1 ; then
138150
echo "Copying $MAGEFILE_SCRIPTS_FOLDER from $SOURCE_BRANCH..."
139151
git checkout "$SOURCE_BRANCH" -- "${MAGEFILE_SCRIPTS_FOLDER}"
152+
git add ${MAGEFILE_SCRIPTS_FOLDER}
153+
140154
echo "Copying $TESTSREPORTER_SCRIPTS_FOLDER from $SOURCE_BRANCH..."
141155
git checkout "$SOURCE_BRANCH" -- "${TESTSREPORTER_SCRIPTS_FOLDER}"
156+
git add ${TESTSREPORTER_SCRIPTS_FOLDER}
157+
142158
echo "Copying $COVERAGE_SCRIPTS_FOLDER from $SOURCE_BRANCH..."
143159
git checkout "$SOURCE_BRANCH" -- "${COVERAGE_SCRIPTS_FOLDER}"
160+
git add ${COVERAGE_SCRIPTS_FOLDER}
161+
162+
echo "Copying $CODEOWNERS_SCRIPTS_FOLDER from $SOURCE_BRANCH..."
163+
git checkout "$SOURCE_BRANCH" -- "${CODEOWNERS_SCRIPTS_FOLDER}"
164+
git add ${CODEOWNERS_SCRIPTS_FOLDER}
165+
144166
echo "Copying magefile.go from $SOURCE_BRANCH..."
145167
git checkout "$SOURCE_BRANCH" -- "magefile.go"
168+
git add magefile.go
169+
170+
# As this script runs in the context of the main branch (mainly go mod tidy), we need to copy
171+
# the .go-version file from the main branch to the backport branch. This avoids failures
172+
# installing dependencies in the backport Pull Request.
173+
echo "Copying .go-version from $SOURCE_BRANCH..."
174+
git checkout "$SOURCE_BRANCH" -- ".go-version"
175+
git add .go-version
176+
146177
# Run go mod tidy to update just the dependencies related to magefile and dev scripts
147178
go mod tidy
179+
180+
git add go.mod go.sum
148181
fi
149182

150183
if [ "${REMOVE_OTHER_PACKAGES}" == "true" ]; then
151184
echo "Removing all packages from $PACKAGES_FOLDER_PATH folder"
152185
removeOtherPackages "${PACKAGES_FOLDER_PATH}"
153-
ls -la $PACKAGES_FOLDER_PATH
186+
ls -la "${PACKAGES_FOLDER_PATH}"
187+
188+
git add "${PACKAGES_FOLDER_PATH}/"
189+
git add .github/CODEOWNERS
154190
fi
155191

192+
git status
193+
156194
echo "Setting up git environment..."
157195
update_git_config
158196

159-
echo "Commiting"
160-
git add $BUILDKITE_FOLDER_PATH
161-
if [ -d "${JENKINS_FOLDER_PATH}" ]; then
162-
git add "${JENKINS_FOLDER_PATH}"
163-
fi
164-
if [ -d "${MAGEFILE_SCRIPTS_FOLDER}" ] ; then
165-
git add ${MAGEFILE_SCRIPTS_FOLDER}
166-
git add ${TESTSREPORTER_SCRIPTS_FOLDER}
167-
git add go.mod go.sum
168-
fi
169-
git add $PACKAGES_FOLDER_PATH/
170-
git status
171-
172197
files_cached_num=$(git diff --name-only --cached | wc -l)
173198
if [ "${files_cached_num}" -gt 0 ]; then
199+
echo "Committing changes..."
174200
git commit -m "Add $BUILDKITE_FOLDER_PATH and $JENKINS_FOLDER_PATH to backport branch: $BACKPORT_BRANCH_NAME from the $SOURCE_BRANCH branch"
175201
else
176202
echo "Nothing to commit, skip."
177203
fi
178204

179205
if [ "$DRY_RUN" == "true" ];then
180206
echo "DRY_RUN mode, nothing will be pushed."
181-
# Show just the relevant files diff (go.mod, go.sum, .buildkite, dev and package to be backported)
182-
git --no-pager diff $SOURCE_BRANCH...$BACKPORT_BRANCH_NAME go.mod go.sum .buildkite/ dev/ "packages/${PACKAGE_NAME}"
207+
# Show just the relevant files diff (go.mod, go.sum, .buildkite, dev, .go-version, .github/CODEOWNERS and package to be backported)
208+
git --no-pager diff $SOURCE_BRANCH...$BACKPORT_BRANCH_NAME .buildkite/ dev/ go.sum go.mod .go-version .github/CODEOWNERS "packages/${PACKAGE_NAME}"
183209
else
184210
echo "Pushing..."
185211
git push origin $BACKPORT_BRANCH_NAME

.buildkite/scripts/common.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,6 @@ prepare_serverless_stack() {
540540
fi
541541
create_elastic_package_profile "${profile_name}"
542542

543-
export EC_API_KEY=${EC_API_KEY_SECRET}
544-
export EC_HOST=${EC_HOST_SECRET}
545-
546543
echo "Boot up the Elastic stack"
547544
# grep command required to remove password from the output
548545
if ! ${ELASTIC_PACKAGE_BIN} stack up \
@@ -749,7 +746,7 @@ is_pr_affected() {
749746
# Example:
750747
# https://buildkite.com/elastic/integrations/builds/25606
751748
# https://github.com/elastic/integrations/pull/13810
752-
if git diff --name-only "${commit_merge}" "${to}" | grep -E -v '^(packages/|\.github/(CODEOWNERS|ISSUE_TEMPLATE|PULL_REQUEST_TEMPLATE)|README\.md|docs/)' > /dev/null; then
749+
if git diff --name-only "${commit_merge}" "${to}" | grep -E -v '^(packages/|\.github/(CODEOWNERS|ISSUE_TEMPLATE|PULL_REQUEST_TEMPLATE)|README\.md|docs/|catalog-info\.yaml|\.buildkite/pull-requests\.json)' > /dev/null; then
753750
echo "[${package}] PR is affected: found non-package files"
754751
return 0
755752
fi
@@ -1112,3 +1109,19 @@ get_comment_with_pattern() {
11121109

11131110
echo "${comment_id}"
11141111
}
1112+
1113+
## Buildkite output
1114+
# https://buildkite.com/docs/pipelines/configure/links-and-images-in-log-output#links
1115+
inline_link() {
1116+
local url="$1"
1117+
local text="${2:-""}"
1118+
local link=""
1119+
1120+
link=$(printf "url='%s'" "$url")
1121+
1122+
if [[ "${text}" != "" ]]; then
1123+
link=$(printf "%s;content='%s'" "$link" "$text")
1124+
fi
1125+
1126+
printf '\033]1339;%s\a\n' "$link"
1127+
}

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/packages/apache_tomcat @elastic/obs-infraobs-integrations
2222
/packages/apm @elastic/obs-ds-intake-services
2323
/packages/arista_ngfw @elastic/sec-deployment-and-devices
24+
/packages/armis @elastic/security-service-integrations
2425
/packages/atlassian_bitbucket @elastic/security-service-integrations
2526
/packages/atlassian_confluence @elastic/security-service-integrations
2627
/packages/atlassian_jira @elastic/security-service-integrations
@@ -38,6 +39,7 @@
3839
/packages/aws/data_stream/cloudtrail @elastic/obs-infraobs-integrations
3940
/packages/aws/data_stream/cloudwatch_logs @elastic/obs-ds-hosted-services
4041
/packages/aws/data_stream/cloudwatch_metrics @elastic/obs-ds-hosted-services
42+
/packages/aws/data_stream/config @elastic/security-service-integrations
4143
/packages/aws/data_stream/dynamodb @elastic/obs-infraobs-integrations
4244
/packages/aws/data_stream/ebs @elastic/obs-ds-hosted-services
4345
/packages/aws/data_stream/ec2_logs @elastic/obs-ds-hosted-services
@@ -50,6 +52,7 @@
5052
/packages/aws/data_stream/guardduty @elastic/security-service-integrations
5153
/packages/aws/data_stream/kinesis @elastic/obs-infraobs-integrations
5254
/packages/aws/data_stream/lambda @elastic/obs-infraobs-integrations
55+
/packages/aws/data_stream/lambda_logs @elastic/obs-infraobs-integrations
5356
/packages/aws/data_stream/natgateway @elastic/obs-infraobs-integrations
5457
/packages/aws/data_stream/rds @elastic/obs-infraobs-integrations
5558
/packages/aws/data_stream/redshift @elastic/obs-infraobs-integrations
@@ -126,6 +129,7 @@
126129
/packages/bbot @elastic/security-service-integrations
127130
/packages/beaconing @elastic/ml-ui @elastic/sec-applied-ml
128131
/packages/beat @elastic/stack-monitoring
132+
/packages/beelzebub @elastic/security-service-integrations
129133
/packages/beyondinsight_password_safe @elastic/security-service-integrations
130134
/packages/beyondtrust_pra @elastic/security-service-integrations
131135
/packages/bitdefender @elastic/security-service-integrations
@@ -188,6 +192,7 @@
188192
/packages/dga @elastic/ml-ui @elastic/sec-applied-ml
189193
/packages/digital_guardian @elastic/security-service-integrations
190194
/packages/docker @elastic/obs-ds-hosted-services
195+
/packages/docker_otel @elastic/obs-ds-hosted-services
191196
/packages/elastic_agent @elastic/elastic-agent
192197
/packages/elastic_connectors @elastic/search-extract-and-transform
193198
/packages/elastic_package_registry @elastic/ecosystem

.github/ISSUE_TEMPLATE/integration_bug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ body:
131131
- Defend for Containers [cloud_defend]
132132
- Digital Guardian [digital_guardian]
133133
- Docker [docker]
134+
- Docker OpenTelemetry Assets [docker_otel]
134135
- Domain Generation Algorithm Detection [dga]
135136
- DomainTools Real Time Unified Feeds [ti_domaintools]
136137
- EclecticIQ [ti_eclecticiq]

.github/ISSUE_TEMPLATE/integration_feature_request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ body:
131131
- Defend for Containers [cloud_defend]
132132
- Digital Guardian [digital_guardian]
133133
- Docker [docker]
134+
- Docker OpenTelemetry Assets [docker_otel]
134135
- Domain Generation Algorithm Detection [dga]
135136
- DomainTools Real Time Unified Feeds [ti_domaintools]
136137
- EclecticIQ [ti_eclecticiq]

.github/workflows/block-paths.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)