forked from kubeflow/pipelines
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* trained model api * remove frameworks' version information
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package v1beta1 | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/api/resource" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +k8s:openapi-gen=true | ||
// +kubebuilder:object:root=true | ||
type TrainedModel struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
Spec TrainedModelSpec `json:"spec,omitempty"` | ||
Status TrainedModelStatus `json:"status,omitempty"` | ||
} | ||
|
||
// TrainedModelList contains a list of TrainedModel | ||
// +kubebuilder:object:root=true | ||
type TrainedModelList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
// +listType=set | ||
Items []TrainedModel `json:"items"` | ||
} | ||
|
||
type TrainedModelSpec struct { | ||
// Required field for parent inference service | ||
InferenceService string `json:"inferenceService"` | ||
// Predictor model spec | ||
PredictorModel ModelSpec `json:"predictorModel"` | ||
} | ||
type ModelSpec struct { | ||
// Storage URI for the model repository | ||
StorageURI string `json:"storageUri"` | ||
// Machine Learning <framework name> | ||
// The values could be: "tensorflow","pytorch","sklearn","onnx","xgboost", "myawesomeinternalframework" etc. | ||
Framework string `json:"framework"` | ||
// Maximum memory this model will consume, this field is used to decide if a model server has enough memory to load this model. | ||
Memory resource.Quantity `json:"memory,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package v1beta1 | ||
|
||
import ( | ||
duckv1beta1 "knative.dev/pkg/apis/duck/v1beta1" | ||
) | ||
|
||
type TrainedModelStatus struct { | ||
// Condition for "Deployed" | ||
duckv1beta1.Status `json:",inline"` | ||
// Addressable endpoint for the deployed trained model | ||
// http://<inferenceservice.metadata.name>/v1/models/<trainedmodel>.metadata.name | ||
Address *duckv1beta1.Addressable `json:"address,omitempty"` | ||
} |