Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reenable macos testing #3205

Merged
merged 19 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions .github/workflows/ci-slow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,6 @@ jobs:
matrix:
os: [macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
# Python 3.9 is on macos-13 but not macos-latest (macos-14-arm64)
# https://github.com/actions/setup-python/issues/696#issuecomment-1637587760
exclude:
- {python-version: '3.9', os: macos-latest}
include:
- {python-version: '3.9', os: macos-13}
fail-fast: false
uses: ./.github/workflows/unit-test.yml
with:
Expand All @@ -275,14 +269,8 @@ jobs:
needs: [run-slow-ci-label-is-set, macos-unit-test]
strategy:
matrix:
os: [macos-13]
os: [macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
# Python 3.9 is on macos-13 but not macos-latest (macos-14-arm64)
# https://github.com/actions/setup-python/issues/696#issuecomment-1637587760
exclude:
- {python-version: '3.9', os: macos-latest}
include:
- {python-version: '3.9', os: macos-13}
test_environment: [default]
fail-fast: false
uses: ./.github/workflows/integration-test-slow.yml
Expand Down
34 changes: 1 addition & 33 deletions .github/workflows/integration-test-slow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ jobs:
GCP_US_EAST4_SERVER_USERNAME: ${{ secrets.GCP_US_EAST4_SERVER_USERNAME }}
GCP_US_EAST4_SERVER_PASSWORD: ${{ secrets.GCP_US_EAST4_SERVER_PASSWORD }}
# TODO: add Windows testing for Python 3.11 and 3.12 back in
# TODO: add macos testing back in
if: ${{ ! startsWith(github.event.head_commit.message, 'GitBook:') && ! (inputs.os == 'windows-latest' && inputs.python-version == '3.11') && ! (inputs.os == 'windows-latest' && inputs.python-version == '3.12') && ! (inputs.os == 'macos-13' || inputs.os == 'macos-latest') }}
if: ${{ ! startsWith(github.event.head_commit.message, 'GitBook:') && ! (inputs.os == 'windows-latest' && inputs.python-version == '3.11') && ! (inputs.os == 'windows-latest' && inputs.python-version == '3.12') }}
defaults:
run:
shell: bash
Expand Down Expand Up @@ -162,37 +161,6 @@ jobs:
- name: Install MacOS System Dependencies
if: runner.os=='macOS'
run: brew install libomp
- name: Unbreak Python in GHA for 3.9-3.10
if: runner.os=='macOS' && inputs.python-version != '3.11'
# github actions overwrites brew's python. Force it to reassert itself, by
# running in a separate step.
# Workaround GitHub Actions Python issues
# see https://github.com/Homebrew/homebrew-core/issues/165793#issuecomment-1989441193
run: |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
- name: Unbreak Python in GHA for 3.11
if: runner.os=='macOS' && inputs.python-version == '3.11'
run: |
# Unlink and re-link to prevent errors when github mac runner images
# https://github.com/actions/setup-python/issues/577
brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done
- name: Install Docker and Colima on MacOS
if: runner.os=='macOS'
run: |
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
brew update
brew install docker colima
brew reinstall --force qemu

# We need to mount the /private/tmp/zenml-test/ folder because
# this folder is also mounted in the Docker containers that are
# started by local ZenML orchestrators.
colima start --mount /private/tmp/zenml-test/:w

# This is required for the Docker Python SDK to work
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Install kubectl on Linux
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
PYTHONIOENCODING: utf-8
UV_HTTP_TIMEOUT: 600
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: 'YES'
if: ${{ ! startsWith(github.event.head_commit.message, 'GitBook:') && ! (inputs.os == 'windows-latest' && inputs.python-version == '3.11') && ! (inputs.os == 'windows-latest' && inputs.python-version == '3.12') && ! (inputs.os == 'macos-13' && inputs.python-version == '3.9') }}
if: ${{ ! startsWith(github.event.head_commit.message, 'GitBook:') && ! (inputs.os == 'windows-latest' && inputs.python-version == '3.11') && ! (inputs.os == 'windows-latest' && inputs.python-version == '3.12') }}
defaults:
run:
shell: bash
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/examples/test_mlflow_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@
# permissions and limitations under the License.


import platform

import pytest

from tests.integration.examples.utils import run_example
from zenml.client import Client
from zenml.enums import ExecutionStatus


@pytest.mark.skipif(
platform.system() == "Darwin",
reason="It hangs forever now. Need to investigate.", # TODO: investigate this
)
def test_example(request: pytest.FixtureRequest) -> None:
"""Runs the mlflow_deployment example."""
with run_example(
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/examples/test_mlflow_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@
# permissions and limitations under the License.


import platform

import pytest

from tests.integration.examples.utils import run_example
from zenml.client import Client


@pytest.mark.skipif(
platform.system() == "Darwin",
reason="It hangs forever now. Need to investigate.", # TODO: investigate this
)
def test_example(request: pytest.FixtureRequest) -> None:
"""Runs the MLFlow Registry example."""

Expand Down
6 changes: 6 additions & 0 deletions tests/integration/examples/test_mlflow_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@
# or implied. See the License for the specific language governing
# permissions and limitations under the License.

import platform

import pytest

from tests.integration.examples.utils import run_example
from zenml.client import Client
from zenml.constants import METADATA_EXPERIMENT_TRACKER_URL


@pytest.mark.skipif(
platform.system() == "Darwin",
reason="It hangs forever now. Need to investigate.", # TODO: investigate this
)
def test_example(request: pytest.FixtureRequest) -> None:
"""Runs the airflow_orchestration example."""
import mlflow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# permissions and limitations under the License.

import os
import platform
import shutil
from pathlib import Path

Expand Down Expand Up @@ -78,6 +79,10 @@ def get_full_path(folder: str):
train_accelerated = run_with_accelerate(train, num_processes=2, use_cpu=True)


@pytest.mark.skipif(
platform.system() == "Darwin",
reason="It fails on MacOS. Need to investigate.", # TODO: investigate this
)
def test_accelerate_runner_on_cpu_with_toy_model(clean_client):
"""Tests whether the run_with_accelerate wrapper works as expected."""

Expand All @@ -99,6 +104,10 @@ def train_pipe():
shutil.rmtree(each)


@pytest.mark.skipif(
platform.system() == "Darwin",
reason="It fails on MacOS. Need to investigate.", # TODO: investigate this
)
def test_accelerate_runner_fails_on_functional_use(clean_client):
"""Tests whether the run_with_accelerate wrapper works as expected."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# or implied. See the License for the specific language governing
# permissions and limitations under the License.

import platform
import sys

import pytest
Expand All @@ -23,6 +24,11 @@
sys.version_info.minor == 12,
reason="The tensorflow integrations is not yet supported on 3.12.",
)
@pytest.mark.skipif(
platform.system() == "Darwin",
# Details: https://github.com/tensorflow/tensorflow/issues/61915#issuecomment-1809771930
reason="Have to be 2.15 and above and our integration is <2.15",
)
def test_tensorflow_keras_materializer(clean_client):
"""Tests whether the steps work for the TensorFlow Keras materializer."""
from tensorflow import keras
Expand Down
Loading