-
Notifications
You must be signed in to change notification settings - Fork 5k
Expand file tree
/
Copy pathpackaging.pipeline.yml
More file actions
444 lines (422 loc) · 15.4 KB
/
Copy pathpackaging.pipeline.yml
File metadata and controls
444 lines (422 loc) · 15.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
# TODO: Pre-cache beats-dev/golang-crossbuild container image
env:
ASDF_MAGE_VERSION: 1.15.0
AWS_ARM_INSTANCE_TYPE: "m6g.xlarge"
AWS_IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2204-aarch64-1782878510"
GCP_DEFAULT_MACHINE_TYPE: "c2d-standard-8"
IMAGE_UBUNTU_X86_64: "platform-ingest-beats-ubuntu-2204-1782878510"
PLATFORMS: "+all linux/amd64 windows/amd64 darwin/amd64"
PLATFORMS_ARM: "+all linux/arm64 darwin/arm64 windows/arm64"
PLATFORMS_AMD64_FIPS: "+all linux/amd64"
PLATFORMS_ARM64_FIPS: "+all linux/arm64"
# This section is used to define the plugins that will be used in the pipeline.
# See https://buildkite.com/docs/pipelines/integrations/plugins/using#using-yaml-anchors-with-plugins
common:
- dockerhub_login_plugin: &dockerhub_login_plugin
elastic/vault-docker-login#v0.8.0:
secret_path: 'kv/ci-shared/observability-github-secrets/shared/docker/dockerhub/observabilityrobots'
disable_logout: true
- docker_elastic_login_plugin: &docker_elastic_login_plugin
elastic/vault-docker-login#v0.8.0:
secret_path: 'kv/ci-shared/platform-ingest/elastic_docker_registry'
disable_logout: true
- google_oidc_plugin: &google_oidc_plugin
# See https://github.com/elastic/oblt-infra/blob/main/conf/resources/repos/elastic-agent/01-gcp-oidc.tf
# This plugin authenticates to Google Cloud using the OIDC token.
elastic/oblt-google-auth#v1.3.1:
lifetime: 10800 # seconds
project-id: "elastic-observability-ci"
project-number: "911195782929"
steps:
# we use concurrency gates (https://buildkite.com/blog/concurrency-gates)
# to implement two FIFO queues for DRA-snapshot and DRA-staging
# this prevents parallel builds and possibility of publishing out of order DRA artifacts if the first job takes longer than the second
- name: Start of concurrency group for DRA Snapshot
if: (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.branch == 'main' || build.env('RUN_SNAPSHOT') == "true") && build.env('VERSION_QUALIFIER') == null
command: echo "--> Start of concurrency gate dra-snapshot"
concurrency_group: "dra-gate-snapshot-$BUILDKITE_BRANCH"
concurrency: 1
key: start-gate-snapshot
- name: Start of concurrency group for DRA Staging
# exceptionally allow building staging from main when VERSION_QUALIFIER is set, to allow prerelease testing
# TODO remove OR clause below and above comment, and only allow matching /^[0-9]+\.[0-9x]+\$/ for build.branch
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null
command: echo "--> Start of concurrency gate dra-staging"
concurrency_group: "dra-gate-staging-$BUILDKITE_BRANCH"
concurrency: 1
key: start-gate-staging
- wait
- group: Beats dashboards
key: dashboards
steps:
- label: Snapshot dashboards
if: (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.branch == 'main' || build.env('RUN_SNAPSHOT') == "true") && build.env('VERSION_QUALIFIER') == null
depends_on: start-gate-snapshot
key: dashboards-snapshot
# TODO: container with go and make
agents:
provider: gcp
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
timeout_in_minutes: 40
retry:
automatic:
- limit: 1
commands:
- make build/distributions/dependencies.csv
- make beats-dashboards
env:
SNAPSHOT: true
DEV: true
artifact_paths:
- build/distributions/**/*
plugins:
- *google_oidc_plugin
- label: Staging dashboards
# TODO remove OR clause below (see earlier comment)
if: (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null) || build.env('RUN_STAGING') == "true"
depends_on: start-gate-staging
key: dashboards-staging
# TODO: container with go and make
agents:
provider: gcp
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
timeout_in_minutes: 40
retry:
automatic:
- limit: 1
commands: |
source .buildkite/scripts/version_qualifier.sh
make build/distributions/dependencies.csv
make beats-dashboards
env:
SNAPSHOT: false
DEV: false
artifact_paths:
- build/distributions/**/*
plugins:
- *google_oidc_plugin
- group: Packaging snapshot
if: (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.branch == 'main' || build.env('RUN_SNAPSHOT') == "true") && build.env('VERSION_QUALIFIER') == null
key: packaging-snapshot
depends_on: start-gate-snapshot
steps:
- label: "SNAPSHOT: {{matrix}}"
env:
PLATFORMS: "${PLATFORMS}"
SNAPSHOT: true
# packaging with `DEV=true` may cause linker issues while crosscompiling https://github.com/elastic/beats/issues/41270
DEV: false
command: ".buildkite/scripts/packaging/package-dra.sh {{matrix}}"
agents:
provider: gcp
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
timeout_in_minutes: 40
retry:
automatic:
- limit: 1
artifact_paths:
- build/distributions/**/*
plugins:
- *google_oidc_plugin
- *dockerhub_login_plugin
- *docker_elastic_login_plugin
matrix:
- auditbeat
- filebeat
- heartbeat
- metricbeat
- packetbeat
- winlogbeat
- x-pack/auditbeat
- x-pack/dockerlogbeat
- x-pack/filebeat
- x-pack/heartbeat
- x-pack/metricbeat
- x-pack/osquerybeat
- x-pack/packetbeat
- x-pack/winlogbeat
- label: "SNAPSHOT: {{matrix}} Linux/arm64, Darwin/arm64, and Windows/arm64"
env:
PLATFORMS: "${PLATFORMS_ARM}"
SNAPSHOT: true
# packaging with `DEV=true` may cause linker issues while crosscompiling https://github.com/elastic/beats/issues/41270
DEV: false
command: ".buildkite/scripts/packaging/package-dra.sh {{matrix}}"
agents:
provider: "aws"
image: "${AWS_IMAGE_UBUNTU_ARM_64}"
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
timeout_in_minutes: 40
retry:
automatic:
- limit: 1
artifact_paths:
- build/distributions/**/*
plugins:
- *google_oidc_plugin
- *dockerhub_login_plugin
- *docker_elastic_login_plugin
matrix:
- auditbeat
- filebeat
- heartbeat
- metricbeat
- packetbeat
- winlogbeat
- x-pack/auditbeat
- x-pack/dockerlogbeat
- x-pack/filebeat
- x-pack/heartbeat
- x-pack/metricbeat
- x-pack/osquerybeat
- x-pack/packetbeat
- x-pack/winlogbeat
- label: "SNAPSHOT: {{matrix}} Linux/amd64 FIPS"
env:
PLATFORMS: "${PLATFORMS_AMD64_FIPS}"
SNAPSHOT: true
# packaging with `DEV=true` may cause linker issues while crosscompiling https://github.com/elastic/beats/issues/41270
DEV: false
FIPS: true
command: ".buildkite/scripts/packaging/package-dra.sh {{matrix}}"
agents:
provider: gcp
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
timeout_in_minutes: 40
retry:
automatic:
- limit: 1
artifact_paths:
- build/distributions/**/*
plugins:
- *google_oidc_plugin
- *dockerhub_login_plugin
- *docker_elastic_login_plugin
matrix:
- x-pack/auditbeat
- x-pack/filebeat
- x-pack/metricbeat
- label: "SNAPSHOT: {{matrix}} Linux/arm64 FIPS"
env:
PLATFORMS: "${PLATFORMS_ARM64_FIPS}"
SNAPSHOT: true
# packaging with `DEV=true` may cause linker issues while crosscompiling https://github.com/elastic/beats/issues/41270
DEV: false
FIPS: true
command: ".buildkite/scripts/packaging/package-dra.sh {{matrix}}"
agents:
provider: "aws"
image: "${AWS_IMAGE_UBUNTU_ARM_64}"
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
timeout_in_minutes: 40
retry:
automatic:
- limit: 1
artifact_paths:
- build/distributions/**/*
plugins:
- *google_oidc_plugin
- *dockerhub_login_plugin
- *docker_elastic_login_plugin
matrix:
- x-pack/auditbeat
- x-pack/filebeat
- x-pack/metricbeat
- group: Packaging Staging
key: packaging-staging
depends_on: start-gate-staging
# TODO remove OR clause below (see earlier comment)
if: (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null) || build.env('RUN_STAGING') == "true"
steps:
- label: "STAGING: {{matrix}}"
env:
PLATFORMS: "${PLATFORMS}"
SNAPSHOT: false
DEV: false
command: |
source .buildkite/scripts/version_qualifier.sh
.buildkite/scripts/packaging/package-dra.sh {{matrix}}
agents:
provider: gcp
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
timeout_in_minutes: 40
retry:
automatic:
- limit: 1
artifact_paths:
- build/distributions/**/*
plugins:
- *google_oidc_plugin
- *dockerhub_login_plugin
- *docker_elastic_login_plugin
matrix:
- auditbeat
- filebeat
- heartbeat
- metricbeat
- packetbeat
- winlogbeat
- x-pack/auditbeat
- x-pack/dockerlogbeat
- x-pack/filebeat
- x-pack/heartbeat
- x-pack/metricbeat
- x-pack/osquerybeat
- x-pack/packetbeat
- x-pack/winlogbeat
- label: "STAGING: {{matrix}} Linux/arm64, Darwin/arm64, and Windows/arm64"
env:
PLATFORMS: "${PLATFORMS_ARM}"
SNAPSHOT: false
DEV: false
command: |
source .buildkite/scripts/version_qualifier.sh
.buildkite/scripts/packaging/package-dra.sh {{matrix}}
agents:
provider: "aws"
image: "${AWS_IMAGE_UBUNTU_ARM_64}"
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
timeout_in_minutes: 40
retry:
automatic:
- limit: 1
artifact_paths:
- build/distributions/**/*
plugins:
- *google_oidc_plugin
- *dockerhub_login_plugin
- *docker_elastic_login_plugin
matrix:
- auditbeat
- filebeat
- heartbeat
- metricbeat
- packetbeat
- winlogbeat
- x-pack/auditbeat
- x-pack/dockerlogbeat
- x-pack/filebeat
- x-pack/heartbeat
- x-pack/metricbeat
- x-pack/osquerybeat
- x-pack/packetbeat
- x-pack/winlogbeat
- label: "STAGING: {{matrix}} Linux/amd64 FIPS"
env:
PLATFORMS: "${PLATFORMS_AMD64_FIPS}"
SNAPSHOT: false
# packaging with `DEV=true` may cause linker issues while crosscompiling https://github.com/elastic/beats/issues/41270
DEV: false
FIPS: true
command: |
source .buildkite/scripts/version_qualifier.sh
.buildkite/scripts/packaging/package-dra.sh {{matrix}}
agents:
provider: gcp
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
timeout_in_minutes: 40
retry:
automatic:
- limit: 1
artifact_paths:
- build/distributions/**/*
plugins:
- *google_oidc_plugin
- *dockerhub_login_plugin
- *docker_elastic_login_plugin
matrix:
- x-pack/auditbeat
- x-pack/filebeat
- x-pack/metricbeat
- label: "STAGING: {{matrix}} Linux/arm64 FIPS"
env:
PLATFORMS: "${PLATFORMS_ARM64_FIPS}"
SNAPSHOT: false
# packaging with `DEV=true` may cause linker issues while crosscompiling https://github.com/elastic/beats/issues/41270
DEV: false
FIPS: true
command: |
source .buildkite/scripts/version_qualifier.sh
.buildkite/scripts/packaging/package-dra.sh {{matrix}}
agents:
provider: "aws"
image: "${AWS_IMAGE_UBUNTU_ARM_64}"
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
timeout_in_minutes: 40
retry:
automatic:
- limit: 1
artifact_paths:
- build/distributions/**/*
plugins:
- *google_oidc_plugin
- *dockerhub_login_plugin
- *docker_elastic_login_plugin
matrix:
- x-pack/auditbeat
- x-pack/filebeat
- x-pack/metricbeat
- group: DRA publish
key: dra
steps:
- label: DRA Snapshot
## Only for release branches and main
if: (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.branch == 'main' || build.env('RUN_SNAPSHOT') == "true") && build.env('VERSION_QUALIFIER') == null
key: dra-snapshot
env:
DRA_WORKFLOW: snapshot
depends_on:
- start-gate-snapshot
- packaging-snapshot
- dashboards-snapshot
command: |
buildkite-agent artifact download "build/**/*" .
.buildkite/scripts/packaging/prepare-release-manager.sh snapshot
.buildkite/scripts/dra.sh
agents:
provider: gcp
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
plugins:
- *google_oidc_plugin
- *docker_elastic_login_plugin
- label: DRA Staging
# TODO remove OR clause below (see earlier comment)
if: (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null) || build.env('RUN_STAGING') == "true"
key: dra-staging
env:
DRA_WORKFLOW: staging
depends_on:
- start-gate-staging
- packaging-staging
- dashboards-staging
command: |
source .buildkite/scripts/version_qualifier.sh
buildkite-agent artifact download "build/**" .
.buildkite/scripts/packaging/prepare-release-manager.sh staging
.buildkite/scripts/dra.sh
agents:
provider: gcp
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
plugins:
- *google_oidc_plugin
- *docker_elastic_login_plugin
- wait
- command: echo "End of concurrency gate dra-snapshot <--"
if: (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.branch == 'main' || build.env('RUN_SNAPSHOT') == "true") && build.env('VERSION_QUALIFIER') == null
concurrency_group: "dra-gate-snapshot-$BUILDKITE_BRANCH"
concurrency: 1
key: end-gate-snapshot
- command: echo "End of concurrency gate dra-staging <--"
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null
concurrency_group: "dra-gate-staging-$BUILDKITE_BRANCH"
concurrency: 1
key: end-gate-staging