forked from pytorch/serve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
torchserve_sanity.py
43 lines (31 loc) · 1.07 KB
/
torchserve_sanity.py
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
from scripts.test_modelarchiver import test_modelarchiver
from scripts.test_torchserve import test_torchserve
from scripts.install_from_src import install_from_src
from scripts.test_sanity import test_sanity
from scripts.shell_utils import rm_dir
from scripts.test_frontend import test_frontend
import scripts.tsutils as ts
import test.print_env_info as build_hdr_printer
def torchserve_sanity():
# Test frontend gradle
test_frontend()
# Install from src
install_from_src()
# Test Torchserve pylint, pytest
test_torchserve()
# Test Model archiver pylint, pytest, IT
test_modelarchiver()
# Run Sanity Tests
test_sanity()
cleanup()
def cleanup():
ts.stop_torchserve()
rm_dir('model_store')
rm_dir('logs')
# clean up residual from model-archiver IT suite.
rm_dir('model-archiver/model_archiver/htmlcov_ut model_archiver/model-archiver/htmlcov_it')
if __name__ == '__main__':
from pygit2 import Repository
git_branch = Repository('.').head.shorthand
build_hdr_printer.main(git_branch)
torchserve_sanity()