Skip to content

Commit

Permalink
Merge branch 'master' into 114984
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Oct 20, 2021
2 parents 89de9d6 + 4ff3cb4 commit c0c54df
Show file tree
Hide file tree
Showing 1,573 changed files with 39,880 additions and 35,215 deletions.
2 changes: 1 addition & 1 deletion .bazeliskversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.7.5
1.10.1
3 changes: 0 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ build --remote_timeout=30
build --remote_header=x-buildbuddy-api-key=3EYk49W2NefOx2n3yMze
build --remote_accept_cached=true

# BuildBuddy
## Metadata settings
build --workspace_status_command="node ./src/dev/bazel_workspace_status.js"
# Enable this in case you want to share your build info
# build --build_metadata=VISIBILITY=PUBLIC
build --build_metadata=TEST_GROUPS=//packages
Expand Down
4 changes: 2 additions & 2 deletions .bazelrc.common
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ test --incompatible_strict_action_env
# collect coverage information from test targets
coverage --instrument_test_targets

# Settings for CI
# Bazel flags for CI are in /src/dev/ci_setup/.bazelrc-ci
# Metadata settings
build --workspace_status_command="node ./src/dev/bazel_workspace_status.js"

# Load any settings specific to the current user.
# .bazelrc.user should appear in .gitignore so that settings are not shared with team members
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0
4.2.1
4 changes: 4 additions & 0 deletions .buildkite/pipelines/es_snapshots/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ steps:

- command: .buildkite/scripts/lifecycle/pre_build.sh
label: Pre-Build
timeout_in_minutes: 10

- wait

Expand All @@ -22,6 +23,7 @@ steps:
queue: c2-16
key: build
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
timeout_in_minutes: 60

- command: .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Default CI Group'
Expand Down Expand Up @@ -81,6 +83,7 @@ steps:

- command: .buildkite/scripts/steps/es_snapshots/trigger_promote.sh
label: Trigger promotion
timeout_in_minutes: 10
depends_on:
- default-cigroup
- default-cigroup-docker
Expand All @@ -93,3 +96,4 @@ steps:

- command: .buildkite/scripts/lifecycle/post_build.sh
label: Post-Build
timeout_in_minutes: 10
6 changes: 6 additions & 0 deletions .buildkite/pipelines/hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ env:
steps:
- command: .buildkite/scripts/lifecycle/pre_build.sh
label: Pre-Build
timeout_in_minutes: 10

- wait

Expand All @@ -12,6 +13,7 @@ steps:
queue: c2-16
key: build
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
timeout_in_minutes: 60

- command: .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Default CI Group'
Expand Down Expand Up @@ -143,21 +145,25 @@ steps:
agents:
queue: n2-2
key: linting
timeout_in_minutes: 90

- command: .buildkite/scripts/steps/checks.sh
label: 'Checks'
agents:
queue: c2-4
key: checks
timeout_in_minutes: 120

- command: .buildkite/scripts/steps/storybooks/build_and_upload.sh
label: 'Build Storybooks'
agents:
queue: c2-4
key: storybooks
timeout_in_minutes: 60

- wait: ~
continue_on_failure: true

- command: .buildkite/scripts/lifecycle/post_build.sh
label: Post-Build
timeout_in_minutes: 10
6 changes: 6 additions & 0 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,27 @@ env:
steps:
- command: .buildkite/scripts/lifecycle/pre_build.sh
label: Pre-Build
timeout_in_minutes: 10

- wait

- command: .buildkite/scripts/steps/on_merge_build_and_metrics.sh
label: Default Build and Metrics
env:
BAZEL_CACHE_MODE: read-write
agents:
queue: c2-8
timeout_in_minutes: 60

- command: .buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh
label: Build TS Refs and Check Public API Docs
agents:
queue: c2-4
timeout_in_minutes: 80

- wait: ~
continue_on_failure: true

- command: .buildkite/scripts/lifecycle/post_build.sh
label: Post-Build
timeout_in_minutes: 10
35 changes: 35 additions & 0 deletions .buildkite/pipelines/performance/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
steps:
- block: ":gear: Performance Tests Configuration"
prompt: "Fill out the details for performance test"
fields:
- text: ":arrows_counterclockwise: Iterations"
key: "performance-test-iteration-count"
hint: "How many times you want to run tests? "
required: true
if: build.env('ITERATION_COUNT_ENV') == null

- label: ":male-mechanic::skin-tone-2: Pre-Build"
command: .buildkite/scripts/lifecycle/pre_build.sh

- wait

- label: ":factory_worker: Build Kibana Distribution and Plugins"
command: .buildkite/scripts/steps/build_kibana.sh
agents:
queue: c2-16
key: build

- label: ":muscle: Performance Tests"
command: .buildkite/scripts/steps/functional/performance.sh
agents:
queue: ci-group-6
depends_on: build
concurrency: 50
concurrency_group: 'performance-test-group'

- wait: ~
continue_on_failure: true

- label: ":male_superhero::skin-tone-2: Post-Build"
command: .buildkite/scripts/lifecycle/post_build.sh

7 changes: 6 additions & 1 deletion .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
steps:
- command: .buildkite/scripts/lifecycle/pre_build.sh
label: Pre-Build
timeout_in_minutes: 10

- wait

