⚠️ 注意:維護受限
本專案不再積極維護。現有版本仍然可用,但沒有計劃的更新、錯誤修復、新功能或安全補丁。使用者應注意,漏洞可能不會得到解決。
程式碼覆蓋率¶
要檢查分支穩定性,請按如下方式執行完整性檢查套件¶
安裝依賴項(如果尚未安裝) 對於 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;