Skip to content

Commit 8910d57

Browse files
committed
Merge branch 'main' into feature/serverless-its-oblt-cli
* main: bk: use elastic/vault-secrets and test-collector plugins together (elastic#8311) ci: reproducible builds using pinned VM images (elastic#8211)
2 parents d653382 + 9206f0b commit 8910d57

File tree

7 files changed

+145
-35
lines changed

7 files changed

+145
-35
lines changed

.buildkite/bk.integration.pipeline.yml

Lines changed: 15 additions & 9 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
@@ -449,7 +451,11 @@ steps:
449451
soft_fail:
450452
- exit_status: "*"
451453
plugins:
452-
- test-collector#v1.10.1:
454+
- elastic/vault-secrets#v0.1.0:
455+
path: "kv/ci-shared/platform-ingest/buildkite_analytics_token"
456+
field: "token"
457+
env_var: "BUILDKITE_ANALYTICS_TOKEN"
458+
- test-collector#v1.11.0:
453459
files: "build/*.xml"
454460
format: "junit"
455461
branches: "main"

.buildkite/hooks/pre-command

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,6 @@ if [[ "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then
5858
export API_KEY_TOKEN=$(vault kv get -field apiKey ${CI_ESS_PATH})
5959
echo ${API_KEY_TOKEN} > ./apiKey
6060
export TEST_INTEG_AUTH_ESS_APIKEY_FILE=$(realpath ./apiKey)
61-
62-
# BK analytics
63-
echo "--- Prepare BK test analytics token :vault:"
64-
BUILDKITE_ANALYTICS_TOKEN=$(vault kv get -field token kv/ci-shared/platform-ingest/buildkite_analytics_token)
65-
export BUILDKITE_ANALYTICS_TOKEN
66-
fi
67-
68-
if [[ "$BUILDKITE_STEP_KEY" == *"aggregate-reports"* ]]; then
69-
# BK analytics
70-
echo "--- Prepare BK test analytics token :vault:"
71-
BUILDKITE_ANALYTICS_TOKEN=$(vault kv get -field token kv/ci-shared/platform-ingest/buildkite_analytics_token)
72-
export BUILDKITE_ANALYTICS_TOKEN
7361
fi
7462

7563
if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-binary-dra" ]]; then

.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"
@@ -91,7 +93,7 @@ steps:
9193
- "coverage-*.out"
9294
agents:
9395
provider: "aws"
94-
imagePrefix: "${IMAGE_UBUNTU_2204_ARM_64}"
96+
image: "${IMAGE_UBUNTU_2204_ARM_64}"
9597
diskSizeGb: 200
9698
instanceType: "m6g.xlarge"
9799
retry:

.buildkite/scripts/steps/integration_tests_tf.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ else
5353
export INTEGRATIONS_SERVER_HOST=$(buildkite-agent meta-data get "integrations_server.host")
5454
fi
5555

56-
# TODO: move to common.sh when it's refactored
57-
# BK analytics
58-
echo "--- Prepare BK test analytics token :vault:"
59-
BUILDKITE_ANALYTICS_TOKEN=$(vault kv get -field token kv/ci-shared/platform-ingest/buildkite_analytics_token)
60-
export BUILDKITE_ANALYTICS_TOKEN
61-
6256
# Run integration tests
6357
echo "~~~ Running integration tests"
6458

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 }}`"

docs/test-framework-dev-guide.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,11 @@ out weight the benefits of creating another group.
356356
machineType: "n1-standard-8"
357357
image: "family/platform-ingest-elastic-agent-ubuntu-2404"
358358
plugins:
359-
- test-collector#v1.10.1:
359+
- elastic/vault-secrets#v0.1.0:
360+
path: "kv/ci-shared/platform-ingest/buildkite_analytics_token"
361+
field: "token"
362+
env_var: "BUILDKITE_ANALYTICS_TOKEN"
363+
- test-collector#v1.11.0:
360364
files: "build/TEST-*.xml"
361365
format: "junit"
362366
branches: "main"

0 commit comments

Comments
 (0)