datamodel

package
v0.10.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GCSServiceAccountJSONSchema *jsonschema.Schema

GCSServiceAccountJSONSchema represents the GCS Service Account JSON Schema for validating the payload

View Source
var GCSUserAccountJSONSchema *jsonschema.Schema

GCSUserAccountJSONSchema represents the GCS User Account JSON Schema for validating the payload

View Source
var ModelDefJSONSchema *jsonschema.Schema

ModelDefJSONSchema represents the ModelDefinition JSON Schema for validating the payload

View Source
var ModelInstanceCardJSONSchema *jsonschema.Schema

ModelInstanceCardJSONSchema represents the Model Instance Card JSON Schema for validating the payload

View Source
var ModelInstanceJSONSchema *jsonschema.Schema

ModelInstanceJSONSchema represents the Model Instance JSON Schema for validating the payload

View Source
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

func ValidateJSONSchema(schema *jsonschema.Schema, msg interface{}, emitUnpopulated bool) error

ValidateJSONSchema validates the Protobuf message data

func ValidateJSONSchemaString

func ValidateJSONSchemaString(schema *jsonschema.Schema, data string) error

ValidateJSONSchemaString validates the string data given a string schema

Types

type ArtiVCModelConfiguration

type ArtiVCModelConfiguration struct {
	Url        string         `json:"url,omitempty"`
	Credential datatypes.JSON `json:"credential,omitempty"`
}

type ArtiVCModelInstanceConfiguration

type ArtiVCModelInstanceConfiguration struct {
	Tag string `json:"tag,omitempty"`
	Url string `json:"url,omitempty"`
}

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 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 GCSUserAccount struct {
	Type         string `json:"type,omitempty"`
	ClientId     string `json:"client_id,omitempty"`
	ClientSecret string `json:"client_secret,omitempty"`
	RefreshToken string `json:"refresh_token,omitempty"`
}

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 HuggingFaceModelConfiguration

type HuggingFaceModelConfiguration struct {
	RepoId  string `json:"repo_id,omitempty"`
	HtmlUrl string `json:"html_url,omitempty"`
}

type HuggingFaceModelInstanceConfiguration

type HuggingFaceModelInstanceConfiguration struct {
	RepoId  string `json:"repo_id,omitempty"`
	HtmlUrl string `json:"html_url,omitempty"`
}

type ListModelQuery

type ListModelQuery struct {
	Owner string
}

type LocalModelConfiguration

type LocalModelConfiguration struct {
	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 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"`

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

	ReleaseStage ReleaseStage `sql:"type:valid_release_stage"`
}

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 ModelInstanceInferResult

type ModelInstanceInferResult struct {
	BaseDynamic

	// Inference id: `instance model id.{datetime}.infer` created by temporal
	ID string `json:"id,omitempty"`

	// Inference result
	Result datatypes.JSON `json:"result,omitempty"`

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

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 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

func (ReleaseStage) Value

func (r ReleaseStage) Value() (driver.Value, error)

Value 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 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