Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
db61ab68
"src/git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "67ca60915033e01b8f9fd664d4089b245f810fd6"
Commit
db61ab68
authored
Jun 10, 2018
by
Nikita Titov
Committed by
Guolin Ke
Jun 10, 2018
Browse files
[ci] refined Travis tests (#1437)
parent
43005194
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
39 deletions
+40
-39
.travis.yml
.travis.yml
+5
-4
.travis/setup.sh
.travis/setup.sh
+17
-5
.travis/test.sh
.travis/test.sh
+18
-30
No files found.
.travis.yml
View file @
db61ab68
...
@@ -42,13 +42,14 @@ matrix:
...
@@ -42,13 +42,14 @@ matrix:
before_install
:
before_install
:
-
test -n $CC && unset CC
-
test -n $CC && unset CC
-
test -n $CXX && unset CXX
-
test -n $CXX && unset CXX
-
export PATH="$HOME/miniconda/bin:$PATH"
-
export LGB_VER=$(head -n 1 VERSION.txt)
-
export AMDAPPSDK=$HOME/AMDAPPSDK
-
export LD_LIBRARY_PATH="$AMDAPPSDK/lib/x86_64:$LD_LIBRARY_PATH"
-
export OPENCL_VENDOR_PATH=$AMDAPPSDK/etc/OpenCL/vendors
install
:
install
:
-
bash .travis/setup.sh
-
bash .travis/setup.sh
-
bash conda.sh -b -p $HOME/miniconda
-
export PATH="$HOME/miniconda/bin:$PATH"
-
conda config --set always_yes yes --set changeps1 no
-
conda update -q conda
script
:
script
:
-
bash .travis/test.sh
-
bash .travis/test.sh
...
...
.travis/setup.sh
View file @
db61ab68
...
@@ -2,20 +2,32 @@
...
@@ -2,20 +2,32 @@
if
[[
$TRAVIS_OS_NAME
==
"osx"
]]
;
then
if
[[
$TRAVIS_OS_NAME
==
"osx"
]]
;
then
rm
'/usr/local/include/c++'
rm
'/usr/local/include/c++'
# brew cask uninstall oclint #
R
eserve variant to deal with conflict link
# brew cask uninstall oclint #
r
eserve variant to deal with conflict link
if
[[
$
{
TASK
}
==
"mpi"
]]
;
then
if
[[
$TASK
==
"mpi"
]]
;
then
brew
install
open-mpi
brew
install
open-mpi
else
else
brew
install
gcc
brew
install
gcc
fi
fi
# brew link --overwrite gcc #
P
revious variant to deal with conflict link
# brew link --overwrite gcc #
p
revious variant to deal with conflict link
wget
-O
conda.sh https://repo.continuum.io/miniconda/Miniconda
${
PYTHON_VERSION
:0:1
}
-latest-MacOSX-x86_64
.sh
wget
-O
conda.sh https://repo.continuum.io/miniconda/Miniconda
${
PYTHON_VERSION
:0:1
}
-latest-MacOSX-x86_64
.sh
else
else
if
[[
$
{
TASK
}
==
"mpi"
]]
;
then
if
[[
$TASK
==
"mpi"
]]
;
then
sudo
apt-get
install
-y
libopenmpi-dev openmpi-bin
sudo
apt-get
install
-y
libopenmpi-dev openmpi-bin
fi
fi
if
[[
$
{
TASK
}
==
"gpu"
]]
;
then
if
[[
$TASK
==
"gpu"
]]
;
then
sudo
apt-get
install
-y
ocl-icd-opencl-dev
sudo
apt-get
install
-y
ocl-icd-opencl-dev
fi
fi
wget
-O
conda.sh https://repo.continuum.io/miniconda/Miniconda
${
PYTHON_VERSION
:0:1
}
-latest-Linux-x86_64
.sh
wget
-O
conda.sh https://repo.continuum.io/miniconda/Miniconda
${
PYTHON_VERSION
:0:1
}
-latest-Linux-x86_64
.sh
fi
fi
sh conda.sh
-b
-p
$HOME
/miniconda
conda config
--set
always_yes
yes
--set
changeps1 no
conda update
-q
conda
if
[[
$TASK
==
"gpu"
]]
&&
[[
$TRAVIS_OS_NAME
==
"linux"
]]
;
then
wget https://github.com/Microsoft/LightGBM/releases/download/v2.0.12/AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2
tar
-xjf
AMD-APP-SDK
*
.tar.bz2
mkdir
-p
$OPENCL_VENDOR_PATH
sh AMD-APP-SDK
*
.sh
--tar
-xf
-C
$AMDAPPSDK
echo
libamdocl64.so
>
$OPENCL_VENDOR_PATH
/amdocl64.icd
fi
.travis/test.sh
View file @
db61ab68
if
[[
${
TASK
}
==
"gpu"
]]
&&
[[
$TRAVIS_OS_NAME
==
"linux"
]]
;
then
#!/bin/bash
wget
"https://github.com/Microsoft/LightGBM/releases/download/v2.0.12/AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2"
;
tar
-xjf
AMD-APP-SDK
*
.tar.bz2
;
AMDAPPSDK
=
${
HOME
}
/AMDAPPSDK
;
export
OPENCL_VENDOR_PATH
=
${
AMDAPPSDK
}
/etc/OpenCL/vendors
;
mkdir
-p
${
OPENCL_VENDOR_PATH
}
;
sh AMD-APP-SDK
*
.sh
--tar
-xf
-C
${
AMDAPPSDK
}
;
echo
libamdocl64.so
>
${
OPENCL_VENDOR_PATH
}
/amdocl64.icd
;
export
LD_LIBRARY_PATH
=
"
$AMDAPPSDK
/lib/x86_64:
$LD_LIBRARY_PATH
"
;
fi
if
[[
$TRAVIS_OS_NAME
==
"osx"
]]
;
then
if
[[
$TRAVIS_OS_NAME
==
"osx"
]]
;
then
export
CXX
=
g++-8
export
CXX
=
g++-8
export
CC
=
gcc-8
export
CC
=
gcc-8
fi
fi
LGB_VER
=
$(
head
-n
1 VERSION.txt
)
conda create
-q
-n
test-env
python
=
$PYTHON_VERSION
conda create
-q
-n
test-env
python
=
$PYTHON_VERSION
source
activate test-env
source
activate test-env
cd
$TRAVIS_BUILD_DIR
cd
$TRAVIS_BUILD_DIR
if
[[
$
{
TASK
}
==
"check-docs"
]]
;
then
if
[[
$TASK
==
"check-docs"
]]
;
then
if
[[
$TRAVIS_OS_NAME
!=
"osx"
]]
;
then
if
[[
$TRAVIS_OS_NAME
!=
"osx"
]]
;
then
sudo
apt-get
install
linkchecker
sudo
apt-get
install
linkchecker
fi
fi
...
@@ -44,13 +33,13 @@ if [[ ${TASK} == "check-docs" ]]; then
...
@@ -44,13 +33,13 @@ if [[ ${TASK} == "check-docs" ]]; then
exit
0
exit
0
fi
fi
if
[[
$
{
TASK
}
==
"pylint"
]]
;
then
if
[[
$TASK
==
"pylint"
]]
;
then
conda
install
pycodestyle
conda
install
pycodestyle
pycodestyle
--ignore
=
E501,W503
--exclude
=
./compute,./docs,./.nuget
.
||
exit
-1
pycodestyle
--ignore
=
E501,W503
--exclude
=
./compute,./docs,./.nuget
.
||
exit
-1
exit
0
exit
0
fi
fi
if
[[
$
{
TASK
}
==
"if-else"
]]
;
then
if
[[
$TASK
==
"if-else"
]]
;
then
conda
install
numpy
conda
install
numpy
mkdir
build
&&
cd
build
&&
cmake ..
&&
make lightgbm
||
exit
-1
mkdir
build
&&
cd
build
&&
cmake ..
&&
make lightgbm
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/tests/cpp_test
&&
../../lightgbm
config
=
train.conf
convert_model_language
=
cpp
convert_model
=
../../src/boosting/gbdt_prediction.cpp
&&
../../lightgbm
config
=
predict.conf
output_result
=
origin.pred
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/tests/cpp_test
&&
../../lightgbm
config
=
train.conf
convert_model_language
=
cpp
convert_model
=
../../src/boosting/gbdt_prediction.cpp
&&
../../lightgbm
config
=
predict.conf
output_result
=
origin.pred
||
exit
-1
...
@@ -61,44 +50,43 @@ fi
...
@@ -61,44 +50,43 @@ fi
conda
install
numpy nose scipy scikit-learn pandas matplotlib pytest
conda
install
numpy nose scipy scikit-learn pandas matplotlib pytest
if
[[
$
{
TASK
}
==
"sdist"
]]
;
then
if
[[
$TASK
==
"sdist"
]]
;
then
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py sdist
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py sdist
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package/dist
&&
pip
install
lightgbm-
$LGB_VER
.tar.gz
-v
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package/dist
&&
pip
install
lightgbm-
$LGB_VER
.tar.gz
-v
||
exit
-1
cd
$TRAVIS_BUILD_DIR
&&
pytest
tests/python_package_test
||
exit
-1
pytest
$TRAVIS_BUILD_DIR
/
tests/python_package_test
||
exit
-1
exit
0
exit
0
elif
[[
$
{
TASK
}
==
"bdist"
]]
;
then
elif
[[
$TASK
==
"bdist"
]]
;
then
if
[[
$TRAVIS_OS_NAME
==
"osx"
]]
;
then
if
[[
$TRAVIS_OS_NAME
==
"osx"
]]
;
then
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py bdist_wheel
--plat-name
=
macosx
--universal
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py bdist_wheel
--plat-name
=
macosx
--universal
||
exit
-1
mv
dist/lightgbm-
$
{
LGB_VER
}
-py2
.py3-none-macosx.whl dist/lightgbm-
$
{
LGB_VER
}
-py2
.py3-none-macosx_10_9_x86_64.macosx_10_10_x86_64.macosx_10_11_x86_64.macosx_10_12_x86_64.macosx_10_13_x86_64.whl
mv
dist/lightgbm-
$LGB_VER
-py2
.py3-none-macosx.whl dist/lightgbm-
$LGB_VER
-py2
.py3-none-macosx_10_9_x86_64.macosx_10_10_x86_64.macosx_10_11_x86_64.macosx_10_12_x86_64.macosx_10_13_x86_64.whl
else
else
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py bdist_wheel
--plat-name
=
manylinux1_x86_64
--universal
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py bdist_wheel
--plat-name
=
manylinux1_x86_64
--universal
||
exit
-1
fi
fi
cd
$TRAVIS_BUILD_DIR
/python-package
&&
pip
install
dist/
*
.whl
||
exit
-1
pip
install
$TRAVIS_BUILD_DIR
/python-package
/
dist/
*
.whl
||
exit
-1
cd
$TRAVIS_BUILD_DIR
&&
pytest
tests/python_package_test
||
exit
-1
pytest
$TRAVIS_BUILD_DIR
/
tests/python_package_test
||
exit
-1
exit
0
exit
0
fi
fi
if
[[
$
{
TASK
}
==
"gpu"
]]
;
then
if
[[
$TASK
==
"gpu"
]]
;
then
conda
install
--yes
-c
conda-forge
boost
=
1.63.0
conda
install
--yes
-c
conda-forge
boost
=
1.63.0
if
[[
${
METHOD
}
==
"pip"
]]
;
then
sed
-i
's/std::string device_type = "cpu";/std::string device_type = "gpu";/'
$TRAVIS_BUILD_DIR
/include/LightGBM/config.h
sed
-i
's/std::string device_type
= "
cpu";/std::string device_type = "gpu";/'
../include/LightGBM/config.h
if
[[
$METHOD
=
=
"
pip"
]]
;
then
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py sdist
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py sdist
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package/dist
&&
pip
install
lightgbm-
$LGB_VER
.tar.gz
-v
--install-option
=
--gpu
--install-option
=
"--boost-root=
$HOME
/miniconda/envs/test-env/"
--install-option
=
"--opencl-include-dir=
$AMDAPPSDK
/include/"
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package/dist
&&
pip
install
lightgbm-
$LGB_VER
.tar.gz
-v
--install-option
=
--gpu
--install-option
=
"--boost-root=
$HOME
/miniconda/envs/test-env/"
--install-option
=
"--opencl-include-dir=
$AMDAPPSDK
/include/"
||
exit
-1
cd
$TRAVIS_BUILD_DIR
&&
pytest
tests/python_package_test
||
exit
-1
pytest
$TRAVIS_BUILD_DIR
/
tests/python_package_test
||
exit
-1
exit
0
exit
0
fi
fi
fi
fi
mkdir
build
&&
cd
build
mkdir
build
&&
cd
build
if
[[
$
{
TASK
}
==
"mpi"
]]
;
then
if
[[
$TASK
==
"mpi"
]]
;
then
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py sdist
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py sdist
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package/dist
&&
pip
install
lightgbm-
$LGB_VER
.tar.gz
-v
--install-option
=
--mpi
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package/dist
&&
pip
install
lightgbm-
$LGB_VER
.tar.gz
-v
--install-option
=
--mpi
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/build
cd
$TRAVIS_BUILD_DIR
/build
cmake
-DUSE_MPI
=
ON ..
cmake
-DUSE_MPI
=
ON ..
elif
[[
${
TASK
}
==
"gpu"
]]
;
then
elif
[[
$TASK
==
"gpu"
]]
;
then
cmake
-DUSE_GPU
=
ON
-DBOOST_ROOT
=
"
$HOME
/miniconda/envs/test-env/"
-DOpenCL_INCLUDE_DIR
=
$AMDAPPSDK
/include/ ..
cmake
-DUSE_GPU
=
ON
-DBOOST_ROOT
=
$HOME
/miniconda/envs/test-env/
-DOpenCL_INCLUDE_DIR
=
$AMDAPPSDK
/include/ ..
sed
-i
's/std::string device_type = "cpu";/std::string device_type = "gpu";/'
../include/LightGBM/config.h
else
else
cmake ..
cmake ..
fi
fi
...
@@ -108,7 +96,7 @@ make _lightgbm || exit -1
...
@@ -108,7 +96,7 @@ make _lightgbm || exit -1
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py
install
--precompile
||
exit
-1
cd
$TRAVIS_BUILD_DIR
/python-package
&&
python setup.py
install
--precompile
||
exit
-1
cd
$TRAVIS_BUILD_DIR
&&
pytest
.
||
exit
-1
cd
$TRAVIS_BUILD_DIR
&&
pytest
.
||
exit
-1
if
[[
$
{
TASK
}
==
"regular"
]]
;
then
if
[[
$TASK
==
"regular"
]]
;
then
conda
install
python-graphviz
conda
install
python-graphviz
cd
$TRAVIS_BUILD_DIR
/examples/python-guide
cd
$TRAVIS_BUILD_DIR
/examples/python-guide
sed
-i
'.bak'
'/import lightgbm as lgb/a\
sed
-i
'.bak'
'/import lightgbm as lgb/a\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment