-
Notifications
You must be signed in to change notification settings - Fork 198
/
azure-pipelines.yml
128 lines (114 loc) · 5.11 KB
/
azure-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
trigger:
branches:
include:
- "*" # must quote since "*" is a YAML reserved character; we want a string
paths:
exclude:
- "*.md"
- "*.png"
- "docs/*"
- ".gitignore"
- "LICENSE"
jobs:
- job: RunTests
displayName: Run Hardware Tests
timeoutInMinutes: 120
pool:
name: "sgx scale set new"
workspace:
clean: all # what to clean up before the job runs
variables:
baseImageRepository: 'azcr.io/enigmampc/ci-base-image'
baseImageRepositoryLocalTests: 'azcr.io/enigmampc/ci-base-image-local'
nodeImageRepository: 'azcr.io/enigmampc/ci-node-image'
containerRegistry: 'enigmampcdocker'
dockerfilePath: '$(Build.SourcesDirectory)/deployment/dockerfiles/Dockerfile'
tag: '$(Build.BuildId)'
DOCKER_BUILDKIT: 1
SGX_MODE: "HW"
FEATURES: "light-client-validation,random"
FEATURES_TESTS_LOCAL: "random"
steps:
- checkout: "self"
submodules: true
displayName: "Checkout Repository and Submodules"
- script: echo $(spid) > spid.txt; echo $(api-key-dev) > api_key.txt
displayName: "Save api keys"
- task: Docker@2
displayName: "Build base image"
inputs:
command: build
repository: '$(baseImageRepository)'
tags: |
$(tag)
latest
buildContext: .
arguments: --secret id=API_KEY,src=api_key.txt --secret id=SPID,src=spid.txt --cache-from $(baseImageRepository) --build-arg SGX_MODE=$(SGX_MODE) --build-arg FEATURES=$(FEATURES) --target compile-secretd
dockerfile: '$(dockerfilePath)'
- task: Docker@2
displayName: "Build base image for system tests"
inputs:
command: build
repository: '$(baseImageRepositoryLocalTests)'
tags: |
$(tag)
latest
buildContext: .
arguments: --secret id=API_KEY,src=api_key.txt --secret id=SPID,src=spid.txt --cache-from $(baseImageRepositoryLocalTests) --build-arg SGX_MODE=$(SGX_MODE) --build-arg FEATURES=$(FEATURES_TESTS_LOCAL) --target compile-secretd
dockerfile: '$(dockerfilePath)'
- script: |
cp deployment/ci/bootstrap_init.sh deployment/docker/testnet/bootstrap_init.sh
cp deployment/ci/node_init.sh deployment/docker/testnet/node_init.sh
cp deployment/ci/startup.sh deployment/docker/testnet/startup.sh
cp deployment/ci/node_key.json deployment/docker/testnet/node_key.json
displayName: Overwrite node scripts
- task: Docker@2
displayName: "Build release image"
inputs:
command: build
repository: '$(nodeImageRepository)'
tags: latest
buildContext: .
arguments: --secret id=API_KEY,src=api_key.txt --secret id=SPID,src=spid.txt --build-arg SCRT_BIN_IMAGE=$(baseImageRepository):$(tag) --cache-from $(nodeImageRepository) --build-arg SGX_MODE=$(SGX_MODE) --build-arg FEATURES=$(FEATURES) --target release-image
Dockerfile: deployment/dockerfiles/Dockerfile
- task: Docker@2
displayName: "Build enclave tests"
inputs:
command: build
repository: rust-enclave-test
tags: latest
buildContext: .
arguments: --secret id=API_KEY,src=api_key.txt --secret id=SPID,src=spid.txt --build-arg SGX_MODE=HW
Dockerfile: deployment/dockerfiles/tests/enclave-test.Dockerfile
- task: Docker@2
displayName: "Build Integration tests image"
inputs:
command: build
repository: integration-tests
tags: latest
buildContext: .
arguments: --build-arg SGX_MODE=HW
Dockerfile: deployment/dockerfiles/tests/integration-tests.Dockerfile
- task: Docker@2
displayName: "Build System tests image"
inputs:
command: build
repository: tests-base-image
tags: latest
buildContext: .
arguments: --build-arg SGX_MODE=HW --build-arg CI_BASE_IMAGE=$(baseImageRepositoryLocalTests):latest
Dockerfile: deployment/dockerfiles/tests/system-tests.Dockerfile
- script: export DOCKER_CLIENT_TIMEOUT=120 && export COMPOSE_HTTP_TIMEOUT=120 && docker-compose --compatibility -f deployment/ci/docker-compose.ci.yaml up --exit-code-from base aesm base
displayName: "Run system tests (go tests)"
- script: export DOCKER_CLIENT_TIMEOUT=120 && export COMPOSE_HTTP_TIMEOUT=120 && docker-compose --compatibility -f deployment/ci/docker-compose.ci.yaml up --exit-code-from bench aesm bench
displayName: "Run benchmarks"
- script: |
docker-compose -f deployment/ci/docker-compose.ci.yaml --compatibility up --exit-code-from integration-tests aesm bootstrap node-no-tests integration-tests
displayName: "Run integration tests (new)"
- script: docker-compose -f deployment/ci/docker-compose.ci.yaml --compatibility up --exit-code-from node aesm bootstrap node
displayName: "Run integration tests (old)"
- script: docker-compose -f deployment/ci/docker-compose.ci.yaml --compatibility up --exit-code-from enclave-test aesm enclave-test
displayName: "Run enclave tests"
- script: docker-compose -f deployment/ci/docker-compose.ci.yaml --compatibility down
condition: always()
displayName: "Shutdown"