Skip to content

Commit

Permalink
Merge branch 'main' into test/page_template
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Sep 6, 2022
2 parents 4f7fa44 + 66f6d59 commit 7ee2602
Show file tree
Hide file tree
Showing 1,262 changed files with 19,124 additions and 7,158 deletions.
3 changes: 3 additions & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ disabled:
- x-pack/test/screenshot_creation/config.ts
- x-pack/test/fleet_packages/config.ts

# Scalability testing config that we run in its own pipeline
- x-pack/test/performance/scalability/config.ts

defaultQueue: 'n2-4-spot'
enabled:
- test/accessibility/config.ts
Expand Down
23 changes: 23 additions & 0 deletions .buildkite/pipelines/scalability/daily.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
steps:
- label: ':male-mechanic::skin-tone-2: Pre-Build'
command: .buildkite/scripts/lifecycle/pre_build.sh
agents:
queue: kibana-default
timeout_in_minutes: 10

- wait

- label: ':kibana: Scalability Tests'
command: .buildkite/scripts/steps/scalability/benchmarking.sh
agents:
queue: kb-static-scalability
timeout_in_minutes: 90

- wait: ~
continue_on_failure: true

- label: ':male_superhero::skin-tone-2: Post-Build'
command: .buildkite/scripts/lifecycle/post_build.sh
agents:
queue: kibana-default
timeout_in_minutes: 10
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for i in "${scalabilityJourneys[@]}"; do
echo "Looking for JOURNEY=${JOURNEY_NAME} and BUILD_ID=${BUILD_ID} in APM traces"

node scripts/extract_performance_testing_dataset \
--config "x-pack/test/performance/journeys/${i}/config.ts" \ \
--config "x-pack/test/performance/journeys/${i}/config.ts" \
--buildId "${BUILD_ID}" \
--es-url "${ES_SERVER_URL}" \
--es-username "${USER_FROM_VAULT}" \
Expand Down Expand Up @@ -51,6 +51,6 @@ cd -

echo "--- Promoting '${BUILD_ID}' dataset to LATEST"
cd "${OUTPUT_DIR}/.."
echo "${BUILD_ID}" > LATEST
gsutil cp LATEST "${GCS_BUCKET}"
echo "${BUILD_ID}" > latest
gsutil cp latest "${GCS_BUCKET}"
cd -
122 changes: 122 additions & 0 deletions .buildkite/scripts/steps/scalability/benchmarking.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

#.buildkite/scripts/bootstrap.sh
echo "--- yarn kbn reset && yarn kbn bootstrap"
yarn kbn reset && yarn kbn bootstrap

GCS_BUCKET="gs://kibana-performance/scalability-tests"
GCS_ARTIFACTS_REL="gcs_artifacts"
GCS_ARTIFACTS_DIR="${WORKSPACE}/${GCS_ARTIFACTS_REL}"
KIBANA_LOAD_TESTING_DIR="${KIBANA_DIR}/kibana-load-testing"

# These tests are running on static workers so we must delete previous build, load runner and scalability artifacts
rm -rf "${KIBANA_BUILD_LOCATION}"
rm -rf "${KIBANA_LOAD_TESTING_DIR}"
rm -rf "${GCS_ARTIFACTS_DIR}"

download_artifacts() {
mkdir -p "${GCS_ARTIFACTS_DIR}"

gsutil cp "$GCS_BUCKET/latest" "${GCS_ARTIFACTS_DIR}/"
HASH=`cat ${GCS_ARTIFACTS_DIR}/latest`
gsutil cp -r "$GCS_BUCKET/$HASH" "${GCS_ARTIFACTS_DIR}/"

export LATEST_RUN_ARTIFACTS_DIR="${GCS_ARTIFACTS_DIR}/${HASH}"

echo "Unzip kibana build, plugins and scalability traces"
cd "$WORKSPACE"
mkdir -p "$KIBANA_BUILD_LOCATION"
tar -xzf "${LATEST_RUN_ARTIFACTS_DIR}/kibana-default.tar.gz" -C "$KIBANA_BUILD_LOCATION" --strip=1

cd "$KIBANA_DIR"
tar -xzf "${LATEST_RUN_ARTIFACTS_DIR}/kibana-default-plugins.tar.gz"
tar -xzf "${LATEST_RUN_ARTIFACTS_DIR}/scalability_traces.tar.gz"
}

checkout_and_compile_load_runner() {
mkdir -p "${KIBANA_LOAD_TESTING_DIR}" && cd "${KIBANA_LOAD_TESTING_DIR}"

if [[ ! -d .git ]]; then
git init
git remote add origin https://github.com/elastic/kibana-load-testing.git
fi
git fetch origin --depth 1 "main"
git reset --hard FETCH_HEAD

KIBANA_LOAD_TESTING_GIT_COMMIT="$(git rev-parse HEAD)"
export KIBANA_LOAD_TESTING_GIT_COMMIT

mvn -q test-compile
echo "Set 'GATLING_PROJECT_PATH' env var for ScalabilityTestRunner"
export GATLING_PROJECT_PATH="$(pwd)"
}

upload_test_results() {
cd "${KIBANA_DIR}"
echo "--- Archive Gatling reports and upload as build artifacts"
tar -czf "scalability_test_report.tar.gz" --exclude=simulation.log -C kibana-load-testing/target gatling
buildkite-agent artifact upload "scalability_test_report.tar.gz"
cd "${LATEST_RUN_ARTIFACTS_DIR}"
echo "Upload scalability traces as build artifacts"
buildkite-agent artifact upload "scalability_traces.tar.gz"
}

echo "--- Download the latest artifacts from single user performance pipeline"
download_artifacts

echo "--- Clone kibana-load-testing repo and compile project"
checkout_and_compile_load_runner

echo "--- Run Scalability Tests with Elasticsearch started only once and Kibana restart before each journey"
cd "$KIBANA_DIR"
node scripts/es snapshot&

esPid=$!
# Set trap on EXIT to stop Elasticsearch process
trap "kill -9 $esPid" EXIT

# unset env vars defined in other parts of CI for automatic APM collection of
# Kibana. We manage APM config in our FTR config and performance service, and
# APM treats config in the ENV with a very high precedence.
unset ELASTIC_APM_ENVIRONMENT
unset ELASTIC_APM_TRANSACTION_SAMPLE_RATE
unset ELASTIC_APM_SERVER_URL
unset ELASTIC_APM_SECRET_TOKEN
unset ELASTIC_APM_ACTIVE
unset ELASTIC_APM_CONTEXT_PROPAGATION_ONLY
unset ELASTIC_APM_GLOBAL_LABELS
unset ELASTIC_APM_MAX_QUEUE_SIZE
unset ELASTIC_APM_METRICS_INTERVAL
unset ELASTIC_APM_CAPTURE_SPAN_STACK_TRACES
unset ELASTIC_APM_BREAKDOWN_METRICS


export TEST_ES_DISABLE_STARTUP=true
ES_HOST="localhost:9200"
export TEST_ES_URL="http://elastic:changeme@${ES_HOST}"
# Overriding Gatling default configuration
export ES_URL="http://${ES_HOST}"

# Pings the ES server every second for 2 mins until its status is green
curl --retry 120 \
--retry-delay 1 \
--retry-connrefused \
-I -XGET "${TEST_ES_URL}/_cluster/health?wait_for_nodes=>=1&wait_for_status=yellow"

export ELASTIC_APM_ACTIVE=true

