config

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 5 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

	// DriverPortEnv specifies the name of the env variable that contains driver port.
	DriverPortEnv = "DRIVER_PORT"

	// EnablePrometheusEnv specifies the name of the env variable that indicates
	// if the collection of Prometheus data is enabled.
	EnablePrometheusEnv = "ENABLE_PROMETHEUS"

	// 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"

	// ReadyMetadataOutputFile is the name of the file where the ready init container
	// should write all Metadata.
	ReadyMetadataOutputFile = ReadyMountPath + "/metadata.json"

	// ReadyNodeInfoOutputFile is the name of the file where the ready init container
	// should write node infomation.
	ReadyNodeInfoOutputFile = ReadyMountPath + "/node_info.json"

	// 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. The runtime for the test may contain multiple run containers.
	// The main container is always the first container on the list.
	RunContainerName = "main"

	// 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"

	// ServerPort is the number of the port that the test server listens on
	// to run test.
	ServerPort = 10010

	// 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"

	// KillAfterEnv specifies the name of the env variable that sets the allowed response time for a pod after timeout.
	KillAfterEnv = "KILL_AFTER"

	// PodTimeoutEnv specifies the name of the env variable that sets the timeout for a pod.
	PodTimeoutEnv = "POD_TIMEOUT"
)
View Source
const (
	// ServerUpdatePort is the port on the xDS server to listen to
	// configuration for PSM test only.
	ServerUpdatePort = 18005

	// XdsServerContainerName holds the name of the xds-server
	// container for PSM test only.
	XdsServerContainerName = "xds-server"

	// SidecarContainerName holds the name of the sidecar
	// container for a proxied PSM test only.
	SidecarContainerName = "sidecar"
)

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"`

	// KillAfter is the duration allowed for pods to respond after timeout.
	KillAfter float64 `json:"killAfter"`
}

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