exec

package
v1.1.1-0...-dcff8be Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorNotPrepared      = "exec is not prepared"
	ErrorExecutionTimeout = "execution timeout"
)
View Source
const (
	MaximumBenchmarkWithSameConfig = 10

	SourceCron            = "cron"
	SourcePullRequest     = "cron_pr"
	SourcePullRequestBase = "cron_pr_base"
	SourceTag             = "cron_tags_"
	SourceReleaseBranch   = "cron_"

	VitessLatestVersion   = "latest"
	VitessPreviousVersion = "v_"
)
View Source
const (
	StatusCreated  = "created"
	StatusStarted  = "started"
	StatusFailed   = "failed"
	StatusFinished = "finished"
)

Variables

This section is empty.

Functions

func CountMacroBenchmark

func CountMacroBenchmark(client storage.SQLClient, gitRef, source, typeOf, status, planner string) (int, error)

func DeleteExecution

func DeleteExecution(client storage.SQLClient, gitRef, UUID, source string) error

func Exists

func Exists(client storage.SQLClient, gitRef, source, typeOf, status string) (bool, error)

func GetFinishedExecution

func GetFinishedExecution(client storage.SQLClient, gitRef, source, benchmarkType, plannerVersion string, pullNb int) (string, error)

func GetLatestDailyJobForMacrobenchmarks

func GetLatestDailyJobForMacrobenchmarks(client storage.SQLClient) (gitSha string, err error)

GetLatestDailyJobForMacrobenchmarks will fetch and return the commit sha for which the last daily job for macrobenchmarks was run

func GetLatestDailyJobForMicrobenchmarks

func GetLatestDailyJobForMicrobenchmarks(client storage.SQLClient) (gitSha string, err error)

GetLatestDailyJobForMicrobenchmarks will fetch and return the commit sha for which the last daily job for microbenchmarks was run

func GetPreviousFromSourceMacrobenchmark

func GetPreviousFromSourceMacrobenchmark(client storage.SQLClient, source, typeOf, plannerVersion, gitRef string) (execUUID, gitRefOut string, err error)

GetPreviousFromSourceMacrobenchmark gets the previous execution from the same source with the sane plannerVersion for macrobenchmarks

func GetPreviousFromSourceMicrobenchmark

func GetPreviousFromSourceMicrobenchmark(client storage.SQLClient, source, gitRef string) (execUUID, gitRefOut string, err error)

GetPreviousFromSourceMicrobenchmark gets the previous execution from the same source for microbenchmarks

func GetPullRequestInfo

func GetPullRequestInfo(client storage.SQLClient, pullNumber int) (pullRequestInfo, error)

func GetPullRequestList

func GetPullRequestList(client storage.SQLClient) ([]int, error)

func IsLastExecutionFinished

func IsLastExecutionFinished(client storage.SQLClient) (bool, error)

Types

type BenchmarkStats

type BenchmarkStats struct {
	Total      int
	Finished   int
	Last30Days int
}

func GetBenchmarkStats

func GetBenchmarkStats(client storage.SQLClient) (BenchmarkStats, error)

type Exec

type Exec struct {
	UUID              uuid.UUID
	RawUUID           string
	AnsibleConfig     ansible.Config
	Source            string
	GitRef            string
	VitessVersion     git.Version
	VitessVersionName string

	// NextBenchmarkIsTheSame is set to true if the next benchmark has the same config
	// as the current one. This allows us to do some optimization in Ansible and speed
	// up the entire benchmarking process.
	NextBenchmarkIsTheSame bool

	// PreviousBenchmarkIsTheSame is set to true if the previous benchmark had the same
	// config as this one. It allows us to skip the preparatory cleanup of the server.
	PreviousBenchmarkIsTheSame bool

	// Status defines the status of the execution (canceled, finished, failed, etc)
	Status string

	StartedAt  *time.Time
	FinishedAt *time.Time

	// Defines the type of execution (oltp, tpcc, micro, ...)
	TypeOf string

	// PullNB defines the pull request number linked to this execution.
	PullNB            int
	PullBaseBranchRef string

	// VtgatePlannerVersion is the planner version that vtgate is going to use
	VtgatePlannerVersion string

	// GolangVersion is the go version to use while executing the benchmark on the remote host
	GolangVersion string

	// ServerAddress is the IP address on which the benchmark will be executed.
	ServerAddress string

	RepoDir string
	// contains filtered or unexported fields
}

func GetRecentExecutions

func GetRecentExecutions(client storage.SQLClient) ([]*Exec, error)

func NewExec

func NewExec(uuidRaw string) (*Exec, error)

NewExec creates a new *Exec given the string representation of an uuid.UUID. If no UUID is provided, a new one will be generated.

func NewExecWithConfig

func NewExecWithConfig(path, uuid string) (*Exec, error)

NewExecWithConfig will create a new Exec using the NewExec method, and will use viper.Viper to apply the configuration located at pathConfig.

func (*Exec) AddToCommand

func (e *Exec) AddToCommand(cmd *cobra.Command)

func (*Exec) AddToViper

func (e *Exec) AddToViper(v *viper.Viper) (err error)

func (*Exec) Execute

func (e *Exec) Execute() (err error)

Execute will provision infra, configure Ansible files, and run the given Ansible config.

func (Exec) ExecuteWithTimeout

func (e Exec) ExecuteWithTimeout(timeout time.Duration) (err error)

ExecuteWithTimeout will call execution's Execute method with the given timeout.

func (*Exec) Prepare

func (e *Exec) Prepare() error

Prepare prepares the Exec for a future Execution.

func (*Exec) SetOutputToDefaultPath

func (e *Exec) SetOutputToDefaultPath() error

SetOutputToDefaultPath sets Exec's outputs to their default files (stdoutFile and stderrFile). If they can't be found in Exec.dirPath, they will be created.

func (*Exec) SetStderr

func (e *Exec) SetStderr(stderr *os.File)

SetStderr sets the standard error output of Exec.

func (*Exec) SetStdout

func (e *Exec) SetStdout(stdout *os.File)

SetStdout sets the standard output of Exec.

func (*Exec) Success

func (e *Exec) Success() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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