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

Feature/revamp model endpoints #2035

Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
21fc0e1
Moved model versions to their own root route
AlexejPenner Nov 9, 2023
d4d1ee2
Fix the delete endpoint
AlexejPenner Nov 9, 2023
1e08173
Fixed smaller mistakes
AlexejPenner Nov 9, 2023
f00593a
Fixed for Client as well
AlexejPenner Nov 9, 2023
c75ae0e
Fixed lint errors
AlexejPenner Nov 9, 2023
2d770c4
More linting
AlexejPenner Nov 9, 2023
641f408
More linting
AlexejPenner Nov 9, 2023
0e78b3e
More tiny fixes
AlexejPenner Nov 9, 2023
b407f71
Update src/zenml/zen_server/routers/model_versions_endpoints.py
AlexejPenner Nov 9, 2023
51c11a9
More linting
AlexejPenner Nov 9, 2023
a914370
Merge branch 'feature/revamp-model-endpoints' of github.com:zenml-io/…
AlexejPenner Nov 9, 2023
f95be63
Merge branch 'develop' into feature/revamp-model-endpoints
AlexejPenner Nov 13, 2023
7dd030f
Fixed tests and solved conflicts
AlexejPenner Nov 13, 2023
0d1cc73
Fixed linting
AlexejPenner Nov 13, 2023
c21dfbb
Fixed more tests
AlexejPenner Nov 13, 2023
f9f35d0
Merge branch 'develop' into feature/revamp-model-endpoints
AlexejPenner Nov 14, 2023
9695b60
Further refactoring
AlexejPenner Nov 14, 2023
1beb80f
Added raises section
AlexejPenner Nov 14, 2023
d114aea
Fix one failing test
AlexejPenner Nov 14, 2023
b965138
Take "latest" stage into account
AlexejPenner Nov 14, 2023
5a8cc70
Reformatted
AlexejPenner Nov 14, 2023
9a86fe6
Standardize use of list response
AlexejPenner Nov 15, 2023
79eb3a2
Rewrote some tests
AlexejPenner Nov 15, 2023
1d5c3ed
Add clien tests
AlexejPenner Nov 15, 2023
33176ba
Fixed spelling
AlexejPenner Nov 15, 2023
3dc5a4e
Merge branch 'feature/OSS-2609-OSS-2575-model-config-is-model-version…
AlexejPenner Nov 15, 2023
713d610
Merge branch 'feature/OSS-2609-OSS-2575-model-config-is-model-version…
AlexejPenner Nov 15, 2023
bf89710
Tested to work with e2e pipeline
AlexejPenner Nov 15, 2023
1c72fd0
Ugly fixes to get response models in the CLI
AlexejPenner Nov 15, 2023
1d539e0
Auto-update of E2E template
actions-user Nov 15, 2023
ac4c980
Access ModelVersionResponseModels in Client again
AlexejPenner Nov 16, 2023
bfde0ba
Merge branch 'feature/revamp-model-endpoints' of github.com:zenml-io/…
AlexejPenner Nov 16, 2023
bf34c71
Another small fix
AlexejPenner Nov 16, 2023
070e37e
Linted
AlexejPenner Nov 16, 2023
0061553
Merge branch 'feature/OSS-2609-OSS-2575-model-config-is-model-version…
avishniakov Nov 16, 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
Prev Previous commit
Next Next commit
Fixed tests and solved conflicts
AlexejPenner committed Nov 13, 2023
commit 7dd030f1834b49f909ece78ad252fa77235c2b91
44 changes: 15 additions & 29 deletions tests/integration/functional/model/test_artifact_config.py
Original file line number Diff line number Diff line change
@@ -86,8 +86,7 @@ def test_link_minimalistic():
mv = client.get_model_version(MODEL_NAME, ModelStages.LATEST)
assert mv.name == "1"
links = client.list_model_version_artifact_links(
model_name_or_id=model.id,
model_version_name_or_number_or_id=mv.id,
model_version_id=mv.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -147,8 +146,7 @@ def test_link_multiple_named_outputs():
mv = client.get_model_version(MODEL_NAME, ModelStages.LATEST)
assert mv.name == "1"
al = client.list_model_version_artifact_links(
model_name_or_id=model.id,
model_version_name_or_number_or_id=mv.id,
model_version_id=mv.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -193,8 +191,7 @@ def test_link_multiple_named_outputs_without_links():
mv = client.get_model_version(MODEL_NAME, ModelStages.LATEST)
assert mv.name == "1"
artifact_links = client.list_model_version_artifact_links(
model_name_or_id=model.id,
model_version_name_or_number_or_id=mv.id,
model_version_id=mv.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -270,16 +267,14 @@ def test_link_multiple_named_outputs_with_self_context_and_caching():
multi_named_pipeline_from_self(run_count == 2)

al1 = client.list_model_version_artifact_links(
model_name_or_id=mv1.model.id,
model_version_name_or_number_or_id=mv1.id,
model_version_id=mv1.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
),
)
al2 = client.list_model_version_artifact_links(
model_name_or_id=mv2.model.id,
model_version_name_or_number_or_id=mv2.id,
model_version_id=mv2.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -298,8 +293,7 @@ def test_link_multiple_named_outputs_with_self_context_and_caching():
for mv, al in zip([mv1, mv2], [al1, al2]):
for al_ in al:
client.zen_store.delete_model_version_artifact_link(
model_name_or_id=mv.model.id,
model_version_name_or_id=mv.id,
model_version_id=mv.id,
model_version_artifact_link_name_or_id=al_.id,
)

@@ -391,8 +385,7 @@ def test_link_multiple_named_outputs_with_mixed_linkage():
for mv in mvs:
artifact_links.append(
client.list_model_version_artifact_links(
model_name_or_id=mv.model.id,
model_version_name_or_number_or_id=mv.id,
model_version_id=mv.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -459,8 +452,7 @@ def test_link_no_versioning():
simple_pipeline_no_versioning()

al1 = client.list_model_version_artifact_links(
model_name_or_id=model.id,
model_version_name_or_number_or_id=mv.id,
model_version_id=mv.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -473,8 +465,7 @@ def test_link_no_versioning():
simple_pipeline_no_versioning()

al2 = client.list_model_version_artifact_links(
model_name_or_id=model.id,
model_version_name_or_number_or_id=mv.id,
model_version_id=mv.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -531,8 +522,7 @@ def test_link_with_versioning():
simple_pipeline_with_versioning()

al1 = client.list_model_version_artifact_links(
model_name_or_id=model.id,
model_version_name_or_number_or_id=mv.id,
model_version_id=mv.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -545,8 +535,7 @@ def test_link_with_versioning():
simple_pipeline_with_versioning()

al2 = client.list_model_version_artifact_links(
model_name_or_id=model.id,
model_version_name_or_number_or_id=mv.id,
model_version_id=mv.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -651,8 +640,7 @@ def test_link_with_manual_linkage(pipeline: Callable):
pipeline()

al1 = client.list_model_version_artifact_links(
model_name_or_id=model.id,
model_version_name_or_number_or_id=mv.id,
model_version_id=mv.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -663,8 +651,7 @@ def test_link_with_manual_linkage(pipeline: Callable):
assert al1[0].name == "1"

al2 = client.list_model_version_artifact_links(
model_name_or_id=model2.id,
model_version_name_or_number_or_id=mv2.id,
model_version_id=mv2.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -761,8 +748,7 @@ def test_link_with_manual_linkage_flexible_config(
simple_pipeline_with_manual_linkage_flexible_config(artifact_config)

links = client.list_model_version_artifact_links(
model_name_or_id=model.id,
model_version_name_or_number_or_id=mv.id,
model_version_id=mv.id,
model_version_artifact_link_filter_model=ModelVersionArtifactFilterModel(
user_id=user,
workspace_id=ws,
@@ -864,7 +850,7 @@ def _inner_pipeline(force_disable_cache: bool = False):

def test_artifacts_linked_from_cache_steps_same_id():
"""Test that artifacts are linked from cache steps with same id.
This case appears if cached step is executed inside same model version
This case appears if cached step is executed inside same model version,
and we need to silently pass linkage without failing on same id.
"""