Commit b447a7bc authored by Nikita Titov's avatar Nikita Titov Committed by Guolin Ke
Browse files

fixed conda (#2016)

parent 5256cda6
...@@ -29,8 +29,8 @@ install: ...@@ -29,8 +29,8 @@ install:
- set PATH=%MINICONDA%;%MINICONDA%\Scripts;%PATH% - set PATH=%MINICONDA%;%MINICONDA%\Scripts;%PATH%
- ps: $env:LGB_VER = (Get-Content VERSION.txt).trim() - ps: $env:LGB_VER = (Get-Content VERSION.txt).trim()
- conda config --set always_yes yes --set changeps1 no - conda config --set always_yes yes --set changeps1 no
- conda update -q conda - conda update -q -y conda
- conda create -q -n test-env python=%PYTHON_VERSION% matplotlib nose numpy pandas psutil pytest python-graphviz scikit-learn scipy - conda create -q -y -n test-env python=%PYTHON_VERSION% matplotlib nose numpy pandas psutil pytest python-graphviz scikit-learn scipy
- activate test-env - activate test-env
build_script: build_script:
...@@ -53,5 +53,5 @@ test_script: ...@@ -53,5 +53,5 @@ test_script:
if (!$?) { $host.SetShouldExit(-1) } if (!$?) { $host.SetShouldExit(-1) }
} # run all examples } # run all examples
- cd %APPVEYOR_BUILD_FOLDER%\examples\python-guide\notebooks - cd %APPVEYOR_BUILD_FOLDER%\examples\python-guide\notebooks
- conda install -y -n test-env ipywidgets notebook - conda install -q -y -n test-env ipywidgets notebook
- jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb # run all notebooks - jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb # run all notebooks
...@@ -20,9 +20,7 @@ if [[ $OS_NAME == "macos" ]]; then ...@@ -20,9 +20,7 @@ if [[ $OS_NAME == "macos" ]]; then
if [[ $TASK == "mpi" ]]; then if [[ $TASK == "mpi" ]]; then
brew install open-mpi brew install open-mpi
fi fi
if [[ $TRAVIS == "true" ]]; then wget -q -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
fi
else # Linux else # Linux
if [[ $AZURE == "true" ]] && [[ $COMPILER == "clang" ]]; then if [[ $AZURE == "true" ]] && [[ $COMPILER == "clang" ]]; then
sudo apt-get update sudo apt-get update
...@@ -49,13 +47,13 @@ else # Linux ...@@ -49,13 +47,13 @@ else # Linux
mv $AMDAPPSDK_PATH/lib/x86_64/sdk/* $AMDAPPSDK_PATH/lib/x86_64/ mv $AMDAPPSDK_PATH/lib/x86_64/sdk/* $AMDAPPSDK_PATH/lib/x86_64/
echo libamdocl64.so > $OPENCL_VENDOR_PATH/amdocl64.icd echo libamdocl64.so > $OPENCL_VENDOR_PATH/amdocl64.icd
fi fi
if [[ $TRAVIS == "true" ]]; then if [[ $TRAVIS == "true" ]] || [[ $TASK == "gpu" ]]; then
wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh wget -q -O conda.sh https://repo.continuum.io/miniconda/Miniconda${PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh
fi fi
fi fi
if [[ $TRAVIS == "true" ]]; then if [[ $TRAVIS == "true" ]] || [[ $OS_NAME == "macos" ]] || [[ $TASK == "gpu" ]]; then
sh conda.sh -b -p $HOME_DIRECTORY/miniconda sh conda.sh -b -p $CONDA
fi fi
conda config --set always_yes yes --set changeps1 no conda config --set always_yes yes --set changeps1 no
conda update -q conda conda update -q conda
...@@ -15,9 +15,9 @@ cd $BUILD_DIRECTORY ...@@ -15,9 +15,9 @@ cd $BUILD_DIRECTORY
if [[ $TRAVIS == "true" ]] && [[ $TASK == "check-docs" ]]; then if [[ $TRAVIS == "true" ]] && [[ $TASK == "check-docs" ]]; then
if [[ $PYTHON_VERSION == "2.7" ]]; then if [[ $PYTHON_VERSION == "2.7" ]]; then
conda -y -n $CONDA_ENV mock conda -q -y -n $CONDA_ENV mock
fi fi
conda install -y -n $CONDA_ENV sphinx "sphinx_rtd_theme>=0.3" conda install -q -y -n $CONDA_ENV sphinx "sphinx_rtd_theme>=0.3"
pip install --user rstcheck pip install --user rstcheck
# check reStructuredText formatting # check reStructuredText formatting
cd $BUILD_DIRECTORY/python-package cd $BUILD_DIRECTORY/python-package
...@@ -43,14 +43,14 @@ if [[ $TRAVIS == "true" ]] && [[ $TASK == "check-docs" ]]; then ...@@ -43,14 +43,14 @@ if [[ $TRAVIS == "true" ]] && [[ $TASK == "check-docs" ]]; then
fi fi
if [[ $TASK == "pylint" ]]; then if [[ $TASK == "pylint" ]]; then
conda install -y -n $CONDA_ENV pycodestyle pydocstyle conda install -q -y -n $CONDA_ENV pycodestyle pydocstyle
pycodestyle --ignore=E501,W503 --exclude=./compute,./.nuget . || exit -1 pycodestyle --ignore=E501,W503 --exclude=./compute,./.nuget . || exit -1
pydocstyle --convention=numpy --add-ignore=D105 --match-dir="^(?!^compute|test|example).*" --match="(?!^test_|setup).*\.py" . || exit -1 pydocstyle --convention=numpy --add-ignore=D105 --match-dir="^(?!^compute|test|example).*" --match="(?!^test_|setup).*\.py" . || exit -1
exit 0 exit 0
fi fi
if [[ $TASK == "if-else" ]]; then if [[ $TASK == "if-else" ]]; then
conda install -y -n $CONDA_ENV numpy conda install -q -y -n $CONDA_ENV numpy
mkdir $BUILD_DIRECTORY/build && cd $BUILD_DIRECTORY/build && cmake .. && make lightgbm -j4 || exit -1 mkdir $BUILD_DIRECTORY/build && cd $BUILD_DIRECTORY/build && cmake .. && make lightgbm -j4 || exit -1
cd $BUILD_DIRECTORY/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_DIRECTORY/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_DIRECTORY/build && make lightgbm -j4 || exit -1 cd $BUILD_DIRECTORY/build && make lightgbm -j4 || exit -1
...@@ -139,6 +139,6 @@ matplotlib.use\(\"Agg\"\)\ ...@@ -139,6 +139,6 @@ matplotlib.use\(\"Agg\"\)\
sed -i'.bak' 's/graph.render(view=True)/graph.render(view=False)/' plot_example.py sed -i'.bak' 's/graph.render(view=True)/graph.render(view=False)/' plot_example.py
for f in *.py; do python $f || exit -1; done # run all examples for f in *.py; do python $f || exit -1; done # run all examples
cd $BUILD_DIRECTORY/examples/python-guide/notebooks cd $BUILD_DIRECTORY/examples/python-guide/notebooks
conda install -y -n $CONDA_ENV ipywidgets notebook conda install -q -y -n $CONDA_ENV ipywidgets notebook
jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb || exit -1 # run all notebooks jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb || exit -1 # run all notebooks
fi fi
...@@ -38,6 +38,6 @@ if ($env:TASK -eq "regular") { ...@@ -38,6 +38,6 @@ if ($env:TASK -eq "regular") {
python $file ; Check-Output $? python $file ; Check-Output $?
} # run all examples } # run all examples
cd $env:BUILD_SOURCESDIRECTORY/examples/python-guide/notebooks cd $env:BUILD_SOURCESDIRECTORY/examples/python-guide/notebooks
conda install -y -n $env:CONDA_ENV ipywidgets notebook conda install -q -y -n $env:CONDA_ENV ipywidgets notebook
jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb ; Check-Output $? # run all notebooks jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb ; Check-Output $? # run all notebooks
} }
...@@ -46,7 +46,8 @@ before_install: ...@@ -46,7 +46,8 @@ before_install:
export OS_NAME="linux"; export OS_NAME="linux";
export COMPILER="clang"; export COMPILER="clang";
fi fi
- export PATH="$HOME/miniconda/bin:$PATH" - export CONDA="$HOME/miniconda"
- export PATH="$CONDA/bin:$PATH"
- export CONDA_ENV="test-env" - export CONDA_ENV="test-env"
- export LGB_VER=$(head -n 1 VERSION.txt) - export LGB_VER=$(head -n 1 VERSION.txt)
- export AMDAPPSDK_PATH=$HOME/AMDAPPSDK - export AMDAPPSDK_PATH=$HOME/AMDAPPSDK
......
...@@ -33,12 +33,12 @@ jobs: ...@@ -33,12 +33,12 @@ jobs:
PYTHON_VERSION: 2.7 PYTHON_VERSION: 2.7
steps: steps:
- script: | - script: |
echo "##vso[task.setvariable variable=PATH]$CONDA/bin:$PATH"
echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY" echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
echo "##vso[task.setvariable variable=OS_NAME]linux" echo "##vso[task.setvariable variable=OS_NAME]linux"
echo "##vso[task.setvariable variable=AZURE]true" echo "##vso[task.setvariable variable=AZURE]true"
echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
echo "##vso[task.prependpath]$CONDA/bin"
displayName: 'Set variables' displayName: 'Set variables'
- bash: $(Build.SourcesDirectory)/.ci/setup.sh - bash: $(Build.SourcesDirectory)/.ci/setup.sh
displayName: Setup displayName: Setup
...@@ -65,9 +65,6 @@ jobs: ...@@ -65,9 +65,6 @@ jobs:
METHOD: source METHOD: source
PYTHON_VERSION: 3.6 PYTHON_VERSION: 3.6
steps: steps:
- task: CondaEnvironment@1
inputs:
updateConda: false
- script: | - script: |
echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY" echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
...@@ -79,6 +76,9 @@ jobs: ...@@ -79,6 +76,9 @@ jobs:
LD_LIBRARY_PATH=$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH LD_LIBRARY_PATH=$AMDAPPSDK_PATH/lib/x86_64:$LD_LIBRARY_PATH
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$LD_LIBRARY_PATH" echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$LD_LIBRARY_PATH"
echo "##vso[task.setvariable variable=OPENCL_VENDOR_PATH]$AMDAPPSDK_PATH/etc/OpenCL/vendors" echo "##vso[task.setvariable variable=OPENCL_VENDOR_PATH]$AMDAPPSDK_PATH/etc/OpenCL/vendors"
CONDA=$AGENT_HOMEDIRECTORY/miniconda
echo "##vso[task.setvariable variable=CONDA]$CONDA"
echo "##vso[task.prependpath]$CONDA/bin"
displayName: 'Set variables' displayName: 'Set variables'
- bash: $(Build.SourcesDirectory)/.ci/setup.sh - bash: $(Build.SourcesDirectory)/.ci/setup.sh
displayName: Setup displayName: Setup
...@@ -103,15 +103,15 @@ jobs: ...@@ -103,15 +103,15 @@ jobs:
bdist: bdist:
TASK: bdist TASK: bdist
steps: steps:
- task: CondaEnvironment@1
inputs:
updateConda: false
- script: | - script: |
echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY" echo "##vso[task.setvariable variable=HOME_DIRECTORY]$AGENT_HOMEDIRECTORY"
echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
echo "##vso[task.setvariable variable=OS_NAME]macos" echo "##vso[task.setvariable variable=OS_NAME]macos"
echo "##vso[task.setvariable variable=AZURE]true" echo "##vso[task.setvariable variable=AZURE]true"
echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)" echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
CONDA=$AGENT_HOMEDIRECTORY/miniconda
echo "##vso[task.setvariable variable=CONDA]$CONDA"
echo "##vso[task.prependpath]$CONDA/bin"
displayName: 'Set variables' displayName: 'Set variables'
- bash: $(Build.SourcesDirectory)/.ci/setup.sh - bash: $(Build.SourcesDirectory)/.ci/setup.sh
displayName: Setup displayName: Setup
...@@ -141,14 +141,12 @@ jobs: ...@@ -141,14 +141,12 @@ jobs:
TASK: bdist TASK: bdist
PYTHON_VERSION: 3.6 PYTHON_VERSION: 3.6
steps: steps:
- task: CondaEnvironment@1 - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
inputs: displayName: Enable conda
createCustomEnvironment: true - script: |
updateConda: true conda update -q -y conda
environmentName: $(CONDA_ENV) conda create -q -y -n %CONDA_ENV% python=%PYTHON_VERSION% matplotlib nose numpy pandas psutil pytest python-graphviz scikit-learn scipy
packageSpecs: 'python=$(PYTHON_VERSION) matplotlib nose numpy pandas psutil pytest python-graphviz scikit-learn scipy' cmd /c "activate %CONDA_ENV% & powershell -ExecutionPolicy Bypass -File %BUILD_SOURCESDIRECTORY%/.ci/test_windows.ps1"
createOptions: '-q'
- powershell: $(Build.SourcesDirectory)/.ci/test_windows.ps1
displayName: Test displayName: Test
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/'))) condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment