Split scalability pipelines (#151915)

## Summary

As a POC single api capacity testing pipeline was sharing pipeline steps
& main script with scalability journey.
This pipeline does not build Kibana sources, but downloads existing
Kibana build and run tests against it.

This PR moves capacity testing in its own script and its own pipeline
that includes building Kibana sources and testing your changes.

cc @afharo 

It should be possible to test your Kibana changes for apis performance
improvements.
This commit is contained in:
Dzmitry Lemechko 2023-02-24 12:52:57 +01:00 committed by GitHub
parent f4ccd89b92
commit 18fbb946aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 115 additions and 41 deletions

View file

@ -0,0 +1,38 @@
steps:
- label: 'Pre-Build'
command: .buildkite/scripts/lifecycle/pre_build.sh
agents:
queue: kibana-default
- wait
- label: 'Build Kibana Distribution and Plugins'
command: .buildkite/scripts/steps/build_kibana.sh
agents:
queue: n2-16-spot
key: build
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3
- label: ':kibana: APIs Capacity Tests'
command: .buildkite/scripts/steps/scalability/api_capacity_testing.sh
agents:
queue: kb-static-scalability
depends_on: build
timeout_in_minutes: 90
retry:
automatic:
- exit_status: '*'
limit: 1
- wait: ~
continue_on_failure: true
- label: 'Post-Build'
command: .buildkite/scripts/lifecycle/post_build.sh
agents:
queue: kibana-default

View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
source .buildkite/scripts/common/util.sh
source .buildkite/scripts/steps/scalability/util.sh
bootstrap_kibana
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}"
echo "--- Download the build artifacts"
.buildkite/scripts/download_build_artifacts.sh
echo "--- Clone kibana-load-testing repo and compile project"
mkdir -p "${KIBANA_LOAD_TESTING_DIR}" && cd "${KIBANA_LOAD_TESTING_DIR}"
checkout_and_compile_load_runner
echo "--- Run single apis capacity tests"
cd "$KIBANA_DIR"
node scripts/run_scalability --kibana-install-dir "$KIBANA_BUILD_LOCATION" --journey-path "x-pack/test/scalability/apis"
echo "--- Upload test results"
upload_test_results

View file

@ -4,9 +4,9 @@ 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
source .buildkite/scripts/steps/scalability/util.sh
bootstrap_kibana
GCS_BUCKET="gs://kibana-performance/scalability-tests"
GCS_ARTIFACTS_REL="gcs_artifacts"
@ -37,51 +37,20 @@ download_artifacts() {
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 "Upload server logs as build artifacts"
tar -czf server-logs.tar.gz data/ftr_servers_logs/**/*
buildkite-agent artifact upload server-logs.tar.gz
echo "--- Upload Gatling reports 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 "--- Clone kibana-load-testing repo and compile project"
mkdir -p "${KIBANA_LOAD_TESTING_DIR}" && cd "${KIBANA_LOAD_TESTING_DIR}"
checkout_and_compile_load_runner
cd "$KIBANA_DIR"
echo "--- Download the latest artifacts from single user performance pipeline"
download_artifacts
if [ "$BUILDKITE_PIPELINE_SLUG" == "kibana-scalability-benchmarking-1" ]; then
echo "--- Run journey scalability tests"
node scripts/run_scalability --kibana-install-dir "$KIBANA_BUILD_LOCATION" --journey-path "scalability_traces/server"
else
echo "--- Run single apis capacity tests"
node scripts/run_scalability --kibana-install-dir "$KIBANA_BUILD_LOCATION" --journey-path "x-pack/test/scalability/apis"
fi
echo "--- Run journey scalability tests"
node scripts/run_scalability --kibana-install-dir "$KIBANA_BUILD_LOCATION" --journey-path "scalability_traces/server"
echo "--- Upload test results"
upload_test_results
cd "${LATEST_RUN_ARTIFACTS_DIR}"
echo "Upload scalability traces as build artifacts"
buildkite-agent artifact upload "scalability_traces.tar.gz"

View file

@ -0,0 +1,39 @@
#!/usr/bin/env bash
checkout_and_compile_load_runner() {
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() {
echo "Upload server logs as build artifacts"
tar -czf server-logs.tar.gz data/ftr_servers_logs/**/*
buildkite-agent artifact upload server-logs.tar.gz
echo "--- Upload Gatling reports 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"
}
bootstrap_kibana() {
echo "--- yarn kbn bootstrap --force-install"
if ! yarn kbn bootstrap --force-install; then
echo "bootstrap failed, trying again in 15 seconds"
sleep 15
rm -rf node_modules
echo "--- yarn kbn reset && yarn kbn bootstrap, attempt 2"
yarn kbn reset && yarn kbn bootstrap
fi
}