fix the CI job for onnx (#22946)

Summary:
ONNX uses virtualenv, and PyTorch doesn't. So --user flag is causing problems in ONNX ci...

Fixing it by moving it to pytorch only scripts. And will install ninja in onnx ci separately.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22946

Reviewed By: bddppq

Differential Revision: D16297781

Pulled By: houseroad

fbshipit-source-id: 52991abac61beaf3cfbcc99af5bb1cd27b790485
This commit is contained in:
Lu Fang
2019-07-17 09:46:56 -07:00
committed by Facebook Github Bot
parent f72d754877
commit b96610bf5a
2 changed files with 6 additions and 5 deletions

View File

@ -126,5 +126,11 @@ pip install --user pytest-sugar
#####################
if [[ "$BUILD_ENVIRONMENT" == *onnx* ]]; then
pip install -q --user git+https://github.com/pytorch/vision.git
pip install -q --user ninja
# JIT C++ extensions require ninja, so put it into PATH.
export PATH="/var/lib/jenkins/.local/bin:$PATH"
if [[ "$BUILD_ENVIRONMENT" == *py3* ]]; then
pip install -q --user onnxruntime
fi
"$ROOT_DIR/scripts/onnx/test.sh"
fi

View File

@ -24,10 +24,6 @@ done
set -- "${UNKNOWN[@]}" # leave UNKNOWN
pip install pytest scipy hypothesis
# JIT C++ extensions require ninja.
pip install ninja --user
# ninja is installed in /var/lib/jenkins/.local/bin
export PATH="/var/lib/jenkins/.local/bin:$PATH"
if [[ $PARALLEL == 1 ]]; then
pip install pytest-xdist
@ -61,7 +57,6 @@ pytest "${args[@]}" \
# onnxruntime only support py3
# "Python.h" not found in py2, needed by TorchScript custom op compilation.
if [[ "$BUILD_ENVIRONMENT" == *py3* ]]; then
pip install --user onnxruntime
pytest "${args[@]}" "$top_dir/test/onnx/test_pytorch_onnx_onnxruntime.py"
pytest "${args[@]}" "$top_dir/test/onnx/test_custom_ops.py"
pytest "${args[@]}" "$top_dir/test/onnx/test_models_onnxruntime.py"