forked from mlflow/mlflow
-
Notifications
You must be signed in to change notification settings - Fork 9
300 lines (282 loc) · 10.2 KB
/
master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
name: MLflow tests
on:
pull_request:
push:
branches:
- master
- branch-[0-9]+.[0-9]+
workflow_dispatch:
inputs:
repository:
description: >
[Optional] Repository name with owner. For example, mlflow/mlflow.
Defaults to the repository that triggered a workflow.
required: false
default: ""
ref:
description: >
[Optional] The branch, tag or SHA to checkout. When checking out the repository that
triggered a workflow, this defaults to the reference or SHA for that event. Otherwise,
uses the default branch.
required: false
default: ""
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
# Use `bash --noprofile --norc -exo pipefail` by default for all `run` steps in this workflow:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaultsrun
defaults:
run:
shell: bash --noprofile --norc -exo pipefail {0}
env:
# Note miniconda is pre-installed in the virtual environments for GitHub Actions:
# https://github.com/actions/virtual-environments/blob/main/images/linux/scripts/installers/miniconda.sh
MLFLOW_CONDA_HOME: /usr/share/miniconda
SPARK_LOCAL_IP: localhost
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
- uses: ./.github/actions/setup-python
- uses: ./.github/actions/cache-pip
- name: Add problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
echo "::add-matcher::.github/workflows/matchers/black.json"
- name: Install dependencies
run: |
source ./dev/install-common-deps.sh --ml
pip install -r requirements/lint-requirements.txt
- name: Test custom pylint-plugins
run : |
pytest pylint_plugins/tests
- name: Run lint checks
run: |
./dev/lint.sh
# python-skinny tests cover a subset of mlflow functionality
# that is meant to be supported with a smaller dependency footprint.
# The python skinny tests cover the subset of mlflow functionality
# while also verifying certain dependencies are omitted.
python-skinny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
- uses: ./.github/actions/setup-python
- name: Install dependencies
run: |
source ./dev/install-common-deps.sh --skinny
- name: Run tests
run: |
./dev/run-python-skinny-tests.sh
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
submodules: recursive
- name: Increase available disk space
run: |
# Increase available disk space by removing unnecessary tool chains:
# https://github.com/actions/virtual-environments/issues/709#issuecomment-612569242
rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: ./.github/actions/setup-python
- uses: ./.github/actions/setup-pyenv
- uses: ./.github/actions/setup-java
with:
java-version: 11
distribution: 'adopt'
- uses: ./.github/actions/cache-pip
- name: Install dependencies
run: |
source ./dev/install-common-deps.sh --ml
- name: Run tests
run: |
source dev/setup-ssh.sh
./dev/run-python-tests.sh
database:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
submodules: recursive
- name: Build
run: |
./tests/db/compose.sh pull -q postgresql mysql mssql
./tests/db/compose.sh build --build-arg DEPENDENCIES="$(python setup.py -q dependencies)"
- name: Run tests
run: |
set +e
err=0
trap 'err=1' ERR
for service in $(./tests/db/compose.sh config --services | grep '^mlflow-')
do
# Set `--no-TTY` to show container logs on GitHub Actions:
# https://github.com/actions/virtual-environments/issues/5022
./tests/db/compose.sh run --rm --no-TTY $service pytest \
tests/store/tracking/test_sqlalchemy_store.py \
tests/store/model_registry/test_sqlalchemy_store.py \
tests/db
done
test $err = 0
- name: Rebuild images with SQLAlchemy 2.x
run: |
sed -i '/sqlalchemy.*/d' requirements/core-requirements.txt
# https://github.com/sqlalchemy/sqlalchemy/commit/f4214975a7deb5e13f8b6cf21e39697821396a7f
# is a patch for https://github.com/sqlalchemy/sqlalchemy/issues/8661. Tests that log a tag
# with a long value (e.g. `"a" * 5000`) fail because of this issue. Install sqlalchemy from
# this commit until a new 2.x version is published on PyPI.
echo 'sqlalchemy@git+https://github.com/sqlalchemy/sqlalchemy.git@f4214975a7deb5e13f8b6cf21e39697821396a7f' >> requirements/core-requirements.txt
git diff
./tests/db/compose.sh build --build-arg DEPENDENCIES="$(python setup.py -q dependencies)"
- name: Run tests
run: |
set +e
err=0
trap 'err=1' ERR
for service in $(./tests/db/compose.sh config --services | grep '^mlflow-')
do
# Set `--no-TTY` to show container logs on GitHub Actions:
./tests/db/compose.sh run --rm --no-TTY $service pytest \
tests/store/tracking/test_sqlalchemy_store.py \
tests/store/model_registry/test_sqlalchemy_store.py \
tests/db
done
test $err = 0
- name: Clean up
run: |
./tests/db/compose.sh down --volumes --remove-orphans --rmi all
java:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
- uses: ./.github/actions/setup-python
- uses: ./.github/actions/setup-java
- name: Install dependencies
run: |
source ./dev/install-common-deps.sh
- name: Run tests
run: |
cd mlflow/java
mvn clean package -q
flavors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
submodules: recursive
- name: Increase available disk space
run: |
# Increase available disk space by removing unnecessary tool chains:
# https://github.com/actions/virtual-environments/issues/709#issuecomment-612569242
rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: ./.github/actions/setup-python
- uses: ./.github/actions/setup-pyenv
- uses: ./.github/actions/setup-java
- uses: ./.github/actions/cache-pip
- name: Install dependencies
run: |
source ./dev/install-common-deps.sh --ml
- name: Run tests
run: |
./dev/run-python-flavor-tests.sh;
# It takes 9 ~ 10 minutes to run tests in `tests/models`. To make CI finish faster,
# run these tests in a separate job.
models:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
- uses: ./.github/actions/setup-python
- uses: ./.github/actions/setup-pyenv
- uses: ./.github/actions/setup-java
- name: Install dependencies
run: |
source ./dev/install-common-deps.sh
pip install pyspark
- name: Run tests
run: |
export MLFLOW_HOME=$(pwd)
pytest tests/models
pyfunc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
submodules: recursive
- uses: ./.github/actions/setup-python
- uses: ./.github/actions/setup-pyenv
- uses: ./.github/actions/setup-java
- name: Install dependencies
run: |
source ./dev/install-common-deps.sh
pip install keras tensorflow pyspark
- name: Run tests
run: |
export MLFLOW_HOME=$(pwd)
pytest --durations=30 tests/pyfunc
sagemaker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
- uses: ./.github/actions/setup-python
- uses: ./.github/actions/setup-java
- name: Install dependencies
run: |
source ./dev/install-common-deps.sh --ml
- name: Run tests
run: |
./dev/run-python-sagemaker-tests.sh;
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
- uses: ./.github/actions/setup-python
- uses: ./.github/actions/setup-pyenv
- uses: ./.github/actions/setup-java
- name: Install python dependencies
run: |
pip install -r requirements/test-requirements.txt
pip install --no-dependencies tests/resources/mlflow-test-plugin
pip install -e .[extras]
pip install pyspark
- name: Download Hadoop winutils for Spark
run: |
git clone https://github.com/cdarlint/winutils
- name: Run python tests
run: |
# Set Hadoop environment variables required for testing Spark integrations on Windows
export HADOOP_HOME=`realpath winutils/hadoop-3.2.2`
export PATH=$PATH:$HADOOP_HOME/bin
# Run Windows tests
pytest --ignore-flavors --ignore=tests/projects --ignore=tests/examples tests --ignore=tests/pipelines