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

[Model Watch Tower] Adding ModelVersion and ModelVersionLink entities #1811

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
320d27c
big bang commit
avishniakov Sep 8, 2023
5e72e3d
typo
avishniakov Sep 8, 2023
18b5344
Apply suggestions from code review
avishniakov Sep 8, 2023
b32a1d3
add Alembic
avishniakov Sep 11, 2023
661729d
lint
avishniakov Sep 11, 2023
6594e16
mypy
avishniakov Sep 11, 2023
b65910a
Merge branch 'develop' into feature/OSS-2417-model-class
avishniakov Sep 11, 2023
353bff8
darglint
avishniakov Sep 11, 2023
a856526
wip
avishniakov Sep 11, 2023
e15ad92
add endpoints
avishniakov Sep 11, 2023
8590eff
Merge branch 'feature/OSS-2417-model-class' into feature/OSS-2418-mod…
avishniakov Sep 11, 2023
a49d2a9
add ModelStages
avishniakov Sep 11, 2023
077c6ee
wip
avishniakov Sep 11, 2023
59f4732
work with client
avishniakov Sep 11, 2023
9222d21
handle tags
avishniakov Sep 11, 2023
67c1286
fix integrations
avishniakov Sep 11, 2023
4a00124
move list around
avishniakov Sep 11, 2023
f18ca6f
Merge branch 'feature/OSS-2417-model-class' into feature/OSS-2418-mod…
avishniakov Sep 11, 2023
3df40d5
update db schema
avishniakov Sep 11, 2023
6bb853f
wip
avishniakov Sep 11, 2023
f8764a7
lint
avishniakov Sep 12, 2023
7b3c60e
Merge branch 'feature/OSS-2417-model-class' into feature/OSS-2418-mod…
avishniakov Sep 12, 2023
1205d17
sync with model branch
avishniakov Sep 12, 2023
e4c5ee0
wip
avishniakov Sep 12, 2023
13159a4
refactor
avishniakov Sep 12, 2023
7907b4e
add stage transition
avishniakov Sep 12, 2023
1a083b0
add update interface
avishniakov Sep 12, 2023
571026f
add model version links
avishniakov Sep 12, 2023
ad66d2e
lint
avishniakov Sep 12, 2023
876730d
fix crud tests
avishniakov Sep 13, 2023
ecb3379
Merge branch 'develop' into feature/OSS-2417-model-class
avishniakov Sep 13, 2023
07c26eb
fix alembic branching
avishniakov Sep 13, 2023
efdab85
Merge branch 'feature/OSS-2417-model-class' into feature/OSS-2418-mod…
avishniakov Sep 13, 2023
4e38be7
patch azure
avishniakov Sep 13, 2023
8b130bd
Merge branch 'feature/OSS-2417-model-class' into feature/OSS-2418-mod…
avishniakov Sep 13, 2023
79e2c09
Merge branch 'feature/OSS-2300-model-watch-tower-v0.1' into feature/O…
fa9r Sep 13, 2023
d0a3c49
Merge branch 'feature/OSS-2417-model-class' into feature/OSS-2418-mod…
avishniakov Sep 13, 2023
9aa006d
Merge branch 'feature/OSS-2300-model-watch-tower-v0.1' into feature/O…
avishniakov Sep 14, 2023
8d14736
lint
avishniakov Sep 14, 2023
574ef03
use zenml StrEnum
avishniakov Sep 14, 2023
02bd3ce
fix param name
avishniakov Sep 14, 2023
efed59b
fix tests in docker
avishniakov Sep 14, 2023
c980036
Merge branch 'develop' into feature/OSS-2418-modelversion
avishniakov Sep 15, 2023
8160116
fix tests for mysql
avishniakov Sep 15, 2023
180295b
rename artifact ids variables
avishniakov Sep 15, 2023
6db61b1
reorder methods
avishniakov Sep 15, 2023
2c8c083
add direct getters
avishniakov Sep 15, 2023
2434771
lint
avishniakov Sep 15, 2023
567a1bd
split links into 2 tables
avishniakov Sep 15, 2023
75ca942
Merge branch 'develop' into feature/OSS-2418-modelversion
avishniakov Sep 15, 2023
d211921
Merge branch 'feature/OSS-2300-model-watch-tower-v0.1' into feature/O…
avishniakov Sep 15, 2023
c887b0b
lint
avishniakov Sep 15, 2023
9b0df95
pr comments
avishniakov Sep 18, 2023
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,5 @@ zenml_tutorial/

