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
f0824da3
Unverified
Commit
f0824da3
authored
Jun 29, 2018
by
Guolin Ke
Committed by
GitHub
Jun 29, 2018
Browse files
add simple definition to vsts-ci
parent
6488f319
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
279 additions
and
0 deletions
+279
-0
.vsts-ci.yml
.vsts-ci.yml
+133
-0
.vsts-ci/setup.sh
.vsts-ci/setup.sh
+34
-0
.vsts-ci/test.sh
.vsts-ci/test.sh
+112
-0
No files found.
.vsts-ci.yml
View file @
f0824da3
phases
:
-
phase
:
Linux
variables
:
PYTHON_VERSION
:
3.6
AGENT_OS
:
linux
CONDA_ENV
:
test-env
queue
:
name
:
'
Hosted
Linux
Preview'
parallel
:
9
matrix
:
regular
:
TASK
:
regular
mpi
:
TASK
:
mpi
pylint
:
TASK
:
pylint
doc
:
TASK
:
check-docs
inference
:
TASK
:
if-else
sdist
:
TASK
:
sdist
PYTHON_VERSION
:
2.7
bdist
:
TASK
:
bdist
PYTHON_VERSION
:
3.5
gpu_1
:
TASK
:
gpu
METHOD
:
source
gpu_2
:
TASK
:
gpu
METHOD
:
pip
steps
:
-
script
:
sudo apt-get update
-
script
:
bash .vsts-ci/setup.sh
# - task: CondaEnvironment@0
# inputs:
# environmentName: $(CONDA_ENV)
# packageSpecs: 'python=$(PYTHON_VERSION)' # Optional
# createOptions: '-q'
-
task
:
UsePythonVersion@0
inputs
:
versionSpec
:
'
$(PYTHON_VERSION)'
architecture
:
'
x64'
-
script
:
python -m pip install --upgrade pip setuptools wheel
-
script
:
bash .vsts-ci/test.sh
-
phase
:
MacOS
variables
:
PYTHON_VERSION
:
3.6
AGENT_OS
:
darwin
CONDA_ENV
:
test-env
queue
:
name
:
'
Hosted
macOS
Preview'
parallel
:
4
matrix
:
regular
:
TASK
:
regular
mpi
:
TASK
:
mpi
sdist
:
TASK
:
sdist
PYTHON_VERSION
:
2.7
bdist
:
TASK
:
bdist
PYTHON_VERSION
:
3.5
steps
:
-
script
:
bash .vsts-ci/setup.sh
# - task: CondaEnvironment@0
# inputs:
# environmentName: $(CONDA_ENV)
# packageSpecs: 'python=$(PYTHON_VERSION)' # Optional
# createOptions: '-q'
-
task
:
UsePythonVersion@0
inputs
:
versionSpec
:
'
$(PYTHON_VERSION)'
architecture
:
'
x64'
-
script
:
python -m pip install --upgrade pip setuptools wheel
-
script
:
bash .vsts-ci/test.sh
-
phase
:
Windows_1
variables
:
PYTHON_VERSION
:
3.6
AGENT_OS
:
windows
queue
:
name
:
'
Hosted'
parallel
:
4
matrix
:
regular
:
TASK
:
regular
mpi
:
TASK
:
mpi
sdist
:
TASK
:
sdist
PYTHON_VERSION
:
2.7
bdist
:
TASK
:
bdist
PYTHON_VERSION
:
3.5
steps
:
-
task
:
UsePythonVersion@0
inputs
:
versionSpec
:
'
$(PYTHON_VERSION)'
architecture
:
'
x64'
-
phase
:
Windows_2
variables
:
PYTHON_VERSION
:
3.6
AGENT_OS
:
windows
queue
:
name
:
'
Hosted
VS2017'
parallel
:
4
matrix
:
regular
:
TASK
:
regular
mpi
:
TASK
:
mpi
sdist
:
TASK
:
sdist
PYTHON_VERSION
:
2.7
bdist
:
TASK
:
bdist
PYTHON_VERSION
:
3.5
steps
:
-
task
:
UsePythonVersion@0
inputs
:
versionSpec
:
'
$(PYTHON_VERSION)'
architecture
:
'
x64'
.vsts-ci/setup.sh
0 → 100644
View file @
f0824da3
#!/bin/bash
test
-n
$CC
&&
unset
CC
test
-n
$CXX
&&
unset
CXX
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
if
[[
${
AGENT_OS
}
==
"darwin"
]]
;
then
rm
'/usr/local/include/c++'
# brew cask uninstall oclint # reserve variant to deal with conflict link
if
[[
$TASK
==
"mpi"
]]
;
then
brew
install
open-mpi
else
brew
install
gcc
fi
# brew link --overwrite gcc # previous variant to deal with conflict link
else
if
[[
$TASK
==
"mpi"
]]
;
then
sudo
apt-get
install
-y
libopenmpi-dev openmpi-bin
fi
if
[[
$TASK
==
"gpu"
]]
;
then
sudo
apt-get
install
-y
ocl-icd-opencl-dev
fi
fi
if
[[
$TASK
==
"gpu"
]]
&&
[[
${
AGENT_OS
}
==
"linux"
]]
;
then
wget https://github.com/Microsoft/LightGBM/releases/download/v2.0.12/AMD-APP-SDKInstaller-v3.0.130.136-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
mv
$AMDAPPSDK
/lib/x86_64/sdk/
*
$AMDAPPSDK
/lib/x86_64/
echo
libamdocl64.so
>
$OPENCL_VENDOR_PATH
/amdocl64.icd
fi
.vsts-ci/test.sh
0 → 100644
View file @
f0824da3
#!/bin/bash
test
-n
$CC
&&
unset
CC
test
-n
$CXX
&&
unset
CXX
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
if
[[
${
AGENT_OS
}
==
"darwin"
]]
;
then
export
CXX
=
g++-8
export
CC
=
gcc-8
fi
cd
${
BUILD_REPOSITORY_LOCALPATH
}
if
[[
$TASK
==
"check-docs"
]]
;
then
if
[[
${
AGENT_OS
}
==
"linux"
]]
;
then
sudo
apt-get
install
linkchecker
fi
if
[[
${
PYTHON_VERSION
}
==
"2.7"
]]
;
then
pip
install
mock
fi
pip
install
sphinx
"sphinx_rtd_theme>=0.3"
# html5validator
pip
install
rstcheck
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/python-package
rstcheck
--report
warning
`
find
.
-type
f
-name
"*.rst"
`
||
exit
-1
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/docs
rstcheck
--report
warning
--ignore-directives
=
autoclass,autofunction
`
find
.
-type
f
-name
"*.rst"
`
||
exit
-1
make html
||
exit
-1
find ./_build/html/
-type
f
-name
'*.html'
-exec
\
sed
-i
-e
's;\(\.\/[^.]*\.\)rst\([^[:space:]]*\);\1html\2;g'
{}
\;
# emulate js function
# html5validator --root ./_build/html/ || exit -1
if
[[
${
AGENT_OS
}
==
"linux"
]]
;
then
linkchecker
--config
=
.linkcheckerrc ./_build/html/
*
.html
||
exit
-1
fi
exit
0
fi
if
[[
$TASK
==
"pylint"
]]
;
then
pip
install
pycodestyle
pycodestyle
--ignore
=
E501,W503
--exclude
=
./compute,./docs,./.nuget
.
||
exit
-1
exit
0
fi
if
[[
$TASK
==
"if-else"
]]
;
then
pip
install
numpy
mkdir
build
&&
cd
build
&&
cmake ..
&&
make lightgbm
||
exit
-1
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/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
${
BUILD_REPOSITORY_LOCALPATH
}
/build
&&
make lightgbm
||
exit
-1
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/tests/cpp_test
&&
../../lightgbm
config
=
predict.conf
output_result
=
ifelse.pred
&&
python test.py
||
exit
-1
exit
0
fi
pip
install
numpy nose scipy scikit-learn pandas matplotlib graphviz pytest
if
[[
$TASK
==
"sdist"
]]
;
then
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/python-package
&&
python setup.py sdist
||
exit
-1
pip
install
${
BUILD_REPOSITORY_LOCALPATH
}
/python-package/dist/lightgbm-
$LGB_VER
.tar.gz
-v
||
exit
-1
pytest
${
BUILD_REPOSITORY_LOCALPATH
}
/tests/python_package_test
||
exit
-1
exit
0
elif
[[
$TASK
==
"bdist"
]]
;
then
if
[[
${
AGENT_OS
}
==
"darwin"
]]
;
then
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/python-package
&&
python setup.py bdist_wheel
--plat-name
=
macdarwin
--universal
||
exit
-1
mv
dist/lightgbm-
$LGB_VER
-py2
.py3-none-macdarwin.whl dist/lightgbm-
$LGB_VER
-py2
.py3-none-macdarwin_10_9_x86_64.macdarwin_10_10_x86_64.macdarwin_10_11_x86_64.macdarwin_10_12_x86_64.macdarwin_10_13_x86_64.whl
else
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/python-package
&&
python setup.py bdist_wheel
--plat-name
=
manylinux1_x86_64
--universal
||
exit
-1
fi
pip
install
${
BUILD_REPOSITORY_LOCALPATH
}
/python-package/dist/
*
.whl
||
exit
-1
pytest
${
BUILD_REPOSITORY_LOCALPATH
}
/tests/python_package_test
||
exit
-1
exit
0
fi
if
[[
$TASK
==
"gpu"
]]
;
then
sudo
apt-get
install
libboost-all-dev
sed
-i
's/std::string device_type = "cpu";/std::string device_type = "gpu";/'
${
BUILD_REPOSITORY_LOCALPATH
}
/include/LightGBM/config.h
grep
-q
'std::string device_type = "gpu"'
${
BUILD_REPOSITORY_LOCALPATH
}
/include/LightGBM/config.h
||
exit
-1
# make sure that changes were really done
if
[[
$METHOD
==
"pip"
]]
;
then
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/python-package
&&
python setup.py sdist
||
exit
-1
pip
install
${
BUILD_REPOSITORY_LOCALPATH
}
/python-package/dist/lightgbm-
$LGB_VER
.tar.gz
-v
--install-option
=
--gpu
--install-option
=
"--opencl-include-dir=
$AMDAPPSDK
/include/"
||
exit
-1
pytest
${
BUILD_REPOSITORY_LOCALPATH
}
/tests/python_package_test
||
exit
-1
exit
0
fi
fi
mkdir
build
&&
cd
build
if
[[
$TASK
==
"mpi"
]]
;
then
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/python-package
&&
python setup.py sdist
||
exit
-1
pip
install
${
BUILD_REPOSITORY_LOCALPATH
}
/python-package/dist/lightgbm-
$LGB_VER
.tar.gz
-v
--install-option
=
--mpi
||
exit
-1
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/build
cmake
-DUSE_MPI
=
ON ..
elif
[[
$TASK
==
"gpu"
]]
;
then
cmake
-DUSE_GPU
=
ON
-DOpenCL_INCLUDE_DIR
=
$AMDAPPSDK
/include/ ..
else
cmake ..
fi
make _lightgbm
||
exit
-1
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/python-package
&&
python setup.py
install
--precompile
||
exit
-1
pytest
${
BUILD_REPOSITORY_LOCALPATH
}
||
exit
-1
if
[[
$TASK
==
"regular"
]]
;
then
cd
${
BUILD_REPOSITORY_LOCALPATH
}
/examples/python-guide
sed
-i
'.bak'
'/import lightgbm as lgb/a\
import matplotlib\
matplotlib.use\(\"Agg\"\)\
'
plot_example.py
# prevent interactive window mode
for
f
in
*
.py
;
do
python
$f
||
exit
-1
;
done
# run all examples
fi
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