for journey in scalability_traces/server/*; do
export SCALABILITY_JOURNEY_PATH="$KIBANA_DIR/$journey"
echo "--- Run scalability file: $SCALABILITY_JOURNEY_PATH"
node scripts/functional_tests \
--config x-pack/test/performance/scalability/config.ts \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug
done

echo "--- Upload test results"
upload_test_results
6 changes: 0 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,6 @@ module.exports = {
'jsx-a11y/click-events-have-key-events': 'off',
},
},
{
files: ['x-pack/plugins/ml/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},

/**
* Files that require dual-license headers, settings
Expand Down
2 changes: 1 addition & 1 deletion api_docs/actions.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1810,7 +1810,7 @@
},
"<",
"ActionTypeConfig",
">[]>; getOAuthAccessToken: ({ type, options }: Readonly<{} & { options: Readonly<{} & { config: Readonly<{} & { clientId: string; jwtKeyId: string; userIdentifierValue: string; }>; tokenUrl: string; secrets: Readonly<{ privateKeyPassword?: string | undefined; } & { clientSecret: string; privateKey: string; }>; }> | Readonly<{} & { scope: string; config: Readonly<{} & { clientId: string; tenantId: string; }>; tokenUrl: string; secrets: Readonly<{} & { clientSecret: string; }>; }>; type: \"client\" | \"jwt\"; }>, configurationUtilities: ",
">[]>; getOAuthAccessToken: ({ type, options }: Readonly<{} & { options: Readonly<{} & { config: Readonly<{} & { clientId: string; jwtKeyId: string; userIdentifierValue: string; }>; tokenUrl: string; secrets: Readonly<{ privateKeyPassword?: string | undefined; } & { clientSecret: string; privateKey: string; }>; }> | Readonly<{} & { scope: string; config: Readonly<{} & { clientId: string; tenantId: string; }>; tokenUrl: string; secrets: Readonly<{} & { clientSecret: string; }>; }>; type: \"jwt\" | \"client\"; }>, configurationUtilities: ",
"ActionsConfigurationUtilities",
") => Promise<{ accessToken: string | null; }>; enqueueExecution: (options: ",
"ExecuteOptions",
Expand Down
2 changes: 1 addition & 1 deletion api_docs/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions
title: "actions"
image: https://source.unsplash.com/400x175/?github
description: API docs for the actions plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions']
---
import actionsObj from './actions.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/advanced_settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings
title: "advancedSettings"
image: https://source.unsplash.com/400x175/?github
description: API docs for the advancedSettings plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings']
---
import advancedSettingsObj from './advanced_settings.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/aiops.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops
title: "aiops"
image: https://source.unsplash.com/400x175/?github
description: API docs for the aiops plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops']
---
import aiopsObj from './aiops.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/alerting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting
title: "alerting"
image: https://source.unsplash.com/400x175/?github
description: API docs for the alerting plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting']
---
import alertingObj from './alerting.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/apm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm
title: "apm"
image: https://source.unsplash.com/400x175/?github
description: API docs for the apm plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm']
---
import apmObj from './apm.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/banners.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners
title: "banners"
image: https://source.unsplash.com/400x175/?github
description: API docs for the banners plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners']
---
import bannersObj from './banners.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/bfetch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch
title: "bfetch"
image: https://source.unsplash.com/400x175/?github
description: API docs for the bfetch plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch']
---
import bfetchObj from './bfetch.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/canvas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas
title: "canvas"
image: https://source.unsplash.com/400x175/?github
description: API docs for the canvas plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas']
---
import canvasObj from './canvas.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/cases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cases
title: "cases"
image: https://source.unsplash.com/400x175/?github
description: API docs for the cases plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases']
---
import casesObj from './cases.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/charts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/charts
title: "charts"
image: https://source.unsplash.com/400x175/?github
description: API docs for the charts plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts']
---
import chartsObj from './charts.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/cloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloud
title: "cloud"
image: https://source.unsplash.com/400x175/?github
description: API docs for the cloud plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud']
---
import cloudObj from './cloud.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/cloud_security_posture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture
title: "cloudSecurityPosture"
image: https://source.unsplash.com/400x175/?github
description: API docs for the cloudSecurityPosture plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture']
---
import cloudSecurityPostureObj from './cloud_security_posture.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/console.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/console
title: "console"
image: https://source.unsplash.com/400x175/?github
description: API docs for the console plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console']
---
import consoleObj from './console.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/controls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/controls
title: "controls"
image: https://source.unsplash.com/400x175/?github
description: API docs for the controls plugin
date: 2022-09-01
date: 2022-09-06
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls']
---
import controlsObj from './controls.devdocs.json';
Expand Down
Loading

0 comments on commit 7ee2602

Please sign in to comment.