diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edaa6555b..00a500974 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -165,7 +165,7 @@ jobs: matrix: os: - ubuntu-22.04 - - macos-13 + - macos-12 python-version: - "3.9" - "3.10" @@ -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: diff --git a/tox.ini b/tox.ini index 56905ebaa..e4a6e37be 100644 --- a/tox.ini +++ b/tox.ini @@ -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} @@ -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}