Skip to content

Commit 652da17

Browse files
authored
[ci] Implement package registry promotion pipeline (#199071)
This adds a daily build that runs tests again `docker.elastic.co/package-registry/distribution:lite` and if successful, promotes the image to `docker.elastic.co/kibana-ci/package-registry-distribution:lite`. A follow up pull request will swap integration tests over to use the promoted image, and add environment overrides to run tests against the source image in this pipeline. https://buildkite.com/elastic/kibana-package-registry-promote/builds/2
1 parent f349f61 commit 652da17

File tree

3 files changed

+99
-6
lines changed

3 files changed

+99
-6
lines changed

.buildkite/pipeline-resource-definitions/kibana-package-registry.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
apiVersion: backstage.io/v1alpha1
33
kind: Resource
44
metadata:
5-
name: bk-kibana-package-registry-promote
5+
name: bk-kibana-package-registry-verify-and-promote
66
description: Promote package-registry/distribution:lite
77
links:
8-
- url: 'https://buildkite.com/elastic/kibana-package-registry-promote'
8+
- url: 'https://buildkite.com/elastic/kibana-package-registry-verify-and-promote'
99
title: Pipeline link
1010
spec:
1111
type: buildkite-pipeline
@@ -15,18 +15,21 @@ spec:
1515
apiVersion: buildkite.elastic.dev/v1
1616
kind: Pipeline
1717
metadata:
18-
name: kibana / package registry promote
19-
description: Promote package-registry/distribution:lite
18+
name: kibana / package registry verify and promote
19+
description: Verify and promote docker.elastic.co/package-registry/distribution:lite
2020
spec:
2121
env:
2222
SLACK_NOTIFICATIONS_CHANNEL: "#kibana-operations-alerts"
23-
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: "false"
23+
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: "true"
2424
repository: elastic/kibana
2525
branch_configuration: main
2626
default_branch: main
2727
pipeline_file: ".buildkite/pipelines/fleet/package_registry.yml"
2828
provider_settings:
2929
trigger_mode: none
30+
schedules:
31+
Daily promotion:
32+
cronline: 0 22 * * * America/New_York
3033
teams:
3134
everyone:
3235
access_level: BUILD_AND_READ
Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,70 @@
1+
env:
2+
IGNORE_SHIP_CI_STATS_ERROR: 'true'
13
steps:
2-
- command: echo "Placeholder"
4+
- command: .buildkite/scripts/lifecycle/pre_build.sh
5+
label: Pre-Build
6+
timeout_in_minutes: 10
7+
agents:
8+
image: family/kibana-ubuntu-2004
9+
imageProject: elastic-images-prod
10+
provider: gcp
11+
machineType: n2-standard-2
12+
13+
- wait
14+
15+
- command: .buildkite/scripts/steps/build_kibana.sh
16+
label: Build Kibana Distribution
17+
agents:
18+
image: family/kibana-ubuntu-2004
19+
imageProject: elastic-images-prod
20+
provider: gcp
21+
machineType: n2-standard-8
22+
preemptible: true
23+
key: build
24+
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
25+
timeout_in_minutes: 60
26+
retry:
27+
automatic:
28+
- exit_status: '-1'
29+
limit: 3
30+
31+
- command: .buildkite/scripts/steps/test/pick_test_group_run_order.sh
32+
label: 'Pick Test Group Run Order'
33+
agents:
34+
image: family/kibana-ubuntu-2004
35+
imageProject: elastic-images-prod
36+
provider: gcp
37+
machineType: n2-standard-2
38+
timeout_in_minutes: 10
39+
env:
40+
JEST_UNIT_SCRIPT: '.buildkite/scripts/steps/test/jest.sh'
41+
JEST_INTEGRATION_SCRIPT: '.buildkite/scripts/steps/test/jest_integration.sh'
42+
FTR_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/ftr_configs.sh'
43+
LIMIT_CONFIG_TYPE: integration,functional
44+
retry:
45+
automatic:
46+
- exit_status: '*'
47+
limit: 1
48+
49+
- command: .buildkite/scripts/steps/fleet/promote_package_registry.sh
50+
label: Promote docker.elastic.co/package-registry/distribution:lite
51+
agents:
52+
image: family/kibana-ubuntu-2004
53+
imageProject: elastic-images-prod
54+
provider: gcp
55+
machineType: n2-standard-2
56+
depends_on:
57+
- ftr-configs
58+
- jest-integration
59+
60+
- wait: ~
61+
continue_on_failure: true
62+
63+
- command: .buildkite/scripts/lifecycle/post_build.sh
64+
label: Post-Build
65+
timeout_in_minutes: 10
66+
agents:
67+
image: family/kibana-ubuntu-2004
68+
imageProject: elastic-images-prod
69+
provider: gcp
70+
machineType: n2-standard-2
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
PACKAGE_REGISTRY_BASE_IMAGE='docker.elastic.co/package-registry/distribution:lite'
6+
PACKAGE_REGISTRY_TARGET_IMAGE='docker.elastic.co/kibana-ci/package-registry-distribution:lite'
7+
8+
if [[ "$BUILDKITE_BRANCH" == "main" ]]; then
9+
docker buildx imagetools create -t "$PACKAGE_REGISTRY_TARGET_IMAGE" "$PACKAGE_REGISTRY_BASE_IMAGE"
10+
cat << EOF | buildkite-agent pipeline upload
11+
steps:
12+
- label: "Update cache for EPR image"
13+
trigger: kibana-vm-images
14+
async: true
15+
build:
16+
env:
17+
IMAGES_CONFIG="kibana/images.yml"
18+
RETRY="1"
19+
EOF
20+
else
21+
echo "Skipping promotion for untracked branch $BUILDKITE_BRANCH"
22+
fi

0 commit comments

Comments
 (0)