Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] use conda-forge in Linux and macOS CI jobs #4953

Merged
merged 86 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
771889f
[ci] use conda-forge in CI jobs (fixes #4948)
jameslamb Jan 16, 2022
33642db
comment out more jobs
jameslamb Jan 16, 2022
6fb5c51
try reverting graphviz patch, running more cuda jobs
jameslamb Jan 16, 2022
ec3378a
get graphviz from PyPI and try removing some patches for r-lintr
jameslamb Jan 16, 2022
d6705ce
start running appveyor again
jameslamb Jan 16, 2022
83fbe0f
use conda-forge if using conda
jameslamb Jan 16, 2022
d365aeb
fix commands
jameslamb Jan 16, 2022
59070c3
conda install graphviz
jameslamb Jan 16, 2022
87804fe
try newer openmp
jameslamb Jan 17, 2022
2455e0d
pin below openmp 11.x
jameslamb Jan 17, 2022
3b6b0c0
focus on gpu task
jameslamb Jan 17, 2022
ab20d1f
trying to narrow down error
jameslamb Jan 17, 2022
592252f
maybe gcc11 is the issue
jameslamb Jan 17, 2022
7e2763e
start adding other tests back
jameslamb Jan 17, 2022
c066906
pin openmp too
jameslamb Jan 17, 2022
1cac6f8
maybe need to pin to gcc less than 10.x
jameslamb Jan 17, 2022
7777b10
pin libgfortran and libstdcxx as well
jameslamb Jan 17, 2022
8897fa8
pin to gcc 9.3.0
jameslamb Jan 17, 2022
be2ad19
move constraints up to initial environment
jameslamb Jan 17, 2022
b4a2eef
add all CI jobs back
jameslamb Jan 17, 2022
92d4956
try installing python-graphviz separately
jameslamb Jan 17, 2022
a1a9cc3
try new lightgbm/vsts-agent image
jameslamb Jan 17, 2022
9c72d0e
fix typo
jameslamb Jan 17, 2022
94d226e
test if pinning gcc for linux gpu_source build is still necessary
jameslamb Jan 17, 2022
5ea98b9
ok yes, pinning gcc is necessary
jameslamb Jan 17, 2022
53d55fa
test if Linux gpu_source works with Python 3.9.6
jameslamb Jan 19, 2022
30b5e39
no special exception for Linux gpu_source job
jameslamb Jan 19, 2022
e271e62
pin to Python 3.9.6 in Linux gpu_source
jameslamb Jan 19, 2022
c9ba0b2
try explicitly asking for libstdcxx-ng for every linux build
jameslamb Jan 19, 2022
4bf9af4
swap compilers
jameslamb Jan 19, 2022
5808c24
switch compilers back
jameslamb Jan 19, 2022
d1db657
revert accidental whitespace change
jameslamb Jan 19, 2022
c4cf301
Merge branch 'master' into ci/conda-forge
jameslamb Jan 20, 2022
7042755
Merge branch 'ci/conda-forge' of github.com:microsoft/LightGBM into c…
jameslamb Jan 20, 2022
ece191f
comment out CI
jameslamb Jan 20, 2022
f6f63cb
try Linux gpu_source with different Python versions
jameslamb Jan 20, 2022
41f4afa
Revert "try Linux gpu_source with different Python versions"
jameslamb Jan 20, 2022
11d104f
Revert "comment out CI"
jameslamb Jan 20, 2022
bc750fb
remove libxml2 install, change CONDA path
jameslamb Jan 22, 2022
3457be7
Merge branch 'master' into ci/conda-forge
jameslamb Jan 22, 2022
44de0ba
avoid installing conda in rchk job
jameslamb Jan 22, 2022
5fadcff
empty commit 1
StrikerRUS Jan 23, 2022
1256e2c
empty commit 2
jameslamb Jan 23, 2022
6bfd496
empty commit 3
StrikerRUS Jan 23, 2022
5ab1789
empty commit 4
StrikerRUS Jan 23, 2022
3dc3907
Merge branch 'master' into ci/conda-forge
jameslamb Jan 26, 2022
537fbd4
add more verbose logging around installation of python-graphviz
jameslamb Jan 26, 2022
4776f16
empty commit 1
jameslamb Jan 30, 2022
bf227b4
get mamba info
jameslamb Jan 30, 2022
a49cefb
get more conda info
jameslamb Jan 30, 2022
de2be6f
add another mamba info call
jameslamb Jan 30, 2022
a3c7a19
allow for other macOS environments in GHA configuration
jameslamb Jan 30, 2022
e5b5435
Revert "allow for other macOS environments in GHA configuration"
jameslamb Jan 30, 2022
bdba86c
get more logs from mamba
jameslamb Jan 30, 2022
0487a8c
get Build.ArtifactsStagingDirectory
jameslamb Jan 30, 2022
9078fb0
get more logs and try to force re-installing everything
jameslamb Jan 30, 2022
c82fe21
clean cache after every step
jameslamb Jan 30, 2022
10c68a8
remove --update-all and make logs less verbose
jameslamb Jan 30, 2022
a450ed1
remove more print statements and uncomment jobs
jameslamb Jan 31, 2022
2b1a940
Merge branch 'master' into ci/conda-forge
jameslamb Feb 1, 2022
33a199e
test if conda-clean issue fixes segfaults for gpu_source
jameslamb Feb 1, 2022
986dad6
pin python version for gpu_source
jameslamb Feb 1, 2022
591a68a
empty commit 1
jameslamb Feb 1, 2022
d9550c4
use miniforge instead
jameslamb Feb 4, 2022
bd472b4
empty commit 1
jameslamb Feb 4, 2022
932cc93
Apply suggestions from code review
StrikerRUS Feb 4, 2022
5e033ad
bring workarounds back
StrikerRUS Feb 4, 2022
b33195e
remove duplicated graphviz system-wide installation (reverts #4095, #…
StrikerRUS Feb 4, 2022
304230b
empty commit 1
StrikerRUS Feb 5, 2022
812a535
empty commit 2
StrikerRUS Feb 5, 2022
263fb05
empty commit 3
StrikerRUS Feb 5, 2022
4149f99
empty commit 4
StrikerRUS Feb 5, 2022
a5173d9
empty commit 5
StrikerRUS Feb 5, 2022
6e4a8d6
empty commit 6
StrikerRUS Feb 5, 2022
79797fc
empty commit 7
StrikerRUS Feb 5, 2022
6052a0f
empty commit 8
StrikerRUS Feb 5, 2022
cee93ac
empty commit 9
StrikerRUS Feb 5, 2022
ce5154e
empty commit 10
StrikerRUS Feb 5, 2022
10a6956
empty commit 10
StrikerRUS Feb 5, 2022
a67af60
empty commit 10
StrikerRUS Feb 5, 2022
66d05f4
empty commit 10
StrikerRUS Feb 6, 2022
543abe2
empty commit 11
StrikerRUS Feb 6, 2022
b36d2ae
one more try
StrikerRUS Feb 6, 2022
8f26585
try to downgrade Python version for Linux GPU job
StrikerRUS Feb 6, 2022
f04dc27
swap compilers
StrikerRUS Feb 6, 2022
1aa67bd
Revert "swap compilers"
StrikerRUS Feb 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 11 additions & 27 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ if [[ $OS_NAME == "macos" ]]; then
if [[ $TASK == "swig" ]]; then
brew install swig
fi
brew install graphviz
curl -sL -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
curl \
-sL \
-o miniforge.sh \
https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh
else # Linux
if [[ $IN_UBUNTU_LATEST_CONTAINER == "true" ]]; then
# fixes error "unable to initialize frontend: Dialog"
Expand All @@ -42,9 +44,6 @@ else # Linux
libicu66 \
libssl1.1 \
libunwind8 \
libxau6 \
libxext6 \
libxrender1 \
locales \
netcat \
unzip \
Expand Down Expand Up @@ -81,16 +80,11 @@ else # Linux
mv $AMDAPPSDK_PATH/lib/x86_64/sdk/* $AMDAPPSDK_PATH/lib/x86_64/
echo libamdocl64.so > $OPENCL_VENDOR_PATH/amdocl64.icd
fi
ARCH=$(uname -m)
if [[ $TASK == "cuda" ]]; then
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
apt-get update
apt-get install --no-install-recommends -y \
curl \
graphviz \
libxau6 \
libxext6 \
libxrender1 \
lsb-release \
software-properties-common
if [[ $COMPILER == "clang" ]]; then
Expand All @@ -103,29 +97,19 @@ else # Linux
apt-get update
apt-get install --no-install-recommends -y \
cmake
else
if [[ $ARCH != "x86_64" ]]; then
yum update -y
yum install -y \
graphviz
else
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
graphviz
fi
fi
if [[ $SETUP_CONDA != "false" ]]; then
if [[ $ARCH == "x86_64" ]]; then
curl -sL -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
else
curl -sL -o conda.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-${ARCH}.sh
fi
ARCH=$(uname -m)
curl \
-sL \
-o miniforge.sh \
https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-${ARCH}.sh
fi
fi

if [[ "${TASK}" != "r-package" ]]; then
if [[ "${TASK}" != "r-package" ]] && [[ "${TASK}" != "r-rchk" ]]; then
jameslamb marked this conversation as resolved.
Show resolved Hide resolved
if [[ $SETUP_CONDA != "false" ]]; then
sh conda.sh -b -p $CONDA
sh miniforge.sh -b -p $CONDA
fi
conda config --set always_yes yes --set changeps1 no
conda update -q -y conda
Expand Down
37 changes: 26 additions & 11 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,13 @@ fi

if [[ $TASK == "lint" ]]; then
conda install -q -y -n $CONDA_ENV \
cmakelint \
cpplint \
isort \
mypy \
pycodestyle \
pydocstyle \
r-stringi # stringi needs to be installed separate from r-lintr to avoid issues like 'unable to load shared object stringi.so'
# r-xfun below has to be upgraded because lintr requires > 0.19 for that package
conda install -q -y -n $CONDA_ENV \
-c conda-forge \
libxml2 \
"r-xfun>=0.19" \
"r-lintr>=2.0"
pip install --user cmakelint cpplint isort mypy
"r-lintr>=2.0"
echo "Linting Python code"
pycodestyle --ignore=E501,W503 --exclude=./.nuget,./external_libs . || exit -1
pydocstyle --convention=numpy --add-ignore=D105 --match-dir="^(?!^external_libs|test|example).*" --match="(?!^test_|setup).*\.py" . || exit -1
Expand Down Expand Up @@ -114,8 +111,22 @@ if [[ $TASK == "swig" ]]; then
exit 0
fi

conda install -q -y -n $CONDA_ENV cloudpickle "dask=2021.9.1" "distributed=2021.9.1" joblib matplotlib numpy pandas psutil pytest scikit-learn scipy
pip install graphviz # python-graphviz from Anaconda is not allowed to be installed with Python 3.9
conda install -q -y -n $CONDA_ENV \
cloudpickle \
dask \
distributed \
jmoralez marked this conversation as resolved.
Show resolved Hide resolved
joblib \
matplotlib \
numpy \
pandas \
psutil \
pytest \
scikit-learn \
scipy || exit -1

# python-graphviz has to be installed separately to prevent conda from downgrading to pypy
conda install -q -y -n $CONDA_ENV \
python-graphviz || exit -1
StrikerRUS marked this conversation as resolved.
Show resolved Hide resolved

if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "clang" ]]; then
# fix "OMP: Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized." (OpenMP library conflict due to conda's MKL)
Expand Down Expand Up @@ -229,7 +240,11 @@ import matplotlib\
matplotlib.use\(\"Agg\"\)\
' plot_example.py # prevent interactive window mode
sed -i'.bak' 's/graph.render(view=True)/graph.render(view=False)/' plot_example.py
conda install -q -y -n $CONDA_ENV h5py ipywidgets notebook # requirements for examples
# requirements for examples
conda install -q -y -n $CONDA_ENV \
h5py \
ipywidgets \
notebook
for f in *.py **/*.py; do python $f || exit -1; done # run all examples
cd $BUILD_DIRECTORY/examples/python-guide/notebooks
sed -i'.bak' 's/INTERACTIVE = False/assert False, \\"Interactive mode disabled\\"/' interactive_plot_example.ipynb
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
LGB_VER=$(head -n 1 VERSION.txt)
EOF
cat > docker-script.sh <<EOF
export CONDA=\$HOME/miniconda
export CONDA=\$HOME/miniforge
export PATH=\$CONDA/bin:\$PATH
nvidia-smi
$ROOT_DOCKER_FOLDER/.ci/setup.sh || exit -1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linkchecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup and run tests
run: |
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export CONDA=${HOME}/miniconda
export CONDA=${HOME}/miniforge
export PATH=${CONDA}/bin:${HOME}/.local/bin:${PATH}
$GITHUB_WORKSPACE/.ci/setup.sh || exit -1
$GITHUB_WORKSPACE/.ci/test.sh || exit -1
2 changes: 1 addition & 1 deletion .github/workflows/python_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
fi
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export LGB_VER=$(head -n 1 VERSION.txt)
export CONDA=${HOME}/miniconda
export CONDA=${HOME}/miniforge
export PATH=${CONDA}/bin:${PATH}
$GITHUB_WORKSPACE/.ci/setup.sh || exit -1
$GITHUB_WORKSPACE/.ci/test.sh || exit -1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
export TASK="${{ matrix.task }}"
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export CONDA=${HOME}/miniconda
export CONDA=${HOME}/miniforge
export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH}
$GITHUB_WORKSPACE/.ci/setup.sh || exit -1
$GITHUB_WORKSPACE/.ci/test.sh || exit -1
Expand Down
11 changes: 7 additions & 4 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ variables:
resources:
containers:
- container: ubuntu1404
image: lightgbm/vsts-agent:ubuntu-14.04
image: lightgbm/vsts-agent:ubuntu-14.04-dev
- container: ubuntu-latest
image: 'ubuntu:latest'
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
Expand Down Expand Up @@ -49,6 +49,9 @@ jobs:
gpu_source:
TASK: gpu
METHOD: source
# on Ubuntu 14.04, gpu_source build segfaults with newer version of Python
# (and newer version of scipy as a consequence)
PYTHON_VERSION: 3.7
swig:
TASK: swig
steps:
Expand Down Expand Up @@ -122,7 +125,7 @@ jobs:
- script: |
echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
CONDA=$HOME/miniconda
CONDA=$HOME/miniforge
echo "##vso[task.setvariable variable=CONDA]$CONDA"
echo "##vso[task.prependpath]$CONDA/bin"
AMDAPPSDK_PATH=$BUILD_SOURCESDIRECTORY/AMDAPPSDK
Expand Down Expand Up @@ -183,7 +186,7 @@ jobs:
BUILD_ARTIFACTSTAGINGDIRECTORY=$BUILD_ARTIFACTSTAGINGDIRECTORY
EOF
cat > docker-script.sh <<EOF
export CONDA=\$HOME/miniconda
export CONDA=\$HOME/miniforge
export PATH=\$CONDA/bin:\$PATH
$ROOT_DOCKER_FOLDER/.ci/setup.sh || exit -1
$ROOT_DOCKER_FOLDER/.ci/test.sh || exit -1
Expand Down Expand Up @@ -236,7 +239,7 @@ jobs:
- script: |
echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
echo "##vso[task.setvariable variable=LGB_VER]$(head -n 1 VERSION.txt)"
CONDA=$AGENT_HOMEDIRECTORY/miniconda
CONDA=$AGENT_HOMEDIRECTORY/miniforge
echo "##vso[task.setvariable variable=CONDA]$CONDA"
echo "##vso[task.prependpath]$CONDA/bin"
echo "##vso[task.setvariable variable=JAVA_HOME]$JAVA_HOME_8_X64"
Expand Down