Skip to content

Commit e4ed27a

Browse files
authored
[CI] Two step epr image promotion (elastic#244517)
## Summary Part of elastic#244476 Makes use of the configurability from elastic/ci-agent-images#2045 This introduces a 2 step promotion, with the following outline: - promote to `:temp` (step1) and start building the VM image with this image - when the VM image is updated with the cache, we promote image to `:lite` which we're using in FTRs Hopefully this will do away with any gaps between promotion and a cache-warmed image.
1 parent 4ef7feb commit e4ed27a

File tree

2 files changed

+44
-25
lines changed

2 files changed

+44
-25
lines changed

.buildkite/pipelines/fleet/package_registry.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
env:
22
IGNORE_SHIP_CI_STATS_ERROR: 'true'
3+
PACKAGE_REGISTRY_BASE_IMAGE: 'docker.elastic.co/package-registry/distribution:lite'
4+
PACKAGE_REGISTRY_TEMP_IMAGE: 'docker.elastic.co/kibana-ci/package-registry-distribution:temp'
5+
PACKAGE_REGISTRY_TARGET_IMAGE: 'docker.elastic.co/kibana-ci/package-registry-distribution:lite'
36
steps:
47
- command: .buildkite/scripts/lifecycle/pre_build.sh
58
label: Pre-Build
@@ -130,8 +133,11 @@ steps:
130133
- exit_status: '-1'
131134
limit: 1
132135

133-
- command: .buildkite/scripts/steps/fleet/promote_package_registry.sh
134-
label: Promote docker.elastic.co/package-registry/distribution:lite
136+
- command: |
137+
echo "--- Promoting base image to temp..."
138+
docker buildx imagetools create -t "$PACKAGE_REGISTRY_TEMP_IMAGE" "$PACKAGE_REGISTRY_BASE_IMAGE"
139+
label: 'Promote EPR image to temp'
140+
key: promote-epr-to-temp
135141
agents:
136142
image: family/kibana-ubuntu-2404
137143
imageProject: elastic-images-prod
@@ -142,6 +148,42 @@ steps:
142148
- jest-integration
143149
- defend-workflows-stateful
144150
- defend-workflows-serverless
151+
if: "build.branch == 'main'"
152+
retry:
153+
automatic:
154+
- exit_status: '-1'
155+
limit: 1
156+
157+
- label: 'Update cache for EPR image'
158+
trigger: kibana-vm-images
159+
key: epr-image-cache-update
160+
build:
161+
env:
162+
EPR_IMAGE: "$PACKAGE_REGISTRY_TEMP_IMAGE"
163+
IMAGES_CONFIG: 'kibana/image_cache.tpl.yml'
164+
BASE_IMAGES_CONFIG: 'core/images.yml,kibana/base_image.yml,kibana/packages_layer.yml'
165+
RETRY: '1'
166+
depends_on:
167+
- promote-epr-to-temp
168+
if: "build.branch == 'main'"
169+
170+
- command: |
171+
echo "--- Promoting temp image to final target..."
172+
docker buildx imagetools create -t "$PACKAGE_REGISTRY_TARGET_IMAGE" "$PACKAGE_REGISTRY_TEMP_IMAGE"
173+
label: 'Promote EPR image to final target'
174+
key: promote-epr-image
175+
agents:
176+
image: family/kibana-ubuntu-2404
177+
imageProject: elastic-images-prod
178+
provider: gcp
179+
machineType: n2-standard-2
180+
depends_on:
181+
- epr-image-cache-update
182+
if: "build.branch == 'main'"
183+
retry:
184+
automatic:
185+
- exit_status: '-1'
186+
limit: 1
145187
146188
- wait: ~
147189
continue_on_failure: true

.buildkite/scripts/steps/fleet/promote_package_registry.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)