Skip to content

Commit 1a0df5a

Browse files
authored
Merge branch 'main' into detections/bulk-actions
2 parents 9c6dc77 + 874e4cb commit 1a0df5a

File tree

1,024 files changed

+14238
-4513
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,024 files changed

+14238
-4513
lines changed

.buildkite/ftr_configs.yml

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ disabled:
5858
- x-pack/test/screenshot_creation/config.ts
5959
- x-pack/test/fleet_packages/config.ts
6060

61+
# Scalability testing config that we run in its own pipeline
62+
- x-pack/test/performance/scalability/config.ts
63+
6164
defaultQueue: 'n2-4-spot'
6265
enabled:
6366
- test/accessibility/config.ts

.buildkite/pipelines/artifacts.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,23 @@ steps:
7373

7474
- command: .buildkite/scripts/steps/artifacts/cloud.sh
7575
label: 'Cloud Deployment'
76-
soft_fail: true
76+
soft_fail:
77+
- exit_status: 255
7778
agents:
7879
queue: n2-2
7980
timeout_in_minutes: 30
8081
if: "build.env('RELEASE_BUILD') == null || build.env('RELEASE_BUILD') == '' || build.env('RELEASE_BUILD') == 'false'"
8182
retry:
8283
automatic:
84+
# Timeout and graceful shutdown | ecctl deployment create falure
85+
- exit_status: 255
86+
limit: 0
87+
88+
# Timeout and forced shutdown
89+
- exit_status: '-1'
90+
limit: 0
91+
92+
# Test failures
8393
- exit_status: '*'
8494
limit: 1
8595

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
steps:
2+
- label: ':male-mechanic::skin-tone-2: Pre-Build'
3+
command: .buildkite/scripts/lifecycle/pre_build.sh
4+
agents:
5+
queue: kibana-default
6+
timeout_in_minutes: 10
7+
8+
- wait
9+
10+
- label: ':kibana: Scalability Tests'
11+
command: .buildkite/scripts/steps/scalability/benchmarking.sh
12+
agents:
13+
queue: kb-static-scalability
14+
timeout_in_minutes: 90
15+
16+
- wait: ~
17+
continue_on_failure: true
18+
19+
- label: ':male_superhero::skin-tone-2: Post-Build'
20+
command: .buildkite/scripts/lifecycle/post_build.sh
21+
agents:
22+
queue: kibana-default
23+
timeout_in_minutes: 10

.buildkite/scripts/steps/artifacts/cloud.sh

+17-16
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@ mkdir -p target
1212

1313
download_artifact "kibana-$FULL_VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
1414

15-
node scripts/build \
16-
--skip-initialize \
17-
--skip-generic-folders \
18-
--skip-platform-folders \
19-
--skip-archives \
20-
--docker-images \
21-
--skip-docker-ubi \
22-
--skip-docker-ubuntu \
23-
--skip-docker-contexts
24-
25-
docker load --input target/kibana-cloud-$FULL_VERSION-docker-image.tar.gz
26-
2715
TAG="$FULL_VERSION-$GIT_COMMIT"
28-
KIBANA_BASE_IMAGE="docker.elastic.co/kibana-ci/kibana-cloud:$FULL_VERSION"
2916
KIBANA_TEST_IMAGE="docker.elastic.co/kibana-ci/kibana-cloud:$TAG"
3017

31-
docker tag "$KIBANA_BASE_IMAGE" "$KIBANA_TEST_IMAGE"
32-
3318
echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co
3419
trap 'docker logout docker.elastic.co' EXIT
3520

36-
docker push "$KIBANA_TEST_IMAGE"
21+
if docker manifest inspect $KIBANA_TEST_IMAGE &> /dev/null; then
22+
echo "Distribution already exists, skipping build"
23+
else
24+
node scripts/build \
25+
--skip-initialize \
26+
--skip-generic-folders \
27+
--skip-platform-folders \
28+
--skip-archives \
29+
--docker-images \
30+
--docker-tag-qualifier="$GIT_COMMIT" \
31+
--docker-push \
32+
--skip-docker-ubi \
33+
--skip-docker-ubuntu \
34+
--skip-docker-contexts
35+
fi
36+
3737
docker logout docker.elastic.co
3838

