datamodel

package
v0.4.2-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 BaseStatic struct {
	UID        uuid.UUID      `gorm:"type:uuid;primary_key;"`
	CreateTime time.Time      `gorm:"autoCreateTime:nano"`
	UpdateTime time.Time      `gorm:"autoUpdateTime:nano"`
	DeleteTime gorm.DeletedAt `sql:"index"`
}

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"`
}

type GitHubModelConfiguration

type GitHubModelConfiguration struct {
	Repository string `json:"repository,omitempty"`
	HtmlUrl    string `json:"html_url,omitempty"`
}

Model configuration

type GitHubModelInstanceConfiguration

type GitHubModelInstanceConfiguration struct {
	Repository string `json:"repository,omitempty"`
	Tag        string `json:"tag,omitempty"`
	HtmlUrl    string `json:"html_url,omitempty"`
}

Model Instance configuration

type ListModelQuery

type ListModelQuery struct {
	Owner string
}

type LocalModelConfiguration

type LocalModelConfiguration struct {
	Description string `json:"description,omitempty"`
	Content     string `json:"content,omitempty"`
}

type LocalModelInstanceConfiguration

type LocalModelInstanceConfiguration struct {
	ID      string `json:"id,omitempty"`
	Content string `json:"content,omitempty"`
}

type Model

type Model struct {
	BaseDynamic

	// Model id
	ID string `json:"id,omitempty"`

	// Model description
	Description string `json:"description,omitempty"`

	// Model definition
	ModelDefinitionUid uuid.UUID `json:"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"`

	// Not stored in DB, only used for processing
	Instances []ModelInstance `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"`

	// ModelDefinition model instance spec
	ModelInstanceSpec datatypes.JSON `json:"model_instance_spec,omitempty"`
}

type ModelInstance

type ModelInstance struct {
	BaseDynamic

	// Model Instance id
	ID string `json:"id,omitempty"`

	// Model instance status
	State ModelInstanceState `sql:"type:valid_state"`

	// Model instance task
	Task ModelInstanceTask `json:"task,omitempty"`

	// Model instance configuration
	Configuration datatypes.JSON `json:"configuration,omitempty"`

	// Model id
	ModelUID uuid.UUID `json:"model_uid,omitempty"`

	// Not stored in DB, only used for processing
	TritonModels []TritonModel `gorm:"foreignKey:ModelInstanceUID;references:UID;constraint:OnDelete:CASCADE;"`
}

func (*ModelInstance) Scan

func (r *ModelInstance) Scan(value interface{}) error

func (*ModelInstance) Value

func (r *ModelInstance) Value() (driver.Value, error)

type ModelInstanceState

type ModelInstanceState modelPB.ModelInstance_State

func (*ModelInstanceState) Scan

func (s *ModelInstanceState) Scan(value interface{}) error

func (ModelInstanceState) Value

func (s ModelInstanceState) Value() (driver.Value, error)

type ModelInstanceTask

type ModelInstanceTask modelPB.ModelInstance_Task

func (*ModelInstanceTask) Scan

func (s *ModelInstanceTask) Scan(value interface{}) error

func (ModelInstanceTask) Value

func (s ModelInstanceTask) Value() (driver.Value, error)

type ModelVisibility

type ModelVisibility modelPB.Model_Visibility

func (*ModelVisibility) Scan

func (v *ModelVisibility) Scan(value interface{}) error

func (ModelVisibility) Value

func (v ModelVisibility) Value() (driver.Value, error)

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 ModelInstanceState `json:"state,omitempty"`

	// Model triton platform, only store ensemble model to make inferencing
	Platform string `json:"platform,omitempty"`

	// Model Instance uid
	ModelInstanceUID uuid.UUID `json:"model_instance_uid,omitempty"`
}

Triton model

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL