-
Notifications
You must be signed in to change notification settings - Fork 20
316 lines (262 loc) · 13 KB
/
nightly-model-testing.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
name: Nightly Round-Trip Tests (Public)
on:
schedule:
- cron: "0 7 * * *"
workflow_dispatch:
env:
python-version: "3.9"
poetry-version: "1.2.1"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout Our Code
uses: actions/checkout@v4
with:
ref: '${{ github.ref }}'
- name: Get GH Reference
run: echo '${{ github.ref }}' >> ~/github.ref
- name: Upload Ref
uses: actions/upload-artifact@v3
with:
name: github_hash
path: ~/github.ref
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Install poetry
run: python3 -m pip install poetry==${{ env.poetry-version }}
- name: Install other python dependencies
run: python3 -m pip install -r requirements.txt
- name: build vcell-cli-utils package
run: |
cd vcell-cli-utils
poetry install
poetry run python -m pytest
- name: build vcell-admin package
run: |
cd docker/swarm/vcell-admin
poetry install
poetry run python -m pytest
- name: build pythonCopasiOpt package
run: |
cd pythonCopasiOpt/vcell-opt
poetry install
poetry run python -m pytest
- name: build pythonVtk package
run: |
cd pythonVtk
poetry install
poetry run python -m pytest
- name: build vcutils package
run: |
cd python-utils
poetry install
poetry run python -m pytest
- name: build python-restclient package
run: |
cd python-restclient
poetry install
poetry run python -m pytest
- name: build vcelldata package
run: |
cd pythonData
poetry install
poetry run python -m pytest
- name: setup java 17 with maven cache
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Build VCell Jars
run: mvn --batch-mode clean install dependency:copy-dependencies -DskipTests=True
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and Export
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
outputs: type=docker,dest=/tmp/image.tar
build-args: | # Max ram for Ubuntu GitHub workflow is 7GB (as of 12/9/22), using MB for precision (0.8 of 7gb)
MAX_JAVA_MEM=5734
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: docker-image
path: /tmp/image.tar
# Report a Problem to Slack
- name: Report Problem to Slack
if: ${{ failure() }}
run: curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="Uh-Oh! The *Build Step* of Nightly Testing Action on GitHub Failed ( ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} )! This may need attention..." https://slack.com/api/chat.postMessage
# Tmate just in case
- name: Setup tmate session 3
uses: mxschmitt/action-tmate@v3
if: ${{ failure() }}
export:
runs-on: ubuntu-20.04
needs: build
steps:
- name: Create Docker Image Dir
run: mkdir /tmp/docker
- name: Download Docker Image from `build` Job
uses: actions/download-artifact@v3
with:
name: docker-image
path: /tmp/docker
- name: Load Downloaded Docker Image
run: docker load --input /tmp/docker/$(ls /tmp/docker)
# Get files from VCDB
- name: Checkout Input Files
uses: actions/checkout@v4
with:
repository: virtualcell/vcdb
- name: Prepare Output Directory
run: mkdir -p $GITHUB_WORKSPACE/export_conversion/output
# Do the conversion
- name: Begin Conversion
#$(docker image ls | grep "<none>" | awk '{print $3;}') to get image id
run: docker run -v $GITHUB_WORKSPACE:/root $(docker image ls | grep "<none>" | awk '{print $3;}') export-omex-batch -i "/root/public/biomodel/vcml" -o "/root/export_conversion/output" -m SBML # grabs image and runs
# Parse the results
- name: Parse Results
run: |
cd $GITHUB_WORKSPACE/export_conversion/output
/bin/echo "biomodels processed $(cat jobLog.txt | grep START | wc -l)" >> ../export_results.txt
/bin/echo "biomodels succeeded $(cat jobLog.txt | grep MODEL,SUCC | wc -l)" >> ../export_results.txt
/bin/echo "simcontexts total $(cat jobLog.txt | grep TEXT | wc -l)" >> ../export_results.txt
/bin/echo "simcontexts failed $(cat jobLog.txt | grep TEXT,FAIL | wc -l)" >> ../import_results.txt
/bin/echo "simcontexts supported that failed $(cat jobLog.txt | grep TEXT,FAIL | grep -v supp | wc -l)" >> ../export_results.txt
/bin/echo "simcontexts math not equivalent $(cat jobLog.txt | grep TEXT,FAIL | grep -v supp | grep equiv | wc -l)" >> ../export_results.txt
/bin/echo "simcontexts divide by zero $(cat jobLog.txt | grep TEXT,FAIL | grep -v supp | grep divide | wc -l)" >> ../export_results.txt
/bin/echo "simcontexts duplicate IDs $(cat jobLog.txt | grep TEXT,FAIL | grep -v supp | grep duplicate | wc -l)" >> ../export_results.txt
/bin/echo "simcontexts null pointer $(cat jobLog.txt | grep TEXT,FAIL | grep -v supp | grep null | wc -l)" >> ../export_results.txt
/bin/echo "simcontexts structure mapping $(cat jobLog.txt | grep TEXT,FAIL | grep -v supp | grep struct | wc -l)" >> ../export_results.txt
/bin/echo "simcontexts other failure $(cat jobLog.txt | grep TEXT,FAIL | grep -v supp | grep -v struct | grep -v null | grep -v duplicate | grep -v divide | grep -v equiv | wc -l)" >> ../export_results.txt
/bin/echo "simulations total $(cat jobLog.txt | grep TION | wc -l)" >> ../export_results.txt
/bin/echo "simulations failed $(cat jobLog.txt | grep TION,FAIL | wc -l)" >> ../export_results.txt
/bin/echo "simulations supported that failed $(cat jobLog.txt | grep TION,FAIL | grep -v supp | wc -l)" >> ../export_results.txt
/bin/echo "simulations orphan overrides $(cat jobLog.txt | grep TION,FAIL | grep -v supp | grep Over | wc -l)" >> ../export_results.txt
/bin/echo "simulations unbound identifier $(cat jobLog.txt | grep TION,FAIL | grep -v supp | grep unbound | wc -l)" >> ../export_results.txt
/bin/echo "simulations other failure $(cat jobLog.txt | grep TION,FAIL | grep -v supp | grep -v Over | grep -v unbound | wc -l)" >> ../export_results.txt
# Create tar of converted files
- name: Compress Converted Files
run: cd $GITHUB_WORKSPACE/export_conversion/output && sudo tar cf omexes.tar --wildcards *.omex
# Upload Converted Files
- name: Upload Converted Files
uses: actions/upload-artifact@v3
with:
name: omexes.tar
path: ~/work/vcell/vcell/export_conversion/output/omexes.tar # Action only has basic ~ based expansion, env variables dont appear to work
# Upload Results
- name: Upload results of round-trip
uses: actions/upload-artifact@v3
with:
name: export_results.txt
path: ~/work/vcell/vcell/export_conversion/output/export_results.txt
- name: Upload original log of export
uses: actions/upload-artifact@v3
with:
name: export_log_original
path: ~/work/vcell/vcell/export_conversion/output/jobLog.txt
# Report a Problem to Slack
- name: Report Problem to Slack
if: ${{ failure() }}
run: curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="Uh-Oh! The *Export Step* of Nightly Testing Action on GitHub Failed ( ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} )! This may need attention..." https://slack.com/api/chat.postMessage
# Tmate just in case
- name: Setup tmate session 3
uses: mxschmitt/action-tmate@v3
if: ${{ failure() }}
import:
runs-on: ubuntu-20.04
needs: export
steps:
- name: Create working directory
run: mkdir ~/wrk
- name: Download Docker Image from `build` Job
uses: actions/download-artifact@v3
with:
name: docker-image
path: ~/wrk
- name: Load Downloaded Docker Image
run: docker load --input ~/wrk/$(ls ~/wrk)
# Make Input Directory
- name: Make Input and Output Directory
run: mkdir -p ~/input_files/output && mkdir ~/input_files/input
# Get the coverted omexes from before
- name: Download Converted COMBINE Archives
uses: actions/download-artifact@v3
with:
name: omexes.tar
path: ~/input_files/input
- name: Unpack Input Files
run: cd ~/input_files/input && sudo tar xvf $(ls *.tar) && rm $(ls *.tar)
- name: Prepare Output Directory
run: mkdir ~/input_files/input
# Do the round trip
- name: Begin Round-Trip Import
#$(docker image ls | grep "<none>" | awk '{print $3;}') to get image id
run: docker run -v ~/input_files:/root $(docker image ls | grep "<none>" | awk '{print $3;}') import-omex-batch -d -i "/root/input" -o "/root/output"
# Parse the results
- name: Parse Results
run: |
cd ~/input_files/output
/bin/echo "Biomodels processed $(cat jobLog.txt | grep '.omex,SUCC\|.omex,FAIL' | wc -l)" >> ~/import_results.txt
/bin/echo "Biomodels succeeded $(cat jobLog.txt | grep SUCC | wc -l)" >> ~/import_results.txt
/bin/echo "Biomodels that didn't converge $(cat jobLog.txt | grep SUCC | grep -v ',1' | wc -l)" >> ~/import_results.txt
# Upload results
- name: Upload Results of Round-Trip
uses: actions/upload-artifact@v3
with:
name: import_results.txt
path: ~/import_results.txt
- name: Upload Results of Round-Trip
uses: actions/upload-artifact@v3
with:
name: import_log_original
path: ~/input_files/output/jobLog.txt
# Report a Problem to Slack
- name: Report Problem to Slack
if: ${{ failure() }}
run: curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="Uh-Oh! The *Import Step* of Nightly Testing Action on GitHub Failed ( ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} )! This may need attention..." https://slack.com/api/chat.postMessage
# Tmate just in case
- name: Setup tmate session 3
uses: mxschmitt/action-tmate@v3
if: ${{ failure() }}
summarize:
runs-on: ubuntu-20.04
needs: import
steps:
- name: Make Results Directory
run: mkdir -p ~/results && cd ~/results
- name: Download Export Results
uses: actions/download-artifact@v3
with:
name: export_results.txt
path: ~/results
- name: Download Import Results
uses: actions/download-artifact@v3
with:
name: import_results.txt
path: ~/results
- name: Compile Results
run: |
if [ $() -gt 50000] && [ $() -lt 120000 ]; then echo -n 'Good Morning! ' >> ~/results/summary.txt; fi
echo 'Here are the results of the Nightly Testing. Have a great day!' >> ~/results/summary.txt
echo '' >> ~/results/summary.txt
echo '-------- Export Results --------' >> ~/results/summary.txt
cat ~/results/export_results.txt >> ~/results/summary.txt
echo '-------- Import Results --------' >> ~/results/summary.txt
cat ~/results/import_results.txt >> ~/results/summary.txt
echo '' >> ~/results/summary.txt
# Report a Success
- name: Report Results to Slack
run: curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="$(cat ~/results/summary.txt)" https://slack.com/api/chat.postMessage
# Report a Problem to Slack
- name: Report Problem to Slack
if: ${{ failure() }}
run: curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="Oops! The *Summary Step* of Nightly Testing Action on GitHub Failed ( ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} ). Go see what happened!" https://slack.com/api/chat.postMessage
- name: Setup tmate session 3
uses: mxschmitt/action-tmate@v3
if: ${{ failure() }}