-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathpipeline.yml
More file actions
374 lines (350 loc) · 12.4 KB
/
Copy pathpipeline.yml
File metadata and controls
374 lines (350 loc) · 12.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
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
env:
DOCKER_COMPOSE_VERSION: "1.25.5"
TERRAFORM_VERSION: "1.6.4"
IMAGE_UBUNTU_X86_64: "platform-ingest-fleets-ubuntu-2204-1770381074"
IMAGE_UBUNTU_ARM_64: "platform-ingest-fleet-server-ubuntu-2204-aarch64-1770381074"
IMAGE_UBUNTU_X86_64_FIPS: "platform-ingest-fleet-server-ubuntu-2204-fips-1770381074"
# 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:
- test_collector_plugin: &test_collector_plugin
test-collector#v1.11.0:
files: "build/test-*.xml"
format: "junit"
branches: "main"
debug: true
- bk_analytics_token_plugin: &bk_analytics_token_plugin
elastic/vault-secrets#v0.1.0:
path: "kv/ci-shared/platform-ingest/buildkite_analytics_token"
field: "token"
env_var: "BUILDKITE_ANALYTICS_TOKEN"
- docker_elastic_login_plugin: &docker_elastic_login_plugin
elastic/vault-docker-login#v0.6.0:
secret_path: 'kv/ci-shared/platform-ingest/elastic_docker_registry'
- dockerhub_login_plugin: &dockerhub_login_plugin
elastic/vault-docker-login#v0.6.0:
secret_path: 'kv/ci-shared/observability-github-secrets/shared/docker/dockerhub/observabilityrobots'
# See https://github.com/elastic/oblt-infra/blob/main/conf/resources/repos/fleet-server/01-gcp-buildkite-oidc.tf
# This plugin authenticates to Google Cloud using the OIDC token.
- oidc_plugin: &oidc_plugin
elastic/oblt-google-auth#v1.2.0:
lifetime: 10800 # seconds
project-id: "elastic-observability-ci"
project-number: "911195782929"
steps:
- group: "Check and build"
key: "check"
steps:
- label: ":white_check_mark: Run check-ci"
key: check-ci
command: ".buildkite/scripts/check_ci.sh"
agents:
provider: "gcp"
- label: "Detect FIPS crypto imports"
command: ".buildkite/scripts/check_detect_fips_crypto.sh"
- label: "Package x86_64"
key: "package-x86-64-pr"
env:
PLATFORMS: "linux/amd64,darwin/amd64,windows/amd64"
command: ".buildkite/scripts/release_test.sh"
artifact_paths:
- build/distributions/**
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "c2-standard-16"
plugins:
- *oidc_plugin
- *dockerhub_login_plugin
- label: "Package x86_64 FIPS"
key: "package-fips-x86-64-pr"
env:
FIPS: "true"
PLATFORMS: "linux/amd64"
command: ".buildkite/scripts/release_test.sh"
artifact_paths:
- build/distributions/**
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "c2-standard-16"
plugins:
- *oidc_plugin
- *dockerhub_login_plugin
- label: "Package aarch64"
key: "package-arm64-pr"
env:
PLATFORMS: "linux/arm64,darwin/arm64"
command: ".buildkite/scripts/release_test.sh"
artifact_paths:
- build/distributions/**
agents:
provider: "aws"
image: "${IMAGE_UBUNTU_ARM_64}"
instanceType: "t4g.2xlarge"
plugins:
- *oidc_plugin
- *dockerhub_login_plugin
- label: "Package aarch64 FIPS"
key: "package-fips-arm64-pr"
env:
FIPS: "true"
PLATFORMS: "linux/arm64"
command: ".buildkite/scripts/release_test.sh"
artifact_paths:
- build/distributions/**
agents:
provider: "aws"
image: "${IMAGE_UBUNTU_ARM_64}"
instanceType: "t4g.2xlarge"
plugins:
- *oidc_plugin
- *dockerhub_login_plugin
- group: "Performance test"
key: "performance-test"
depends_on: "check"
steps:
- label: "Run go benchmark for PR branch"
key: "go-benchmark-pr"
command: ".buildkite/scripts/run_benchmark.sh pr"
env:
BENCHMARK_ARGS: "-count=8 -benchmem"
artifact_paths:
- build/next.out
- build/next.stat
agents:
provider: "gcp"
machineType: "c2-standard-8"
- label: "Run go benchmark for ${BUILDKITE_PULL_REQUEST_BASE_BRANCH}"
key: "go-benchmark-base"
command: ".buildkite/scripts/run_benchmark.sh base"
env:
BENCHMARK_ARGS: "-count=8 -benchmem"
artifact_paths:
- build/base.out
- build/base.stat
agents:
provider: "gcp"
machineType: "c2-standard-8"
- label: "Compare results"
key: "go-benchmark-compare"
command: ".buildkite/scripts/run_benchmark.sh compare"
artifact_paths:
- build/failed_summary.md
- build/failed_report.json
- build/full_report.json
depends_on:
- go-benchmark-pr
- go-benchmark-base
agents:
provider: "gcp"
- group: "Run tests"
key: "tests"
depends_on: "check"
steps:
- label: ":smartbear-testexecute: Run unit tests"
key: unit-test
command: ".buildkite/scripts/unit_test.sh"
agents:
provider: "gcp"
artifact_paths:
- build/*.xml
- build/coverage*.out
- label: ":smartbear-testexecute: Run unit tests with requirefips build tag and FIPS provider"
key: unit-test-fips-tag
command: ".buildkite/scripts/unit_test.sh"
env:
FIPS: "true"
GOEXPERIMENT: "systemcrypto"
GO_DISTRO: "microsoft"
agents:
provider: "aws"
image: "${IMAGE_UBUNTU_X86_64_FIPS}"
instanceType: "m5.xlarge"
artifact_paths:
- build/*.xml
- build/coverage*.out
- label: ":smartbear-testexecute: Run fips140=only unit tests with FIPS provider"
key: unit-test-fips140-only
command: ".buildkite/scripts/unit_test_fipsonly.sh"
env:
FIPS: "true"
GO_DISTRO: "stdlib"
agents:
provider: "aws"
image: "${IMAGE_UBUNTU_X86_64_FIPS}"
instanceType: "m5.xlarge"
artifact_paths:
- build/*.xml
- build/coverage*.out
- label: ":smartbear-testexecute: Run unit tests: MacOS 13"
key: unit-test-macos-13
command: ".buildkite/scripts/unit_test.sh"
agents:
provider: orka
imagePrefix: generic-13-ventura-arm
artifact_paths:
- build/*.xml
- build/coverage*.out
- label: ":smartbear-testexecute: Run integration tests"
key: int-test
command: ".buildkite/scripts/integration_test.sh"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "c2-standard-16"
artifact_paths:
- build/*.xml
plugins:
- *bk_analytics_token_plugin
- *test_collector_plugin
retry:
automatic:
limit: 1
- label: "E2E Test"
key: "e2e-test"
command: ".buildkite/scripts/e2e_test.sh"
env:
TESTCONTAINERS_RYUK_CONTAINER_PRIVILEGED: "true"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "c2-standard-16"
artifact_paths:
- build/*.xml
- build/e2e-coverage.out
plugins:
- *bk_analytics_token_plugin
- *test_collector_plugin
retry:
automatic:
limit: 1
- label: ":junit: Junit annotate"
agents:
# requires at least "bash", "curl" and "git"
image: "docker.elastic.co/ci-agent-images/buildkite-junit-annotate:1.0"
plugins:
- junit-annotate#v2.7.0:
artifacts: "build/*.xml"
run-in-docker: false
depends_on:
- step: "unit-test"
allow_failure: true
- step: "unit-test-macos-13"
allow_failure: true
- step: "int-test"
allow_failure: true
- step: "e2e-test"
allow_failure: true
- label: ":gcloud: Cloud e2e Test"
key: "cloud-e2e-test"
env:
DOCKER_IMAGE: "docker.elastic.co/beats-ci/elastic-agent-cloud-fleet"
DOCKER_IMAGE_TAG: "pr-${BUILDKITE_PULL_REQUEST}-${BUILDKITE_COMMIT:0:12}"
SNAPSHOT: "true"
PLATFORMS: "linux/amd64"
TF_VAR_pull_request: "${BUILDKITE_PULL_REQUEST}"
command: ".buildkite/scripts/cloud_e2e_test.sh"
agents:
provider: "gcp"
plugins:
- *docker_elastic_login_plugin
- elastic/vault-secrets#v0.1.0:
path: "kv/ci-shared/platform-ingest/platform-ingest-ec-prod"
field: "apiKey"
env_var: "EC_API_KEY"
depends_on:
- step: "unit-test"
allow_failure: false
- step: "int-test"
allow_failure: false
- step: "e2e-test"
allow_failure: false
retry:
automatic:
limit: 1
manual:
allowed: true
- label: ":gcloud: Cloud e2e FIPS Test"
key: "cloud-e2e-fips-test"
env:
DOCKER_BASE_IMAGE: "docker.elastic.co/cloud-release/elastic-agent-cloud-fips"
DOCKER_IMAGE: "docker.elastic.co/beats-ci/elastic-agent-cloud-fips"
DOCKER_IMAGE_TAG: "pr-${BUILDKITE_PULL_REQUEST}-${BUILDKITE_COMMIT:0:12}"
SNAPSHOT: "true"
PLATFORMS: "linux/amd64"
TF_VAR_pull_request: "${BUILDKITE_PULL_REQUEST}"
FIPS: "true"
EC_ENDPOINT: "https://api.staging.elastic-gov.com"
TF_VAR_ess_region: "us-gov-east-1"
TF_VAR_deployment_template_id: "aws-general-purpose"
command: ".buildkite/scripts/cloud_e2e_test.sh"
agents:
provider: "gcp"
plugins:
- *docker_elastic_login_plugin
- elastic/vault-secrets#v0.1.0:
path: "kv/ci-shared/platform-ingest/platform-ingest-ec-staging-gov"
field: "apiKey"
env_var: "EC_API_KEY"
depends_on:
- step: "unit-test"
allow_failure: false
- step: "int-test"
allow_failure: false
- step: "e2e-test"
allow_failure: false
retry:
automatic:
limit: 1
manual:
allowed: true
- label: ":docker: Publish docker image"
key: "publish"
command: ".buildkite/scripts/build_push_docker_image.sh"
env:
DOCKER_IMAGE: "docker.elastic.co/observability-ci/fleet-server" # needs to rename for rollback
DOCKER_IMAGE_SHA_TAG: "git-${BUILDKITE_COMMIT:0:12}" # needs to rename for rollback, should be "git-${BUILDKITE_COMMIT:0:12}"
DOCKER_IMAGE_LATEST_TAG: "latest" # needs to rename for rollback
DOCKER_IMAGE_GIT_TAG: "${BUILDKITE_BRANCH}" # needs to rename for rollback
if: "build.env('BUILDKITE_PULL_REQUEST') == 'false' && build.env('BUILDKITE_BRANCH') == 'main'"
agents:
provider: "gcp"
plugins:
- *docker_elastic_login_plugin
depends_on:
- step: "tests"
allow_failure: false
- label: ":serverless::argo: Run synthetics tests and update fleet to ${BUILDKITE_COMMIT:0:12} in serverless-gitops"
branches: main
trigger: gpctl-promote-after-serverless-devenv-synthetics
build:
env:
SERVICE_COMMIT_HASH: ${BUILDKITE_COMMIT:0:12}
SERVICE: fleet
depends_on:
- step: "publish"
- label: ":jenkins: Release - Package Registry Distribution"
key: "release-package-registry"
trigger: "package-registry-release-package-registry-distribution"
build:
branch: "main"
meta_data:
DOCKER_TAG: "${BUILDKITE_TAG}"
if: "build.env('BUILDKITE_TAG') != ''"
- trigger: "fleet-server-package-mbp"
label: ":esbuild: Downstream - Package"
key: "downstream-package"
if: "build.env('BUILDKITE_PULL_REQUEST') == 'false' && build.env('BUILDKITE_TAG') == '' && build.env('BUILDKITE_BRANCH') != ''"
build:
branch: "${BUILDKITE_BRANCH}"
depends_on:
- step: "package-x86-64-pr"
allow_failure: false
- step: "package-arm64-pr"
allow_failure: false
- step: "package-fips-x86-64-pr"
allow_failure: false
- step: "package-fips-arm64-pr"
allow_failure: false