controllers

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Redis              store.RedisStore
	S3                 s3.ObjectStore
	Bus                *pubgo.Bus
	Logger             zerolog.Logger
	PublishBenchEvents bool
}

Controller defines methods to interact with mlsolid.

func (*Controller) AddArtifactToRegistry

func (c *Controller) AddArtifactToRegistry(ctx context.Context, registryName string, runID string,
	artifactID string, tags ...string,
) error

AddArtifactToRegistry adds a model artifact as a new model entry to a registry.

func (*Controller) AddArtifacts

func (c *Controller) AddArtifacts(ctx context.Context, runID string, as []types.Artifact) error

func (*Controller) AddBenchmarkMetrics added in v0.1.3

func (c *Controller) AddBenchmarkMetrics(ctx context.Context, benchID string, metrics []types.BenchMetric) error

AddBenchmarkMetrics adds metrics to a benchmark.

func (*Controller) AddBenchmarkRegistries added in v0.1.3

func (c *Controller) AddBenchmarkRegistries(ctx context.Context, benchID string, registries []string) error

AddBenchmarkRegistries adds new registries to a benchmark.

func (*Controller) AddMetrics

func (c *Controller) AddMetrics(ctx context.Context, runID string, m []types.Metric) error

func (*Controller) AddModelEntry

func (c *Controller) AddModelEntry(ctx context.Context, registryName string, url string, tags ...string) error

AddModelEntry adds a new model entry to the registry.

func (*Controller) Artifact

func (c *Controller) Artifact(ctx context.Context, runID string,
	artifact string,
) (*types.SavedArtifact, io.ReadCloser, error)

Artifact fetches an artifact and returns a Reader to its content.

func (*Controller) Artifacts

func (c *Controller) Artifacts(ctx context.Context,
	runIDs []string,
) (map[string][]string, error)

Artifacts returns a Map of runID to artifact ids i.e a list of artifact ids for each run.

func (*Controller) Benchmark added in v0.1.3

func (c *Controller) Benchmark(ctx context.Context, benchID string) (*types.Bench, error)

Benchmark returns a benchmark with id `benchID` if present.

func (*Controller) BenchmarkMetrics added in v0.1.3

func (c *Controller) BenchmarkMetrics(ctx context.Context, benchID string) ([]types.BenchMetric, error)

BenchmarkMetrics pulls metrics tracked by a benchmark.

func (*Controller) BenchmarkNames added in v0.1.6

func (c *Controller) BenchmarkNames(ctx context.Context) (map[string]string, error)

BenchmarkNames pulls a map of benchmark id to benchmark name for all known benchmarks.

func (*Controller) BenchmarkRegistries added in v0.1.3

func (c *Controller) BenchmarkRegistries(ctx context.Context, benchID string) ([]string, error)

BenchmarkRegistries pulls registries linked the benchmark.

func (*Controller) BenchmarkRuns added in v0.1.3

func (c *Controller) BenchmarkRuns(ctx context.Context, benchID string) ([]*types.BenchRun, error)

BenchmarkRuns pulls all recorded benchmark runs.

func (*Controller) Benchmarks added in v0.1.3

func (c *Controller) Benchmarks(ctx context.Context) ([]string, error)

Benchmarks pulls all known benchmark ids.

func (*Controller) BenchmarksPage added in v0.1.6

func (c *Controller) BenchmarksPage(ctx context.Context,
	cursor uint64, limit int64,
) (map[string]string, uint64, error)

BenchmarksPage pulls a single page of benchmark id to benchmark name, starting at cursor. A returned cursor of 0 means there are no more pages.

func (*Controller) BestRuns added in v0.1.3

func (c *Controller) BestRuns(ctx context.Context, benchID string,
	metrics ...string,
) (map[string]*types.BenchRun, error)

BestRuns returns the best run for each metric selected.

func (*Controller) CreateBenchmark added in v0.1.3

func (c *Controller) CreateBenchmark(ctx context.Context, b types.Bench) (string, bool, error)

CreateBenchmark creates a new benchmark.

func (*Controller) CreateModelRegistry

func (c *Controller) CreateModelRegistry(ctx context.Context,
	name string, benchmarkingOps types.RegistryBenchmarkOps,
) error

CreateModelRegistry creates a new model registry with the specified name.

func (*Controller) CreateRun

func (c *Controller) CreateRun(ctx context.Context, run types.Run) error

func (*Controller) Exp

func (c *Controller) Exp(ctx context.Context, expID string) (*types.Experiment, error)

func (*Controller) ExpInfo

func (c *Controller) ExpInfo(ctx context.Context, expID string) (types.ExperimentInfo, error)

ExpInfo returns info data linked to an experiment (description, etc).

func (*Controller) ExpRuns

func (c *Controller) ExpRuns(ctx context.Context, expID string) ([]string, error)

func (*Controller) Exps

func (c *Controller) Exps(ctx context.Context) ([]string, error)

func (*Controller) ExpsPage added in v0.1.6

func (c *Controller) ExpsPage(ctx context.Context, cursor uint64, limit int64) ([]string, uint64, error)

