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

Support 2.x #7

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 4 additions & 3 deletions google_cloud_mlflow/_mlflow_model_gcp_deployment_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@

import google
from google.cloud import aiplatform
from mlflow.models import cli, Model
from mlflow.models import Model
from mlflow.models.flavor_backend_registry import get_flavor_backend
from mlflow.models.model import MLMODEL_FILE_NAME
from mlflow.tracking.artifact_utils import _download_artifact_from_uri
from unittest import mock
Expand Down Expand Up @@ -297,12 +298,12 @@ def _build_serving_image(
Fully-qualified URI of the pushed container image including the hash digest.
"""
_logger.info("Building image. This can take up to 20 minutes")
flavor_backend = cli._get_flavor_backend(
flavor_backend = get_flavor_backend(
model_uri
) # pylint:disable=protected-access

with mock.patch(
"mlflow.models.docker_utils._build_image_from_context",
"mlflow.models.docker_utils.build_image_from_context",
new=docker_utils_patch._build_image_from_context
):
flavor_backend.build_image(
Expand Down
2 changes: 1 addition & 1 deletion google_cloud_mlflow/_mlflow_models_docker_utils_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _build_image_from_context_using_cloudbuild_client(
_logger.info(f"Logs are available at [{build_operation.metadata.build.log_url}].")

try:
result = build_operation.result()
result = build_operation.result(timeout=3600)
except Exception as ex:
_logger.error(
"MLFlow container image build has failed."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ def predict(
"""
endpoint = self._get_deployment(deployment_name=deployment_name)
predictions = endpoint.predict(
instances=_data_to_list_of_instances(df),
instances=df.to_dict(orient="records"),
)
return predictions
return pandas.DataFrame(predictions.predictions)

def explain(
self,
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
keywords='mlflow, Google Cloud, Vertex AI',
python_requires=">=3.6",
install_requires=[
"google-cloud-aiplatform~=1.7",
"mlflow~=1.22",
"google-cloud-aiplatform~=1.35",
"mlflow>=2.10.0",
"google-cloud-build==3.*",
"google-cloud-storage==1.*",
],
Expand Down