Expand All @@ -10,14 +11,15 @@ steps:
queue: c2-16
key: build
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
timeout_in_minutes: 60

- command: .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Default CI Group'
parallelism: 13
agents:
queue: ci-group-6
depends_on: build
timeout_in_minutes: 120
timeout_in_minutes: 150
key: default-cigroup
retry:
automatic:
Expand Down Expand Up @@ -141,15 +143,18 @@ steps:
agents:
queue: n2-2
key: linting
timeout_in_minutes: 90

- command: .buildkite/scripts/steps/checks.sh
label: 'Checks'
agents:
queue: c2-4
key: checks
timeout_in_minutes: 120

- command: .buildkite/scripts/steps/storybooks/build_and_upload.sh
label: 'Build Storybooks'
agents:
queue: c2-4
key: storybooks
timeout_in_minutes: 60
2 changes: 2 additions & 0 deletions .buildkite/pipelines/update_demo_env.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
steps:
- command: .buildkite/scripts/steps/demo_env/es_and_init.sh
label: Initialize Environment and Deploy ES
timeout_in_minutes: 10

- command: .buildkite/scripts/steps/demo_env/kibana.sh
label: Build and Deploy Kibana
agents:
queue: c2-8
timeout_in_minutes: 60
1 change: 1 addition & 0 deletions .buildkite/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -euo pipefail

source .buildkite/scripts/common/util.sh
source .buildkite/scripts/common/setup_bazel.sh

echo "--- yarn install and bootstrap"
retry 2 15 yarn kbn bootstrap
Expand Down
15 changes: 0 additions & 15 deletions .buildkite/scripts/common/persist_bazel_cache.sh

This file was deleted.

38 changes: 38 additions & 0 deletions .buildkite/scripts/common/setup_bazel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

source .buildkite/scripts/common/util.sh

KIBANA_BUILDBUDDY_CI_API_KEY=$(retry 5 5 vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key)
export KIBANA_BUILDBUDDY_CI_API_KEY

echo "[bazel] writing .bazelrc"
cat <<EOF > $KIBANA_DIR/.bazelrc
# Generated by .buildkite/scripts/common/setup_bazel.sh
import %workspace%/.bazelrc.common
build --build_metadata=ROLE=CI
EOF

if [[ "${BAZEL_CACHE_MODE:-none}" == read* ]]; then
echo "[bazel] enabling caching"
cat <<EOF >> $KIBANA_DIR/.bazelrc
build --bes_results_url=https://app.buildbuddy.io/invocation/
build --bes_backend=grpcs://cloud.buildbuddy.io
build --remote_cache=grpcs://cloud.buildbuddy.io
build --remote_timeout=3600
build --remote_header=x-buildbuddy-api-key=$KIBANA_BUILDBUDDY_CI_API_KEY
EOF
fi

if [[ "${BAZEL_CACHE_MODE:-none}" == "read" ]]; then
echo "[bazel] cache set to read-only"
cat <<EOF >> $KIBANA_DIR/.bazelrc
build --noremote_upload_local_results
EOF
fi

if [[ "${BAZEL_CACHE_MODE:-none}" != @(read|read-write|none|) ]]; then
echo "invalid value for BAZEL_CACHE_MODE received ($BAZEL_CACHE_MODE), expected one of [read,read-write,none]"
exit 1
fi
2 changes: 1 addition & 1 deletion .buildkite/scripts/common/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ verify_no_git_changes() {
RED='\033[0;31m'
C_RESET='\033[0m' # Reset color

GIT_CHANGES="$(git ls-files --modified)"
GIT_CHANGES="$(git ls-files --modified -- . ':!:.bazelrc')"
if [ "$GIT_CHANGES" ]; then
echo -e "\n${RED}ERROR: '$1' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
Expand Down
20 changes: 20 additions & 0 deletions .buildkite/scripts/steps/functional/performance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -uo pipefail

if [ -z "${ITERATION_COUNT_ENV+x}" ]; then
ITERATION_COUNT="$(buildkite-agent meta-data get performance-test-iteration-count)"
else
ITERATION_COUNT=$ITERATION_COUNT_ENV
fi

tput setab 2; tput setaf 0; echo "Performance test will be run at ${BUILDKITE_BRANCH} ${ITERATION_COUNT} times"

cat << EOF | buildkite-agent pipeline upload
steps:
- command: .buildkite/scripts/steps/functional/performance_sub.sh
parallelism: "$ITERATION_COUNT"
EOF



17 changes: 17 additions & 0 deletions .buildkite/scripts/steps/functional/performance_sub.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
.buildkite/scripts/download_build_artifacts.sh

cd "$XPACK_DIR"

echo --- Run Performance Tests
checks-reporter-with-killswitch "Run Performance Tests" \
node scripts/functional_tests \
--debug --bail \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--config test/performance/config.ts;
3 changes: 0 additions & 3 deletions .buildkite/scripts/steps/on_merge_build_and_metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

set -euo pipefail

# Write Bazel cache for Linux
.buildkite/scripts/common/persist_bazel_cache.sh

.buildkite/scripts/bootstrap.sh
.buildkite/scripts/build_kibana.sh
.buildkite/scripts/post_build_kibana.sh
Expand Down
Loading

0 comments on commit c0c54df

Please sign in to comment.