Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Commit 20e28a7

Browse files
amogkamkrfricke
andauthored
Add 3.8 Tests and force fork strategy (#42)
* add python 3.8 tests * fix wheel link * lint * try * add force * lint Co-authored-by: Kai Fricke <krfricke@users.noreply.github.com>
1 parent 7a1df52 commit 20e28a7

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

.github/workflows/test.yaml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ jobs:
66
test_lint:
77
runs-on: ubuntu-latest
88
timeout-minutes: 3
9-
109
steps:
1110
- uses: actions/checkout@v2
1211
- name: Set up Python 3.7
@@ -25,18 +24,25 @@ jobs:
2524
test_linux_ray_master:
2625
runs-on: ubuntu-latest
2726
timeout-minutes: 12
28-
27+
strategy:
28+
matrix:
29+
python-version: [3.7, 3.8]
30+
include:
31+
- python-version: 3.7
32+
ray-wheel: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-1.2.0.dev0-cp37-cp37m-manylinux2014_x86_64.whl
33+
- python-version: 3.8
34+
ray-wheel: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-1.2.0.dev0-cp38-cp38-manylinux2014_x86_64.whl
2935
steps:
3036
- uses: actions/checkout@v2
31-
- name: Set up Python 3.7
37+
- name: Set up Python ${{ matrix.python-version }}
3238
uses: actions/setup-python@v2
3339
with:
34-
python-version: 3.7
40+
python-version: ${{ matrix.python-version }}
3541
- name: Install dependencies
3642
run: |
3743
python -m pip install --upgrade pip
3844
python -m pip install codecov
39-
python -m pip install -U https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-1.2.0.dev0-cp37-cp37m-manylinux2014_x86_64.whl
45+
python -m pip install -U ${{ matrix.ray-wheel }}
4046
if [ -f requirements-test.txt ]; then python -m pip install -r requirements-test.txt; fi
4147
- name: Install package
4248
run: |
@@ -63,13 +69,15 @@ jobs:
6369
test_linux_ray_release:
6470
runs-on: ubuntu-latest
6571
timeout-minutes: 12
66-
72+
strategy:
73+
matrix:
74+
python-version: [3.7, 3.8]
6775
steps:
6876
- uses: actions/checkout@v2
69-
- name: Set up Python 3.7
77+
- name: Set up Python ${{ matrix.python-version }}
7078
uses: actions/setup-python@v2
7179
with:
72-
python-version: 3.7
80+
python-version: ${{ matrix.python-version }}
7381
- name: Install dependencies
7482
run: |
7583
python -m pip install --upgrade pip
@@ -103,13 +111,15 @@ jobs:
103111
# Test runs on latest ray release
104112
runs-on: ubuntu-latest
105113
timeout-minutes: 12
106-
114+
strategy:
115+
matrix:
116+
python-version: [3.7, 3.8]
107117
steps:
108118
- uses: actions/checkout@v2
109-
- name: Set up Python 3.7
119+
- name: Set up Python ${{ matrix.python-version }}
110120
uses: actions/setup-python@v2
111121
with:
112-
python-version: 3.7
122+
python-version: ${{ matrix.python-version }}
113123
- name: Install dependencies
114124
run: |
115125
python -m pip install --upgrade pip

xgboost_ray/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ class _RabitTracker(xgb.RabitTracker):
9999
"""
100100

101101
def start(self, nslave):
102+
# TODO: refactor RabitTracker to support spawn process creation.
103+
# In python 3.8, spawn is used as default process creation on macOS.
104+
# But spawn doesn't work because `run` is not pickleable.
105+
# For now we force the start method to use fork.
106+
multiprocessing.set_start_method("fork", force=True)
107+
102108
def run():
103109
self.accept_slaves(nslave)
104110

0 commit comments

Comments
 (0)