1515 matrix :
1616 python-version : ["3.9", "3.10"]
1717 target : ["dataplane", "model-repository"]
18- runs-on : ubuntu-latest
18+ runs-on : ubuntu-22.04
1919 steps :
2020 - uses : actions/checkout@v4
2121 - name : Set up Python ${{ matrix.python-version }}
3636 lint :
3737 strategy :
3838 matrix :
39- python-version : ["3.9", "3.10"]
40- runs-on : ubuntu-latest
39+ python-version :
40+ - " 3.9"
41+ - " 3.10"
42+ runs-on : ubuntu-22.04
4143 steps :
4244 - uses : actions/checkout@v4
4345 - name : Set up Python ${{ matrix.python-version }}
@@ -57,33 +59,30 @@ jobs:
5759 strategy :
5860 fail-fast : false
5961 matrix :
60- os : [ubuntu-latest, macos-latest]
62+ os :
63+ - ubuntu-22.04
64+ - macos-13
6165 # NOTE: There's no pre-built `grpcio` wheel for Python 3.11 yet
6266 # https://github.com/grpc/grpc/issues/32454
63- python-version : ["3.9", "3.10"]
67+ python-version :
68+ - " 3.9"
69+ - " 3.10"
6470 is-pr :
6571 - ${{ github.event_name == 'pull_request' }}
6672 exclude :
6773 # MacOS tests take a lot of time, so we will run them only on merge
6874 # From https://github.com/orgs/community/discussions/26253
6975 - is-pr : true
70- os : macos-latest
76+ os : macos-13
7177 runs-on : ${{ matrix.os }}
7278 steps :
73- - name : Setup docker (missing on MacOS)
74- if : runner.os == 'macos'
75- run : |
76- # From https://github.com/actions/runner-images/issues/17#issuecomment-1537238473
77- # From https://github.com/abiosoft/colima/discussions/273#discussioncomment-4959736
78- # NOTE: Use the `slirp` driver rather than the default to avoid
79- # random connection errors.
80- # From https://github.com/abiosoft/colima/issues/577
81- brew install docker docker-buildx
82- mkdir -p $HOME/.docker/cli-plugins
83- ln -sfn $(which docker-buildx) $HOME/.docker/cli-plugins/docker-buildx
84- colima start --memory 5 --network-driver slirp
85- sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
8679 - uses : actions/checkout@v4
80+ - name : Setup Docker (missing on MacOS)
81+ if : runner.os == 'macos'
82+ run : ./hack/install-docker-macos.sh
83+ - name : Install OpenMP (in MacOS)
84+ if : runner.os == 'macOS'
85+ run : brew install libomp
8786 - name : Set up Python ${{ matrix.python-version }}
8887 uses : actions/setup-python@v5
8988 with :
@@ -97,16 +96,28 @@ jobs:
9796 with :
9897 virtualenvs-create : false
9998 - name : Install Dependencies
100- run : poetry install --sync --only dev
99+ run : |
100+ if [[ ${{ runner.os == 'macOS' }} ]]; then
101+ source ./hack/activate-libomp-macos.sh
102+ fi
103+ poetry install --sync --only dev
101104 - name : Test
102- run : tox -e mlserver
105+ run : |
106+ if [[ ${{ runner.os == 'macOS' }} ]]; then
107+ source ./hack/activate-libomp-macos.sh
108+ fi
109+ tox -e mlserver
103110
104111 runtimes :
105112 strategy :
106113 fail-fast : false
107114 matrix :
108- os : [ubuntu-latest, macos-latest]
109- python-version : ["3.9", "3.10"]
115+ os :
116+ - ubuntu-22.04
117+ - macos-13
118+ python-version :
119+ - " 3.9"
120+ - " 3.10"
110121 tox-environment :
111122 - sklearn
112123 - xgboost
@@ -122,10 +133,13 @@ jobs:
122133 # MacOS tests take a lot of time, so we will run them only on merge
123134 # From https://github.com/orgs/community/discussions/26253
124135 - is-pr : true
125- os : macos-latest
136+ os : macos-13
126137 runs-on : ${{ matrix.os }}
127138 steps :
128139 - uses : actions/checkout@v4
140+ - name : Install OpenMP (in MacOS)
141+ if : runner.os == 'macOS'
142+ run : brew install libomp
129143 - name : Set up Python ${{ matrix.python-version }}
130144 uses : actions/setup-python@v5
131145 with :
@@ -139,18 +153,30 @@ jobs:
139153 with :
140154 virtualenvs-create : false
141155 - name : Install Dependencies
142- run : poetry install --sync --only dev
156+ run : |
157+ if [[ ${{ runner.os == 'macOS' }} ]]; then
158+ source ./hack/activate-libomp-macos.sh
159+ fi
160+ poetry install --sync --only dev
143161 - name : Test
144- run : tox -c ./runtimes/${{ matrix.tox-environment }}
162+ run : |
163+ if [[ ${{ runner.os == 'macOS' }} ]]; then
164+ source ./hack/activate-libomp-macos.sh
165+ fi
166+ tox -c ./runtimes/${{ matrix.tox-environment }}
145167
146168 # Ensure that having all the runtimes installed together works
147169 all-runtimes :
148170 if : github.event_name == 'push'
149171 strategy :
150172 fail-fast : false
151173 matrix :
152- os : [ubuntu-latest, macos-latest]
153- python-version : ["3.9", "3.10"]
174+ os :
175+ - ubuntu-22.04
176+ - macos-13
177+ python-version :
178+ - " 3.9"
179+ - " 3.10"
154180 runs-on : ${{ matrix.os }}
155181 steps :
156182 - name : Maximize build space
@@ -164,30 +190,13 @@ jobs:
164190 remove-docker-images : ' true'
165191 overprovision-lvm : ' true'
166192 swap-size-mb : 1024
167- - name : Setup docker (missing on MacOS)
193+ - uses : actions/checkout@v4
194+ - name : Setup Docker (missing on MacOS)
168195 if : runner.os == 'macOS'
169- run : |
170- # From https://github.com/actions/runner-images/issues/17#issuecomment-1537238473
171- # From https://github.com/abiosoft/colima/discussions/273#discussioncomment-4959736
172- # NOTE: Use the `slirp` driver rather than the default to avoid
173- # random connection errors.
174- # From https://github.com/abiosoft/colima/issues/577
175- brew install docker docker-buildx
176- mkdir -p $HOME/.docker/cli-plugins
177- ln -sfn $(which docker-buildx) $HOME/.docker/cli-plugins/docker-buildx
178- colima start --memory 5 --network-driver slirp
179- sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
180- - name : Downgrade OpenMP (in MacOS)
196+ run : ./hack/install-docker-macos.sh
197+ - name : Install OpenMP (in MacOS)
181198 if : runner.os == 'macOS'
182- run : |
183- # Recent versions of OpenMP cause segfaults in MacOS when training
184- # LightGBM / XGBoost models (but only when Torch is present)
185- # https://github.com/microsoft/LightGBM/issues/4229
186- # https://github.com/autogluon/autogluon/issues/1442
187- wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
188- brew unlink libomp
189- brew install libomp.rb
190- - uses : actions/checkout@v4
199+ run : brew install libomp
191200 - name : Set up Python ${{ matrix.python-version }}
192201 uses : actions/setup-python@v5
193202 with :
@@ -201,6 +210,14 @@ jobs:
201210 with :
202211 virtualenvs-create : false
203212 - name : Install Dependencies
204- run : poetry install --sync --only dev
213+ run : |
214+ if [[ ${{ runner.os == 'macOS' }} ]]; then
215+ source ./hack/activate-libomp-macos.sh
216+ fi
217+ poetry install --sync --only dev
205218 - name : Test
206- run : tox -e all-runtimes
219+ run : |
220+ if [[ ${{ runner.os == 'macOS' }} ]]; then
221+ source ./hack/activate-libomp-macos.sh
222+ fi
223+ tox -e all-runtimes
0 commit comments