# script for testing
mlstacks_reset.sh

.local/
1 change: 1 addition & 0 deletions src/zenml/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def handle_int_env_var(var: str, default: int = 0) -> int:
SERVICE_CONNECTOR_RESOURCES = "/resources"
SERVICE_CONNECTOR_CLIENT = "/client"
MODELS = "/models"
MODEL_VERSIONS = "/model_versions"

# mandatory stack component attributes
MANDATORY_COMPONENT_ATTRIBUTES = ["name", "uuid"]
Expand Down
23 changes: 23 additions & 0 deletions src/zenml/model/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) ZenML GmbH 2023. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.

"""Initialization of ZenML model.
ZenML model support Model WatchTower feature.
"""

from zenml.model.model_stages import ModelStages

__all__ = [
"ModelStages",
]
28 changes: 28 additions & 0 deletions src/zenml/model/model_stages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) ZenML GmbH 2023. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""ModelStages lists supported stages of a Model Version."""

from zenml.utils.enum_utils import StrEnum


class ModelStages(StrEnum):
avishniakov marked this conversation as resolved.
Show resolved Hide resolved
"""All possible stages of a Model Version."""

NONE = "none"
STAGING = "staging"
PRODUCTION = "production"
ARCHIVED = "archived"
# technical stages
LATEST = "latest"
RUNNING = "running"
40 changes: 32 additions & 8 deletions src/zenml/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,19 @@
ModelResponseModel,
ModelRequestModel,
ModelUpdateModel,
ModelConfigBaseModel,
ModelConfigResponseModel,
ModelConfigRequestModel,
ModelVersionBaseModel,
ModelVersionResponseModel,
ModelVersionRequestModel,
ModelVersionArtifactBaseModel,
ModelVersionArtifactFilterModel,
ModelVersionArtifactRequestModel,
ModelVersionArtifactResponseModel,
ModelVersionPipelineRunBaseModel,
ModelVersionPipelineRunFilterModel,
ModelVersionPipelineRunRequestModel,
ModelVersionPipelineRunResponseModel,
ModelVersionFilterModel,
ModelVersionUpdateModel,
)

ComponentResponseModel.update_forward_refs(
Expand Down Expand Up @@ -277,22 +284,29 @@
WorkspaceResponseModel=WorkspaceResponseModel,
)

ModelConfigRequestModel.update_forward_refs(
ModelVersionRequestModel.update_forward_refs(
UserResponseModel=UserResponseModel,
WorkspaceResponseModel=WorkspaceResponseModel,
)

ModelConfigResponseModel.update_forward_refs(
ModelVersionResponseModel.update_forward_refs(
UserResponseModel=UserResponseModel,
WorkspaceResponseModel=WorkspaceResponseModel,
)

ModelVersionRequestModel.update_forward_refs(
ModelVersionArtifactRequestModel.update_forward_refs(
UserResponseModel=UserResponseModel,
WorkspaceResponseModel=WorkspaceResponseModel,
)

ModelVersionResponseModel.update_forward_refs(
ModelVersionArtifactResponseModel.update_forward_refs(
UserResponseModel=UserResponseModel,
WorkspaceResponseModel=WorkspaceResponseModel,
)
ModelVersionPipelineRunRequestModel.update_forward_refs(
UserResponseModel=UserResponseModel,
WorkspaceResponseModel=WorkspaceResponseModel,
)
ModelVersionPipelineRunResponseModel.update_forward_refs(
UserResponseModel=UserResponseModel,
WorkspaceResponseModel=WorkspaceResponseModel,
)
Expand Down Expand Up @@ -398,6 +412,16 @@
"ModelConfigRequestModel",
"ModelConfigResponseModel",
"ModelVersionBaseModel",
"ModelVersionFilterModel",
"ModelVersionRequestModel",
"ModelVersionResponseModel",
"ModelVersionUpdateModel",
"ModelVersionArtifactBaseModel",
"ModelVersionArtifactFilterModel",
"ModelVersionArtifactRequestModel",
"ModelVersionArtifactResponseModel",
"ModelVersionPipelineRunBaseModel",
"ModelVersionPipelineRunFilterModel",
"ModelVersionPipelineRunRequestModel",
"ModelVersionPipelineRunResponseModel",
]
Loading
Loading