Skip to content

Commit

Permalink
Retry CI tests on failure, bump version to 0.1.1, fix error caused by…
Browse files Browse the repository at this point in the history
… xgboost==1.5.0 (#14)

* Retry tests on failure

* Retry examples on failure

* Fix sklearn

* Bump version
  • Loading branch information
Yard1 authored Oct 19, 2021
1 parent defe8cf commit cd6bdb7
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 24 deletions.
64 changes: 44 additions & 20 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
test_linux_ray_master:
runs-on: ubuntu-latest
timeout-minutes: 40
timeout-minutes: 100
strategy:
matrix:
python-version: [3.6.9, 3.7, 3.8]
Expand Down Expand Up @@ -60,15 +60,21 @@ jobs:
run: |
./lightgbm_ray/tests/env_info.sh
- name: Run tests
run: |
bash ./run_ci_tests.sh
uses: nick-invision/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: bash ./run_ci_tests.sh
- name: Run examples
run: |
bash ./run_ci_examples.sh
uses: nick-invision/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: bash ./run_ci_examples.sh

test_linux_ray_release:
runs-on: ubuntu-latest
timeout-minutes: 40
timeout-minutes: 100
strategy:
matrix:
python-version: [3.6.9, 3.7, 3.8]
Expand All @@ -91,17 +97,23 @@ jobs:
run: |
./lightgbm_ray/tests/env_info.sh
- name: Run tests
run: |
bash ./run_ci_tests.sh
uses: nick-invision/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: bash ./run_ci_tests.sh
- name: Run examples
run: |
bash ./run_ci_examples.sh
uses: nick-invision/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: bash ./run_ci_examples.sh

test_linux_compat:
# Test compatibility when some optional libraries are missing
# Test runs on latest ray release
runs-on: ubuntu-latest
timeout-minutes: 40
timeout-minutes: 100
strategy:
matrix:
python-version: [3.6.9, 3.7, 3.8]
Expand Down Expand Up @@ -129,16 +141,22 @@ jobs:
run: |
./lightgbm_ray/tests/env_info.sh
- name: Run tests
run: |
bash ./run_ci_tests.sh --no-tune
uses: nick-invision/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: bash ./run_ci_tests.sh --no-tune
- name: Run examples
run: |
bash ./run_ci_examples.sh --no-tune
uses: nick-invision/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: bash ./run_ci_examples.sh --no-tune

test_linux_cutting_edge:
# Tests on cutting edge, i.e. latest Ray master, latest LightGBM master
runs-on: ubuntu-latest
timeout-minutes: 40
timeout-minutes: 100
strategy:
matrix:
python-version: [3.6.9, 3.7, 3.8]
Expand Down Expand Up @@ -185,8 +203,14 @@ jobs:
run: |
./lightgbm_ray/tests/env_info.sh
- name: Run tests
run: |
bash ./run_ci_tests.sh
uses: nick-invision/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: bash ./run_ci_tests.sh
- name: Run examples
run: |
bash ./run_ci_examples.sh
uses: nick-invision/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: bash ./run_ci_examples.sh
2 changes: 1 addition & 1 deletion lightgbm_ray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from lightgbm_ray.sklearn import RayLGBMClassifier, RayLGBMRegressor

__version__ = "0.1.0"
__version__ = "0.1.1"

__all__ = [
"__version__", "RayParams", "RayDMatrix", "RayDeviceQuantileDMatrix",
Expand Down
12 changes: 11 additions & 1 deletion lightgbm_ray/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _ray_fit(self,
eval_init_score)

if train_dmatrix is None:
train_dmatrix, evals = _wrap_evaluation_matrices(
wrap_evaluation_matrices_kwargs = dict(
missing=None,
X=X,
y=y,
Expand All @@ -158,6 +158,16 @@ def _ray_fit(self,
**kwargs,
**ray_dmatrix_params
}))
try:
train_dmatrix, evals = _wrap_evaluation_matrices(
**wrap_evaluation_matrices_kwargs)
except TypeError as e:
if "enable_categorical" in str(e):
train_dmatrix, evals = _wrap_evaluation_matrices(
**wrap_evaluation_matrices_kwargs,
enable_categorical=False)
else:
raise e

eval_names = eval_names or []

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
setup(
name="lightgbm_ray",
packages=find_packages(where=".", include="lightgbm_ray*"),
version="0.1.0",
version="0.1.1",
author="Ray Team",
description="A Ray backend for distributed LightGBM",
long_description="A distributed backend for LightGBM built on top of "
"distributed computing framework Ray.",
url="https://github.com/ray-project/lightgbm_ray",
install_requires=["lightgbm>=3.2.1", "xgboost_ray>=0.1.3"])
install_requires=["lightgbm>=3.2.1", "xgboost_ray>=0.1.4"])

0 comments on commit cd6bdb7

Please sign in to comment.