Documentation
¶
Overview ¶
Package bengine handles running benchmarks.
Index ¶
- func ExtractArchiveFromReader(ctx context.Context, dest string, fileName string, r io.Reader) error
- type Config
- type Engine
- func (e *Engine) ConsumeEvent(ctx context.Context, event *types.BenchEvent) error
- func (e *Engine) PullDataset(ctx context.Context, url string, outputPath string, fromS3 bool) error
- func (e *Engine) PullDatasetFromS3(ctx context.Context, url string, outputPath string) error
- func (e *Engine) RecordRun(ctx context.Context, event *types.BenchEvent, start, end time.Time, ...) error
- func (e *Engine) RunContainer(ctx context.Context, image, datasetName, datasetPath, checkpointPath string) (string, error)
- func (e *Engine) Start(ctx context.Context)
- type Opts
- func WithHostSourceVolume(source string) Opts
- func WithHumanReadableLogs() Opts
- func WithLoggingLevel(lvl zerolog.Level) Opts
- func WithRegistryCreds(username, password string) Opts
- func WithRootDest(dest string) Opts
- func WithRunRecorder(recorder RunRecorder) Opts
- func WithS3(store s3.ObjectStore) Opts
- type RunRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Recorder RunRecorder
Sub *pubgo.Subscription
S3 s3.ObjectStore
RegistryUsername string
RegistryPassword string
RootDest string
LoggingLevel zerolog.Level
HumanReadable bool
// contains filtered or unexported fields
}
Config struct for a bengine instance.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is a benchmark runner with docker containers.
func New ¶
func New(sub *pubgo.Subscription, opts ...Opts) *Engine
New creates a new benchmark engine.
func (*Engine) ConsumeEvent ¶
ConsumeEvent handles a benchmarking event.
func (*Engine) PullDataset ¶
PullDataset pulls a dataset from a public source with http.
func (*Engine) PullDatasetFromS3 ¶
PullDatasetFromS3 pulls a dataset from a S3 object.
func (*Engine) RecordRun ¶
func (e *Engine) RecordRun(ctx context.Context, event *types.BenchEvent, start, end time.Time, result string) error
RecordRun records a run into the store.
type Opts ¶
type Opts func(cfg *Config)
Opts handler function for setting engine configuration.
func WithHostSourceVolume ¶
WithHostSourceVolume sets host source volume if service is running inside a container.
func WithHumanReadableLogs ¶
func WithHumanReadableLogs() Opts
WithHumanReadableLogs disables structured logging.
func WithLoggingLevel ¶
WithLoggingLevel sets logging level.
func WithRegistryCreds ¶
WithRegistryCreds sets the credentials of the docker registry to pull images from.
func WithRootDest ¶
WithRootDest sets root destination where datasets & checkpoints are saved.
func WithRunRecorder ¶ added in v0.1.6
func WithRunRecorder(recorder RunRecorder) Opts
WithRunRecorder sets the recorder used to save benchmarking runs. If none is provided, saving is skipped.
func WithS3 ¶
func WithS3(store s3.ObjectStore) Opts
WithS3 enables pulling datasets from an S3 bucket.
type RunRecorder ¶ added in v0.1.6
type RunRecorder interface {
RecordRuns(ctx context.Context, benchID string, runs []types.BenchRun) error
SetActiveBenchRun(ctx context.Context, benchID string, run types.BenchRun) error
RemActiveBenchRun(ctx context.Context, benchID string) error
}
RunRecorder records completed benchmark runs. Satisfied by *controllers.Controller; kept narrow so bengine doesn't need access to the rest of the controller's surface.