models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceTypeDataset  = "DATASET"
	DestinationTypeRun = "RUN"
)
View Source
const (
	TraceInfoStatusUnspecified = "TRACE_STATUS_UNSPECIFIED"
	TraceInfoStatusOk          = "OK"
	TraceInfoStatusError       = "ERROR"
	TraceInfoStatusInProgress  = "IN_PROGRESS"
)
View Source
const TableNameExperimentTag = "experiment_tags"

Variables

This section is empty.

Functions

This section is empty.

Types

type AlembicVersion

type AlembicVersion struct {
	VersionNum *string `db:"version_num" gorm:"column:version_num;primaryKey"`
}

AlembicVersion mapped from table <alembic_version>.

func (*AlembicVersion) TableName

func (*AlembicVersion) TableName() string

TableName AlembicVersion's table name.

type Dataset

type Dataset struct {
	ID           string `db:"dataset_uuid"        gorm:"column:dataset_uuid;not null"`
	ExperimentID int32  `db:"experiment_id"       gorm:"column:experiment_id;primaryKey"`
	Name         string `db:"name"                gorm:"column:name;primaryKey"`
	Digest       string `db:"digest"              gorm:"column:digest;primaryKey"`
	SourceType   string `db:"dataset_source_type" gorm:"column:dataset_source_type;not null"`
	Source       string `db:"dataset_source"      gorm:"column:dataset_source;not null"`
	Schema       string `db:"dataset_schema"      gorm:"column:dataset_schema"`
	Profile      string `db:"dataset_profile"     gorm:"column:dataset_profile"`
}

Dataset mapped from table <datasets>.

func (*Dataset) ToEntity

func (d *Dataset) ToEntity() *entities.Dataset

type Experiment

type Experiment struct {
	ID               int32          `gorm:"column:experiment_id;primaryKey;autoIncrement:true"`
	Name             string         `gorm:"column:name;not null"`
	ArtifactLocation string         `gorm:"column:artifact_location"`
	LifecycleStage   LifecycleStage `gorm:"column:lifecycle_stage"`
	CreationTime     int64          `gorm:"column:creation_time"`
	LastUpdateTime   int64          `gorm:"column:last_update_time"`
	Tags             []ExperimentTag
	Runs             []Run
}

Experiment mapped from table <experiments>.

func (Experiment) ToEntity

func (e Experiment) ToEntity() *entities.Experiment

type ExperimentTag

type ExperimentTag struct {
	Key          string `db:"key"           gorm:"column:key;primaryKey"`
	Value        string `db:"value"         gorm:"column:value"`
	ExperimentID int32  `db:"experiment_id" gorm:"column:experiment_id;primaryKey"`
}

ExperimentTag mapped from table <experiment_tags>.

type Input

type Input struct {
	ID              string     `db:"input_uuid"                          gorm:"column:input_uuid;not null"`
	SourceType      string     `db:"source_type"                         gorm:"column:source_type;primaryKey"`
	SourceID        string     `db:"source_id"                           gorm:"column:source_id;primaryKey"`
	DestinationType string     `db:"destination_type"                    gorm:"column:destination_type;primaryKey"`
	DestinationID   string     `db:"destination_id"                      gorm:"column:destination_id;primaryKey"`
	Tags            []InputTag `gorm:"foreignKey:InputID;references:ID"`
	Dataset         Dataset    `gorm:"foreignKey:ID;references:SourceID"`
}

Input mapped from table <inputs>.

func NewInputFromEntity

func NewInputFromEntity(
	id, sourceID, destinationID string,
) *Input

func (*Input) ToEntity

func (i *Input) ToEntity() *entities.DatasetInput

type InputTag

type InputTag struct {
	Key     string `gorm:"column:name;primaryKey"`
	Value   string `gorm:"column:value;not null"`
	InputID string `gorm:"column:input_uuid;primaryKey"`
}

InputTag mapped from table <input_tags>.

func NewInputTagFromEntity

func NewInputTagFromEntity(inputID string, tag *entities.InputTag) *InputTag

func (*InputTag) ToEntity

func (i *InputTag) ToEntity() *entities.InputTag

type LatestMetric

type LatestMetric struct {
	Key       string  `db:"key"       gorm:"column:key;primaryKey"`
	Value     float64 `db:"value"     gorm:"column:value;not null"`
	Timestamp int64   `db:"timestamp" gorm:"column:timestamp"`
	Step      int64   `db:"step"      gorm:"column:step;not null"`
	IsNaN     bool    `db:"is_nan"    gorm:"column:is_nan;not null"`
	RunID     string  `db:"run_uuid"  gorm:"column:run_uuid;primaryKey"`
}

LatestMetric mapped from table <latest_metrics>.

func (LatestMetric) ToEntity

func (lm LatestMetric) ToEntity() *entities.Metric

type LifecycleStage

type LifecycleStage string
const (
	LifecycleStageActive  LifecycleStage = "active"
	LifecycleStageDeleted LifecycleStage = "deleted"
)

func (LifecycleStage) String

func (s LifecycleStage) String() string

type Metric

type Metric struct {
	Key       string  `db:"key"       gorm:"column:key;primaryKey"`
	Value     float64 `db:"value"     gorm:"column:value;primaryKey"`
	Timestamp int64   `db:"timestamp" gorm:"column:timestamp;primaryKey"`
	RunID     string  `db:"run_uuid"  gorm:"column:run_uuid;primaryKey"`
	Step      int64   `db:"step"      gorm:"column:step;primaryKey"`
	IsNaN     bool    `db:"is_nan"    gorm:"column:is_nan;primaryKey"`
}

Metric mapped from table <metrics>.

func NewMetricFromEntity

func NewMetricFromEntity(runID string, metric *entities.Metric) *Metric