ExpsPage returns a single page of experiment ids starting at cursor. A returned cursor of 0 means there are no more pages.

func (*Controller) GenerateKey added in v0.1.3

func (c *Controller) GenerateKey(ctx context.Context, label string) (string, error)

GenerateKey generates a new API Key.

func (*Controller) IsValidAPIKey added in v0.1.3

func (c *Controller) IsValidAPIKey(ctx context.Context, key string) (bool, error)

IsValidAPIKey checks if an API Key is valid.

func (*Controller) LastModelEntry

func (c *Controller) LastModelEntry(ctx context.Context, registryName string) (types.ModelEntry, error)

LastModelEntry returns the last model entry in the model registry.

func (*Controller) ModelRegistriesID

func (c *Controller) ModelRegistriesID(ctx context.Context) ([]string, error)

ModelRegistriesID retrieves all known model registry ids.

func (*Controller) ModelRegistriesIDPage added in v0.1.6

func (c *Controller) ModelRegistriesIDPage(ctx context.Context, cursor uint64, limit int64) ([]string, uint64, error)

ModelRegistriesIDPage retrieves a single page of model registry ids starting at cursor. A returned cursor of 0 means there are no more pages.

func (*Controller) ModelRegistry

func (c *Controller) ModelRegistry(ctx context.Context, name string) (*types.ModelRegistry, error)

ModelRegistry pulls a model registry.

func (*Controller) RecordRuns added in v0.1.6

func (c *Controller) RecordRuns(ctx context.Context, benchID string, runs []types.BenchRun) error

RecordRuns records new benchmark runs. All metrics reported by a run are stored as-is, including ones not (yet) declared on the benchmark, so a run already carries a value once a matching metric is added to the benchmark.

func (*Controller) RegistryBenchmarks added in v0.1.3

func (c *Controller) RegistryBenchmarks(ctx context.Context, registry string) ([]string, error)

RegistryBenchmarks pulls all benchmarks linked to a registry.

func (*Controller) RemActiveBenchRun added in v0.1.6

func (c *Controller) RemActiveBenchRun(ctx context.Context, benchID string) error

RemActiveBenchRun clears the run marked as currently executing for benchID by SetActiveBenchRun. It succeeds without error when no run is active, so it is safe to call unconditionally once a run finishes.

func (*Controller) RemBenchmarkMetrics added in v0.1.3

func (c *Controller) RemBenchmarkMetrics(ctx context.Context, benchID string, metrics []string) error

RemBenchmarkMetrics removes metrics from a benchmark.

func (*Controller) RemBenchmarkRegistries added in v0.1.3

func (c *Controller) RemBenchmarkRegistries(ctx context.Context, benchID string, registries []string) error

RemBenchmarkRegistries removes registries from a benchmark.

func (*Controller) Run

func (c *Controller) Run(ctx context.Context, runID string) (*types.Run, error)

func (*Controller) Runs

func (c *Controller) Runs(ctx context.Context, ids []string) ([]*types.Run, error)

func (*Controller) RunsFromExp

func (c *Controller) RunsFromExp(ctx context.Context, expID string) ([]*types.Run, error)

func (*Controller) SetActiveBenchRun added in v0.1.6

func (c *Controller) SetActiveBenchRun(ctx context.Context, benchID string, run types.BenchRun) error

SetActiveBenchRun marks run as the one currently executing for benchID, so that Benchmark's ActiveBenchRun field reflects it before the run finishes and is persisted via RecordRuns. Setting a new active run replaces any previous one. Callers should follow up with RemActiveBenchRun once the run completes, whether it succeeded or failed.

func (*Controller) SetExpInfo

func (c *Controller) SetExpInfo(ctx context.Context, expID string,
	info types.ExperimentInfo,
) error

SetExpInfo updates an experiment's info data.

func (*Controller) TagModel

func (c *Controller) TagModel(ctx context.Context, registryName string, version int, tags ...string) error

TagModel tags a model entry of a registry with the specified tag.

func (*Controller) TaggedModel

func (c *Controller) TaggedModel(ctx context.Context, registryName string, tag string) (types.ModelEntry, error)

TaggedModel returns the latest model entry with the specified tag.

func (*Controller) ToggleBenchmark added in v0.1.3

func (c *Controller) ToggleBenchmark(ctx context.Context, benchID string, paused bool) error

ToggleBenchmark toggle a benchmark's paused state.

func (*Controller) UpdateBenchmark added in v0.1.3

func (c *Controller) UpdateBenchmark(ctx context.Context, benchID string, update types.UpdateBench) error

UpdateBenchmark updates an existing benchmark.

func (*Controller) UpdateRegistryBenchmarkGpuPassthrough added in v0.1.5

func (c *Controller) UpdateRegistryBenchmarkGpuPassthrough(ctx context.Context, registry string, pass bool) error

func (*Controller) UpdateRegistryDockerImage added in v0.1.3

func (c *Controller) UpdateRegistryDockerImage(ctx context.Context, registry, dockerImage string) error

UpdateRegistryDockerImage updates the docker image of a registry.

Jump to

Keyboard shortcuts

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