This repository has been archived by the owner on Jul 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfig.yml
313 lines (271 loc) · 10.7 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
version: 2.1
orbs:
win: circleci/[email protected]
workflows:
build_and_test:
jobs:
- build
- blendnet_test:
blender_version: "2.80" # The first one supported
requires:
- build
- blendnet_test:
blender_version: lts
requires:
- build
- blendnet_test:
blender_version: latest # Latest release available
requires:
- build
- blendnet_test_win:
requires:
- build
nightly_test:
triggers:
- schedule:
cron: "0 6 * * *"
filters:
branches:
only:
- master
jobs:
- blendnet_test:
blender_version: "2.80" # The first one supported
- blendnet_test:
blender_version: lts
- blendnet_test:
blender_version: latest # Latest release available
jobs:
build:
docker:
- image: cimg/base:stable-20.04
steps:
- checkout:
path: blendnet
- run:
name: Packing dist archive
command: blendnet/.circleci/build.sh
# TODO: run static tests
#- store_test_results:
# path: results/reports
- store_artifacts:
path: results
destination: results
blendnet_test:
parameters:
blender_version:
description: |
Blender version to use
* <version> - exact version you need
* lts - latest available LTS version
* latest - latest available version
type: string
docker:
- image: cimg/base:stable-20.04
steps:
- checkout:
path: blendnet
- setup_remote_docker
- run:
name: Preparing to the test execution
command: |
blendnet/.circleci/test_prepare.sh "<< parameters.blender_version >>"
# Creating the docker container to store the data
docker create -v /srv --name blendnet-srv alpine /bin/true
mkdir -p scripts/addons
cp -a blendnet scripts/addons
docker cp scripts blendnet-srv:/srv
docker cp blender blendnet-srv:/srv
docker cp workspace blendnet-srv:/srv
mkdir -p results
no_output_timeout: 5m
- run:
name: Run blendnet-agent-1
background: true
command: |
docker run --name blendnet-agent-1 -m 2G --rm -it \
--volumes-from blendnet-srv ubuntu:20.04 \
/srv/workspace/test_run_service.sh agent 2>&1 | tee results/agent-1.log || true
echo "Check exceptions in the log"
grep '^Traceback' results/agent-1.log && exit 1 || echo ok
echo "Check errors in the log"
grep '^ERROR: ' results/agent-1.log && exit 2 || echo ok
grep '^Fatal Python error: ' results/agent-1.log && exit 3 || echo ok
- run:
name: Run blendnet-agent-2
background: true
command: |
docker run --name blendnet-agent-2 -m 2G --rm -it \
--volumes-from blendnet-srv ubuntu:20.04 \
/srv/workspace/test_run_service.sh agent 2>&1 | tee results/agent-2.log || true
echo "Check exceptions in the log"
grep '^Traceback' results/agent-2.log && exit 1 || echo ok
echo "Check errors in the log"
grep '^ERROR: ' results/agent-2.log && exit 2 || echo ok
grep '^Fatal Python error: ' results/agent-2.log && exit 3 || echo ok
- run:
name: Run blendnet-manager
background: true
command: |
# Wait for blendnet-agent-1 container
while ! docker ps | grep blendnet-agent-1; do echo "waiting agent-1"; docker ps; sleep 1; done
# Wait for blendnet-agent-2 container
while ! docker ps | grep blendnet-agent-2; do echo "waiting agent-2"; docker ps; sleep 1; done
docker run --name blendnet-manager -m 2G --rm -it \
--link blendnet-agent-1:blendnet-agent-1-host \
--link blendnet-agent-2:blendnet-agent-2-host \
--volumes-from blendnet-srv ubuntu:20.04 \
/srv/workspace/test_run_service.sh manager 2>&1 | tee results/manager.log || true
echo "Check exceptions in the log"
grep '^Traceback' results/manager.log && exit 1 || echo ok
echo "Check errors in the log"
grep '^ERROR: ' results/manager.log && exit 2 || echo ok
grep '^Fatal Python error: ' results/manager.log && exit 3 || echo ok
- run:
name: Run blendnet-executor
background: true
command: |
# Wait for blendnet-manager container
while ! docker ps | grep blendnet-manager; do echo "waiting manager"; docker ps; sleep 1; done
# Run executor to connect with Manager
docker run --name blendnet-executor -m 1G --rm -it \
--link blendnet-manager:blendnet-manager-host \
--volumes-from blendnet-srv ubuntu:20.04 /bin/sleep 3600 || true
- run:
name: Run Addon test
command: blendnet/.circleci/test_execute_addon.sh "<< parameters.blender_version >>" || exit 1
- run:
name: Run API test
command: blendnet/.circleci/test_execute_api.sh "<< parameters.blender_version >>" || exit 1
- run:
name: Clean the docker containers
when: always
command: |
# TODO: when BN-64 is completed - stop Manager and Agents properly
docker rm -f blendnet-agent-1 || true
docker rm -f blendnet-agent-2 || true
docker rm -f blendnet-manager || true
docker rm -f blendnet-executor || true
docker rm -f blendnet-srv || true
# TODO: Add test results
#- store_test_results:
# path: results/reports
- store_artifacts:
path: results
destination: results
blendnet_test_win:
executor:
name: win/default
steps:
- checkout:
path: blendnet
- run:
name: Preparing to the test execution
command: |
blendnet\.circleci\test_prepare.ps1
# Put addon to the proper place
mkdir -p scripts/addons
cp -r blendnet scripts/addons/
# Create the results dir
mkdir results
no_output_timeout: 5m
- run:
name: Run blendnet-agent-1
background: true
command: |
cp -r workspace agent-1
cd agent-1
echo '{"listen_host": "127.0.1.1"}' | Out-File -Encoding ASCII agent.json
..\blender\blender.exe -b -noaudio -P ..\scripts\addons\blendnet\agent.py 2>&1 | tee -filepath ..\results\agent-1.log
cd ..
echo "Check exceptions in the log"
$result = cat results\agent-1.log | Select-String -Pattern '^Traceback'
if ($result -ne $null) {
echo "Found exceptions in the agent-1 log: $result"
exit 1
}
echo "Check errors in the log"
$result = cat results\agent-1.log | Select-String -Pattern '^ERROR: '
if ($result -ne $null) {
echo "Found errors in the agent-1 log: $result"
exit 2
}
$result = cat results\agent-1.log | Select-String -Pattern '^Fatal Python error: '
if ($result -ne $null) {
echo "Found errors in the agent-1 log: $result"
exit 3
}
- run:
name: Run blendnet-agent-2
background: true
command: |
cp -r workspace agent-2
cd agent-2
echo '{"listen_host": "127.0.1.2"}' | Out-File -Encoding ASCII agent.json
..\blender\blender.exe -b -noaudio -P ..\scripts\addons\blendnet\agent.py 2>&1 | tee -filepath ..\results\agent-2.log
cd ..
echo "Check exceptions in the log"
$result = cat results\agent-2.log | Select-String -Pattern '^Traceback'
if ($result -ne $null) {
echo "Found exceptions in the agent-2 log: $result"
exit 1
}
echo "Check errors in the log"
$result = cat results\agent-2.log | Select-String -Pattern '^ERROR: '
if ($result -ne $null) {
echo "Found errors in the agent-2 log: $result"
exit 2
}
$result = cat results\agent-2.log | Select-String -Pattern '^Fatal Python error: '
if ($result -ne $null) {
echo "Found errors in the agent-2 log: $result"
exit 3
}
- run:
name: Run blendnet-manager
background: true
command: |
# Adding resolve paths for the agents
Add-Content -Path "$env:windir\System32\drivers\etc\hosts" -Value "127.0.1.1`tblendnet-agent-1-host" -Force
Add-Content -Path "$env:windir\System32\drivers\etc\hosts" -Value "127.0.1.2`tblendnet-agent-2-host" -Force
cp -r workspace manager
cd manager
..\blender\blender.exe -b -noaudio -P ..\scripts\addons\blendnet\manager.py 2>&1 | tee -filepath ..\results\manager.log
cd ..
echo "Check exceptions in the log"
$result = cat results\manager.log | Select-String -Pattern '^Traceback'
if ($result -ne $null) {
echo "Found exceptions in the manager log: $result"
exit 1
}
echo "Check errors in the log"
$result = cat results\manager.log | Select-String -Pattern '^ERROR: '
if ($result -ne $null) {
echo "Found errors in the manager log: $result"
exit 2
}
$result = cat results\manager.log | Select-String -Pattern '^Fatal Python error: '
if ($result -ne $null) {
echo "Found errors in the manager log: $result"
exit 3
}
- run:
name: Run Addon test
command: |
Add-Content -Path "$env:windir\System32\drivers\etc\hosts" -Value "127.0.0.1`tblendnet-manager-host" -Force
blendnet\.circleci\test_execute_addon.ps1
- run:
name: Stop the running blender processes
when: always
command: |
# TODO: when BN-64 is completed - stop Manager and Agents properly
Stop-Process -Name "blender"
sleep 1
Stop-Process -Name "blender" -Force
sleep 10
# TODO: Add test results
#- store_test_results:
# path: results/reports
- store_artifacts:
path: results
destination: results