Skip to content

Commit

Permalink
Fix/macos all runtimes (#1823)
Browse files Browse the repository at this point in the history
* Run kafka and parallel tests without xdist

* Downgrade OpenMP

* Update tox.ini

Co-authored-by: Sherif Akoush <[email protected]>

---------

Co-authored-by: Sherif Akoush <[email protected]>
  • Loading branch information
RobertSamoilescu and sakoush authored Jun 19, 2024
1 parent f60cf3d commit d9bff8f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
matrix:
os:
- ubuntu-22.04
- macos-13
- macos-12
python-version:
- "3.9"
- "3.10"
Expand All @@ -186,9 +186,17 @@ jobs:
- name: Setup Docker (missing on MacOS)
if: runner.os == 'macOS'
run: ./hack/install-docker-macos.sh
- name: Install OpenMP (in MacOS)
if: runner.os == 'macOS'
run: brew install libomp
- name: Downgrade OpenMP (in MacOS)
if: runner.os == 'macos'
run: |
# Recent versions of OpenMP cause segfaults in MacOS when training
# LightGBM / XGBoost models (but only when Torch is present)
# https://github.com/microsoft/LightGBM/issues/4229
# https://github.com/autogluon/autogluon/issues/1442
wget https://raw.githubusercontent.com/chenrui333/homebrew-core/0094d1513ce9e2e85e07443b8b5930ad298aad91/Formula/libomp.rb
brew unlink libomp
brew install --build-from-source ./libomp.rb
brew list --version libomp
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down
21 changes: 13 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ commands_pre =
poetry install --sync --no-root
commands =
python -m pytest {posargs} -n auto \
{toxinidir}/tests --ignore={toxinidir}/tests/kafka
# kafka tests are failinig for macos when running in parallel
{toxinidir}/tests \
--ignore={toxinidir}/tests/kafka \
--ignore={toxinidir}/tests/parallel
# kafka and parallel tests are failing for macos when running in parallel
# with the entire test suite. So, we run them separately.
python -m pytest {posargs} -n auto \
{toxinidir}/tests/kafka
python -m pytest {posargs} \
{toxinidir}/tests/kafka \
{toxinidir}/tests/parallel
set_env =
GITHUB_SERVER_URL = {env:GITHUB_SERVER_URL:https\://github.com}
GITHUB_REPOSITORY = {env:GITHUB_REPOSITORY:SeldonIO/MLServer}
Expand All @@ -46,11 +49,13 @@ commands =
{toxinidir}/runtimes/lightgbm \
{toxinidir}/runtimes/mlflow \
{toxinidir}/runtimes/huggingface \
--ignore={toxinidir}/tests/kafka
# kafka tests are failinig for macos when running in parallel
--ignore={toxinidir}/tests/kafka \
--ignore={toxinidir}/tests/parallel
# kafka and parallel tests are failinig for macos when running in parallel
# with the entire test suite. So, we run them separately.
python -m pytest {posargs} -n auto \
{toxinidir}/tests/kafka
python -m pytest {posargs} \
{toxinidir}/tests/kafka \
{toxinidir}/tests/parallel
set_env =
GITHUB_SERVER_URL = {env:GITHUB_SERVER_URL:https\://github.com}
GITHUB_REPOSITORY = {env:GITHUB_REPOSITORY:SeldonIO/MLServer}
Expand Down

0 comments on commit d9bff8f

Please sign in to comment.