Skip to content

Commit

Permalink
Merge branch '8.2' of https://github.com/elastic/kibana into backport…
Browse files Browse the repository at this point in the history
…/8.2/pr-130123
  • Loading branch information
alisonelizabeth committed Apr 18, 2022
2 parents 8653e24 + b406d2b commit 31df581
Show file tree
Hide file tree
Showing 289 changed files with 1,661 additions and 3,162 deletions.
8 changes: 0 additions & 8 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
# Import shared settings first so we can override below
import %workspace%/.bazelrc.common

# Remote cache settings for local env
# build --remote_cache=grpcs://cloud.buildbuddy.io
# build --incompatible_remote_results_ignore_disk=true
# build --noremote_upload_local_results
# build --remote_timeout=30
# build --remote_header=x-buildbuddy-api-key=3EYk49W2NefOx2n3yMze
# build --remote_accept_cached=true

# Enable this in case you want to share your build info
# build --build_metadata=VISIBILITY=PUBLIC
build --build_metadata=TEST_GROUPS=//packages
Expand Down
14 changes: 1 addition & 13 deletions .buildkite/pipelines/es_snapshots/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ steps:

- command: .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Default CI Group'
parallelism: 27
parallelism: 29
agents:
queue: n2-4
depends_on: build
Expand All @@ -40,18 +40,6 @@ steps:
- exit_status: '*'
limit: 1

- command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Docker CI Group'
agents:
queue: n2-4
depends_on: build
timeout_in_minutes: 120
key: default-cigroup-docker
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/oss_cigroup.sh
label: 'OSS CI Group'
parallelism: 11
Expand Down
6 changes: 1 addition & 5 deletions .buildkite/pipelines/flaky_tests/groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@
{
"key": "xpack/cigroup",
"name": "Default CI Group",
"ciGroups": 27
},
{
"key": "xpack/cigroup/Docker",
"name": "Default CI Group Docker"
"ciGroups": 29
},
{
"key": "xpack/firefox",
Expand Down
16 changes: 1 addition & 15 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ steps:

- command: .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Default CI Group'
parallelism: 27
parallelism: 29
agents:
queue: n2-4-spot
depends_on: build
Expand All @@ -64,20 +64,6 @@ steps:
- exit_status: '*'
limit: 1

- command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Docker CI Group'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
key: default-cigroup-docker
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/oss_cigroup.sh
label: 'OSS CI Group'
parallelism: 11
Expand Down
50 changes: 34 additions & 16 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:

- command: .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Default CI Group'
parallelism: 27
parallelism: 29
agents:
queue: n2-4
depends_on: build
Expand All @@ -28,28 +28,18 @@ steps:
- exit_status: '*'
limit: 1

- command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Docker CI Group'
agents:
queue: n2-4
depends_on: build
timeout_in_minutes: 120
key: default-cigroup-docker
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/oss_cigroup.sh
label: 'OSS CI Group'
parallelism: 11
agents:
queue: ci-group-4d
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
key: oss-cigroup
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

Expand All @@ -61,6 +51,8 @@ steps:
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

Expand All @@ -72,6 +64,8 @@ steps:
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

Expand All @@ -83,6 +77,8 @@ steps:
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

Expand All @@ -94,6 +90,8 @@ steps:
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

Expand All @@ -105,6 +103,8 @@ steps:
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

Expand All @@ -116,31 +116,45 @@ steps:
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/test/jest.sh
label: 'Jest Tests'
parallelism: 8
agents:
queue: n2-4
queue: n2-4-spot
timeout_in_minutes: 90
key: jest
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/test/jest_integration.sh
label: 'Jest Integration Tests'
parallelism: 3
agents:
queue: n2-4
queue: n2-4-spot
timeout_in_minutes: 120
key: jest-integration
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/test/api_integration.sh
label: 'API Integration Tests'
agents:
queue: n2-2
timeout_in_minutes: 120
key: api-integration
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
Expand Down Expand Up @@ -176,6 +190,10 @@ steps:
queue: n2-4
key: build_api_docs
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/webpack_bundle_analyzer/build_and_upload.sh
label: 'Build Webpack Bundle Analyzer reports'
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/common/setup_bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ 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 --bes_backend=grpcs://remote.buildbuddy.io
build --remote_cache=grpcs://remote.buildbuddy.io
build --remote_timeout=3600
build --remote_header=x-buildbuddy-api-key=$KIBANA_BUILDBUDDY_CI_API_KEY
EOF
Expand Down
8 changes: 8 additions & 0 deletions .buildkite/scripts/lifecycle/pre_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@ export CI_STATS_TOKEN="$(retry 5 5 vault read -field=api_token secret/kibana-iss
export CI_STATS_HOST="$(retry 5 5 vault read -field=api_host secret/kibana-issues/dev/kibana_ci_stats)"

node "$(dirname "${0}")/ci_stats_start.js"

# We resolve the latest manifest URL at the beginning of the build to ensure that all steps in the build will use the same manifest
# Otherwise, the manifest could change if a step is running around the time that a new one is promoted
if [[ ! "${ES_SNAPSHOT_MANIFEST:-}" ]]; then
BUCKET=$(curl -s "https://storage.googleapis.com/kibana-ci-es-snapshots-daily/$(cat package.json | jq -r .version)/manifest-latest-verified.json" | jq -r .bucket)
ES_SNAPSHOT_MANIFEST_DEFAULT="https://storage.googleapis.com/$BUCKET/manifest.json"
buildkite-agent meta-data set ES_SNAPSHOT_MANIFEST_DEFAULT "$ES_SNAPSHOT_MANIFEST_DEFAULT"
fi
9 changes: 9 additions & 0 deletions .buildkite/scripts/lifecycle/pre_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ EOF
fi
}

