Skip to content

Commit

Permalink
Merge branch 'main' into update-bundled-packages-20230119165025
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Jan 25, 2023
2 parents 0bc5ade + 201fabc commit 6056081
Show file tree
Hide file tree
Showing 2,393 changed files with 120,833 additions and 97,496 deletions.
1 change: 1 addition & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ enabled:
- x-pack/test/security_api_integration/oidc.config.ts
- x-pack/test/security_api_integration/pki.config.ts
- x-pack/test/security_api_integration/saml.config.ts
- x-pack/test/security_api_integration/saml_cloud.config.ts
- x-pack/test/security_api_integration/session_idle.config.ts
- x-pack/test/security_api_integration/session_invalidate.config.ts
- x-pack/test/security_api_integration/session_lifespan.config.ts
Expand Down
8 changes: 8 additions & 0 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,11 @@ steps:
timeout_in_minutes: 10
agents:
queue: kibana-default

- wait

- command: '.buildkite/scripts/steps/artifacts/docker_image_trigger.sh'
label: Trigger container image build
timeout_in_minutes: 10
agents:
queue: 'kibana-default'
14 changes: 11 additions & 3 deletions .buildkite/scripts/post_build_kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
set -euo pipefail

if [[ ! "${DISABLE_CI_STATS_SHIPPING:-}" ]]; then
cmd=(
"node" "scripts/ship_ci_stats"
"--metrics" "target/optimizer_bundle_metrics.json"
"--metrics" "build/kibana/node_modules/@kbn/ui-shared-deps-src/shared_built_assets/metrics.json"
)

if [ "$BUILDKITE_PIPELINE_SLUG" == "kibana-on-merge" ]; then
cmd+=("--validate")
fi

echo "--- Ship Kibana Distribution Metrics to CI Stats"
node scripts/ship_ci_stats \
--metrics target/optimizer_bundle_metrics.json \
--metrics build/kibana/node_modules/@kbn/ui-shared-deps-src/shared_built_assets/metrics.json
"${cmd[@]}"
fi

echo "--- Upload Build Artifacts"
Expand Down
49 changes: 46 additions & 3 deletions .buildkite/scripts/steps/artifacts/docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ source .buildkite/scripts/steps/artifacts/env.sh
GIT_ABBREV_COMMIT=${BUILDKITE_COMMIT:0:7}
KIBANA_IMAGE="docker.elastic.co/kibana-ci/kibana:$GIT_ABBREV_COMMIT"

echo "--- Verify image does not already exist"
echo "--- Verify manifest does not already exist"
echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co
trap 'docker logout docker.elastic.co' EXIT

if docker manifest inspect $KIBANA_IMAGE &> /dev/null; then
echo "Image already exists, exiting"
echo "Manifest already exists, exiting"
exit 1
fi

echo "--- Build image"
echo "--- Build images"
node scripts/build \
--debug \
--release \
Expand All @@ -29,6 +29,29 @@ node scripts/build \
--skip-docker-ubi \
--skip-docker-cloud \
--skip-docker-contexts

echo "--- Tag images"
docker rmi "$KIBANA_IMAGE"
docker load < "target/kibana-$BASE_VERSION-docker-image.tar.gz"
docker tag "$KIBANA_IMAGE" "$KIBANA_IMAGE-amd64"

docker rmi "$KIBANA_IMAGE"
docker load < "target/kibana-$BASE_VERSION-docker-image-aarch64.tar.gz"
docker tag "$KIBANA_IMAGE" "$KIBANA_IMAGE-arm64"

echo "--- Push images"
docker image push "$KIBANA_IMAGE-arm64"
docker image push "$KIBANA_IMAGE-amd64"

echo "--- Create manifest"
docker rmi "$KIBANA_IMAGE"
docker manifest create \
"$KIBANA_IMAGE" \
--amend "$KIBANA_IMAGE-arm64" \
--amend "$KIBANA_IMAGE-amd64"

echo "--- Push manifest"
docker manifest push "$KIBANA_IMAGE"
docker logout docker.elastic.co

echo "--- Build dependencies report"
Expand All @@ -42,3 +65,23 @@ buildkite-agent artifact upload "kibana-$BASE_VERSION-docker-image.tar.gz"
buildkite-agent artifact upload "kibana-$BASE_VERSION-docker-image-aarch64.tar.gz"
buildkite-agent artifact upload "dependencies-$GIT_ABBREV_COMMIT.csv"
cd -

echo "--- Trigger image tag update"
if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]]; then

cat << EOF | buildkite-agent pipeline upload
steps:
- trigger: k8s-gitops-update-image-tag
label: ":argo: Update image tag for deployment-api"
branches: main
build:
env:
MODE: sed
TARGET_FILE: kibana-controller.yaml
IMAGE_TAG: "$GIT_ABBREV_COMMIT"
SERVICE: kibana-controller
EOF

else
echo "Skipping update for untracked branch $BUILDKITE_BRANCH"
fi
5 changes: 5 additions & 0 deletions .buildkite/scripts/steps/artifacts/docker_image_trigger.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -euo pipefail

ts-node .buildkite/scripts/steps/trigger_pipeline.ts kibana-artifacts-container-image "$BUILDKITE_BRANCH" "$BUILDKITE_COMMIT"
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ packages/kbn-chart-icons @elastic/kibana-visualizations
packages/kbn-ci-stats-core @elastic/kibana-operations
packages/kbn-ci-stats-performance-metrics @elastic/kibana-operations
packages/kbn-ci-stats-reporter @elastic/kibana-operations
packages/kbn-ci-stats-shipper-cli @elastic/kibana-operations
packages/kbn-cli-dev-mode @elastic/kibana-operations
packages/kbn-coloring @elastic/kibana-visualizations
packages/kbn-config @elastic/kibana-core
Expand Down Expand Up @@ -981,6 +982,7 @@ packages/kbn-rison @elastic/kibana-operations
packages/kbn-rule-data-utils @elastic/security-detections-response @elastic/actionable-observability @elastic/response-ops
packages/kbn-safer-lodash-set @elastic/kibana-security
packages/kbn-securitysolution-autocomplete @elastic/security-solution-platform
packages/kbn-securitysolution-ecs @elastic/security-threat-hunting-explore
packages/kbn-securitysolution-es-utils @elastic/security-solution-platform
packages/kbn-securitysolution-exception-list-components @elastic/security-solution-platform
packages/kbn-securitysolution-hook-utils @elastic/security-solution-platform
Expand Down Expand Up @@ -1017,6 +1019,7 @@ packages/kbn-tooling-log @elastic/kibana-operations
packages/kbn-ts-projects @elastic/kibana-operations
packages/kbn-ts-type-check-cli @elastic/kibana-operations
packages/kbn-typed-react-router-config @elastic/apm-ui
packages/kbn-ui-actions-browser @elastic/appex-sharedux
packages/kbn-ui-framework @elastic/kibana-design
packages/kbn-ui-shared-deps-npm @elastic/kibana-operations
packages/kbn-ui-shared-deps-src @elastic/kibana-operations
Expand Down
Loading

0 comments on commit 6056081

Please sign in to comment.