config

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BazelCacheVolumeName holds the name of the volume which allows images to
	// share a bazel cache.
	BazelCacheVolumeName = "bazel-cache"

	// BazelCacheMountPath stores the directory where the bazel cache resides. For
	// a description of the bazel image and its cache/output directories, see
	// https://docs.bazel.build/versions/master/output_directories.html.
	BazelCacheMountPath = "/root/.cache/bazel"

	// BigQueryTableEnv specifies the name of the env variable that holds the name
	// of the table where results should be written.
	BigQueryTableEnv = "BQ_RESULT_TABLE"

	// BuildInitContainerName holds the name of the init container that assembles
	// a binary or other bundle required to run the tests.
	BuildInitContainerName = "build"

	// ClientRole is the value the controller expects for the RoleLabel
	// on a client component.
	ClientRole = "client"

	// CloneGitRefEnv specifies the name of the env variable that contains the
	// commit, tag or branch to checkout after cloning a git repository.
	CloneGitRefEnv = "CLONE_GIT_REF"

	// CloneInitContainerName holds the name of the init container that obtains
	// a copy of the code at a specific point in time.
	CloneInitContainerName = "clone"

	// CloneRepoEnv specifies the name of the env variable that contains the git
	// repository to clone.
	CloneRepoEnv = "CLONE_REPO"

	// ComponentNameLabel is a label used to distinguish between test
	// components with the same role.
	ComponentNameLabel = "loadtest-component"

	// DriverRole is the value the controller expects for the RoleLabel
	// on a driver component.
	DriverRole = "driver"

	// DriverPort is the number of the port that the servers and clients expose
	// for the driver to connect to. This connection allows the driver to send
	// instructions and receive results from the servers and clients.
	DriverPort = 10000

	// LoadTestLabel is a label which contains the test's unique name.
	LoadTestLabel = "loadtest"

	// PoolLabel is the key for a label which will have the name of a pool as
	// the value.
	PoolLabel = "pool"

	// ReadyInitContainerName holds the name of the init container that blocks a
	// driver from running until all worker pods are ready.
	ReadyInitContainerName = "ready"

	// ReadyMountPath is the absolute path where the ready volume should be
	// mounted in both the ready init container and the driver's run container.
	ReadyMountPath = "/var/data/qps_workers"

	// ReadyOutputFile is the name of the file where the ready init container
	// should write all IP addresses and port numbers for ready workers.
	ReadyOutputFile = ReadyMountPath + "/addresses"

	// ReadyVolumeName is the name of the volume that permits sharing files
	// between the ready init container and the driver's run container.
	ReadyVolumeName = "worker-addresses"

	// RoleLabel is a label with the role  of a test component. For
	// example, "loadtest-role=server" indicates a server component.
	RoleLabel = "loadtest-role"

	// RunContainerName holds the name of the main container where the test is
	// executed.
	RunContainerName = "run"

	// ScenariosFileEnv specifies the name of an env variable that specifies the
	// path to a JSON file with scenarios.
	ScenariosFileEnv = "SCENARIOS_FILE"

	// ScenariosMountPath specifies where the JSON file with the scenario should
	// be mounted in the driver container.
	ScenariosMountPath = "/src/scenarios"

	// ServerRole is the value the controller expects for the RoleLabel
	// on a server component.
	ServerRole = "server"

	// WorkspaceMountPath contains the path to mount the volume identified by
	// `workspaceVolume`.
	WorkspaceMountPath = "/src/workspace"

	// WorkspaceVolumeName contains the name of the volume that is shared between
	// the init containers and containers for a driver or worker pod.
	WorkspaceVolumeName = "workspace"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Defaults

type Defaults struct {
	// ComponentNamespace is the default namespace for load test components. Note
	// this is not the namespace for the manager.
	ComponentNamespace string `json:"componentNamespace"`

	// DefaultPoolLabels map a client, driver and server to a label on a node.
	// Any node with a matching key and a value of "true" may be used as a
	// default pool.
	DefaultPoolLabels *PoolLabelMap `json:"defaultPoolLabels,omitempty"`

	// CloneImage specifies the default container image to use for
	// cloning Git repositories at a specific snapshot.
	CloneImage string `json:"cloneImage"`

	// ReadyImage specifies the container image to use to block the driver from
	// starting before all worker pods are ready.
	ReadyImage string `json:"readyImage"`

	// DriverImage specifies a default driver image. This image will
	// be used to orchestrate a test.
	DriverImage string `json:"driverImage"`

	// Languages specifies the default build and run container images
	// for each known language.
	Languages []LanguageDefault `json:"languages,omitempty"`
}

Defaults defines the default settings for the system.

func (*Defaults) SetLoadTestDefaults

func (d *Defaults) SetLoadTestDefaults(test *grpcv1.LoadTest) error

SetLoadTestDefaults applies default values for missing fields that are required to reconcile a load test.

This returns an error if the system has no viable default. For example, the system cannot infer a run image for "fortran" if a build image was not declared for this language in the Defaults object.

func (*Defaults) Validate

func (d *Defaults) Validate() error

Validate ensures that the required fields are present and an acceptable value. If an issue is encountered, an error is returned. If the defaults are valid, nil is returned.

type LanguageDefault

type LanguageDefault struct {
	// Language uniquely identifies a programming language. When the
	// system encounters this name, it will select the build image and
	// run image as the defaults.
	Language string `json:"language"`

	// BuildImage specifies the default container image for building or
	// assembling an executable or bundle for a language. This image
	// likely contains a compiler and any required libraries for
	// compilation.
	BuildImage string `json:"buildImage"`

	// RunImage specifies the default container image for the
	// environment for the runtime of the test. It should provide any
	// necessary interpreters or dependencies to run or use the output
	// of the build image.
	RunImage string `json:"runImage"`
}

LanguageDefault defines a programming language, as well as its default container images.

type PoolLabelMap added in v0.3.1

type PoolLabelMap struct {
	// Client maps a client to the key of a label where the client may run.
	Client string `json:"client"`

	// Driver maps a driver to the key of a label where the driver may run.
	Driver string `json:"driver"`

	// Server maps a server to the key of a label where the server may run.
	Server string `json:"server"`
}

PoolLabelMap maps a client, driver or server to a string. This string should be the key of a label on a node where the client, driver or server pods may run. The value of the label should be the string "true".

For example, the Driver field may be set to "default-driver-pool". This means the driver would run on any node with a "default-driver-pool" label set to a value of "true".

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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