Skip to content

Commit cd6bdb7

Browse files
authored
Retry CI tests on failure, bump version to 0.1.1, fix error caused by xgboost==1.5.0 (#14)
* Retry tests on failure * Retry examples on failure * Fix sklearn * Bump version
1 parent defe8cf commit cd6bdb7

File tree

4 files changed

+58
-24
lines changed

4 files changed

+58
-24
lines changed

.github/workflows/test.yaml

+44-20
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
3131
test_linux_ray_master:
3232
runs-on: ubuntu-latest
33-
timeout-minutes: 40
33+
timeout-minutes: 100
3434
strategy:
3535
matrix:
3636
python-version: [3.6.9, 3.7, 3.8]
@@ -60,15 +60,21 @@ jobs:
6060
run: |
6161
./lightgbm_ray/tests/env_info.sh
6262
- name: Run tests
63-
run: |
64-
bash ./run_ci_tests.sh
63+
uses: nick-invision/retry@v2
64+
with:
65+
timeout_minutes: 30
66+
max_attempts: 3
67+
command: bash ./run_ci_tests.sh
6568
- name: Run examples
66-
run: |
67-
bash ./run_ci_examples.sh
69+
uses: nick-invision/retry@v2
70+
with:
71+
timeout_minutes: 30
72+
max_attempts: 3
73+
command: bash ./run_ci_examples.sh
6874

6975
test_linux_ray_release:
7076
runs-on: ubuntu-latest
71-
timeout-minutes: 40
77+
timeout-minutes: 100
7278
strategy:
7379
matrix:
7480
python-version: [3.6.9, 3.7, 3.8]
@@ -91,17 +97,23 @@ jobs:
9197
run: |
9298
./lightgbm_ray/tests/env_info.sh
9399
- name: Run tests
94-
run: |
95-
bash ./run_ci_tests.sh
100+
uses: nick-invision/retry@v2
101+
with:
102+
timeout_minutes: 30
103+
max_attempts: 3
104+
command: bash ./run_ci_tests.sh
96105
- name: Run examples
97-
run: |
98-
bash ./run_ci_examples.sh
106+
uses: nick-invision/retry@v2
107+
with:
108+
timeout_minutes: 30
109+
max_attempts: 3
110+
command: bash ./run_ci_examples.sh
99111

100112
test_linux_compat:
101113
# Test compatibility when some optional libraries are missing
102114
# Test runs on latest ray release
103115
runs-on: ubuntu-latest
104-
timeout-minutes: 40
116+
timeout-minutes: 100
105117
strategy:
106118
matrix:
107119
python-version: [3.6.9, 3.7, 3.8]
@@ -129,16 +141,22 @@ jobs:
129141
run: |
130142
./lightgbm_ray/tests/env_info.sh
131143
- name: Run tests
132-
run: |
133-
bash ./run_ci_tests.sh --no-tune
144+
uses: nick-invision/retry@v2
145+
with:
146+
timeout_minutes: 30
147+
max_attempts: 3
148+
command: bash ./run_ci_tests.sh --no-tune
134149
- name: Run examples
135-
run: |
136-
bash ./run_ci_examples.sh --no-tune
150+
uses: nick-invision/retry@v2
151+
with:
152+
timeout_minutes: 30
153+
max_attempts: 3
154+
command: bash ./run_ci_examples.sh --no-tune
137155

138156
test_linux_cutting_edge:
139157
# Tests on cutting edge, i.e. latest Ray master, latest LightGBM master
140158
runs-on: ubuntu-latest
141-
timeout-minutes: 40
159+
timeout-minutes: 100
142160
strategy:
143161
matrix:
144162
python-version: [3.6.9, 3.7, 3.8]
@@ -185,8 +203,14 @@ jobs:
185203
run: |
186204
./lightgbm_ray/tests/env_info.sh
187205
- name: Run tests
188-
run: |
189-
bash ./run_ci_tests.sh
206+
uses: nick-invision/retry@v2
207+
with:
208+
timeout_minutes: 30
209+
max_attempts: 3
210+
command: bash ./run_ci_tests.sh
190211
- name: Run examples
191-
run: |
192-
bash ./run_ci_examples.sh
212+
uses: nick-invision/retry@v2
213+
with:
214+
timeout_minutes: 30
215+
max_attempts: 3
216+
command: bash ./run_ci_examples.sh

lightgbm_ray/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from lightgbm_ray.sklearn import RayLGBMClassifier, RayLGBMRegressor
77

8-
__version__ = "0.1.0"
8+
__version__ = "0.1.1"
99

1010
__all__ = [
1111
"__version__", "RayParams", "RayDMatrix", "RayDeviceQuantileDMatrix",

lightgbm_ray/sklearn.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def _ray_fit(self,
139139
eval_init_score)
140140

141141
if train_dmatrix is None:
142-
train_dmatrix, evals = _wrap_evaluation_matrices(
142+
wrap_evaluation_matrices_kwargs = dict(
143143
missing=None,
144144
X=X,
145145
y=y,
@@ -158,6 +158,16 @@ def _ray_fit(self,
158158
**kwargs,
159159
**ray_dmatrix_params
160160
}))
161+
try:
162+
train_dmatrix, evals = _wrap_evaluation_matrices(
163+
**wrap_evaluation_matrices_kwargs)
164+
except TypeError as e:
165+
if "enable_categorical" in str(e):
166+
train_dmatrix, evals = _wrap_evaluation_matrices(
167+
**wrap_evaluation_matrices_kwargs,
168+
enable_categorical=False)
169+
else:
170+
raise e
161171

162172
eval_names = eval_names or []
163173

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
setup(
44
name="lightgbm_ray",
55
packages=find_packages(where=".", include="lightgbm_ray*"),
6-
version="0.1.0",
6+
version="0.1.1",
77
author="Ray Team",
88
description="A Ray backend for distributed LightGBM",
99
long_description="A distributed backend for LightGBM built on top of "
1010
"distributed computing framework Ray.",
1111
url="https://github.com/ray-project/lightgbm_ray",
12-
install_requires=["lightgbm>=3.2.1", "xgboost_ray>=0.1.3"])
12+
install_requires=["lightgbm>=3.2.1", "xgboost_ray>=0.1.4"])

0 commit comments

Comments
 (0)