Skip to content

Commit 9051644

Browse files
v1vmergify[bot]
authored andcommitted
ci: reproducible builds using pinned VM images (#8211)
(cherry picked from commit 9259f35)
1 parent 386e722 commit 9051644

File tree

4 files changed

+135
-15
lines changed

4 files changed

+135
-15
lines changed

.buildkite/bk.integration.pipeline.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ env:
55
VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp"
66
ASDF_MAGE_VERSION: 1.14.0
77

8-
IMAGE_UBUNTU_2404_X86_64: "family/platform-ingest-elastic-agent-ubuntu-2404"
9-
IMAGE_UBUNTU_2404_ARM_64: "platform-ingest-elastic-agent-ubuntu-2404-aarch64"
10-
IMAGE_RHEL_8: "family/platform-ingest-elastic-agent-rhel-8"
11-
IMAGE_DEBIAN_12: "family/platform-ingest-elastic-agent-debian-12"
12-
IMAGE_WIN_2022: "family/platform-ingest-elastic-agent-windows-2022"
13-
IMAGE_WIN_2025: "family/platform-ingest-elastic-agent-windows-2025"
8+
# The following images are defined here and their values will be updated by updatecli
9+
# Please do not change them manually.
10+
IMAGE_UBUNTU_2404_X86_64: "platform-ingest-elastic-agent-ubuntu-2404-1748347205"
11+
IMAGE_UBUNTU_2404_ARM_64: "platform-ingest-elastic-agent-ubuntu-2404-aarch64-1748347205"
12+
IMAGE_RHEL_8: "platform-ingest-elastic-agent-rhel-8-1748347205"
13+
IMAGE_DEBIAN_12: "platform-ingest-elastic-agent-debian-12-1748347205"
14+
IMAGE_WIN_2022: "platform-ingest-elastic-agent-windows-2022-1748347205"
15+
IMAGE_WIN_2025: "platform-ingest-elastic-agent-windows-2025-1748347205"
1416

1517
steps:
1618
- label: Start ESS stack for integration tests
@@ -249,7 +251,7 @@ steps:
249251
- build/diagnostics/**
250252
agents:
251253
provider: "aws"
252-
imagePrefix: "${IMAGE_UBUNTU_2404_ARM_64}"
254+
image: "${IMAGE_UBUNTU_2404_ARM_64}"
253255
instanceType: "m6g.2xlarge"
254256
retry:
255257
automatic:
@@ -286,7 +288,7 @@ steps:
286288
limit: 1
287289
agents:
288290
provider: "aws"
289-
imagePrefix: "${IMAGE_UBUNTU_2404_ARM_64}"
291+
image: "${IMAGE_UBUNTU_2404_ARM_64}"
290292
instanceType: "m6g.xlarge"
291293
matrix:
292294
- default

.buildkite/pipeline.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ env:
44
VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp"
55
DOCKER_REGISTRY: "docker.elastic.co"
66

7-
IMAGE_UBUNTU_2204_X86_64: "family/platform-ingest-elastic-agent-ubuntu-2204"
8-
IMAGE_UBUNTU_2204_ARM_64: "platform-ingest-elastic-agent-ubuntu-2204-aarch64"
9-
IMAGE_WIN_2016: "family/platform-ingest-elastic-agent-windows-2016"
10-
IMAGE_WIN_2022: "family/platform-ingest-elastic-agent-windows-2022"
11-
IMAGE_WIN_10: "family/platform-ingest-elastic-agent-windows-10"
12-
IMAGE_WIN_11: "family/platform-ingest-elastic-agent-windows-11"
7+
# The following images are defined here and their values will be updated by updatecli
8+
# Please do not change them manually.
9+
IMAGE_UBUNTU_2204_X86_64: "platform-ingest-elastic-agent-ubuntu-2204-1748347205"
10+
IMAGE_UBUNTU_2204_ARM_64: "platform-ingest-elastic-agent-ubuntu-2204-aarch64-1748347205"
11+
IMAGE_WIN_2016: "platform-ingest-elastic-agent-windows-2016-1748347205"
12+
IMAGE_WIN_2022: "platform-ingest-elastic-agent-windows-2022-1748347205"
13+
IMAGE_WIN_10: "platform-ingest-elastic-agent-windows-10-1748347205"
14+
IMAGE_WIN_11: "platform-ingest-elastic-agent-windows-11-1748347205"
1315

1416
steps:
1517
- label: "check-ci"
@@ -52,7 +54,7 @@ steps:
5254
- "coverage-*.out"
5355
agents:
5456
provider: "aws"
55-
imagePrefix: "${IMAGE_UBUNTU_2204_ARM_64}"
57+
image: "${IMAGE_UBUNTU_2204_ARM_64}"
5658
diskSizeGb: 200
5759
instanceType: "m6g.xlarge"
5860
retry:
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# update-cli configuration for automated VM image version bumping
2+
---
3+
name: Bump vm-images to latest version
4+
5+
scms:
6+
githubConfig:
7+
kind: github
8+
spec:
9+
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
10+
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
11+
owner: '{{ .scm.owner }}'
12+
repository: '{{ .scm.repository }}'
13+
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
14+
commitusingapi: true
15+
branch: '{{ .scm.branch }}'
16+
force: false
17+
18+
actions:
19+
elastic-agent:
20+
kind: github/pullrequest
21+
scmid: githubConfig
22+
sourceid: latestGoVersion
23+
spec:
24+
automerge: false
25+
labels:
26+
- dependencies
27+
- backport-active-all
28+
title: '[Automation] Bump VM Image version to {{ source "latestVersion" }}'
29+
30+
sources:
31+
latestVersion:
32+
name: Get latest available build
33+
kind: json
34+
spec:
35+
file: https://storage.googleapis.com/artifacts-api/vm-images/elastic-agent/latest.json
36+
key: .date
37+
38+
conditions:
39+
latestVersion-check:
40+
name: Check if defined latest version differs
41+
kind: shell
42+
sourceid: latestVersion
43+
spec:
44+
command: 'grep -q -v {{ source "latestVersion" }} .buildkite/pipeline.yml #'
45+
46+
targets:
47+
update-buildkite-pipeline:
48+
name: "Update .buildkite/pipeline.yml"
49+
sourceid: latestVersion
50+
scmid: githubConfig
51+
kind: file
52+
spec:
53+
file: .buildkite/pipeline.yml
54+
matchpattern: '(IMAGE_.+): "platform-ingest-elastic-agent-(.+)-(.+)"'
55+
replacepattern: '$1: "platform-ingest-elastic-agent-$2-{{ source "latestVersion" }}"'
56+
57+
update-buildkite-bk.integration.pipeline:
58+
name: "Update .buildkite/bk.integration.pipeline.yml"
59+
sourceid: latestVersion
60+
scmid: githubConfig
61+
kind: file
62+
spec:
63+
file: .buildkite/bk.integration.pipeline.yml
64+
matchpattern: '(IMAGE_.+): "platform-ingest-elastic-agent-(.+)-(.+)"'
65+
replacepattern: '$1: "platform-ingest-elastic-agent-$2-{{ source "latestVersion" }}"'
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: bump-vm-images
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: "0 10 * * 0"
8+
9+
permissions:
10+
contents: read
11+
12+
env:
13+
JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
14+
15+
jobs:
16+
bump:
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: elastic/oblt-actions/updatecli/run@v1
25+
with:
26+
command: apply --config .ci/updatecli/updatecli-bump-vm-images.yml --values .ci/updatecli/values.d/scm.yml
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- if: ${{ failure() }}
31+
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
32+
with:
33+
method: chat.postMessage
34+
token: ${{ secrets.SLACK_BOT_TOKEN }}
35+
payload: |
36+
{
37+
"channel": "#ingest-notifications",
38+
"text": "${{ env.SLACK_MESSAGE }}",
39+
"blocks": [
40+
{
41+
"type": "section",
42+
"text": {
43+
"type": "mrkdwn",
44+
"text": "${{ env.SLACK_MESSAGE }}"
45+
}
46+
}
47+
]
48+
}
49+
env:
50+
#SLACK_MESSAGE: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@agent-team` please look what's going on <${{ env.JOB_URL }}|here>"
51+
SLACK_MESSAGE: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`"

0 commit comments

Comments
 (0)