Skip to content

Commit

Permalink
Add 3.8 Tests and force fork strategy (#42)
Browse files Browse the repository at this point in the history
* add python 3.8 tests

* fix wheel link

* lint

* try

* add force

* lint

Co-authored-by: Kai Fricke <[email protected]>
  • Loading branch information
amogkam and krfricke authored Jan 6, 2021
1 parent 7a1df52 commit 20e28a7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ jobs:
test_lint:
runs-on: ubuntu-latest
timeout-minutes: 3

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
Expand All @@ -25,18 +24,25 @@ jobs:
test_linux_ray_master:
runs-on: ubuntu-latest
timeout-minutes: 12

strategy:
matrix:
python-version: [3.7, 3.8]
include:
- python-version: 3.7
ray-wheel: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-1.2.0.dev0-cp37-cp37m-manylinux2014_x86_64.whl
- python-version: 3.8
ray-wheel: https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-1.2.0.dev0-cp38-cp38-manylinux2014_x86_64.whl
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install codecov
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
python -m pip install -U ${{ matrix.ray-wheel }}
if [ -f requirements-test.txt ]; then python -m pip install -r requirements-test.txt; fi
- name: Install package
run: |
Expand All @@ -63,13 +69,15 @@ jobs:
test_linux_ray_release:
runs-on: ubuntu-latest
timeout-minutes: 12

strategy:
matrix:
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -103,13 +111,15 @@ jobs:
# Test runs on latest ray release
runs-on: ubuntu-latest
timeout-minutes: 12

strategy:
matrix:
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 6 additions & 0 deletions xgboost_ray/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ class _RabitTracker(xgb.RabitTracker):
"""

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

def run():
self.accept_slaves(nslave)

Expand Down

0 comments on commit 20e28a7

Please sign in to comment.