Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .buildkite/scripts/lifecycle/pre_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ export SYNTHETICS_REMOTE_KIBANA_URL
DEPLOY_TAGGER_SLACK_WEBHOOK_URL=${DEPLOY_TAGGER_SLACK_WEBHOOK_URL:-"$(vault_get kibana-serverless-release-tools DEPLOY_TAGGER_SLACK_WEBHOOK_URL)"}
export DEPLOY_TAGGER_SLACK_WEBHOOK_URL

GCS_SA_CDN_QA_KEY="$(vault_get gcs-sa-cdn-qa key)"
export GCS_SA_CDN_QA_KEY

GCS_SA_CDN_QA_BUCKET="$(vault_get gcs-sa-cdn-qa bucket)"
export GCS_SA_CDN_QA_BUCKET

# Setup Failed Test Reporter Elasticsearch credentials
{
TEST_FAILURES_ES_CLOUD_ID=$(vault_get failed_tests_reporter_es cloud_id)
Expand Down
16 changes: 12 additions & 4 deletions .buildkite/scripts/steps/artifacts/docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if docker manifest inspect $KIBANA_IMAGE &> /dev/null; then
exit 1
fi

echo "--- Build images"
echo "--- Build Kibana"
node scripts/build \
--debug \
--release \
Expand All @@ -37,8 +37,7 @@ node scripts/build \
--skip-docker-ubuntu \
--skip-docker-ubi \
--skip-docker-cloud \
--skip-docker-contexts \
--skip-cdn-assets
--skip-docker-contexts

echo "--- Tag images"
docker rmi "$KIBANA_IMAGE"
Expand Down Expand Up @@ -88,12 +87,21 @@ fi
echo "--- Build dependencies report"
node scripts/licenses_csv_report "--csv=target/dependencies-$GIT_ABBREV_COMMIT.csv"

echo "--- Upload artifacts"
echo "--- Upload CDN assets"
Comment thread
Ikuni17 marked this conversation as resolved.
gcloud auth activate-service-account --key-file <(echo "$GCS_SA_CDN_QA_KEY")

CDN_ASSETS_FOLDER=$(mktemp -d)
tar -xf "kibana-$BASE_VERSION-cdn-assets.tar.gz" -C "$CDN_ASSETS_FOLDER" --strip=1

gsutil -m cp -r "$CDN_ASSETS_FOLDER/*" "gs://$GCS_SA_CDN_QA_BUCKET/$GIT_ABBREV_COMMIT"

@rudolf rudolf Dec 18, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would we construct this path to point to the static assets from index.html? We already use a build number https://github.com/elastic/kibana/blob/main/packages/core/rendering/core-rendering-server-internal/src/bootstrap/bootstrap_renderer.ts#L82

Is this GIT_ABBREV_COMMIT hash included in any of the RawPackageInfo fields https://github.com/elastic/kibana/blob/main/packages/kbn-config/src/env.ts#L45-L48

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build number doesn't contain all assets and in a branching scenario can cause conflicts.

% tree -L 3
.
├── 70129
│   └── bundles
│       ├── core
│       ├── kbn-monaco
│       ├── kbn-ui-shared-deps-npm
│       ├── kbn-ui-shared-deps-src
│       └── plugin
└── ui
    ├── favicons
    │   ├── favicon.distribution.ico
    │   ├── favicon.distribution.png
    │   ├── favicon.distribution.svg
    │   ├── favicon.ico
    │   ├── favicon.png
    │   └── favicon.svg
    ├── fonts
    │   ├── inter
    │   └── roboto_mono
    ├── legacy_dark_theme.css
    ├── legacy_dark_theme.min.css
    ├── legacy_light_theme.css
    └── legacy_light_theme.min.css

13 directories, 10 files

Is this GIT_ABBREV_COMMIT hash included in any of the RawPackageInfo fields https://github.com/elastic/kibana/blob/main/packages/kbn-config/src/env.ts#L45-L48

It is, build.sha{0,12}. It's also available to the controller as the id used to reference a build.


echo "--- Upload archives"
cd target
buildkite-agent artifact upload "kibana-$BASE_VERSION-linux-x86_64.tar.gz"
buildkite-agent artifact upload "kibana-$BASE_VERSION-linux-aarch64.tar.gz"
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 "kibana-$BASE_VERSION-cdn-assets.tar.gz"
buildkite-agent artifact upload "dependencies-$GIT_ABBREV_COMMIT.csv"
cd -

Expand Down