Documentation
¶
Overview ¶
Code generated by 'make migrations-rebuild'; DO NOT EDIT.
Index ¶
- Constants
- Variables
- func ApplyNamespaceRestriction(table string, item map[string]any, namespace *Namespace) map[string]any
- func CheckAndMigrateDB(migrate bool, db *gorm.DB) error
- func CreateDefaultExperiment(db *gorm.DB, defaultArtifactRoot string) error
- func CreateDefaultMetricContext(db *gorm.DB) error
- func CreateDefaultNamespace(db *gorm.DB) error
- func EntityLimitedByNamespace(table string, db *gorm.DB, namespace *Namespace) *gorm.DB
- func NewLoggerAdaptor(l *logrus.Logger, cfg LoggerAdaptorConfig) logger.Interface
- func NewUUID() string
- func WithDestinationNamespace(namespace string) func(importer *Importer)
- func WithSourceNamespace(namespace string) func(importer *Importer)
- type AlembicVersion
- type App
- type AppState
- type Artifact
- type Base
- type Context
- type DBInstance
- type DBProvider
- type Dashboard
- type Experiment
- type ExperimentTag
- type Importer
- type LatestMetric
- type LifecycleStage
- type Log
- type LoggerAdaptorConfig
- type Metric
- type Namespace
- type Param
- type PostgresDBInstance
- type Role
- type RoleNamespace
- type RowNum
- type Run
- type RunSharedTag
- type SchemaVersion
- type SharedTag
- type SqliteDBInstance
- type Status
- type Tag
Constants ¶
const ( SQLiteSchemaName = "sqlite" PostgresSchemaName = "postgres" PostgresQLSchemaName = "postgresql" )
list of supported database schemas.
const ( SQLiteDialectorName = "sqlite" PostgresDialectorName = "postgres" )
list of supported dialects.
const ( DefaultExperimentID = int32(0) DefaultExperimentName = "Default" )
Default Experiment properties.
const (
SQLiteCustomDriverName = "sqlite3_custom_driver"
)
Variables ¶
var DB *gorm.DB
DB is a global gorm.DB reference
Functions ¶
func ApplyNamespaceRestriction ¶
func ApplyNamespaceRestriction(table string, item map[string]any, namespace *Namespace) map[string]any
ApplyNamespaceRestriction overwrite Namespace if it is needed.
func CheckAndMigrateDB ¶ added in v0.4.0
CheckAndMigrateDB makes database migration. nolint:gocyclo
func CreateDefaultExperiment ¶ added in v0.4.0
CreateDefaultExperiment creates the default experiment if it doesn't exist.
func CreateDefaultMetricContext ¶ added in v0.5.0
CreateDefaultMetricContext creates the default metric context if it doesn't exist.
func CreateDefaultNamespace ¶ added in v0.4.0
CreateDefaultNamespace creates the default namespace if it doesn't exist.
func EntityLimitedByNamespace ¶
EntityLimitedByNamespace represents scope function that limits current query by Namespace.
func NewLoggerAdaptor ¶ added in v0.3.1
func NewLoggerAdaptor(l *logrus.Logger, cfg LoggerAdaptorConfig) logger.Interface
NewLoggerAdaptor creates a new logger adaptor.
func WithDestinationNamespace ¶
WithDestinationNamespace sets Importer destination Namespace.
func WithSourceNamespace ¶
WithSourceNamespace sets Importer source Namespace.
Types ¶
type AlembicVersion ¶
type AlembicVersion struct {
Version string `gorm:"column:version_num;type:varchar(32);not null;primaryKey"`
}
func (AlembicVersion) TableName ¶
func (AlembicVersion) TableName() string
type AppState ¶
func (AppState) GormDataType ¶
type Artifact ¶
type Artifact struct {
Base
Name string `gorm:"not null;index"`
Iter int64 `gorm:"index"`
Step int64 `gorm:"default:0;not null"`
Run Run
RunID string `gorm:"column:run_uuid;not null;index;constraint:OnDelete:CASCADE"`
Index int64
Width int64
Height int64
Format string
Caption string
BlobURI string
}
type Base ¶
type Context ¶ added in v0.5.0
type Context struct {
ID uint `gorm:"primaryKey;autoIncrement"`
Json types.JSONB `gorm:"not null;unique;index"`
}
func (Context) GetJsonHash ¶ added in v0.5.0
GetJsonHash returns hash of the Context.Json
type DBInstance ¶ added in v0.3.0
DBInstance is the base concrete type for DbProvider.
func (*DBInstance) Close ¶ added in v0.3.0
func (db *DBInstance) Close() error
Close invokes the closers.
func (*DBInstance) Dsn ¶ added in v0.3.0
func (db *DBInstance) Dsn() string
Dsn returns the dsn string.
func (*DBInstance) GormDB ¶ added in v0.3.0
func (db *DBInstance) GormDB() *gorm.DB
GormDB returns the gorm DB.
type DBProvider ¶ added in v0.3.0
DBProvider is the interface to access the DB.
func NewDBProvider ¶ added in v0.4.0
func NewDBProvider( dsn string, slowThreshold time.Duration, poolMax int, ) (db DBProvider, err error)
NewDBProvider creates a DBProvider of the correct type from the parameters.
type Dashboard ¶
type Dashboard struct {
Base
Name string `json:"name"`
Description string `json:"description"`
AppID *uuid.UUID `gorm:"type:uuid" json:"app_id"`
App App `json:"-"`
IsArchived bool `json:"-"`
}
func (Dashboard) MarshalJSON ¶
type Experiment ¶
type Experiment struct {
ID *int32 `gorm:"column:experiment_id;not null;primaryKey"`
Name string `gorm:"type:varchar(256);not null;index:,unique,composite:name"`
ArtifactLocation string `gorm:"type:varchar(256)"`
LifecycleStage LifecycleStage `gorm:"type:varchar(32);check:lifecycle_stage IN ('active', 'deleted')"`
CreationTime sql.NullInt64 `gorm:"type:bigint"`
LastUpdateTime sql.NullInt64 `gorm:"type:bigint"`
NamespaceID uint `gorm:"not null;index:,unique,composite:name"`
Namespace Namespace
Tags []ExperimentTag `gorm:"constraint:OnDelete:CASCADE"`
Runs []Run `gorm:"constraint:OnDelete:CASCADE"`
}
type ExperimentTag ¶
type Importer ¶ added in v0.3.0
type Importer struct {
// contains filtered or unexported fields
}
Importer will handle the transport of data from source to destination db.
func NewImporter ¶ added in v0.3.0
NewImporter initializes an Importer.
type LatestMetric ¶
type LatestMetric struct {
Key string `gorm:"type:varchar(250);not null;primaryKey"`
Value float64 `gorm:"type:double precision;not null"`
Timestamp int64
Step int64 `gorm:"not null"`
IsNan bool `gorm:"not null"`
RunID string `gorm:"column:run_uuid;not null;primaryKey;index"`
LastIter int64
ContextID uint `gorm:"not null;primaryKey"`
Context Context
}
type LifecycleStage ¶
type LifecycleStage string
const ( LifecycleStageActive LifecycleStage = "active" LifecycleStageDeleted LifecycleStage = "deleted" )
type LoggerAdaptorConfig ¶ added in v0.3.1
type Metric ¶
type Metric struct {
Key string `gorm:"type:varchar(250);not null;primaryKey"`
Value float64 `gorm:"type:double precision;not null;primaryKey"`
Timestamp int64 `gorm:"not null;primaryKey"`
RunID string `gorm:"column:run_uuid;not null;primaryKey;index"`
Step int64 `gorm:"default:0;not null;primaryKey"`
IsNan bool `gorm:"default:false;not null;primaryKey"`
Iter int64 `gorm:"index"`
ContextID uint `gorm:"not null;primaryKey"`
Context Context
}
type Namespace ¶ added in v0.4.0
type Namespace struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
Apps []App `gorm:"constraint:OnDelete:CASCADE" json:"apps"`
Code string `gorm:"unique;index;not null" json:"code"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
DefaultExperimentID *int32 `gorm:"not null" json:"default_experiment_id"`
Experiments []Experiment `gorm:"constraint:OnDelete:CASCADE" json:"experiments"`
}
type PostgresDBInstance ¶ added in v0.3.0
type PostgresDBInstance struct {
DBInstance
}
PostgresDBInstance is the Postgres-specific DbInstance variant.
func NewPostgresDBInstance ¶ added in v0.3.0
func NewPostgresDBInstance( dsnURL url.URL, slowThreshold time.Duration, poolMax int, ) (*PostgresDBInstance, error)
NewPostgresDBInstance constructs a Postgres DbInstance.
func (PostgresDBInstance) Reset ¶ added in v0.3.0
func (pgdb PostgresDBInstance) Reset() error
Reset resets database.
type RoleNamespace ¶ added in v0.6.0
type Run ¶
type Run struct {
ID string `gorm:"<-:create;column:run_uuid;type:varchar(32);not null;primaryKey"`
Name string `gorm:"type:varchar(250)"`
SourceType string `gorm:"<-:create;type:varchar(20);check:source_type IN ('NOTEBOOK', 'JOB', 'LOCAL', 'UNKNOWN', 'PROJECT')"`
SourceName string `gorm:"<-:create;type:varchar(500)"`
EntryPointName string `gorm:"<-:create;type:varchar(50)"`
UserID string `gorm:"<-:create;type:varchar(256)"`
Status Status `gorm:"type:varchar(9);check:status IN ('SCHEDULED', 'FAILED', 'FINISHED', 'RUNNING', 'KILLED')"`
StartTime sql.NullInt64 `gorm:"<-:create;type:bigint"`
EndTime sql.NullInt64 `gorm:"type:bigint"`
SourceVersion string `gorm:"<-:create;type:varchar(50)"`
LifecycleStage LifecycleStage `gorm:"type:varchar(20);check:lifecycle_stage IN ('active', 'deleted')"`
ArtifactURI string `gorm:"<-:create;type:varchar(200)"`
ExperimentID int32
Experiment Experiment
DeletedTime sql.NullInt64 `gorm:"type:bigint"`
RowNum RowNum `gorm:"<-:create;index"`
Params []Param `gorm:"constraint:OnDelete:CASCADE"`
Tags []Tag `gorm:"constraint:OnDelete:CASCADE"`
Metrics []Metric `gorm:"constraint:OnDelete:CASCADE"`
LatestMetrics []LatestMetric `gorm:"constraint:OnDelete:CASCADE"`
Logs []Log `gorm:"constraing:OnDelete:CASCADE"`
}
type RunSharedTag ¶
type RunSharedTag struct {
}
RunSharedTag represents a model to store connection between tags and runs.
type SchemaVersion ¶
type SchemaVersion struct {
Version string `gorm:"not null;primaryKey"`
}
func (SchemaVersion) TableName ¶
func (SchemaVersion) TableName() string
type SharedTag ¶
type SharedTag struct {
}
SharedTag represents a tag which can label multiple runs (for Aim).
type SqliteDBInstance ¶ added in v0.3.0
type SqliteDBInstance struct {
DBInstance
}
SqliteDBInstance is the sqlite specific variant of DbInstance.
func NewSqliteDBInstance ¶ added in v0.3.0
func NewSqliteDBInstance( dsnURL url.URL, slowThreshold time.Duration, poolMax int, ) (*SqliteDBInstance, error)
NewSqliteDBInstance creates a SqliteDBInstance.
func (SqliteDBInstance) Reset ¶ added in v0.3.0
func (db SqliteDBInstance) Reset() error
Reset resets database.