-
Notifications
You must be signed in to change notification settings - Fork 8
353 lines (298 loc) · 10.9 KB
/
test-server-all.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
name: Build and Run Tests on CC, MC, and BTS Containers
on:
pull_request:
push:
branches:
- main
- "release/**"
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
COMPOSE_FILES_OPT: "-f ./docker-compose.medium.yml -f ./docker-compose.core.yml -f ./docker-compose.benchmark.yml -f ./docker-compose.small.yml -f ./docker-compose.datadog.yml -f ./docker-compose.dev.yml"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install clang-format tool
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 14
sudo apt-get update
sudo apt-get install clang-format-14
- name: Check if *.{cpp|hpp} files are formatted
run: |
cd ${{ github.workspace }}/packages/server/
make check
small_test_cc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Update .bazelrc for using remote cache
run: |
eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build cc with cache
uses: ./.github/actions/build_images_with_cache
with:
container-name: "small_cc"
cache-key: ${{ hashFiles('./packages/server/computation_container/**') }}
dockerfile-path: ./packages/server/computation_container/Dockerfile
builder-name: ${{ steps.buildx.outputs.name }}
target: "small_tmp"
- name: Run bazel test in computation_container
run: make test t=./computation_container m=run p=small
working-directory: ./scripts
small_test_mc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build mc with cache
uses: ./.github/actions/build_images_with_cache
with:
container-name: "small_mc"
cache-key: ${{ hashFiles('./packages/server/manage_container/**') }}
dockerfile-path: ./packages/server/manage_container/Dockerfile
builder-name: ${{ steps.buildx.outputs.name }}
target: "small"
- name: Run Go test in manage_container
run: make test t=./manage_container m=run p=small
working-directory: ./scripts
small_test_bts:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build bts with cache
uses: ./.github/actions/build_images_with_cache
with:
container-name: "small_bts"
cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }}
dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile
builder-name: ${{ steps.buildx.outputs.name }}
target: "small"
- name: Run test in beaver_triple_service
run: make test t=./beaver_triple_service m=run
working-directory: ./scripts
small_test:
runs-on: ubuntu-latest
needs: [small_test_cc, small_test_mc, small_test_bts]
steps:
- name: Merge All small_test
run: echo "ok"
medium_test_cc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Update .bazelrc for using remote cache
run: |
eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build cc with cache
uses: ./.github/actions/build_images_with_cache
with:
container-name: "medium_cc"
cache-key: ${{ hashFiles('./packages/server/computation_container/**') }}
dockerfile-path: ./packages/server/computation_container/Dockerfile
builder-name: ${{ steps.buildx.outputs.name }}
target: "medium"
- name: Build bts with cache
uses: ./.github/actions/build_images_with_cache
with:
container-name: "dev_bts"
cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }}
dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile
builder-name: ${{ steps.buildx.outputs.name }}
target: "dev"
- name: Run bazel test in computation_container
run: make test t=./computation_container m=run p=medium
working-directory: ./scripts
medium_test_mc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build mc with cache
uses: ./.github/actions/build_images_with_cache
with:
container-name: "medium_mc"
cache-key: ${{ hashFiles('./packages/server/manage_container/**') }}
dockerfile-path: ./packages/server/manage_container/Dockerfile
builder-name: ${{ steps.buildx.outputs.name }}
target: "medium"
- name: Run bazel test in manage_container
run: make test t=./manage_container m=run p=medium
working-directory: ./scripts
medium_test_libclient:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test_name:
[
correl,
get_computation_result,
get_elapsed_time,
job_error_info,
join,
mean,
parallel,
send_share,
string,
sum,
token,
variance,
]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }}
submodules: true
- name: Update .bazelrc for using remote cache
run: |
eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- uses: ./.github/actions/prepare_libclient_test
- name: Run container test
run: docker-compose ${{ env.COMPOSE_FILES_OPT }} run medium-libc pytest src/tests/test_${{ matrix.test_name }}.py -s -v -log-cli-level=DEBUG
working-directory: ./scripts
medium_test_container_up:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }}
submodules: true
- name: Update .bazelrc for using remote cache
run: |
eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- uses: ./.github/actions/prepare_container_test
- name: Run container test
run: |
pipenv sync
pipenv install --skip-lock ../../packages/client/libclient-py
pipenv run pytest ./tests/test_up.py -s -v -log-cli-level=DEBUG
working-directory: ./scripts/container_test
medium_test_container_restart:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test_name:
[
send_share,
execute_computation,
get_computation_result,
execute_multiple
]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }}
submodules: true
- name: Update .bazelrc for using remote cache
run: |
eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- uses: ./.github/actions/prepare_container_test
- name: Run container test
run: |
pipenv sync
pipenv install --skip-lock ../../packages/client/libclient-py
pipenv run pytest ./tests/test_restart_request.py::test_success_${{ matrix.test_name }}_with_restart -s -v -log-cli-level=DEBUG
working-directory: ./scripts/container_test
medium_test_container_down:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test_name:
[
send_share,
execute_computation,
get_computation_result,
]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.CI_REPOSITORY_ACCESS_TOKEN }}
submodules: true
- name: Update .bazelrc for using remote cache
run: |
eval "echo \"$(cat ./.github/workflows/.bazelrc_for_ci)\"" >> ./packages/server/computation_container/.bazelrc
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- uses: ./.github/actions/prepare_container_test
- name: Run container test
run: |
pipenv sync
pipenv install --skip-lock ../../packages/client/libclient-py
pipenv run pytest ./tests/test_down_request.py::test_failed_${{ matrix.test_name }}_with_down -s -v -log-cli-level=DEBUG
working-directory: ./scripts/container_test
medium_test_container:
runs-on: ubuntu-latest
needs:
[
medium_test_container_up,
medium_test_container_restart,
medium_test_container_down
]
steps:
- name: Merge All medium_test_container
run: echo "ok"
medium_test:
runs-on: ubuntu-latest
needs:
[
medium_test_cc,
medium_test_mc,
medium_test_libclient,
medium_test_container
]
steps:
- name: Merge All medium_test
run: echo "ok"