⚠️ 注意:维护受限
本项目不再积极维护。现有版本仍然可用,但没有计划的更新、错误修复、新功能或安全补丁。用户应注意,漏洞可能不会得到解决。
代码覆盖率¶
要检查分支稳定性,请按如下方式运行完整性检查套件¶
安装依赖项(如果尚未安装) 对于 CPU
python ts_scripts/install_dependencies.py --environment=dev
对于 GPU
安装依赖项(如果尚未安装)
python ts_scripts/install_dependencies.py --environment=dev --cuda=cu121
支持的 cuda 版本有 cu121, cu118, cu117, cu116, cu113, cu111, cu102, cu101, cu92
执行完整性检查套件
python ./torchserve_sanity.py
要运行前端构建套件,请运行以下命令¶
frontend/gradlew -p frontend clean build
TorchServe 前端构建套件包括
checkstyle
findbugs
PMD
UT
报告生成在以下路径:frontend/server/build/reports
要运行后端 pytest 套件,请运行以下命令¶
python -m pytest --cov-report html:htmlcov --cov=ts/ ts/tests/unit_tests/
报告生成在以下路径:htmlcov/
要对 ts
包运行 python linting,请运行以下命令¶
pylint -rn --rcfile=./ts/tests/pylintrc ts/.
要在 model-archiver 上运行 pytest 套件,请运行以下命令¶
cd model-archiver
python -m pytest --cov-report html:htmlcov_ut --cov=model_archiver/ model_archiver/tests/unit_tests/
报告生成在以下路径:model-archiver/htmlcov_ut/
要在 model-archiver 上运行 IT 套件,请运行以下命令¶
cd model-archiver
pip install .
python -m pytest --cov-report html:htmlcov_it --cov=model_archiver/ model_archiver/tests/integ_tests/
报告生成在以下路径:model-archiver/htmlcov_it/
注意:所有上述命令都需要在 serve 主目录下执行
要运行 markdown 链接检查,请运行以下命令¶
安装 markdown 链接检查器依赖项¶
运行以下命令安装 node 和 markdown-link-check
npm 包。
安装 node
对于 Linux
sudo apt-get -y install nodejs-dev
sudo apt-get -y install npm
对于 Mac
brew install node
brew install npm
安装 markdown
sudo npm install -g n
sudo npm install -g markdown-link-check
执行此命令可在本地运行 markdown 链接检查。它将递归检查当前目录中所有扩展名为 “.md” 的文件中的损坏链接。
for i in **/*.md; do markdown-link-check $i --config link_check_config.json; done;