Skip to content

Commit 8e3e6a5

Browse files
rareddypboyd
andauthored
API Simplification - Flatten base types (kubeflow#1090)
* chore(openapi): flatten base types Signed-off-by: Paul Boyd <[email protected]> * Simplification of the API of the Model Registry by reducing nested objects and making the API little flat Signed-off-by: Ramesh Reddy <[email protected]> --------- Signed-off-by: Paul Boyd <[email protected]> Signed-off-by: Ramesh Reddy <[email protected]> Co-authored-by: Paul Boyd <[email protected]>
1 parent cbf228f commit 8e3e6a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+816
-3554
lines changed

api/openapi/model-registry.yaml

Lines changed: 87 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,73 +1188,68 @@ components:
11881188
mapping:
11891189
model-artifact: "#/components/schemas/ModelArtifactUpdate"
11901190
doc-artifact: "#/components/schemas/DocArtifactUpdate"
1191-
BaseArtifact:
1192-
allOf:
1193-
- $ref: "#/components/schemas/BaseArtifactCreate"
1194-
- $ref: "#/components/schemas/BaseResource"
1195-
BaseArtifactCreate:
1196-
allOf:
1197-
- $ref: "#/components/schemas/BaseArtifactUpdate"
1198-
- $ref: "#/components/schemas/BaseResourceCreate"
1199-
BaseArtifactUpdate:
1200-
allOf:
1201-
- $ref: "#/components/schemas/BaseResourceUpdate"
1202-
- type: object
1203-
properties:
1204-
uri:
1205-
description: |-
1206-
The uniform resource identifier of the physical artifact.
1207-
May be empty if there is no physical artifact.
1208-
type: string
1209-
state:
1210-
$ref: "#/components/schemas/ArtifactState"
1211-
BaseExecution:
1212-
allOf:
1213-
- $ref: "#/components/schemas/BaseExecutionCreate"
1214-
- $ref: "#/components/schemas/BaseResource"
1215-
BaseExecutionCreate:
1216-
allOf:
1217-
- $ref: "#/components/schemas/BaseExecutionUpdate"
1218-
- $ref: "#/components/schemas/BaseResourceCreate"
1219-
BaseExecutionUpdate:
1220-
allOf:
1221-
- type: object
1222-
properties:
1223-
lastKnownState:
1224-
$ref: "#/components/schemas/ExecutionState"
1225-
- $ref: "#/components/schemas/BaseResourceUpdate"
12261191
BaseResource:
1227-
allOf:
1228-
- $ref: "#/components/schemas/BaseResourceCreate"
1229-
- type: object
1230-
properties:
1231-
id:
1232-
format: int64
1233-
description: The unique server generated id of the resource.
1234-
type: string
1235-
createTimeSinceEpoch:
1236-
format: int64
1237-
description: Output only. Create time of the resource in millisecond since epoch.
1238-
type: string
1239-
readOnly: true
1240-
lastUpdateTimeSinceEpoch:
1241-
format: int64
1242-
description: |-
1243-
Output only. Last update time of the resource since epoch in millisecond
1244-
since epoch.
1245-
type: string
1246-
readOnly: true
1192+
type: object
1193+
properties:
1194+
customProperties:
1195+
description: User provided custom properties which are not defined by its type.
1196+
type: object
1197+
additionalProperties:
1198+
$ref: "#/components/schemas/MetadataValue"
1199+
description:
1200+
description: |-
1201+
An optional description about the resource.
1202+
type: string
1203+
externalId:
1204+
description: |-
1205+
The external id that come from the clients’ system. This field is optional.
1206+
If set, it must be unique among all resources within a database instance.
1207+
type: string
1208+
name:
1209+
description: |-
1210+
The client provided name of the artifact. This field is optional. If set,
1211+
it must be unique among all the artifacts of the same artifact type within
1212+
a database instance and cannot be changed once set.
1213+
type: string
1214+
id:
1215+
format: int64
1216+
description: The unique server generated id of the resource.
1217+
type: string
1218+
createTimeSinceEpoch:
1219+
format: int64
1220+
description: Output only. Create time of the resource in millisecond since epoch.
1221+
type: string
1222+
readOnly: true
1223+
lastUpdateTimeSinceEpoch:
1224+
format: int64
1225+
description: |-
1226+
Output only. Last update time of the resource since epoch in millisecond
1227+
since epoch.
1228+
type: string
1229+
readOnly: true
12471230
BaseResourceCreate:
1248-
allOf:
1249-
- $ref: "#/components/schemas/BaseResourceUpdate"
1250-
- type: object
1251-
properties:
1252-
name:
1253-
description: |-
1254-
The client provided name of the artifact. This field is optional. If set,
1255-
it must be unique among all the artifacts of the same artifact type within
1256-
a database instance and cannot be changed once set.
1257-
type: string
1231+
type: object
1232+
properties:
1233+
customProperties:
1234+
description: User provided custom properties which are not defined by its type.
1235+
type: object
1236+
additionalProperties:
1237+
$ref: "#/components/schemas/MetadataValue"
1238+
description:
1239+
description: |-
1240+
An optional description about the resource.
1241+
type: string
1242+
externalId:
1243+
description: |-
1244+
The external id that come from the clients’ system. This field is optional.
1245+
If set, it must be unique among all resources within a database instance.
1246+
type: string
1247+
name:
1248+
description: |-
1249+
The client provided name of the artifact. This field is optional. If set,
1250+
it must be unique among all the artifacts of the same artifact type within
1251+
a database instance and cannot be changed once set.
1252+
type: string
12581253
BaseResourceList:
12591254
required:
12601255
- nextPageToken
@@ -1293,7 +1288,7 @@ components:
12931288
DocArtifact:
12941289
description: A document.
12951290
allOf:
1296-
- $ref: "#/components/schemas/BaseArtifact"
1291+
- $ref: "#/components/schemas/BaseResource"
12971292
- $ref: "#/components/schemas/DocArtifactCreate"
12981293
- type: object
12991294
properties:
@@ -1303,7 +1298,7 @@ components:
13031298
DocArtifactCreate:
13041299
description: A document artifact to be created.
13051300
allOf:
1306-
- $ref: "#/components/schemas/BaseArtifactCreate"
1301+
- $ref: "#/components/schemas/BaseResourceCreate"
13071302
- $ref: "#/components/schemas/DocArtifactUpdate"
13081303
- type: object
13091304
properties:
@@ -1313,12 +1308,19 @@ components:
13131308
DocArtifactUpdate:
13141309
description: A document artifact to be updated.
13151310
allOf:
1316-
- $ref: "#/components/schemas/BaseArtifactUpdate"
1311+
- $ref: "#/components/schemas/BaseResourceUpdate"
13171312
- type: object
13181313
properties:
13191314
artifactType:
13201315
type: string
13211316
default: "doc-artifact"
1317+
uri:
1318+
description: |-
1319+
The uniform resource identifier of the physical artifact.
1320+
May be empty if there is no physical artifact.
1321+
type: string
1322+
state:
1323+
$ref: "#/components/schemas/ArtifactState"
13221324
Error:
13231325
description: Error code and message.
13241326
required:
@@ -1527,7 +1529,7 @@ components:
15271529
ModelArtifact:
15281530
description: An ML model artifact.
15291531
allOf:
1530-
- $ref: "#/components/schemas/BaseArtifact"
1532+
- $ref: "#/components/schemas/BaseResource"
15311533
- $ref: "#/components/schemas/ModelArtifactCreate"
15321534
- type: object
15331535
properties:
@@ -1541,7 +1543,7 @@ components:
15411543
type: string
15421544
default: "model-artifact"
15431545
allOf:
1544-
- $ref: "#/components/schemas/BaseArtifactCreate"
1546+
- $ref: "#/components/schemas/BaseResourceCreate"
15451547
- $ref: "#/components/schemas/ModelArtifactUpdate"
15461548
ModelArtifactList:
15471549
description: List of ModelArtifact entities.
@@ -1559,7 +1561,7 @@ components:
15591561
ModelArtifactUpdate:
15601562
description: An ML model artifact to be updated.
15611563
allOf:
1562-
- $ref: "#/components/schemas/BaseArtifactUpdate"
1564+
- $ref: "#/components/schemas/BaseResourceUpdate"
15631565
- type: object
15641566
properties:
15651567
artifactType:
@@ -1600,6 +1602,13 @@ components:
16001602
modelSourceName:
16011603
type: string
16021604
description: "A human-readable name for the source model. \nE.g. `my-project/1`, `ibm-granite/granite-3.1-8b-base:2.1.2`."
1605+
uri:
1606+
description: |-
1607+
The uniform resource identifier of the physical artifact.
1608+
May be empty if there is no physical artifact.
1609+
type: string
1610+
state:
1611+
$ref: "#/components/schemas/ArtifactState"
16031612
ModelVersion:
16041613
description: Represents a ModelVersion belonging to a RegisteredModel.
16051614
allOf:
@@ -1718,14 +1727,14 @@ components:
17181727
ServeModel:
17191728
description: An ML model serving action.
17201729
allOf:
1721-
- $ref: "#/components/schemas/BaseExecution"
1730+
- $ref: "#/components/schemas/BaseResource"
17221731
- $ref: "#/components/schemas/ServeModelCreate"
17231732
ServeModelCreate:
17241733
description: An ML model serving action.
17251734
required:
17261735
- modelVersionId
17271736
allOf:
1728-
- $ref: "#/components/schemas/BaseExecutionCreate"
1737+
- $ref: "#/components/schemas/BaseResourceCreate"
17291738
- $ref: "#/components/schemas/ServeModelUpdate"
17301739
- type: object
17311740
properties:
@@ -1748,7 +1757,11 @@ components:
17481757
ServeModelUpdate:
17491758
description: An ML model serving action.
17501759
allOf:
1751-
- $ref: "#/components/schemas/BaseExecutionUpdate"
1760+
- $ref: "#/components/schemas/BaseResourceUpdate"
1761+
- type: object
1762+
properties:
1763+
lastKnownState:
1764+
$ref: "#/components/schemas/ExecutionState"
17521765
ServingEnvironment:
17531766
description: A Model Serving environment for serving `RegisteredModels`.
17541767
allOf:

clients/python/src/.openapi-generator/FILES

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ mr_openapi/models/artifact_create.py
1111
mr_openapi/models/artifact_list.py
1212
mr_openapi/models/artifact_state.py
1313
mr_openapi/models/artifact_update.py
14-
mr_openapi/models/base_artifact.py
15-
mr_openapi/models/base_artifact_create.py
16-
mr_openapi/models/base_artifact_update.py
17-
mr_openapi/models/base_execution.py
18-
mr_openapi/models/base_execution_create.py
19-
mr_openapi/models/base_execution_update.py
2014
mr_openapi/models/base_resource.py
2115
mr_openapi/models/base_resource_create.py
2216
mr_openapi/models/base_resource_list.py

clients/python/src/mr_openapi/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,6 @@ Class | Method | HTTP request | Description
122122
- [ArtifactList](mr_openapi/docs/ArtifactList.md)
123123
- [ArtifactState](mr_openapi/docs/ArtifactState.md)
124124
- [ArtifactUpdate](mr_openapi/docs/ArtifactUpdate.md)
125-
- [BaseArtifact](mr_openapi/docs/BaseArtifact.md)
126-
- [BaseArtifactCreate](mr_openapi/docs/BaseArtifactCreate.md)
127-
- [BaseArtifactUpdate](mr_openapi/docs/BaseArtifactUpdate.md)
128-
- [BaseExecution](mr_openapi/docs/BaseExecution.md)
129-
- [BaseExecutionCreate](mr_openapi/docs/BaseExecutionCreate.md)
130-
- [BaseExecutionUpdate](mr_openapi/docs/BaseExecutionUpdate.md)
131125
- [BaseResource](mr_openapi/docs/BaseResource.md)
132126
- [BaseResourceCreate](mr_openapi/docs/BaseResourceCreate.md)
133127
- [BaseResourceList](mr_openapi/docs/BaseResourceList.md)

clients/python/src/mr_openapi/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@
3636
from mr_openapi.models.artifact_list import ArtifactList
3737
from mr_openapi.models.artifact_state import ArtifactState
3838
from mr_openapi.models.artifact_update import ArtifactUpdate
39-
from mr_openapi.models.base_artifact import BaseArtifact
40-
from mr_openapi.models.base_artifact_create import BaseArtifactCreate
41-
from mr_openapi.models.base_artifact_update import BaseArtifactUpdate
42-
from mr_openapi.models.base_execution import BaseExecution
43-
from mr_openapi.models.base_execution_create import BaseExecutionCreate
44-
from mr_openapi.models.base_execution_update import BaseExecutionUpdate
4539
from mr_openapi.models.base_resource import BaseResource
4640
from mr_openapi.models.base_resource_create import BaseResourceCreate
4741
from mr_openapi.models.base_resource_list import BaseResourceList

clients/python/src/mr_openapi/models/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
from mr_openapi.models.artifact_list import ArtifactList
2020
from mr_openapi.models.artifact_state import ArtifactState
2121
from mr_openapi.models.artifact_update import ArtifactUpdate
22-
from mr_openapi.models.base_artifact import BaseArtifact
23-
from mr_openapi.models.base_artifact_create import BaseArtifactCreate
24-
from mr_openapi.models.base_artifact_update import BaseArtifactUpdate
25-
from mr_openapi.models.base_execution import BaseExecution
26-
from mr_openapi.models.base_execution_create import BaseExecutionCreate
27-
from mr_openapi.models.base_execution_update import BaseExecutionUpdate
2822
from mr_openapi.models.base_resource import BaseResource
2923
from mr_openapi.models.base_resource_create import BaseResourceCreate
3024
from mr_openapi.models.base_resource_list import BaseResourceList

0 commit comments

Comments
 (0)