# If a custom manifest isn't specified, then use the default one that we resolve earlier in the build
{
if [[ ! "${ES_SNAPSHOT_MANIFEST:-}" ]]; then
ES_SNAPSHOT_MANIFEST=${ES_SNAPSHOT_MANIFEST:-$(buildkite-agent meta-data get ES_SNAPSHOT_MANIFEST_DEFAULT --default '')}
export ES_SNAPSHOT_MANIFEST
echo "Using default ES Snapshot Manifest: $ES_SNAPSHOT_MANIFEST"
fi
}

# Setup CI Stats
{
CI_STATS_BUILD_ID="$(buildkite-agent meta-data get ci_stats_build_id --default '')"
Expand Down
15 changes: 12 additions & 3 deletions .buildkite/scripts/steps/artifacts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@ source .buildkite/scripts/steps/artifacts/env.sh
echo "--- Build Kibana artifacts"
node scripts/build --all-platforms --debug --docker-cross-compile $(echo "$BUILD_ARGS")

echo "--- Build and upload dependencies report"
echo "--- Extract default i18n messages"
mkdir -p target/i18n
node scripts/i18n_extract --output-dir=target/i18n

echo "--- Build dependencies report"
node scripts/licenses_csv_report "--csv=target/dependencies-$FULL_VERSION.csv"
(cd target; sha512sum "dependencies-$FULL_VERSION.csv" > "dependencies-$FULL_VERSION.csv.sha512.txt")

echo "--- Upload Kibana Artifacts"
cd target
sha512sum "dependencies-$FULL_VERSION.csv" > "dependencies-$FULL_VERSION.csv.sha512.txt"
buildkite-agent artifact upload "*"
buildkite-agent artifact upload 'kibana-*'
buildkite-agent artifact upload "dependencies-$FULL_VERSION.csv"
buildkite-agent artifact upload "dependencies-$FULL_VERSION.csv.sha512.txt"
buildkite-agent artifact upload 'i18n/*.json'
cd -
51 changes: 28 additions & 23 deletions .buildkite/scripts/steps/artifacts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,35 @@ trap 'docker logout docker.elastic.co' EXIT
docker pull docker.elastic.co/infra/release-manager:latest

echo "--- Publish artifacts"
export VAULT_ROLE_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-role-id)"
export VAULT_SECRET_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-secret-id)"
export VAULT_ADDR="https://secrets.elastic.co:8200"
docker run --rm \
--name release-manager \
-e VAULT_ADDR \
-e VAULT_ROLE_ID \
-e VAULT_SECRET_ID \
--mount type=bind,readonly=false,src="$PWD/target",target=/artifacts/target \
docker.elastic.co/infra/release-manager:latest \
cli collect \
--project kibana \
--branch "$KIBANA_BASE_BRANCH" \
--commit "$GIT_COMMIT" \
--workflow "$WORKFLOW" \
--version "$BASE_VERSION" \
--qualifier "$VERSION_QUALIFIER" \
--artifact-set main

