Documentation ¶
Overview ¶
Package datamodel contains the data models for the API.
Index ¶
- Variables
- func InitJSONSchema()
- func ValidateJSONSchema(schema *jsonschema.Schema, msg interface{}, emitUnpopulated bool) error
- func ValidateJSONSchemaString(schema *jsonschema.Schema, data string) error
- type ArtiVCModelConfiguration
- type BaseDynamic
- type BaseStatic
- type Error
- type GCSServiceAccount
- type GCSUserAccount
- type GitHubModelConfiguration
- type HuggingFaceModelConfiguration
- type ListModelQuery
- type LocalModelConfiguration
- type Model
- type ModelDefinition
- type ModelInferResult
- type ModelState
- type ModelTask
- type ModelVisibility
- type ReleaseStage
- type TritonModel
Constants ¶
This section is empty.
Variables ¶
var GCSServiceAccountJSONSchema *jsonschema.Schema
GCSServiceAccountJSONSchema represents the GCS Service Account JSON Schema for validating the payload
var GCSUserAccountJSONSchema *jsonschema.Schema
GCSUserAccountJSONSchema represents the GCS User Account JSON Schema for validating the payload
var ModelCardJSONSchema *jsonschema.Schema
ModelCardJSONSchema represents the Model Instance Card JSON Schema for validating the payload
var ModelDefJSONSchema *jsonschema.Schema
ModelDefJSONSchema represents the ModelDefinition JSON Schema for validating the payload
var ModelJSONSchema *jsonschema.Schema
ModelJSONSchema represents the Model JSON Schema for validating the payload
Functions ¶
func InitJSONSchema ¶
func InitJSONSchema()
InitJSONSchema initialise JSON Schema instances with the given files
func ValidateJSONSchema ¶
ValidateJSONSchema validates the Protobuf message data
func ValidateJSONSchemaString ¶
ValidateJSONSchemaString validates the string data given a string schema
Types ¶
type BaseDynamic ¶
type BaseDynamic struct { UID uuid.UUID `gorm:"type:uuid;primary_key;<-:create"` // allow read and create CreateTime time.Time `gorm:"autoCreateTime:nano"` UpdateTime time.Time `gorm:"autoUpdateTime:nano"` DeleteTime gorm.DeletedAt `sql:"index"` }
BaseDynamic contains common columns for all tables with dynamic UUID as primary key generated when creating
func (*BaseDynamic) BeforeCreate ¶
func (base *BaseDynamic) BeforeCreate(db *gorm.DB) error
BeforeCreate will set a UUID rather than numeric ID.
type BaseStatic ¶
type Error ¶
type Error struct { // Error code Status int32 `json:"status"` // Short description of the error Title string `json:"title"` // Human-readable error message Detail string `json:"detail"` }
Error represents the error response.
type GCSServiceAccount ¶
type GCSServiceAccount struct { Type string `json:"type,omitempty"` ProjectId string `json:"project_id,omitempty"` PrivateKeyId string `json:"private_key_id,omitempty"` PrivateKey string `json:"private_key,omitempty"` ClientEmail string `json:"client_email,omitempty"` ClientId string `json:"client_id,omitempty"` AuthUri string `json:"auth_uri,omitempty"` TokenUri string `json:"token_uri,omitempty"` AuthProviderX509CertUrl string `json:"auth_provider_x509_cert_url,omitempty"` ClientX509CertUrl string `json:"client_x509_cert_url,omitempty"` }
type GCSUserAccount ¶
type GitHubModelConfiguration ¶
type GitHubModelConfiguration struct { Repository string `json:"repository,omitempty"` Tag string `json:"tag,omitempty"` HtmlUrl string `json:"html_url,omitempty"` }
Model configuration
type ListModelQuery ¶
type ListModelQuery struct {
Owner string
}
type LocalModelConfiguration ¶
type Model ¶
type Model struct { BaseDynamic // Model id ID string `json:"id,omitempty"` // Model description Description sql.NullString // Model definition ModelDefinitionUid uuid.UUID `gorm:"model_definition_uid,omitempty"` // Model definition configuration Configuration datatypes.JSON `json:"configuration,omitempty"` // Model visibility Visibility ModelVisibility `json:"visibility,omitempty"` // Model owner Owner string `json:"owner,omitempty"` // Model task Task ModelTask `json:"task,omitempty"` // Model state State ModelState `json:"state,omitempty"` // Not stored in DB, only used for processing TritonModels []TritonModel `gorm:"foreignKey:ModelUID;references:UID;constraint:OnDelete:CASCADE;"` }
Model combines several Triton model. It includes ensemble model.
type ModelDefinition ¶
type ModelDefinition struct { BaseStatic // ModelDefinition id ID string `json:"id,omitempty"` // ModelDefinition title Title string `json:"title,omitempty"` // ModelDefinition documentation_url DocumentationUrl string `json:"documentation_url,omitempty"` // ModelDefinition icon Icon string `json:"icon,omitempty"` // ModelDefinition model spec ModelSpec datatypes.JSON `json:"model_spec,omitempty"` ReleaseStage ReleaseStage `sql:"type:valid_release_stage"` }
type ModelInferResult ¶
type ModelState ¶
type ModelState modelPB.Model_State
func (*ModelState) Scan ¶
func (s *ModelState) Scan(value interface{}) error
type ModelTask ¶
type ModelTask modelPB.Model_Task
type ModelVisibility ¶
type ModelVisibility modelPB.Model_Visibility
func (*ModelVisibility) Scan ¶
func (v *ModelVisibility) Scan(value interface{}) error
type ReleaseStage ¶
type ReleaseStage modelPB.ReleaseStage
ReleaseStage is an alias type for Protobuf enum ReleaseStage
func (*ReleaseStage) Scan ¶
func (r *ReleaseStage) Scan(value interface{}) error
Scan function for custom GORM type ReleaseStage
type TritonModel ¶
type TritonModel struct { BaseDynamic // Triton Model name Name string `json:"name,omitempty"` // Triton Model version Version int `json:"version,omitempty"` // Triton Model status State ModelState `json:"state,omitempty"` // Model triton platform, only store ensemble model to make inferencing Platform string `json:"platform,omitempty"` // Model uid ModelUID uuid.UUID `json:"model_uid,omitempty"` }
Triton model