From fa61571eaf6608d57f291465f0b34c4d5844367f Mon Sep 17 00:00:00 2001 From: lxn2 Date: Wed, 31 May 2017 17:36:08 -0700 Subject: [PATCH] Revert "Test install.md for macOS (#6231)" (#6520) This reverts commit bc83786a6b7d1f283376b366e1d51479c33b7d2d. --- .travis.yml | 5 +- docs/get_started/install.md | 12 +- tests/jenkins/run_test_installation_docs.sh | 239 +++++++------------- tests/travis/run_test.sh | 17 -- tests/travis/setup.sh | 2 +- 5 files changed, 91 insertions(+), 184 deletions(-) diff --git a/.travis.yml b/.travis.yml index a5f28fa5d115..c8ba0b1e645b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,7 @@ env: - TASK=cpp_test # run tests/python - TASK=python_test - #- TASK=r_test - - TASK=installation_packaged_test - - TASK=installation_source_test + - TASK=r_test # - TASK=julia JULIA_VER=0.4 # - TASK=scala_test @@ -80,6 +78,7 @@ addons: before_install: - export NVCC_PREFIX=${HOME} - source dmlc-core/scripts/travis/travis_setup_env.sh + - export PYTHONPATH=${PYTHONPATH}:${PWD}/python - export MAVEN_SKIP_RC=true - export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m -XX:-UseGCOverheadLimit -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC" diff --git a/docs/get_started/install.md b/docs/get_started/install.md index 4930a59d615d..f81307833029 100644 --- a/docs/get_started/install.md +++ b/docs/get_started/install.md @@ -462,14 +462,14 @@ If not already installed, [download and install Xcode](https://developer.apple.c
**Step 1** Install prerequisites - Homebrew, python development tools. - + ```bash # Install Homebrew -$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" /dev/null || brew install python +$ brew install python ``` **Step 2** Install virtualenv for macOS. @@ -523,14 +523,14 @@ Install *MXNet* with OpenBLAS acceleration.
**Step 1** Install prerequisites - Homebrew, python development tools. - + ```bash # Install Homebrew -$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" /dev/null || brew install python +$ brew install python ``` **Step 2** Install MXNet with OpenBLAS acceleration. diff --git a/tests/jenkins/run_test_installation_docs.sh b/tests/jenkins/run_test_installation_docs.sh index 09ebf28f7f67..921c89a16605 100755 --- a/tests/jenkins/run_test_installation_docs.sh +++ b/tests/jenkins/run_test_installation_docs.sh @@ -75,7 +75,7 @@ function retrieve_closest_index() { cur_num=${arr[${i}]} if [[ ${cur_num} -eq ${number} || ${cur_num} -gt ${number} ]] then - echo "${i}" + echo ${i} return fi done @@ -124,7 +124,7 @@ function retrieve_commands() { fi done done - echo "${commands}" + echo ${commands} } # Sorts array of numbers. @@ -139,32 +139,26 @@ function retrieve_commands() { function sort() { declare -a lineno_array=("${!1}") size=${#lineno_array[@]} - for((i=1;i 0 && ${lineno_array[$j-1]} > ${lineno_array[$j]} )); do + x=${lineno_array[$j-1]} + lineno_array[$j-1]=${lineno_array[$j]} + lineno_array[$j]=$x + j=$j-1 + done done printf "${lineno_array[*]}" } -if (( $# < 2 )); then +if (( $# < 1 )); then echo "" - echo "Usage: $(basename $0) FILE ENV" + echo "Usage: $(basename $0) FILE" echo "" exit 1 fi FILE=${1} -TASK=${2} # get all line numbers with "```" signifying start or end of source section and put them in an array SOURCE_REGEX="\`\`\`" @@ -176,10 +170,6 @@ PIP_LINENO_ALL=($(grep -n "
" "${FILE}" | cut -d : -f 1)) DOCKER_LINENO_ALL=($(grep -n "
" "${FILE}" | cut -d : -f 1)) BUILDFROMSOURCE_LINENO_ALL=($(grep -n "
" "${FILE}" | cut -d : -f 1)) -# validation instructions -PYTHON_GPU_VALIDATION="import mxnet as mx; a = mx.nd.ones((2, 3), mx.gpu()); b = a * 2 + 1; b.asnumpy()" -PYTHON_CPU_VALIDATION="import mxnet as mx; a = mx.nd.ones((2, 3)); b = a * 2 + 1; b.asnumpy()" - # Given two line numbers, collects instruction sets for installing via Virtualenv, Pip, Docker, and source within the # two lines assuming there is one of each. # @@ -242,139 +232,74 @@ function set_instruction_set() { ${sorted_indexes[$end_buildfromsource_command_index]}) } -if [[ "${TASK}" == "linux" ]] -then - - ########################LINUX-PYTHON-CPU############################ - echo - echo - echo "### Testing LINUX-PYTHON-CPU ###" - echo - # range of all lines inside Linux-Python-CPU instructions - LINUX_PYTHON_CPU_START_LINENO=$(grep -n "START - Linux Python CPU Installation Instructions" "${FILE}" | cut -d : -f 1) - LINUX_PYTHON_CPU_END_LINENO=$(grep -n "END - Linux Python CPU Installation Instructions" "${FILE}" | cut -d : -f 1) - - set_instruction_set ${LINUX_PYTHON_CPU_START_LINENO} ${LINUX_PYTHON_CPU_END_LINENO} - - virtualenv_commands="${virtualenv_commands} python -c \"${PYTHON_CPU_VALIDATION}\"" - echo - echo "### Testing Virtualenv ###" - echo "${virtualenv_commands}" - echo - docker run --rm ubuntu:14.04 bash -c "${virtualenv_commands}" - - pip_commands="${pip_commands} python -c \"${PYTHON_CPU_VALIDATION}\"" - echo - echo "### Testing Pip ###" - echo "${pip_commands}" - echo - docker run --rm ubuntu:14.04 bash -c "${pip_commands}" - - docker_img=$(echo "$docker_commands" | sed 's/.*docker pull \(.*\)/\1/' | sed 's/;.*//') - docker_commands="${docker_commands} docker run ${docker_img} python -c \"${PYTHON_CPU_VALIDATION}\"" - echo - echo "### Testing Docker ###" - echo "${docker_commands}" - echo - eval "${docker_commands}" - - buildfromsource_commands="${buildfromsource_commands} python -c \"${PYTHON_CPU_VALIDATION}\"" - echo - echo "### Testing Build From Source ###" - echo "${buildfromsource_commands}" - echo - docker run --rm ubuntu:14.04 bash -c "${buildfromsource_commands}" - - #########################LINUX-PYTHON-GPU########################### - - echo - echo - echo "### Testing LINUX-PYTHON-GPU ###" - echo - # range of all lines inside Linux-Python-GPU instructions - LINUX_PYTHON_GPU_START_LINENO=$(grep -n "START - Linux Python GPU Installation Instructions" "${FILE}" | cut -d : -f 1) - LINUX_PYTHON_GPU_END_LINENO=$(grep -n "END - Linux Python GPU Installation Instructions" "${FILE}" | cut -d : -f 1) - - set_instruction_set ${LINUX_PYTHON_GPU_START_LINENO} ${LINUX_PYTHON_GPU_END_LINENO} - - virtualenv_commands="${virtualenv_commands} python -c \"${PYTHON_GPU_VALIDATION}\"" - echo - echo "### Testing Virtualenv ###" - echo "${virtualenv_commands}" - echo - nvidia-docker run --rm nvidia/cuda:8.0-cudnn5-devel-ubuntu14.04 bash -c "${virtualenv_commands}" - - pip_commands="${pip_commands} python -c \"${PYTHON_GPU_VALIDATION}\"" - echo - echo "### Testing Pip ###" - echo "${pip_commands}" - echo - nvidia-docker run --rm nvidia/cuda:8.0-cudnn5-devel-ubuntu14.04 bash -c "${pip_commands}" - - docker_img=$(echo "$docker_commands" | sed 's/.*docker pull \(.*\)/\1/' | sed 's/;.*//') - docker_commands="${docker_commands} nvidia-docker run ${docker_img} python -c \"${PYTHON_GPU_VALIDATION}\"" - echo - echo "### Testing Docker ###" - echo "${docker_commands}" - echo - eval "${docker_commands}" - - buildfromsource_commands="${buildfromsource_commands} python -c \"${PYTHON_GPU_VALIDATION}\"" - echo - echo "### Testing Build From Source ###" - echo "${buildfromsource_commands}" - echo - nvidia-docker run --rm nvidia/cuda:8.0-cudnn5-devel-ubuntu14.04 bash -c "${buildfromsource_commands}" - -else - - #########################MACOS-PYTHON-CPU########################### - # Currently this section is invoked in ../travis/run_test.sh so this test can run on MacOS. - echo - echo - echo "### Testing MACOS-PYTHON-CPU ###" - echo - # range of all lines inside MacOS-Python-CPU instructions - MAC_PYTHON_CPU_START_LINENO=$(grep -n "START - MacOS Python CPU Installation Instructions" "${FILE}" | cut -d : -f 1) - MAC_PYTHON_CPU_END_LINENO=$(grep -n "END - Mac OS Python CPU Installation Instructions" "${FILE}" | cut -d : -f 1) - - set_instruction_set ${MAC_PYTHON_CPU_START_LINENO} ${MAC_PYTHON_CPU_END_LINENO} - - if [[ "${TASK}" == "installation_packaged_test" ]] - then - virtualenv_commands="${virtualenv_commands} python -c \"import sys; print hasattr(sys, 'real_prefix'); ${PYTHON_CPU_VALIDATION}\"; deactivate;" - echo - echo "### Testing Virtualenv ###" - echo "${virtualenv_commands}" - echo - eval "${virtualenv_commands}" - - pip_commands="${pip_commands} python -c \"${PYTHON_CPU_VALIDATION}\"" - echo - echo "### Testing Pip ###" - echo "${pip_commands}" - echo - eval "${pip_commands}" - - exit - fi - - ###COMMENTING THIS OUT FOR NOW AS TRAVIS DOES NOT SUPPORT DOCKER FOR MAC -# echo -# echo "### Testing Docker ###" -# echo "${docker_commands}" -# echo -# eval ${docker_commands} - if [[ "${TASK}" == "installation_source_test" ]] - then - buildfromsource_commands="${buildfromsource_commands} python -c \"${PYTHON_CPU_VALIDATION}\"" - echo - echo "### Testing Build From Source ###" - echo "${buildfromsource_commands}" - echo - eval "${buildfromsource_commands}" - - exit - fi -fi +########################LINUX-PYTHON-CPU############################ +echo +echo +echo "### Testing LINUX-PYTHON-CPU ###" +echo +# range of all lines inside Linux-Python-CPU instructions +LINUX_PYTHON_CPU_START_LINENO=$(grep -n "START - Linux Python CPU Installation Instructions" "${FILE}" | cut -d : -f 1) +LINUX_PYTHON_CPU_END_LINENO=$(grep -n "END - Linux Python CPU Installation Instructions" "${FILE}" | cut -d : -f 1) + +set_instruction_set ${LINUX_PYTHON_CPU_START_LINENO} ${LINUX_PYTHON_CPU_END_LINENO} + +echo +echo "### Testing Virtualenv ###" +echo "${virtualenv_commands}" +echo +docker run --rm ubuntu:14.04 bash -c "${virtualenv_commands}" + +echo +echo "### Testing Pip ###" +echo "${pip_commands}" +echo +docker run --rm ubuntu:14.04 bash -c "${pip_commands}" + +echo +echo "### Testing Docker ###" +echo "${docker_commands}" +echo +eval ${docker_commands} + +echo +echo "### Testing Build From Source ###" +echo "${buildfromsource_commands}" +echo +docker run --rm ubuntu:14.04 bash -c "${buildfromsource_commands}" + +#########################LINUX-PYTHON-GPU########################### + +echo +echo +echo "### Testing LINUX-PYTHON-GPU ###" +echo +# range of all lines inside Linux-Python-GPU instructions +LINUX_PYTHON_GPU_START_LINENO=$(grep -n "START - Linux Python GPU Installation Instructions" "${FILE}" | cut -d : -f 1) +LINUX_PYTHON_GPU_END_LINENO=$(grep -n "END - Linux Python GPU Installation Instructions" "${FILE}" | cut -d : -f 1) + +set_instruction_set ${LINUX_PYTHON_GPU_START_LINENO} ${LINUX_PYTHON_GPU_END_LINENO} + +echo +echo "### Testing Virtualenv ###" +echo "${virtualenv_commands}" +echo +nvidia-docker run --rm nvidia/cuda:7.5-cudnn5-devel bash -c "${virtualenv_commands}" + +echo +echo "### Testing Pip ###" +echo "${pip_commands}" +echo +nvidia-docker run --rm nvidia/cuda:7.5-cudnn5-devel bash -c "${pip_commands}" + +echo +echo "### Testing Docker ###" +echo "${docker_commands}" +echo +eval ${docker_commands} + +echo +echo "### Testing Build From Source ###" +echo "${buildfromsource_commands}" +echo +nvidia-docker run --rm nvidia/cuda:7.5-cudnn5-devel bash -c "${buildfromsource_commands}" diff --git a/tests/travis/run_test.sh b/tests/travis/run_test.sh index 540d013f1f16..cff4196b6043 100755 --- a/tests/travis/run_test.sh +++ b/tests/travis/run_test.sh @@ -5,22 +5,6 @@ then exit 0 fi -if [[ ${TASK} == *"installation"* ]]; then - git remote add main https://github.com/dmlc/mxnet.git - git fetch main master - echo "File changes compared to origin/master:" - echo "**********************************" - git diff --name-only remotes/main/master - echo "**********************************" - - if [[ ! $(git diff --name-only remotes/main/master | grep install.md) ]]; then - echo "No changes to install.md. Skipping installation tasks..." - exit 0 - fi - ./tests/jenkins/run_test_installation_docs.sh docs/get_started/install.md ${TASK} - exit $? -fi - if [ ${TASK} == "lint" ]; then make lint || exit -1 echo "Check documentations of c++ code..." @@ -109,7 +93,6 @@ if [ ${TASK} == "r_test" ]; then fi if [ ${TASK} == "python_test" ]; then - export PYTHONPATH=${PYTHONPATH}:${PWD}/python make all || exit -1 # use cached dir for storing data rm -rf ${PWD}/data diff --git a/tests/travis/setup.sh b/tests/travis/setup.sh index e1027b0db05e..ec071009bda5 100755 --- a/tests/travis/setup.sh +++ b/tests/travis/setup.sh @@ -5,7 +5,7 @@ then exit 0 fi -if [[ ${TRAVIS_OS_NAME} == "osx" && ${TASK} != *"installation"* ]]; then +if [ ${TRAVIS_OS_NAME} == "osx" ]; then brew update brew tap homebrew/science brew install opencv