forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipelines.yml
498 lines (466 loc) · 19.8 KB
/
pipelines.yml
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
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
trigger:
branches:
include:
- "main"
- "release/v*"
tags:
include:
- "v*"
# PR build config is manually overridden in Azure pipelines UI with different secrets
pr: none
stages:
- stage: precheck
jobs:
- job: format
dependsOn: [] # this removes the implicit dependency on previous stage and causes this to run in parallel.
pool:
vmImage: "ubuntu-18.04"
steps:
- task: Cache@2
inputs:
key: "format | ./WORKSPACE | **/*.bzl"
path: $(Build.StagingDirectory)/repository_cache
continueOnError: true
- script: ci/run_envoy_docker.sh 'ci/check_and_fix_format.sh'
workingDirectory: $(Build.SourcesDirectory)
env:
ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory)
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
displayName: "Run check format scripts"
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: "$(Build.StagingDirectory)/fix_format.diff"
artifactName: format
condition: failed()
- job: docs
dependsOn: [] # this removes the implicit dependency on previous stage and causes this to run in parallel.
condition: ne(variables['PostSubmit'], true)
pool:
vmImage: "ubuntu-18.04"
steps:
- task: Cache@2
inputs:
key: "docs | ./WORKSPACE | **/*.bzl"
path: $(Build.StagingDirectory)/repository_cache
continueOnError: true
- script: ci/run_envoy_docker.sh 'ci/do_ci.sh docs'
workingDirectory: $(Build.SourcesDirectory)
env:
AZP_BRANCH: $(Build.SourceBranch)
ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory)
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
displayName: "Generate docs"
- script: |
ci/run_envoy_docker.sh 'ci/upload_gcs_artifact.sh /source/generated/docs docs'
displayName: "Upload Docs to GCS"
env:
ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory)
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
GCS_ARTIFACT_BUCKET: $(GcsArtifactBucket)
- job: dependencies
dependsOn: [] # this removes the implicit dependency on previous stage and causes this to run in parallel.
pool:
vmImage: "ubuntu-18.04"
steps:
- script: ci/run_envoy_docker.sh 'ci/do_ci.sh deps'
workingDirectory: $(Build.SourcesDirectory)
env:
ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory)
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
GITHUB_TOKEN: $(GitHubPublicRepoOnlyAccessToken)
displayName: "Verify dependency information"
- stage: sync
condition: and(succeeded(), eq(variables['PostSubmit'], true), ne(variables['NoSync'], true))
dependsOn: []
jobs:
- job: filter_example
dependsOn: []
pool:
vmImage: "ubuntu-18.04"
steps:
- task: InstallSSHKey@0
inputs:
hostName: "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="
sshPublicKey: "$(FilterExamplePublicKey)"
sshPassphrase: "$(SshDeployKeyPassphrase)"
sshKeySecureFile: "$(FilterExamplePrivateKey)"
- bash: ci/filter_example_mirror.sh
displayName: "Sync envoy-filter-example"
workingDirectory: $(Build.SourcesDirectory)
env:
AZP_BRANCH: $(Build.SourceBranch)
- job: data_plane_api
dependsOn: []
pool:
vmImage: "ubuntu-18.04"
steps:
- task: InstallSSHKey@0
inputs:
hostName: "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="
sshPublicKey: "$(DataPlaneApiPublicKey)"
sshPassphrase: "$(SshDeployKeyPassphrase)"
sshKeySecureFile: "$(DataPlaneApiPrivateKey)"
- bash: ci/api_mirror.sh
displayName: "Sync data-plane-api"
workingDirectory: $(Build.SourcesDirectory)
env:
AZP_BRANCH: $(Build.SourceBranch)
- job: go_control_plane
dependsOn: []
pool:
vmImage: "ubuntu-18.04"
steps:
- task: InstallSSHKey@0
inputs:
hostName: "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="
sshPublicKey: "$(GoControlPlanePublicKey)"
sshPassphrase: "$(SshDeployKeyPassphrase)"
sshKeySecureFile: "$(GoControlPlanePrivateKey)"
- bash: |
cp -a ~/.ssh $(Build.StagingDirectory)/
ci/run_envoy_docker.sh 'ci/go_mirror.sh'
displayName: "Sync go-control-plane"
workingDirectory: $(Build.SourcesDirectory)
env:
ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory)
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
AZP_BRANCH: $(Build.SourceBranch)
- stage: linux_x64
dependsOn: ["precheck"]
# For post-submit builds, continue even if precheck fails
condition: and(not(canceled()), or(succeeded(), eq(variables['PostSubmit'], true)))
jobs:
- job: release
timeoutInMinutes: 120
pool:
vmImage: "ubuntu-18.04"
steps:
- template: bazel.yml
parameters:
ciTarget: bazel.release
- stage: linux_arm64
dependsOn: ["precheck"]
# For post-submit builds, continue even if precheck fails
condition: and(not(canceled()), or(succeeded(), eq(variables['PostSubmit'], true)))
jobs:
- job: release
timeoutInMinutes: 120
pool: "arm-large"
steps:
- template: bazel.yml
parameters:
managedAgent: false
ciTarget: bazel.release
rbe: false
artifactSuffix: ".arm64"
bazelBuildExtraOptions: "--sandbox_base=/tmp/sandbox_base"
- stage: check
dependsOn: ["linux_x64"]
jobs:
- job: bazel
displayName: "linux_x64"
dependsOn: []
strategy:
maxParallel: 3
matrix:
api:
CI_TARGET: "bazel.api"
gcc:
CI_TARGET: "bazel.gcc"
clang_tidy:
CI_TARGET: "bazel.clang_tidy"
asan:
CI_TARGET: "bazel.asan"
tsan:
CI_TARGET: "bazel.tsan"
compile_time_options:
CI_TARGET: "bazel.compile_time_options"
timeoutInMinutes: 120
pool:
vmImage: "ubuntu-18.04"
steps:
- template: bazel.yml
parameters:
ciTarget: $(CI_TARGET)
- job: coverage
displayName: "linux_x64"
dependsOn: []
timeoutInMinutes: 120
pool: "x64-large"
strategy:
maxParallel: 2
matrix:
coverage:
CI_TARGET: "coverage"
fuzz_coverage:
CI_TARGET: "fuzz_coverage"
steps:
- template: bazel.yml
parameters:
managedAgent: false
ciTarget: bazel.$(CI_TARGET)
rbe: false
# /tmp/sandbox_base is a tmpfs in CI environment to optimize large I/O for coverage traces
bazelBuildExtraOptions: "--define=no_debug_info=1 --linkopt=-Wl,-s --test_env=ENVOY_IP_TEST_VERSIONS=v4only --sandbox_base=/tmp/sandbox_base"
- script: ci/run_envoy_docker.sh 'ci/upload_gcs_artifact.sh /source/generated/$(CI_TARGET) $(CI_TARGET)'
displayName: "Upload $(CI_TARGET) Report to GCS"
env:
ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory)
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
GCS_ARTIFACT_BUCKET: $(GcsArtifactBucket)
condition: always()
- stage: docker
dependsOn: ["linux_x64", "linux_arm64"]
jobs:
- job: docker
displayName: "linux multiarch"
pool:
vmImage: "ubuntu-18.04"
steps:
- bash: .azure-pipelines/cleanup.sh
displayName: "Removing tools from agent"
- bash: |
echo "disk space at beginning of build:"
df -h
displayName: "Check disk space at beginning"
- task: DownloadBuildArtifacts@0
inputs:
buildType: current
artifactName: "bazel.release"
itemPattern: "bazel.release/envoy_binary.tar.gz"
downloadType: single
targetPath: $(Build.StagingDirectory)
- task: DownloadBuildArtifacts@0
inputs:
buildType: current
artifactName: "bazel.release.arm64"
itemPattern: "bazel.release.arm64/envoy_binary.tar.gz"
downloadType: single
targetPath: $(Build.StagingDirectory)
- bash: |
set -e
mkdir -p linux/amd64 && tar zxf $(Build.StagingDirectory)/bazel.release/envoy_binary.tar.gz -C ./linux/amd64
mkdir -p linux/arm64 && tar zxf $(Build.StagingDirectory)/bazel.release.arm64/envoy_binary.tar.gz -C ./linux/arm64
ci/docker_ci.sh
workingDirectory: $(Build.SourcesDirectory)
env:
AZP_BRANCH: $(Build.SourceBranch)
AZP_SHA1: $(Build.SourceVersion)
DOCKERHUB_USERNAME: $(DockerUsername)
DOCKERHUB_PASSWORD: $(DockerPassword)
- bash: |
echo "disk space at end of build:"
df -h
displayName: "Check disk space at end"
condition: always()
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: "$(Build.StagingDirectory)/build_images"
artifactName: docker
condition: always()
- stage: docs
dependsOn: ["docker"]
condition: and(succeeded(), eq(variables['PostSubmit'], true), ne(variables['NoSync'], true))
jobs:
- job: publish
pool:
vmImage: "ubuntu-18.04"
steps:
- task: Cache@2
inputs:
key: "docs | ./WORKSPACE | **/*.bzl"
path: $(Build.StagingDirectory)/repository_cache
continueOnError: true
- script: ci/run_envoy_docker.sh 'ci/do_ci.sh docs'
workingDirectory: $(Build.SourcesDirectory)
env:
AZP_BRANCH: $(Build.SourceBranch)
ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory)
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
displayName: "Generate docs"
- task: InstallSSHKey@0
inputs:
hostName: "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="
sshPublicKey: "$(DocsPublicKey)"
sshPassphrase: "$(SshDeployKeyPassphrase)"
sshKeySecureFile: "$(DocsPrivateKey)"
- script: docs/publish.sh
displayName: "Publish to GitHub"
workingDirectory: $(Build.SourcesDirectory)
env:
AZP_BRANCH: $(Build.SourceBranch)
- stage: verify
dependsOn: ["docker"]
jobs:
- job: examples
pool:
vmImage: "ubuntu-18.04"
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: current
artifactName: "docker"
itemPattern: "docker/envoy-docker-images.tar.xz"
downloadType: single
targetPath: $(Build.StagingDirectory)
- bash: ./ci/do_ci.sh verify_examples
env:
ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory)
NO_BUILD_SETUP: 1
- job: examples_build
dependsOn: []
pool:
vmImage: "ubuntu-18.04"
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: current
artifactName: "docker"
itemPattern: "docker/envoy-docker-images.tar.xz"
downloadType: single
targetPath: $(Build.StagingDirectory)
- bash: ./ci/do_ci.sh verify_build_examples
env:
ENVOY_DOCKER_BUILD_DIR: $(Build.StagingDirectory)
NO_BUILD_SETUP: 1
- stage: macos
dependsOn: ["precheck"]
jobs:
- job: test
timeoutInMinutes: 180
pool:
vmImage: "macos-latest"
steps:
- script: ./ci/mac_ci_setup.sh
displayName: "Install dependencies"
- script: ./ci/mac_ci_steps.sh
displayName: "Run Mac CI"
env:
BAZEL_BUILD_EXTRA_OPTIONS: "--remote_download_toplevel --flaky_test_attempts=2"
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
- task: PublishTestResults@2
inputs:
testResultsFiles: "**/bazel-testlogs/**/test.xml"
testRunTitle: "macOS"
condition: always()
- script: ./ci/flaky_test/run_process_xml.sh
displayName: "Process Test Results"
env:
TEST_TMPDIR: $(Build.SourcesDirectory)
SLACK_TOKEN: $(SLACK_TOKEN)
CI_TARGET: "MacOS"
REPO_URI: $(Build.Repository.Uri)
BUILD_URI: $(Build.BuildUri)
- stage: windows
dependsOn: ["precheck"]
jobs:
- job: release
timeoutInMinutes: 120
pool:
vmImage: "windows-latest"
steps:
- task: Cache@2
inputs:
key: '"windows.release" | ./WORKSPACE | **/*.bzl'
path: $(Build.StagingDirectory)/repository_cache
continueOnError: true
- bash: ci/run_envoy_docker.sh ci/windows_ci_steps.sh
displayName: "Run Windows msvc-cl CI"
env:
CI_TARGET: "windows"
ENVOY_DOCKER_BUILD_DIR: "$(Build.StagingDirectory)"
SLACK_TOKEN: $(SLACK_TOKEN)
REPO_URI: $(Build.Repository.Uri)
BUILD_URI: $(Build.BuildUri)
ENVOY_RBE: "true"
BAZEL_BUILD_EXTRA_OPTIONS: "--config=remote-ci --config=remote-msvc-cl --jobs=$(RbeJobs) --flaky_test_attempts=2"
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
- task: PublishTestResults@2
inputs:
testResultsFiles: "**/bazel-out/**/testlogs/**/test.xml"
testRunTitle: "windows"
searchFolder: $(Build.StagingDirectory)/tmp
condition: always()
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: "$(Build.StagingDirectory)/envoy"
artifactName: windows.release
condition: always()
- job: clang_cl
timeoutInMinutes: 120
pool:
vmImage: "windows-latest"
steps:
- task: Cache@2
inputs:
key: '"windows.release" | ./WORKSPACE | **/*.bzl'
path: $(Build.StagingDirectory)/repository_cache
continueOnError: true
- bash: ci/run_envoy_docker.sh ci/windows_ci_steps.sh
displayName: "Run Windows clang-cl CI"
env:
CI_TARGET: "windows"
ENVOY_DOCKER_BUILD_DIR: "$(Build.StagingDirectory)"
SLACK_TOKEN: $(SLACK_TOKEN)
REPO_URI: $(Build.Repository.Uri)
BUILD_URI: $(Build.BuildUri)
ENVOY_RBE: "true"
BAZEL_BUILD_EXTRA_OPTIONS: "--config=remote-ci --config=remote-clang-cl --jobs=$(RbeJobs) --flaky_test_attempts=2"
BAZEL_REMOTE_CACHE: grpcs://remotebuildexecution.googleapis.com
BAZEL_REMOTE_INSTANCE: projects/envoy-ci/instances/default_instance
GCP_SERVICE_ACCOUNT_KEY: $(GcpServiceAccountKey)
- task: PublishTestResults@2
inputs:
testResultsFiles: "**/bazel-out/**/testlogs/**/test.xml"
testRunTitle: "clang-cl"
searchFolder: $(Build.StagingDirectory)/tmp
condition: always()
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: "$(Build.StagingDirectory)/envoy"
artifactName: windows.clang-cl
condition: always()
- job: docker
dependsOn: ["release"]
timeoutInMinutes: 120
pool:
vmImage: "windows-latest"
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: current
artifactName: "windows.release"
itemPattern: "windows.release/envoy_binary.tar.gz"
downloadType: single
targetPath: $(Build.StagingDirectory)
- bash: |
set -e
# Convert to Unix-style path so tar doesn't think drive letter is a hostname
STAGING_DIR="/$(echo '$(Build.StagingDirectory)' | tr -d ':' | tr '\\' '/')"
mkdir -p windows/amd64 && tar zxf "${STAGING_DIR}/windows.release/envoy_binary.tar.gz" -C ./windows/amd64
ci/docker_ci.sh
workingDirectory: $(Build.SourcesDirectory)
env:
AZP_BRANCH: $(Build.SourceBranch)
AZP_SHA1: $(Build.SourceVersion)
DOCKERHUB_USERNAME: $(DockerUsername)
DOCKERHUB_PASSWORD: $(DockerPassword)
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: "$(Build.StagingDirectory)/build_images"
artifactName: docker_windows
condition: always()