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, cli *client.Client, 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, result string) 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 WithRedisStore(store *store.RedisStore) Opts
- func WithRegistryCreds(username, password string) Opts
- func WithRootDest(dest string) Opts
- func WithS3(store s3.ObjectStore) Opts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Store *store.RedisStore
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 ¶
func (e *Engine) ConsumeEvent(ctx context.Context, cli *client.Client, event *types.BenchEvent) error
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.
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 WithRedisStore ¶
func WithRedisStore(store *store.RedisStore) Opts
WithRedisStore sets the redis store used to record benchmarking runs. If no redis store is provided, saving is skipped.
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 WithS3 ¶
func WithS3(store s3.ObjectStore) Opts
WithS3 enables pulling datasets from an S3 bucket.