From 9ff141195b4fb3c276e70ad6a48689b9ad91e7cd Mon Sep 17 00:00:00 2001 From: Alex Szabo Date: Mon, 10 Mar 2025 10:56:15 +0100 Subject: [PATCH] [ci] Trigger VM image rebuild for cache rebuild only (#213497) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary When VM image rebuild is triggered after ES promotion, only the cache warmup should be built. This PR also separates the daily full build to a daily base + cache build (in case ES promotions are failing for some reason, we should still have a daily cache refresh). Requires: https://github.com/elastic/ci-agent-images/pull/1295 With this, we'd run a daily base image build and cache build (~40m + 25m) + cache warmups for every promotion (~4x 25m) instead of a full build and promotion per build (~4x 55m). Ultimately not that much of a gain 🤷 (4*55=220m => 40+5x25=165m) (cherry picked from commit 830dbd4ed72cb05829dbc1ee383dee9f9cbcdac8) --- .../kibana-vm-images.yml | 17 ++++++++++++----- .../promote_es_serverless_image.sh | 3 ++- .../scripts/steps/es_snapshots/promote.sh | 3 ++- .../steps/fleet/promote_package_registry.sh | 3 ++- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.buildkite/pipeline-resource-definitions/kibana-vm-images.yml b/.buildkite/pipeline-resource-definitions/kibana-vm-images.yml index c0ca615646e93..d17ff5ffc3b70 100644 --- a/.buildkite/pipeline-resource-definitions/kibana-vm-images.yml +++ b/.buildkite/pipeline-resource-definitions/kibana-vm-images.yml @@ -27,17 +27,24 @@ spec: provider_settings: trigger_mode: none schedules: - daily kibana image build: + daily kibana base image build: branch: main cronline: '0 0 * * *' env: - IMAGES_CONFIG: kibana/images.yml - message: Builds Kibana VM images daily + IMAGES_CONFIG: kibana/base_image.yml + message: Builds Kibana VM base image daily + daily kibana cache layer build: + branch: main + cronline: '0 1 * * *' # make sure this runs after the daily kibana base image build + env: + IMAGES_CONFIG: kibana/image_cache.yml + BASE_IMAGES_CONFIG: 'core/images.yml,kibana/base_image.yml' + message: Builds Kibana VM cache warmup daily daily kibana fips image build: branch: main - cronline: '0 4 * * *' # make sure this runs after the daily kibana image build + cronline: '0 4 * * *' # make sure this runs after the daily kibana cache image build env: - BASE_IMAGES_CONFIG: 'core/images.yml,kibana/images.yml' + BASE_IMAGES_CONFIG: 'core/images.yml,kibana/base_image.yml,kibana/image_cache.yml' IMAGES_CONFIG: kibana/fips.yml message: Builds Kibana FIPS VM image daily teams: diff --git a/.buildkite/scripts/steps/es_serverless/promote_es_serverless_image.sh b/.buildkite/scripts/steps/es_serverless/promote_es_serverless_image.sh index a8885c44cfb74..309086fedb007 100755 --- a/.buildkite/scripts/steps/es_serverless/promote_es_serverless_image.sh +++ b/.buildkite/scripts/steps/es_serverless/promote_es_serverless_image.sh @@ -77,6 +77,7 @@ steps: async: true build: env: - IMAGES_CONFIG: "kibana/images.yml" + IMAGES_CONFIG: 'kibana/image_cache.yml' + BASE_IMAGES_CONFIG: 'core/images.yml,kibana/base_image.yml' RETRY: "1" EOF diff --git a/.buildkite/scripts/steps/es_snapshots/promote.sh b/.buildkite/scripts/steps/es_snapshots/promote.sh index 2b85505619a95..9f249680dd851 100755 --- a/.buildkite/scripts/steps/es_snapshots/promote.sh +++ b/.buildkite/scripts/steps/es_snapshots/promote.sh @@ -25,6 +25,7 @@ steps: async: true build: env: - IMAGES_CONFIG: "kibana/images.yml" + IMAGES_CONFIG: 'kibana/image_cache.yml' + BASE_IMAGES_CONFIG: 'core/images.yml,kibana/base_image.yml' RETRY: "1" EOF diff --git a/.buildkite/scripts/steps/fleet/promote_package_registry.sh b/.buildkite/scripts/steps/fleet/promote_package_registry.sh index 5fa62369cfa87..ba40b3214db96 100755 --- a/.buildkite/scripts/steps/fleet/promote_package_registry.sh +++ b/.buildkite/scripts/steps/fleet/promote_package_registry.sh @@ -14,7 +14,8 @@ steps: async: true build: env: - IMAGES_CONFIG: "kibana/images.yml" + IMAGES_CONFIG: 'kibana/image_cache.yml' + BASE_IMAGES_CONFIG: 'core/images.yml,kibana/base_image.yml' RETRY: "1" EOF else