ARTIFACTS_SUBDOMAIN="artifacts-$WORKFLOW"
ARTIFACTS_SUMMARY=$(curl -s "https://$ARTIFACTS_SUBDOMAIN.elastic.co/kibana/latest/$FULL_VERSION.json" | jq -re '.summary_url')

cat << EOF | buildkite-agent annotate --style "info" --context artifacts-summary
if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]]; then
export VAULT_ROLE_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-role-id)"
export VAULT_SECRET_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-secret-id)"
export VAULT_ADDR="https://secrets.elastic.co:8200"
docker run --rm \
--name release-manager \
-e VAULT_ADDR \
-e VAULT_ROLE_ID \
-e VAULT_SECRET_ID \
--mount type=bind,readonly=false,src="$PWD/target",target=/artifacts/target \
docker.elastic.co/infra/release-manager:latest \
cli collect \
--project kibana \
--branch "$KIBANA_BASE_BRANCH" \
--commit "$GIT_COMMIT" \
--workflow "$WORKFLOW" \
--version "$BASE_VERSION" \
--qualifier "$VERSION_QUALIFIER" \
--artifact-set main

ARTIFACTS_SUBDOMAIN="artifacts-$WORKFLOW"
ARTIFACTS_SUMMARY=$(curl -s "https://$ARTIFACTS_SUBDOMAIN.elastic.co/kibana/latest/$FULL_VERSION.json" | jq -re '.summary_url')

cat << EOF | buildkite-agent annotate --style "info" --context artifacts-summary
### Artifacts Summary
$ARTIFACTS_SUMMARY
EOF

else
echo "Skipping publish for untracked branch $BUILDKITE_BRANCH"
fi
12 changes: 11 additions & 1 deletion .buildkite/scripts/steps/package_testing/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ elif [[ "$TEST_PACKAGE" == "docker" ]]; then
fi
cd ..

export VAGRANT_CWD=test/package
export VAGRANT_CWD=$PWD/test/package
vagrant up "$TEST_PACKAGE" --no-provision

node scripts/es snapshot \
Expand All @@ -29,6 +29,16 @@ node scripts/es snapshot \
--license=trial &
while ! timeout 1 bash -c "echo > /dev/tcp/localhost/9200"; do sleep 30; done

function echoKibanaLogs {
echo '--- Kibana logs'
if [[ "$TEST_PACKAGE" == "deb" ]] || [[ "$TEST_PACKAGE" == "rpm" ]]; then
vagrant ssh $TEST_PACKAGE -t -c 'sudo cat /var/log/kibana/kibana.log'
elif [[ "$TEST_PACKAGE" == "docker" ]]; then
vagrant ssh $TEST_PACKAGE -t -c 'sudo docker logs kibana'
fi
}
trap "echoKibanaLogs" EXIT

vagrant provision "$TEST_PACKAGE"

export TEST_BROWSER_HEADLESS=1
Expand Down
3 changes: 2 additions & 1 deletion .ci/ci_groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ xpack:
- ciGroup25
- ciGroup26
- ciGroup27
- ciGroupDocker
- ciGroup28
- ciGroup29
Loading

0 comments on commit 31df581

Please sign in to comment.