mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Fixing conda test builds (#6261)
* Moving conda test package installs into docker image * Small nits * Onnx setup.py still needs PROTOBUF_INCDIR passed in
This commit is contained in:
parent
0b3edfd3dd
commit
38b995a13b
|
|
@ -61,13 +61,10 @@ if [[ "${BUILD_ENVIRONMENT}" == conda* ]]; then
|
|||
export CONDA_INSTALL_LOCALLY=1
|
||||
"${ROOT_DIR}/scripts/build_anaconda.sh" "$@"
|
||||
|
||||
# The tests all need hypothesis, tabulate, and pydot, which aren't included
|
||||
# in the conda packages
|
||||
conda install -y hypothesis tabulate pydot
|
||||
|
||||
# This build will be tested against onnx tests, which needs onnx installed.
|
||||
# Onnx should be built against the same protobuf that Caffe2 uses, which is
|
||||
# only installed in the conda environment when Caffe2 is.
|
||||
# At this point the visible protbuf installation will be in conda, since one
|
||||
# of Caffe2's dependencies uses conda, so the correct protobuf include
|
||||
# headers are those in conda as well
|
||||
# This path comes from install_anaconda.sh which installs Anaconda into the
|
||||
# docker image
|
||||
PROTOBUF_INCDIR=/opt/conda/include pip install "${ROOT_DIR}/third_party/onnx"
|
||||
|
|
|
|||
|
|
@ -25,23 +25,6 @@ if [[ "$BUILD_ENVIRONMENT" == conda* ]]; then
|
|||
# docker image
|
||||
PYTHON="/opt/conda/bin/python"
|
||||
INSTALL_PREFIX="/opt/conda/"
|
||||
|
||||
# Testing requires separate packages
|
||||
if [[ $BUILD_ENVIRONMENT == *gcc4* ]]; then
|
||||
# These are from conda-forge
|
||||
conda install -yc conda-forge hypothesis tabulate pydot networkx==2.0 click pytest scipy
|
||||
# These packages are from the default channels
|
||||
conda install -y opencv=3.1.0=np112py27_1 pil=1.1.7=py27_2
|
||||
else
|
||||
conda install -y hypothesis tabulate pydot
|
||||
fi
|
||||
|
||||
# This build will be tested against onnx tests, which needs onnx installed.
|
||||
# Onnx should be built against the same protobuf that Caffe2 uses, which is
|
||||
# only installed in the conda environment when Caffe2 is.
|
||||
# This path comes from install_anaconda.sh which installs Anaconda into the
|
||||
# docker image
|
||||
PROTOBUF_INCDIR=/opt/conda/include pip install "${ROOT_DIR}/third_party/onnx"
|
||||
fi
|
||||
|
||||
# Add the site-packages in the caffe2 install prefix to the PYTHONPATH
|
||||
|
|
|
|||
|
|
@ -18,3 +18,7 @@ rm "$CONDA_PKG_NAME"
|
|||
|
||||
export PATH="/opt/conda/bin:$PATH"
|
||||
echo 'export PATH=/opt/conda/bin:$PATH' > ~/.bashrc
|
||||
|
||||
# Install packages needed for tests, but that aren't included in the base conda
|
||||
# requirements to keep them slim
|
||||
conda install -y hypothesis tabulate pydot
|
||||
|
|
|
|||
|
|
@ -101,15 +101,15 @@ if [[ $BUILD_ENVIRONMENT == *cuda* ]]; then
|
|||
# and manually set the package name ourself.
|
||||
CAFFE2_PACKAGE_NAME="${CAFFE2_PACKAGE_NAME}-cuda${CAFFE2_CUDA_VERSION}-cudnn${CAFFE2_CUDNN_VERSION}"
|
||||
fi
|
||||
if [[ $GCC_USE_C11 -eq 0 ]]; then
|
||||
# gcc compatibility is not tracked by conda-forge, so we track it ourselves
|
||||
CAFFE2_PACKAGE_NAME="${CAFFE2_PACKAGE_NAME}-gcc${GCC_VERSION:0:3}"
|
||||
fi
|
||||
if [[ "$(uname)" != 'Darwin' ]]; then
|
||||
if [[ $BUILD_ENVIRONMENT == *full* ]]; then
|
||||
CAFFE2_PACKAGE_NAME="${CAFFE2_PACKAGE_NAME}-full"
|
||||
if [[ $GCC_USE_C11 -eq 0 ]]; then
|
||||
# gcc compatibility is not tracked by conda-forge, so we track it ourselves
|
||||
CAFFE2_PACKAGE_NAME="${CAFFE2_PACKAGE_NAME}-gcc${GCC_VERSION:0:3}"
|
||||
fi
|
||||
fi
|
||||
if [[ $BUILD_ENVIRONMENT == *full* ]]; then
|
||||
CAFFE2_PACKAGE_NAME="${CAFFE2_PACKAGE_NAME}-full"
|
||||
fi
|
||||
portable_sed "s/name: caffe2.*\$/name: ${CAFFE2_PACKAGE_NAME}/" "${META_YAML}"
|
||||
|
||||
|
||||
|
|
@ -139,7 +139,6 @@ if [[ "$(uname)" != 'Darwin' ]]; then
|
|||
CMAKE_BUILD_ARGS+=("-DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0")
|
||||
# Default conda channels use gcc 7.2 (for recent packages), conda-forge uses
|
||||
# gcc 4.8.5
|
||||
# TODO don't do this if user also specified a channel
|
||||
CAFFE2_CONDA_CHANNEL='-c conda-forge'
|
||||
|
||||
# opencv 3.3.1 in conda-forge doesn't have imgcodecs
|
||||
|
|
@ -148,7 +147,6 @@ if [[ "$(uname)" != 'Darwin' ]]; then
|
|||
# opencv 3.1.0 for python 3 requires numpy 1.12
|
||||
add_package 'numpy' '>1.11'
|
||||
fi
|
||||
CONDA_BUILD_ARGS+=(" -c conda-forge")
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user