action

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package action contains the logic for each action that Iter8 can perform.

This is a library for calling top-level Iter8 actions like 'launch', 'assert', or 'report'. Actions approximately match the command line invocations that the Iter8 CLI uses.

Index

Constants

View Source
const (
	// Completed states that the experiment is complete
	Completed = "completed"
	// NoFailure states that none of the tasks in the experiment have failed
	NoFailure = "nofailure"
	// SLOs states that all app versions participating in the experiment satisfy SLOs
	SLOs = "slos"
)
View Source
const (
	// TextOutputFormat is the output format used to create text output
	TextOutputFormatKey = "text"

	// HTMLOutputFormat is the output format used to create html output
	HTMLOutputFormatKey = "html"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssertOpts

type AssertOpts struct {
	// Timeout is the duration to wait for conditions to be satisfied
	Timeout time.Duration
	// Conditions are checked by assert
	Conditions []string
	// RunOpts provides options relating to experiment resources
	RunOpts
}

AssertOpts are the options used for asserting experiment results

func NewAssertOpts

func NewAssertOpts(kd *driver.KubeDriver) *AssertOpts

NewAssertOpts initializes and returns assert opts

func (*AssertOpts) KubeRun

func (aOpts *AssertOpts) KubeRun() (bool, error)

LocalRun asserts conditions for a Kubernetes experiment

func (*AssertOpts) LocalRun

func (aOpts *AssertOpts) LocalRun() (bool, error)

LocalRun asserts conditions for a local experiment

func (*AssertOpts) Run

func (assert *AssertOpts) Run(eio base.Driver) (bool, error)

Run builds the experiment and verifies assert conditions

type ChartNameAndDestOptions

type ChartNameAndDestOptions struct {
	// ChartName is the name of the chart
	ChartName string
	// DestDir is the directory where it is to be downloaded
	DestDir string
}

ChartNameAndDestOptions specifies which chart needs to be downloaded and where

type GenOpts

type GenOpts struct {
	// Options provides the values to be combined with the experiment chart
	values.Options
	// SourceDir is the path to the experiment chart
	SourceDir string
}

GenOpts are the options used for generating experiment.yaml

func NewGenOpts

func NewGenOpts() *GenOpts

NewGenOpts initializes and returns gen opts

func (*GenOpts) LocalRun

func (gen *GenOpts) LocalRun() error

LocalRun generates a local experiment.yaml file

type HubOpts

type HubOpts struct {
	// ChartNameAndDestOptions contains ChartName and DestDir options
	ChartNameAndDestOptions
	// ChartPathOptions contains RepoURL and (chart) Version (constraint) options
	action.ChartPathOptions
}

HubOpts are the options used for downloading an experiment chart

func NewHubOpts

func NewHubOpts() *HubOpts

NewHubOpts initializes and returns hub opts

func (*HubOpts) LocalRun

func (hub *HubOpts) LocalRun() error

LocalRun downloads an experiment chart to DestDir

type LaunchOpts

type LaunchOpts struct {
	// DryRun enables simulating a launch
	DryRun bool
	// HubOpts contains the options for downloading the chart
	HubOpts
	// GenOpts contains the options for generating the experiment including values
	GenOpts
	// RunOpts enables local and Kubernetes runs
	RunOpts
}

LaunchOpts are the options used for launching experiments

func NewLaunchOpts

func NewLaunchOpts(kd *driver.KubeDriver) *LaunchOpts

NewHubOpts initializes and returns launch opts

func (*LaunchOpts) KubeRun

func (lOpts *LaunchOpts) KubeRun() error

KubeRun launches a Kubernetes experiment

func (*LaunchOpts) LocalRun

func (lOpts *LaunchOpts) LocalRun() error

LocalRun launches a local experiment

type LogOpts

type LogOpts struct {
	// KubeDriver enables interaction with Kubernetes cluster
	*driver.KubeDriver
}

LogOpts enables fetching logs from Kubernetes

func NewLogOpts

func NewLogOpts(kd *driver.KubeDriver) *LogOpts

NewHubOpts initializes and returns log opts

func (*LogOpts) KubeRun

func (lOpts *LogOpts) KubeRun() (string, error)

KubeRun fetches logs from a Kubernetes experiment

type ReportOpts

type ReportOpts struct {
	// OutputFormat specifies the output format to be used by report
	OutputFormat string
	// RunOpts enables fetching local experiment spec and result
	RunOpts
	// KubeDriver enables fetching Kubernetes experiment spec and result
	*driver.KubeDriver
}

ReportOpts are the options used for generating reports from experiment result

func NewReportOpts

func NewReportOpts(kd *driver.KubeDriver) *ReportOpts

NewReportOpts initializes and returns report opts

func (*ReportOpts) KubeRun

func (rOpts *ReportOpts) KubeRun(out io.Writer) error

KubeRun generates report for a Kubernetes experiment

func (*ReportOpts) LocalRun

func (rOpts *ReportOpts) LocalRun(out io.Writer) error

LocalRun generates report for a local experiment

func (*ReportOpts) Run

func (rOpts *ReportOpts) Run(eio base.Driver, out io.Writer) error

Run generates the text or HTML report

type RunOpts

type RunOpts struct {
	// Rundir is the directory of the local experiment.yaml file
	RunDir string
	// KubeDriver enables Kubernetes experiment run
	*driver.KubeDriver
}

RunOpts are the options used for running an experiment

func NewRunOpts

func NewRunOpts(kd *driver.KubeDriver) *RunOpts

NewRunOpts initializes and returns run opts

func (*RunOpts) KubeRun

func (rOpts *RunOpts) KubeRun() error

KubeRun runs a Kubernetes experiment

func (*RunOpts) LocalRun

func (rOpts *RunOpts) LocalRun() error

LocalRun runs a local experiment

Directories

Path Synopsis
Package report contains the logic for reporting the results of an experiment.
Package report contains the logic for reporting the results of an experiment.

Jump to

Keyboard shortcuts

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