3939
echo "--- Create deployment"
@@ -62,6 +62,7 @@ function shutdown {
6262
trap "shutdown" EXIT
6363

6464
ecctl deployment create --track --output json --file "$DEPLOYMENT_SPEC" > "$LOGS"
65+
6566
CLOUD_DEPLOYMENT_USERNAME=$(jq -r --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.username' "$LOGS")
6667
CLOUD_DEPLOYMENT_PASSWORD=$(jq -r --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.password' "$LOGS")
6768
CLOUD_DEPLOYMENT_ID=$(jq -r --slurp '.[0].id' "$LOGS")

.buildkite/scripts/steps/functional/scalability_dataset_extraction.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ for i in "${scalabilityJourneys[@]}"; do
2222
echo "Looking for JOURNEY=${JOURNEY_NAME} and BUILD_ID=${BUILD_ID} in APM traces"
2323

2424
node scripts/extract_performance_testing_dataset \
25-
--config "x-pack/test/performance/journeys/${i}/config.ts" \ \
25+
--config "x-pack/test/performance/journeys/${i}/config.ts" \
2626
--buildId "${BUILD_ID}" \
2727
--es-url "${ES_SERVER_URL}" \
2828
--es-username "${USER_FROM_VAULT}" \
@@ -51,6 +51,6 @@ cd -
5151

5252
echo "--- Promoting '${BUILD_ID}' dataset to LATEST"
5353
cd "${OUTPUT_DIR}/.."
54-
echo "${BUILD_ID}" > LATEST
55-
gsutil cp LATEST "${GCS_BUCKET}"
54+
echo "${BUILD_ID}" > latest
55+
gsutil cp latest "${GCS_BUCKET}"
5656
cd -
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
source .buildkite/scripts/common/util.sh
6+
7+
#.buildkite/scripts/bootstrap.sh
8+
echo "--- yarn kbn reset && yarn kbn bootstrap"
9+
yarn kbn reset && yarn kbn bootstrap
10+
11+
GCS_BUCKET="gs://kibana-performance/scalability-tests"
12+
GCS_ARTIFACTS_REL="gcs_artifacts"
13+
GCS_ARTIFACTS_DIR="${WORKSPACE}/${GCS_ARTIFACTS_REL}"
14+
KIBANA_LOAD_TESTING_DIR="${KIBANA_DIR}/kibana-load-testing"
15+
16+
# These tests are running on static workers so we must delete previous build, load runner and scalability artifacts
17+
rm -rf "${KIBANA_BUILD_LOCATION}"
18+
rm -rf "${KIBANA_LOAD_TESTING_DIR}"
19+
rm -rf "${GCS_ARTIFACTS_DIR}"
20+
21+
download_artifacts() {
22+
mkdir -p "${GCS_ARTIFACTS_DIR}"
23+
24+
gsutil cp "$GCS_BUCKET/latest" "${GCS_ARTIFACTS_DIR}/"
25+
HASH=`cat ${GCS_ARTIFACTS_DIR}/latest`
26+
gsutil cp -r "$GCS_BUCKET/$HASH" "${GCS_ARTIFACTS_DIR}/"
27+
28+
export LATEST_RUN_ARTIFACTS_DIR="${GCS_ARTIFACTS_DIR}/${HASH}"
29+
30+
echo "Unzip kibana build, plugins and scalability traces"
31+
cd "$WORKSPACE"
32+
mkdir -p "$KIBANA_BUILD_LOCATION"
33+
tar -xzf "${LATEST_RUN_ARTIFACTS_DIR}/kibana-default.tar.gz" -C "$KIBANA_BUILD_LOCATION" --strip=1
34+
35+
cd "$KIBANA_DIR"
36+
tar -xzf "${LATEST_RUN_ARTIFACTS_DIR}/kibana-default-plugins.tar.gz"
37+
tar -xzf "${LATEST_RUN_ARTIFACTS_DIR}/scalability_traces.tar.gz"
38+
}
39+
40+
checkout_and_compile_load_runner() {
41+
mkdir -p "${KIBANA_LOAD_TESTING_DIR}" && cd "${KIBANA_LOAD_TESTING_DIR}"
42+
43+
if [[ ! -d .git ]]; then
44+
git init
45+
git remote add origin https://github.com/elastic/kibana-load-testing.git
46+
fi
47+
git fetch origin --depth 1 "main"
48+
git reset --hard FETCH_HEAD
49+
50+
KIBANA_LOAD_TESTING_GIT_COMMIT="$(git rev-parse HEAD)"
51+
export KIBANA_LOAD_TESTING_GIT_COMMIT
52+
53+
mvn -q test-compile
54+
echo "Set 'GATLING_PROJECT_PATH' env var for ScalabilityTestRunner"
55+
export GATLING_PROJECT_PATH="$(pwd)"
56+
}
57+
58+
upload_test_results() {
59+
cd "${KIBANA_DIR}"
60+
echo "--- Archive Gatling reports and upload as build artifacts"
61+
tar -czf "scalability_test_report.tar.gz" --exclude=simulation.log -C kibana-load-testing/target gatling
62+
buildkite-agent artifact upload "scalability_test_report.tar.gz"
63+
cd "${LATEST_RUN_ARTIFACTS_DIR}"
64+
echo "Upload scalability traces as build artifacts"
65+
buildkite-agent artifact upload "scalability_traces.tar.gz"
66+
}
67+
68+
echo "--- Download the latest artifacts from single user performance pipeline"
69+
download_artifacts
70+
71+
echo "--- Clone kibana-load-testing repo and compile project"
72+
checkout_and_compile_load_runner
73+
74+
echo "--- Run Scalability Tests with Elasticsearch started only once and Kibana restart before each journey"
75+
cd "$KIBANA_DIR"
76+
node scripts/es snapshot&
77+
78+
esPid=$!
79+
# Set trap on EXIT to stop Elasticsearch process
80+
trap "kill -9 $esPid" EXIT
81+
82+
# unset env vars defined in other parts of CI for automatic APM collection of
83+
# Kibana. We manage APM config in our FTR config and performance service, and
84+
# APM treats config in the ENV with a very high precedence.
85+
unset ELASTIC_APM_ENVIRONMENT
86+
unset ELASTIC_APM_TRANSACTION_SAMPLE_RATE
87+
unset ELASTIC_APM_SERVER_URL
88+
unset ELASTIC_APM_SECRET_TOKEN
89+
unset ELASTIC_APM_ACTIVE
90+
unset ELASTIC_APM_CONTEXT_PROPAGATION_ONLY
91+
unset ELASTIC_APM_GLOBAL_LABELS
92+
unset ELASTIC_APM_MAX_QUEUE_SIZE
93+
unset ELASTIC_APM_METRICS_INTERVAL
94+
unset ELASTIC_APM_CAPTURE_SPAN_STACK_TRACES
95+
unset ELASTIC_APM_BREAKDOWN_METRICS
96+
97+
98+
export TEST_ES_DISABLE_STARTUP=true
99+
ES_HOST="localhost:9200"
100+
export TEST_ES_URL="http://elastic:changeme@${ES_HOST}"
101+
# Overriding Gatling default configuration
102+
export ES_URL="http://${ES_HOST}"
103+
104+
# Pings the ES server every second for 2 mins until its status is green
105+
curl --retry 120 \
106+
--retry-delay 1 \
107+
--retry-connrefused \
108+
-I -XGET "${TEST_ES_URL}/_cluster/health?wait_for_nodes=>=1&wait_for_status=yellow"
109+
110+
export ELASTIC_APM_ACTIVE=true
111+
112+
for journey in scalability_traces/server/*; do
113+
export SCALABILITY_JOURNEY_PATH="$KIBANA_DIR/$journey"
114+
echo "--- Run scalability file: $SCALABILITY_JOURNEY_PATH"
115+
node scripts/functional_tests \
116+
--config x-pack/test/performance/scalability/config.ts \
117+
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
118+
--debug
119+
done
120+
121+
echo "--- Upload test results"
122+
upload_test_results

.eslintrc.js

-6
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,6 @@ module.exports = {
287287
'jsx-a11y/click-events-have-key-events': 'off',
288288
},
289289
},
290-
{
291-
files: ['x-pack/plugins/ml/**/*.{js,mjs,ts,tsx}'],
292-
rules: {
293-
'react-hooks/exhaustive-deps': 'off',
294-
},
295-
},
296290

297291
/**
298292
* Files that require dual-license headers, settings

api_docs/actions.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions
88
title: "actions"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the actions plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions']
1313
---
1414
import actionsObj from './actions.devdocs.json';

api_docs/advanced_settings.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings
88
title: "advancedSettings"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the advancedSettings plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings']
1313
---
1414
import advancedSettingsObj from './advanced_settings.devdocs.json';

api_docs/aiops.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops
88
title: "aiops"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the aiops plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops']
1313
---
1414
import aiopsObj from './aiops.devdocs.json';

api_docs/alerting.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting
88
title: "alerting"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the alerting plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting']
1313
---
1414
import alertingObj from './alerting.devdocs.json';

api_docs/apm.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm
88
title: "apm"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the apm plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm']
1313
---
1414
import apmObj from './apm.devdocs.json';

api_docs/banners.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners
88
title: "banners"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the banners plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners']
1313
---
1414
import bannersObj from './banners.devdocs.json';

api_docs/bfetch.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch
88
title: "bfetch"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the bfetch plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch']
1313
---
1414
import bfetchObj from './bfetch.devdocs.json';

api_docs/canvas.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas
88
title: "canvas"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the canvas plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas']
1313
---
1414
import canvasObj from './canvas.devdocs.json';

api_docs/cases.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cases
88
title: "cases"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the cases plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases']
1313
---
1414
import casesObj from './cases.devdocs.json';

api_docs/charts.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/charts
88
title: "charts"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the charts plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts']
1313
---
1414
import chartsObj from './charts.devdocs.json';

api_docs/cloud.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloud
88
title: "cloud"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the cloud plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud']
1313
---
1414
import cloudObj from './cloud.devdocs.json';

api_docs/cloud_security_posture.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture
88
title: "cloudSecurityPosture"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the cloudSecurityPosture plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture']
1313
---
1414
import cloudSecurityPostureObj from './cloud_security_posture.devdocs.json';

api_docs/console.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/console
88
title: "console"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the console plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console']
1313
---
1414
import consoleObj from './console.devdocs.json';

api_docs/controls.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/controls
88
title: "controls"
99
image: https://source.unsplash.com/400x175/?github
1010
description: API docs for the controls plugin
11-
date: 2022-09-05
11+
date: 2022-09-06
1212
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls']
1313
---
1414
import controlsObj from './controls.devdocs.json';

0 commit comments

Comments
 (0)