forked from istio/istio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
597 lines (568 loc) · 16.6 KB
/
config.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
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
version: 2
# Docker environment.
defaults: &defaults
working_directory: /go/src/istio.io/istio
docker:
- image: istio/ci:go1.10-k8s1.10.4-helm2.7.2-minikube0.25
environment:
GOPATH: /go
SKIP_CLEANUP: true
# org context settings. If developing on a clone, please configure:
# DOCKER_USER
# DOCKER_PASS
# HUB: ex istio, costinm (it is not the hub, but the dockerhub org or user)
# VM environment. Includes docker.
integrationDefaults: &integrationDefaults
machine: true
working_directory: /go/src/istio.io/istio #same as docker
environment:
- CHANGE_MINIKUBE_NONE_USER: true
- GOPATH: /go
- SKIP_CLEANUP: true
- KUBECONFIG: /go/out/minikube.conf
- TEST_ENV: minikube-none
# Common procedure to initialize working directory
initWorkingDir: &initWorkingDir
type: shell
name: Initialize Working Directory
pwd: /
command: |
sudo mkdir -p /go/src/istio.io/istio
sudo chown -R circleci /go
mkdir -p /go/out/tests
mkdir -p /go/out/logs
mkdir -p /home/circleci/logs
recordZeroExitCodeIfTestPassed: &recordZeroExitCodeIfTestPassed
run:
when: on_success
name: Record zero exit code as test passed
command: echo 0 > exit_code
recordNonzeroExitCodeIfTestFailed: &recordNonzeroExitCodeIfTestFailed
run:
when: on_fail
name: Record nonzero exit code as test failed
command: echo 1 > exit_code
markJobStartsOnGCS: &markJobStartsOnGCS
run:
when: always
command: bin/ci2gubernator.sh --job_starts
markJobFinishesOnGCS: &markJobFinishesOnGCS
run:
when: always
command: |
make dumpsys || true
make junit-report || true
# TODO: upload the artifacts as well, for debugging !
bin/ci2gubernator.sh --exit_code=$(cat exit_code) --junit_xml=/go/out/tests/junit.xml
jobs:
e2e-simple:
<<: *integrationDefaults
environment:
- KUBECONFIG: /go/out/minikube.conf
- TEST_ENV: minikube-none
- GOPATH: /go
steps:
- <<: *initWorkingDir
- checkout
- attach_workspace:
at: /go
- <<: *markJobStartsOnGCS
- run: make sync
- run: bin/testEnvRootMinikube.sh start
- run:
command: |
if [ ! -f /go/out/linux_amd64/release/pilot-discovery ]; then
# Should only happen when re-running a job, and the workspace is gone
time make build test-bins
fi
make docker.all
- run: bin/testEnvRootMinikube.sh wait
- run: docker images
- run: make test/local/auth/e2e_simple
- <<: *recordZeroExitCodeIfTestPassed
- <<: *recordNonzeroExitCodeIfTestFailed
- <<: *markJobFinishesOnGCS
- store_artifacts:
path: /home/circleci/logs
- store_artifacts:
path: /tmp
- store_artifacts:
path: /var/lib/localkube/
- store_test_results:
path: /go/out/tests
e2e-dashboard:
<<: *integrationDefaults
environment:
- KUBECONFIG: /go/out/minikube.conf
- TEST_ENV: minikube-none
- GOPATH: /go
steps:
- <<: *initWorkingDir
- checkout
- attach_workspace:
at: /go
- <<: *markJobStartsOnGCS
- run: make sync
- run: bin/testEnvRootMinikube.sh start
- run:
command: |
if [ ! -f /go/out/linux_amd64/release/pilot-discovery ]; then
# Should only happen when re-running a job, and the workspace is gone
time make build test-bins
fi
make docker.all generate_yaml
- run: bin/testEnvRootMinikube.sh wait
- run: docker images
- run:
command: |
PATH=$GOPATH/bin:$PATH \
E2E_ARGS="--skip_cleanup -use_local_cluster -test.v" \
set -o pipefail
make e2e_dashboard | tee -a /go/out/tests/build-log.txt
- <<: *recordZeroExitCodeIfTestPassed
- <<: *recordNonzeroExitCodeIfTestFailed
- <<: *markJobFinishesOnGCS
- store_artifacts:
path: /home/circleci/logs
- store_artifacts:
path: /tmp
- store_artifacts:
path: /var/lib/localkube/
e2e-mixer-noauth-v1alpha3-v2:
<<: *integrationDefaults
steps:
- <<: *initWorkingDir
- checkout
- attach_workspace:
at: /go
- <<: *markJobStartsOnGCS
- run: make sync
- run: bin/testEnvRootMinikube.sh start
- run:
command: |
if [ ! -f /go/out/linux_amd64/release/pilot-discovery ]; then
# Should only happen when re-running a job, and the workspace is gone
time make build test-bins
fi
make docker.all generate_yaml
- run: bin/testEnvRootMinikube.sh wait
- run: docker images
- run:
no_output_timeout: 20m
# Run the test even if previous failed
when: always
name: make e2e_mixer
command: |
make test/local/noauth/e2e_mixer_envoyv2
- <<: *recordZeroExitCodeIfTestPassed
- <<: *recordNonzeroExitCodeIfTestFailed
- <<: *markJobFinishesOnGCS
- store_artifacts:
path: /home/circleci/logs
- store_artifacts:
path: /tmp
- store_test_results:
path: /go/out/tests
e2e-galley:
<<: *integrationDefaults
environment:
- KUBECONFIG: /go/out/minikube.conf
- TEST_ENV: minikube-none
- GOPATH: /go
steps:
- <<: *initWorkingDir
- checkout
- attach_workspace:
at: /go
- <<: *markJobStartsOnGCS
- run: make sync
- run: bin/testEnvRootMinikube.sh start
- run:
command: |
if [ ! -f /go/out/linux_amd64/release/pilot-discovery ]; then
# Should only happen when re-running a job, and the workspace is gone
time make build test-bins
fi
make docker.all generate_yaml
- run: bin/testEnvRootMinikube.sh wait
- run: docker images
- run:
no_output_timeout: 20m
# Run the test even if previous failed
when: always
name: make e2e_galley
command: |
make test/local/e2e_galley
- <<: *recordZeroExitCodeIfTestPassed
- <<: *recordNonzeroExitCodeIfTestFailed
- <<: *markJobFinishesOnGCS
- store_artifacts:
path: /home/circleci/logs
- store_artifacts:
path: /tmp
- store_test_results:
path: /go/out/tests
e2e-pilot-cloudfoundry-v1alpha3-v2:
<<: *integrationDefaults
steps:
- <<: *initWorkingDir
- checkout
- attach_workspace:
at: /go
- run: make sync
- run:
no_output_timeout: 20m
when: always
command: |
export PATH=$GOPATH/bin:$PATH
make localTestEnv
make test/local/cloudfoundry/e2e_pilotv2
- <<: *recordZeroExitCodeIfTestPassed
- <<: *recordNonzeroExitCodeIfTestFailed
- <<: *markJobFinishesOnGCS
- store_artifacts:
path: /go/out/logs
- store_artifacts:
path: /tmp
e2e-pilot-noauth-v1alpha3-v2:
<<: *integrationDefaults
environment:
- GOPATH: /go
- KUBECONFIG: /go/out/minikube.conf
- TEST_ENV: minikube-none
steps:
- <<: *initWorkingDir
- checkout
- attach_workspace:
at: /go
- <<: *markJobStartsOnGCS
- run: make sync
- run: bin/testEnvRootMinikube.sh start
- run:
command: |
if [ ! -f /go/out/linux_amd64/release/pilot-discovery ]; then
# Should only happen when re-running a job, and the workspace is gone
time make build test-bins
fi
make docker.all generate_yaml
- run: bin/testEnvRootMinikube.sh wait
- run: docker images
- run:
no_output_timeout: 20m
# Run the test even if previous failed
when: always
command: |
make test/local/noauth/e2e_pilotv2
- <<: *recordZeroExitCodeIfTestPassed
- <<: *recordNonzeroExitCodeIfTestFailed
- <<: *markJobFinishesOnGCS
- store_test_results:
path: /go/out/tests
- store_artifacts:
path: /go/out/logs
- store_artifacts:
path: /tmp
e2e-pilot-auth-v1alpha3-v2:
<<: *integrationDefaults
steps:
- <<: *initWorkingDir
- checkout
- attach_workspace:
at: /go
- <<: *markJobStartsOnGCS
- run: make sync
- run: bin/testEnvRootMinikube.sh start
- run:
command: |
if [ ! -f /go/out/linux_amd64/release/pilot-discovery ]; then
# Should only happen when re-running a job, and the workspace is gone
time make build test-bins
fi
make docker.all generate_yaml
- run: bin/testEnvRootMinikube.sh wait
- run: docker images
- run:
no_output_timeout: 20m
# Run the test even if previous failed
when: always
command: |
make test/local/auth/e2e_pilotv2
- <<: *recordZeroExitCodeIfTestPassed
- <<: *recordNonzeroExitCodeIfTestFailed
- <<: *markJobFinishesOnGCS
- store_test_results:
path: /go/out/tests
- store_artifacts:
path: /go/out/logs
- store_artifacts:
path: /tmp
# Run nightly, to verify 'dep ensure --update' works
depupdate:
<<: *defaults
steps:
- checkout
- run: mkdir -p /go/out
- run:
name: Updating all dependencies
command: dep ensure --update
- run: ( cd vendor ; git status ) # just to see what changes
- run: make init build
- run:
name: Status and artifacts
command: dep status -dot > /go/out/dep.dot
- store_artifacts:
path: /go/out/dep.dot
codecov:
<<: *defaults
resource_class: xlarge
environment:
KUBECONFIG: /go/src/istio.io/istio/.circleci/config
ISTIO_BIN: /go/bin
steps:
- checkout
- run:
name: Starting Kubernetes API Server standalone and running tests
command: |
make localTestEnv
cd /go/src/istio.io/istio
MAXPROCS=6 bin/codecov.sh
- run:
name: Uploading code coverage to codecov.io
when: always
command: bash <(curl -s https://codecov.io/bash) -f /go/out/codecov/coverage.cov
- store_artifacts:
path: /go/out/codecov
test:
<<: *defaults
environment:
KUBECONFIG: /go/src/istio.io/istio/.circleci/config
resource_class: xlarge
steps:
- checkout
- <<: *markJobStartsOnGCS
- run: make sync
- run:
command: |
mkdir -p /go/out/tests
export PATH=$GOPATH/bin:$PATH
make localTestEnv
set -o pipefail
make test T=-v | tee -a /go/out/tests/build-log.txt
- <<: *recordZeroExitCodeIfTestPassed
- <<: *recordNonzeroExitCodeIfTestFailed
- <<: *markJobFinishesOnGCS
- store_test_results:
path: /go/out/tests
racetest:
<<: *defaults
environment:
KUBECONFIG: /go/src/istio.io/istio/.circleci/config
RACE_TEST: 1
resource_class: xlarge
steps:
- checkout
- <<: *markJobStartsOnGCS
- run:
command: |
mkdir -p /go/out/tests
trap "go-junit-report </go/out/tests/build-log.txt > /go/out/tests/junit.xml" EXIT
make localTestEnv
set -o pipefail
make -k pilot-racetest mixer-racetest security-racetest T=-v | tee -a /go/out/tests/build-log.txt
- <<: *recordZeroExitCodeIfTestPassed
- <<: *recordNonzeroExitCodeIfTestFailed
- <<: *markJobFinishesOnGCS
- store_test_results:
path: /go/out/tests
benchcheck:
<<: *defaults
environment:
KUBECONFIG: /go/src/istio.io/istio/.circleci/config
steps:
- checkout
- run:
command: |
mkdir -p /go/out/benchcheck
make benchcheck | tee -a /go/out/benchcheck/go-benchcheck-report.out
- store_test_results:
path: /go/out/benchcheck
build:
<<: *defaults
resource_class: xlarge
steps:
- checkout
- run: make sync
- run: make build test-bins /go/bin/go-junit-report
- persist_to_workspace:
root: /go
paths:
- pkg/linux_amd64
- bin
- out
- run: make sidecar.deb
- store_artifacts:
path: /go/out/istio-sidecar.deb
shellcheck:
docker:
- image: koalaman/shellcheck-alpine:v0.5.0
steps:
- checkout
- run:
name: Check Scripts
command: /root/project/tools/run_shellcheck.sh
lint:
<<: *defaults
environment:
KUBECONFIG: /go/src/istio.io/istio/.circleci/config
resource_class: xlarge
steps:
- checkout
- run: make sync
- run: make lint
# Make sure that any modification to vendor is correct. Always use the latest version of dep.
- run:
name: Creating vendor diff
command: make depend.diff ISTIO_OUT=/go/out
- store_artifacts:
path: /go/out/dep.diff
nightly:
<<: *defaults
resource_class: xlarge
environment:
TAG: circleci-nightly
steps:
- checkout
- attach_workspace:
at: /go
- run: make sync
- setup_remote_docker:
docker_layer_caching: true
- run: make istio-archive
- run:
command: |
if [ ! -z "${DOCKER_USER}" ] ; then
echo "Pushing docker images"
export TAG=nightly-${CIRCLE_BRANCH}
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
# The xenail debug image is built first, will be used in the next steps
make docker.push.basedebug docker.all push
fi
goxbuild:
<<: *defaults
resource_class: xlarge
steps:
- checkout
- run:
command: |
cp -a /usr/local/go /go
export PATH=/go/go/bin:$PATH
export GOROOT=/go/go
cd /go/src/istio.io/istio
make build GOOS=darwin KUBECONFIG=/go/src/istio.io/istio/.circleci/config
make build GOOS=linux GOARCH=arm KUBECONFIG=/go/src/istio.io/istio/.circleci/config
- store_artifacts:
path: /go/bin
workflows:
version: 2
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
- release-0.8
- release-1.0
- dev-networking
jobs: #daisy chained steps ending with docker push
- depupdate
- build
- test
- e2e-simple:
requires:
- test
- build
- e2e-pilot-auth-v1alpha3-v2: # auth+v1alpha3+v2
requires:
- build
# Compile for mac and arm
- goxbuild:
requires:
- test
- build
# Nightly release
- nightly:
context: org-global
requires:
- build
periodic:
triggers:
- schedule:
cron: "20 7,14,21 * * *"
filters:
branches:
only:
- master
- release-0.8
- release-1.0
- dev-networking
jobs:
- depupdate
- build
- test
- e2e-simple:
requires:
- build
- e2e-dashboard:
requires:
- build
- benchcheck:
requires:
- test
- build
- e2e-mixer-noauth-v1alpha3-v2:
requires:
- build
- e2e-galley:
requires:
- build
- racetest:
requires:
- test
- e2e-pilot-noauth-v1alpha3-v2: # no auth+v1alpha3+v2
requires:
- build
- e2e-pilot-auth-v1alpha3-v2: # auth+v1alpha3+v2
requires:
- build
all:
jobs:
- shellcheck
- lint
- build
- test
- codecov:
requires:
- build
- e2e-mixer-noauth-v1alpha3-v2:
requires:
- build
- e2e-galley:
requires:
- build
- e2e-simple:
requires:
- build
- racetest:
requires:
- test
- e2e-pilot-auth-v1alpha3-v2: # auth+v1alpha3+v2
requires:
- build
- e2e-pilot-noauth-v1alpha3-v2: # noauth+v1alpha3+v2
requires:
- build
- e2e-pilot-cloudfoundry-v1alpha3-v2:
requires:
- build