func (Metric) NewLatestMetricFromProto

func (m Metric) NewLatestMetricFromProto() LatestMetric

func (Metric) ToEntity

func (m Metric) ToEntity() *entities.Metric

type Param

type Param struct {
	Key   string         `db:"key"      gorm:"column:key;primaryKey"`
	Value sql.NullString `db:"value"    gorm:"column:value;not null"`
	RunID string         `db:"run_uuid" gorm:"column:run_uuid;primaryKey"`
}

Param mapped from table <params>.

func NewParamFromEntity

func NewParamFromEntity(runID string, entity *entities.Param) Param

func (Param) ToEntity

func (p Param) ToEntity() *entities.Param

type Run

type Run struct {
	ID             string         `db:"run_uuid"         gorm:"column:run_uuid;primaryKey"`
	Name           string         `db:"name"             gorm:"column:name"`
	SourceType     SourceType     `db:"source_type"      gorm:"column:source_type"`
	SourceName     string         `db:"source_name"      gorm:"column:source_name"`
	EntryPointName string         `db:"entry_point_name" gorm:"column:entry_point_name"`
	UserID         string         `db:"user_id"          gorm:"column:user_id"`
	Status         RunStatus      `db:"status"           gorm:"column:status"`
	StartTime      int64          `db:"start_time"       gorm:"column:start_time"`
	EndTime        sql.NullInt64  `db:"end_time"         gorm:"column:end_time"`
	SourceVersion  string         `db:"source_version"   gorm:"column:source_version"`
	LifecycleStage LifecycleStage `db:"lifecycle_stage"  gorm:"column:lifecycle_stage"`
	ArtifactURI    string         `db:"artifact_uri"     gorm:"column:artifact_uri"`
	ExperimentID   int32          `db:"experiment_id"    gorm:"column:experiment_id"`
	DeletedTime    sql.NullInt64  `db:"deleted_time"     gorm:"column:deleted_time"`
	Params         []Param
	Tags           []Tag
	Metrics        []Metric
	LatestMetrics  []LatestMetric
	Inputs         []Input `gorm:"foreignKey:DestinationID"`
}

Run mapped from table <runs>.

func (Run) ToEntity

func (r Run) ToEntity() *entities.Run

type RunStatus

type RunStatus string
const (
	RunStatusRunning   RunStatus = "RUNNING"
	RunStatusScheduled RunStatus = "SCHEDULED"
	RunStatusFinished  RunStatus = "FINISHED"
	RunStatusFailed    RunStatus = "FAILED"
	RunStatusKilled    RunStatus = "KILLED"
)

func (RunStatus) String

func (s RunStatus) String() string

type SourceType

type SourceType string
const (
	SourceTypeNotebook SourceType = "NOTEBOOK"
	SourceTypeJob      SourceType = "JOB"
	SourceTypeProject  SourceType = "PROJECT"
	SourceTypeLocal    SourceType = "LOCAL"
	SourceTypeUnknown  SourceType = "UNKNOWN"
	SourceTypeRecipe   SourceType = "RECIPE"
)

type Tag

type Tag struct {
	Key   string `db:"key"      gorm:"column:key;primaryKey"`
	Value string `db:"value"    gorm:"column:value"`
	RunID string `db:"run_uuid" gorm:"column:run_uuid;primaryKey"`
}

Tag mapped from table <tags>.

func NewTagFromEntity

func NewTagFromEntity(runID string, entity *entities.RunTag) Tag

func (Tag) ToEntity

func (t Tag) ToEntity() *entities.RunTag

type TraceInfo

type TraceInfo struct {
	RequestID            string                 `db:"request_id"             gorm:"column:request_id;primaryKey"`
	ExperimentID         string                 `db:"experiment_id"          gorm:"column:experiment_id"`
	TimestampMS          int64                  `db:"timestamp_ms"           gorm:"column:timestamp_ms"`
	ExecutionTimeMS      sql.NullInt64          `db:"execution_time_ms"      gorm:"column:execution_time_ms"`
	Status               string                 `db:"status"                 gorm:"column:status"`
	Tags                 []TraceTag             `gorm:"foreignKey:RequestID"`
	TraceRequestMetadata []TraceRequestMetadata `gorm:"foreignKey:RequestID"`
}

TraceInfo mapped from table <trace_info>.

func (TraceInfo) TableName

func (ti TraceInfo) TableName() string

func (TraceInfo) ToEntity

func (ti TraceInfo) ToEntity() *entities.TraceInfo

type TraceRequestMetadata

type TraceRequestMetadata struct {
	Key       string `db:"key"        gorm:"column:key;primaryKey"`
	Value     string `db:"value"      gorm:"column:value"`
	RequestID string `db:"request_id" gorm:"column:request_id;primaryKey"`
}

TraceRequestMetadata mapped from table <trace_request_metadata>.

func NewTraceRequestMetadataFromEntity

func NewTraceRequestMetadataFromEntity(
	requestID string, metadata *entities.TraceRequestMetadata,
) TraceRequestMetadata

func (TraceRequestMetadata) TableName

func (trm TraceRequestMetadata) TableName() string

func (TraceRequestMetadata) ToEntity

type TraceTag

type TraceTag struct {
	Key       string `db:"key"        gorm:"column:key;primaryKey"`
	Value     string `db:"value"      gorm:"column:value"`
	RequestID string `db:"request_id" gorm:"column:request_id;primaryKey"`
}

TraceTag mapped from table <trace_tags>.

func NewTraceTagFromEntity

func NewTraceTagFromEntity(requestID string, entity *entities.TraceTag) TraceTag

func (TraceTag) ToEntity

func (t TraceTag) ToEntity() *entities.TraceTag

Jump to

Keyboard shortcuts

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