Skip to content

Commit

Permalink
Merge branch 'feature/use-connectors-for-secrets-stores' of github.co…
Browse files Browse the repository at this point in the history
…m:zenml-io/zenml into feature/use-connectors-for-secrets-stores
  • Loading branch information
stefannica committed Dec 15, 2023
2 parents e15b334 + 64e5332 commit 2ca188c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion examples/e2e/.copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 2023.11.24
_commit: 2023.12.06
_src_path: gh:zenml-io/template-e2e-batch
data_quality_checks: true
email: ''
Expand Down
6 changes: 3 additions & 3 deletions examples/e2e/steps/deployment/deployment_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def deployment_deploy() -> (
# deploy predictor service
deployment_service = mlflow_model_registry_deployer_step.entrypoint(
registry_model_name=model_version.name,
registry_model_version=model_version.get_model_artifact("model")
.run_metadata["model_registry_version"]
.value,
registry_model_version=model_version.metadata[
"model_registry_version"
],
replace_existing=True,
)
else:
Expand Down
22 changes: 7 additions & 15 deletions examples/e2e/steps/promotion/promote_with_metric_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,17 @@ def promote_with_metric_compare(
logger.info(f"Current model version was promoted to '{target_env}'.")

# Promote in Model Registry
latest_version_model_registry_number = (
latest_version.get_model_artifact("model")
.run_metadata["model_registry_version"]
.value
)
latest_version_model_registry_number = latest_version.metadata[
"model_registry_version"
]
if current_version_number is None:
current_version_model_registry_number = (
latest_version_model_registry_number
)
else:
current_version_model_registry_number = (
current_version.get_model_artifact("model")
.run_metadata["model_registry_version"]
.value
)
current_version_model_registry_number = current_version.metadata[
"model_registry_version"
]
promote_in_model_registry(
latest_version=latest_version_model_registry_number,
current_version=current_version_model_registry_number,
Expand All @@ -113,11 +109,7 @@ def promote_with_metric_compare(
)
promoted_version = latest_version_model_registry_number
else:
promoted_version = (
current_version.get_model_artifact("model")
.run_metadata["model_registry_version"]
.value
)
promoted_version = current_version.metadata["model_registry_version"]

logger.info(
f"Current model version in `{target_env}` is `{promoted_version}` registered in Model Registry"
Expand Down
8 changes: 4 additions & 4 deletions examples/e2e/steps/training/model_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from sklearn.base import ClassifierMixin
from typing_extensions import Annotated

from zenml import ArtifactConfig, log_artifact_metadata, step
from zenml import ArtifactConfig, get_step_context, step
from zenml.client import Client
from zenml.integrations.mlflow.experiment_trackers import (
MLFlowExperimentTracker,
Expand Down Expand Up @@ -103,9 +103,9 @@ def model_trainer(
if model_registry:
versions = model_registry.list_model_versions(name=name)
if versions:
log_artifact_metadata(
metadata={"model_registry_version": versions[-1].version},
artifact_name="model",
model_version = get_step_context().model_version
model_version.log_metadata(
{"model_registry_version": versions[-1].version}
)
### YOUR CODE ENDS HERE ###

Expand Down

0 comments on commit 2ca188c

Please sign in to comment.