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

[pull] main from kubeflow:main #164

Merged
merged 20 commits into from
Jan 30, 2025
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8a39ad5
fix: patch requests to artifact endpoint make mr panic (#718)
Al-Pragliola Jan 20, 2025
39beea8
feat(bff) crud for api/v1/model_registry/{model_registry_id}/artifact…
ederign Jan 21, 2025
7a7c093
chore: bump py version to 0.2.13 (#722)
tarilabs Jan 21, 2025
59b3326
fix(nav, masthead): Edit navbar styling to handle dynamic window sizi…
jenny-s51 Jan 21, 2025
de52a0b
Fix issue with make command (#723)
lucferbux Jan 21, 2025
979b1ed
Keep up with midstream (#706)
lucferbux Jan 22, 2025
d06665b
build(deps-dev): bump react-router-dom from 7.1.1 to 7.1.3 in /client…
dependabot[bot] Jan 22, 2025
ecf4e54
fix(frontend): adding missing key for SimpleSelect (#729)
ederign Jan 23, 2025
ddb7961
chore(frontend): FE version bump for eslint-plugin-react-hooks, types…
ederign Jan 23, 2025
62cfc06
Update install_protoc.sh script to support apple architectures (#732)
Crazyglue Jan 23, 2025
462790c
chore(bff): version bump for golang 1.22.2 -> 1.23.5, go lint v1.63.4…
ederign Jan 24, 2025
8120c99
build(deps-dev): bump @mui/icons-material from 6.1.10 to 6.4.1 in /cl…
dependabot[bot] Jan 27, 2025
8498a22
build(deps-dev): bump @testing-library/user-event from 14.5.2 to 14.6…
dependabot[bot] Jan 27, 2025
2eb66b4
Moving UI Manifests to root manifests directory (#731)
Griffin-Sullivan Jan 28, 2025
822028f
chore(go): bump golang version to 1.22 (#689)
Al-Pragliola Jan 28, 2025
77657a1
Update verify_ssl behaviour in Configuration class (#726)
lugi0 Jan 29, 2025
66ea120
fix(bff): bump golang base image in Dockerfile (#742)
Al-Pragliola Jan 29, 2025
3fb4a14
build(deps): bump pydantic from 2.10.4 to 2.10.6 in /clients/python (…
dependabot[bot] Jan 30, 2025
de8af6f
build(deps-dev): bump mypy from 1.14.0 to 1.14.1 in /clients/python (…
dependabot[bot] Jan 30, 2025
c09e98b
build(deps-dev): bump ruff from 0.9.2 to 0.9.3 in /clients/python (#736)
dependabot[bot] Jan 30, 2025
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
Next Next commit
fix: patch requests to artifact endpoint make mr panic (kubeflow#718)
* fix: patch requests to artifact endpoint make mr panic

Signed-off-by: Alessio Pragliola <[email protected]>

* chore: remove commented code

Signed-off-by: Alessio Pragliola <[email protected]>

---------

Signed-off-by: Alessio Pragliola <[email protected]>
Al-Pragliola authored Jan 20, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 8a39ad539665744ad54a52e60204a8e2829e842c
33 changes: 33 additions & 0 deletions clients/python/tests/regression_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import requests

from model_registry import ModelRegistry
from model_registry.types.artifacts import ModelArtifact
@@ -99,3 +100,35 @@ async def test_create_standalone_model_artifact(client: ModelRegistry):
assert mv.id
mv_ma = await client._api.upsert_model_version_artifact(new_ma, mv.id)
assert mv_ma.id == new_ma.id

@pytest.mark.e2e
async def test_patch_model_artifacts_artifact_type(client: ModelRegistry):
"""Patching Artifacts makes the model registry server panic.
reported with https://issues.redhat.com/browse/RHOAIENG-16932
"""
name = "test_model"
version = "1.0.0"
rm = client.register_model(
name,
"s3",
model_format_name="test_format",
model_format_version="test_version",
version=version,
)
assert rm.id
mv = client.get_model_version(name, version)
assert mv
assert mv.id
ma = client.get_model_artifact(name, version)
assert ma
assert ma.id

payload = { "modelFormatName": "foo", "artifactType": "model-artifact" }
from .conftest import REGISTRY_HOST, REGISTRY_PORT
response = requests.patch(url=f"{REGISTRY_HOST}:{REGISTRY_PORT}/api/model_registry/v1alpha3/artifacts/{ma.id}", json=payload, timeout=10, headers={"Content-Type": "application/json"})
assert response.status_code == 200
ma = client.get_model_artifact(name, version)
assert ma
assert ma.id
assert ma.model_format_name == "foo"
26 changes: 18 additions & 8 deletions internal/converter/openapi_reconciler_util.go
Original file line number Diff line number Diff line change
@@ -6,18 +6,28 @@ import (

func UpdateExistingArtifact(genc OpenAPIReconciler, source OpenapiUpdateWrapper[openapi.Artifact]) (openapi.Artifact, error) {
art := InitWithExisting(source)

if source.Update == nil {
return art, nil
}
ma, err := genc.UpdateExistingModelArtifact(OpenapiUpdateWrapper[openapi.ModelArtifact]{Existing: art.ModelArtifact, Update: source.Update.ModelArtifact})
if err != nil {
return art, err

if source.Update.ModelArtifact != nil {
ma, err := genc.UpdateExistingModelArtifact(OpenapiUpdateWrapper[openapi.ModelArtifact]{Existing: art.ModelArtifact, Update: source.Update.ModelArtifact})
if err != nil {
return art, err
}

art.ModelArtifact = &ma
}
da, err := genc.UpdateExistingDocArtifact(OpenapiUpdateWrapper[openapi.DocArtifact]{Existing: art.DocArtifact, Update: source.Update.DocArtifact})
if err != nil {
return art, err

if source.Update.DocArtifact != nil {
da, err := genc.UpdateExistingDocArtifact(OpenapiUpdateWrapper[openapi.DocArtifact]{Existing: art.DocArtifact, Update: source.Update.DocArtifact})
if err != nil {
return art, err
}

art.DocArtifact = &da
}
art.DocArtifact = &da
art.ModelArtifact = &ma

return art, nil
}
Original file line number Diff line number Diff line change
@@ -492,7 +492,8 @@ func (s *ModelRegistryServiceAPIService) UpdateArtifact(ctx context.Context, art
}
if artifactUpdate.DocArtifactUpdate != nil {
entity.DocArtifact.Id = &artifactId
} else {
}
if artifactUpdate.ModelArtifactUpdate != nil {
entity.ModelArtifact.Id = &artifactId
}
existing, err := s.coreApi.GetArtifactById(artifactId)