driver

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Package driver enables interaction with experiment resources. It provides drivers for local and Kubernetes experiments.

Index

Constants

View Source
const (
	// ExperimentPath is the name of the experiment file
	ExperimentPath = "experiment.yaml"
	// DefaultExperimentGroup is the name of the default experiment chart
	DefaultExperimentGroup = "default"
)
View Source
const (

	// ManifestFile is the name of the Kubernetes manifest file
	ManifestFile = "manifest.yaml"
)

Variables

This section is empty.

Functions

func ExperimentFromBytes added in v0.11.0

func ExperimentFromBytes(b []byte) (*base.Experiment, error)

ExperimentFromBytes reads experiment from bytes

Types

type FileDriver

type FileDriver struct {
	// RunDir is the directory where the experiment.yaml file is to be found
	RunDir string
}

FileDriver enables reading and writing experiment spec and result files

func (*FileDriver) GetRevision added in v0.11.0

func (f *FileDriver) GetRevision() int

GetRevision is undefined for file drivers

func (*FileDriver) Read added in v0.11.0

func (f *FileDriver) Read() (*base.Experiment, error)

Read the experiment

func (*FileDriver) Write added in v0.11.0

func (f *FileDriver) Write(exp *base.Experiment) error

Write the experiment

type KubeDriver

type KubeDriver struct {
	// EnvSettings provides generic Kubernetes and Helm options
	*cli.EnvSettings
	// Clientset enables interaction with a Kubernetes cluster
	Clientset kubernetes.Interface
	// Configuration enables Helm-based interaction with a Kubernetes cluster
	*action.Configuration
	// Group is the experiment group
	Group string
	// contains filtered or unexported fields
}

KubeDriver embeds Helm and Kube configuration, and enables interaction with a Kubernetes cluster through Kube APIs and Helm APIs

func NewFakeKubeDriver

func NewFakeKubeDriver(s *cli.EnvSettings, objects ...runtime.Object) *KubeDriver

NewFakeKubeDriver creates and returns a new KubeDriver with fake clients

func NewKubeDriver

func NewKubeDriver(s *cli.EnvSettings) *KubeDriver

NewKubeDriver creates and returns a new KubeDriver

func (*KubeDriver) Delete added in v0.10.0

func (kd *KubeDriver) Delete() error

Delete a Kubernetes experiment group

func (*KubeDriver) GetExperimentLogs

func (kd *KubeDriver) GetExperimentLogs() (string, error)

GetExperimentLogs gets logs for a Kubernetes experiment

func (*KubeDriver) GetRevision added in v0.11.0

func (kd *KubeDriver) GetRevision() int

GetRevision gets the experiment revision

func (*KubeDriver) Init

func (kd *KubeDriver) Init() error

Init initializes the KubeDriver

func (*KubeDriver) InitKube added in v0.10.13

func (kd *KubeDriver) InitKube() error

InitKube initializes the Kubernetes clientset

func (*KubeDriver) Launch added in v0.10.9

func (kd *KubeDriver) Launch(chartPathOptions action.ChartPathOptions, chartName string, valueOpts values.Options, group string, dry bool) error

Launch a Kubernetes experiment

func (*KubeDriver) Read added in v0.11.0

func (kd *KubeDriver) Read() (*base.Experiment, error)

Read experiment from secret

func (*KubeDriver) Write added in v0.11.0

func (kd *KubeDriver) Write(exp *base.Experiment) error

Write writes a Kubernetes experiment

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