Skip to content

Commit b310de4

Browse files
chore(sdk): Update mlflow version in sdk (#616)
# Description This PR is the **first part** (1 out of 3) of a series of PRs to update the version of Mlflow used by Merlin (to `1.26.1`*). These changes are: 1. Update the version of Mlflow used in the Merlin SDK and publish it to PyPI 2. Update - the Merlin pyfunc server and batch predictor to use the updated Merlin SDK version released in step 1 and publish them to PyPI - the Merlin API server to ensure that requests sent to Mlflow reflect the update API endpoint contracts - the Mlflow image so that it's built using version `1.26.1` 3. Update the default pyfunc server and batch predictor version in the Merlin SDK and publish its new version to PyPI I also made some minor refactoring to the requirements files so that they are stored in a separate file and the reading of these files is consistent with what is done in the batch predictor and pyfunc server `setup.py` files. *I've selected `1.26.1` because it's the latest version of Mlflow available that is before Mlflow v2, that still allows `pandas==2.2.0` to be installed (this is a hard requirement needed by the `arize` package). # Modifications - Update Mlflow version to `1.26.1` (and other dependencies) in the SDK as well as observation publisher's requirements file since the unit tests there import the SDK's requirements file's dependencies - ~~Update unit tests to ensure that the updated `PythonModelContext` from Mlflow is initialised with the required arguments~~ (will only be needed for newer versions of Mlflow) # Tests <!-- Besides the existing / updated automated tests, what specific scenarios should be tested? Consider the backward compatibility of the changes, whether corner cases are covered, etc. Please describe the tests and check the ones that have been completed. Eg: - [x] Deploying new and existing standard models - [ ] Deploying PyFunc models --> # Checklist - [x] Added PR label - [ ] Added unit test, integration, and/or e2e tests - [x] Tested locally - [ ] Updated documentation - [ ] Update Swagger spec if the PR introduce API changes - [ ] Regenerated Golang and Python client if the PR introduces API changes # Release Notes <!-- Does this PR introduce a user-facing change? If no, just write "NONE" in the release-note block below. If yes, a release note is required. Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information about release notes, see kubernetes' guide here: http://git.k8s.io/community/contributors/guide/release-notes.md --> ```release-note NONE ```
1 parent 875b77f commit b310de4

File tree

4 files changed

+48
-48
lines changed

4 files changed

+48
-48
lines changed

python/observation-publisher/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ binaryornot==0.4.4
2222
# via cookiecutter
2323
blinker==1.7.0
2424
# via flask
25-
boto3==1.34.45
25+
boto3==1.35.39
2626
# via merlin-sdk
27-
botocore==1.34.45
27+
botocore==1.35.39
2828
# via
2929
# boto3
3030
# s3transfer
@@ -215,7 +215,7 @@ python-dateutil==2.8.2
215215
# pandas
216216
python-slugify==8.0.4
217217
# via cookiecutter
218-
pytz==2024.1
218+
pytz==2022.7.1
219219
# via
220220
# mlflow
221221
# pandas

python/sdk/requirements.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
boto3>=1.35.39
2+
caraml-upi-protos>=0.3.1
3+
certifi>=2017.4.17
4+
Click>=7.0,<8.1.4
5+
cloudpickle==2.0.0 # used by mlflow
6+
cookiecutter>=1.7.2
7+
dataclasses-json>=0.5.2 # allow Flyte version 1.2.0 or above to import Merlin SDK
8+
docker<=6.1.3
9+
GitPython>=3.1.40
10+
google-cloud-storage>=1.19.0
11+
protobuf>=3.12.0,<5.0.0 # Determined by the mlflow dependency
12+
mlflow==1.26.1
13+
PyPrind>=2.11.2
14+
python_dateutil>=2.5.3
15+
PyYAML>=5.4
16+
six>=1.10
17+
urllib3>=1.26
18+
numpy<=1.23.5 # Temporary pin numpy due to https://numpy.org/doc/stable/release/1.20.0-notes.html#numpy-1-20-0-release-notes
19+
caraml-auth-google==0.0.0.post7
20+
pydantic==2.5.3

python/sdk/requirements_test.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
google-cloud-bigquery-storage>=0.7.0
2+
google-cloud-bigquery>=1.18.0
3+
joblib>=0.13.0,<1.2.0 # >=1.2.0 upon upgrade of kserve's version
4+
mypy>=0.812
5+
pytest-cov
6+
pytest-dependency
7+
pytest-xdist
8+
pytest
9+
recursive-diff>=1.0.0
10+
requests
11+
scikit-learn>=1.1.2
12+
types-python-dateutil
13+
types-PyYAML
14+
types-six
15+
types-protobuf
16+
urllib3-mock>=0.3.3
17+
xarray
18+
xgboost==1.6.2

python/sdk/setup.py

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,49 +22,11 @@
2222
"merlin.version", os.path.join("merlin", "version.py")
2323
).VERSION
2424

25-
REQUIRES = [
26-
"boto3>=1.9.84",
27-
"caraml-upi-protos>=0.3.1",
28-
"certifi>=2017.4.17",
29-
"Click>=7.0,<8.1.4",
30-
"cloudpickle==2.0.0", # used by mlflow
31-
"cookiecutter>=1.7.2",
32-
"dataclasses-json>=0.5.2", # allow Flyte version 1.2.0 or above to import Merlin SDK
33-
"docker<=6.1.3",
34-
"GitPython>=3.1.40",
35-
"google-cloud-storage>=1.19.0",
36-
"protobuf>=3.12.0,<5.0.0", # Determined by the mlflow dependency
37-
"mlflow==1.26.1",
38-
"PyPrind>=2.11.2",
39-
"python_dateutil>=2.5.3",
40-
"PyYAML>=5.4",
41-
"six>=1.10",
42-
"urllib3>=1.26",
43-
"numpy<=1.23.5", # Temporary pin numpy due to https://numpy.org/doc/stable/release/1.20.0-notes.html#numpy-1-20-0-release-notes
44-
"caraml-auth-google==0.0.0.post7",
45-
"pydantic==2.5.3"
46-
]
25+
with open("requirements.txt") as f:
26+
REQUIRE = f.read().splitlines()
4727

48-
TEST_REQUIRES = [
49-
"google-cloud-bigquery-storage>=0.7.0",
50-
"google-cloud-bigquery>=1.18.0",
51-
"joblib>=0.13.0,<1.2.0", # >=1.2.0 upon upgrade of kserve's version
52-
"mypy>=0.812",
53-
"pytest-cov",
54-
"pytest-dependency",
55-
"pytest-xdist",
56-
"pytest",
57-
"recursive-diff>=1.0.0",
58-
"requests",
59-
"scikit-learn>=1.1.2",
60-
"types-python-dateutil",
61-
"types-PyYAML",
62-
"types-six",
63-
"types-protobuf",
64-
"urllib3-mock>=0.3.3",
65-
"xarray",
66-
"xgboost==1.6.2",
67-
]
28+
with open("requirements_test.txt") as f:
29+
TESTS_REQUIRE = f.read().splitlines()
6830

6931
setup(
7032
name="merlin-sdk",
@@ -75,10 +37,10 @@
7537
packages=find_packages(),
7638
package_data={"merlin": ["docker/pyfunc.Dockerfile", "docker/standard.Dockerfile"]},
7739
zip_safe=True,
78-
install_requires=REQUIRES,
40+
install_requires=REQUIRE,
7941
setup_requires=["setuptools_scm"],
80-
tests_require=TEST_REQUIRES,
81-
extras_require={"test": TEST_REQUIRES},
42+
tests_require=TESTS_REQUIRE,
43+
extras_require={"test": TESTS_REQUIRE},
8244
python_requires=">=3.8,<3.11",
8345
long_description=open("README.md").read(),
8446
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)