Skip to content

Commit

Permalink
Re-enable build env check (#7969)
Browse files Browse the repository at this point in the history
* Re-enable build env check

* Fix linux test error

* Try to fix macOS test error
  • Loading branch information
yf225 authored and ezyang committed Jun 1, 2018
1 parent dbe5c7f commit b41050f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .jenkins/pytorch/macos-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fi
export PATH="${PYTORCH_ENV_DIR}/miniconda3/bin:$PATH"
source ${PYTORCH_ENV_DIR}/miniconda3/bin/activate
conda install -y mkl mkl-include numpy pyyaml setuptools cmake cffi ninja
rm -rf ${PYTORCH_ENV_DIR}/miniconda3/lib/python3.6/site-packages/torch
rm -rf ${PYTORCH_ENV_DIR}/miniconda3/lib/python3.6/site-packages/torch*

git submodule update --init --recursive
export CMAKE_PREFIX_PATH=${PYTORCH_ENV_DIR}/miniconda3/
Expand All @@ -33,5 +33,5 @@ export IMAGE_COMMIT_TAG=${BUILD_ENVIRONMENT}-${IMAGE_COMMIT_ID}
python setup.py install

# Upload torch binaries when the build job is finished
7z a ${IMAGE_COMMIT_TAG}.7z ${PYTORCH_ENV_DIR}/miniconda3/lib/python3.6/site-packages/torch
7z a ${IMAGE_COMMIT_TAG}.7z ${PYTORCH_ENV_DIR}/miniconda3/lib/python3.6/site-packages/torch*
aws s3 cp ${IMAGE_COMMIT_TAG}.7z s3://ossci-macos-build/pytorch/${IMAGE_COMMIT_TAG}.7z --acl public-read
4 changes: 2 additions & 2 deletions .jenkins/pytorch/macos-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fi
export PATH="${PYTORCH_ENV_DIR}/miniconda3/bin:$PATH"
source ${PYTORCH_ENV_DIR}/miniconda3/bin/activate
conda install -y mkl mkl-include numpy pyyaml setuptools cmake cffi ninja
rm -rf ${PYTORCH_ENV_DIR}/miniconda3/lib/python3.6/site-packages/torch
rm -rf ${PYTORCH_ENV_DIR}/miniconda3/lib/python3.6/site-packages/torch*

git submodule update --init --recursive
export CMAKE_PREFIX_PATH=${PYTORCH_ENV_DIR}/miniconda3/
Expand All @@ -31,7 +31,7 @@ export MAX_JOBS=2
export IMAGE_COMMIT_TAG=${BUILD_ENVIRONMENT}-${IMAGE_COMMIT_ID}

# Download torch binaries in the test jobs
rm -rf ${PYTORCH_ENV_DIR}/miniconda3/lib/python3.6/site-packages/torch
rm -rf ${PYTORCH_ENV_DIR}/miniconda3/lib/python3.6/site-packages/torch*
aws s3 cp s3://ossci-macos-build/pytorch/${IMAGE_COMMIT_TAG}.7z ${IMAGE_COMMIT_TAG}.7z
7z x ${IMAGE_COMMIT_TAG}.7z -o"${PYTORCH_ENV_DIR}/miniconda3/lib/python3.6/site-packages"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ GPU models and configuration:
GPU 0: Tesla M60
GPU 1: Tesla M60

Nvidia driver version: 384.X
Nvidia driver version: 390.X
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.1.2
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.1.4
/usr/lib/x86_64-linux-gnu/libcudnn_static_v7.a

Versions of relevant libraries:
Expand Down
30 changes: 15 additions & 15 deletions test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,21 +670,21 @@ def test_smoke(self):
info_output = get_pretty_env_info()
self.assertTrue(info_output.count('\n') >= 17)

# @unittest.skipIf('BUILD_ENVIRONMENT' not in os.environ.keys(), 'CI-only test')
# def test_expect(self):
# info_output = get_pretty_env_info()

# ci_build_envs = [
# 'pytorch-linux-trusty-py2.7',
# 'pytorch-linux-xenial-cuda9-cudnn7-py3',
# 'pytorch-macos-10.13-py3',
# 'pytorch-win-ws2016-cuda9-cudnn7-py3'
# ]
# build_env = os.environ['BUILD_ENVIRONMENT']
# if build_env not in ci_build_envs:
# return

# self.assertExpectedOutput(info_output, build_env)
@unittest.skipIf('BUILD_ENVIRONMENT' not in os.environ.keys(), 'CI-only test')
def test_expect(self):
info_output = get_pretty_env_info()

ci_build_envs = [
'pytorch-linux-trusty-py2.7',
'pytorch-linux-xenial-cuda9-cudnn7-py3',
'pytorch-macos-10.13-py3',
'pytorch-win-ws2016-cuda9-cudnn7-py3'
]
build_env = os.environ['BUILD_ENVIRONMENT']
if build_env not in ci_build_envs:
return

self.assertExpectedOutput(info_output, build_env)


class TestONNXUtils(TestCase):
Expand Down

0 comments on commit b41050f

Please sign in to comment.