Documentation ¶
Index ¶
- Constants
- func ApplyCondition(status *redskyv1beta1.ExperimentStatus, ...)
- func IsFinished(exp *redskyv1beta1.Experiment) bool
- func NextTrialNamespace(ctx context.Context, c client.Client, exp *redskyv1beta1.Experiment, ...) (string, error)
- func PopulateTrialFromTemplate(exp *redskyv1beta1.Experiment, t *redskyv1beta1.Trial)
- func UpdateStatus(exp *redskyv1beta1.Experiment, trialList *redskyv1beta1.TrialList) bool
- func Walk(ctx context.Context, v Visitor, obj interface{})
- func WalkPath(ctx context.Context) []string
- type Generator
- type Visitor
Constants ¶
const ( // PhaseCreated indicates that the experiment has been created on the remote server but is not receiving trials PhaseCreated string = "Created" // PhasePaused indicates that the experiment has been paused, i.e. the desired replica count is zero PhasePaused = "Paused" // PhaseEmpty indicates there is no record of trials being run in the cluster PhaseEmpty = "Never run" // TODO This is misleading, it could be that we already deleted the trials that ran // PhaseIdle indicates that the experiment is waiting for trials to be manually created PhaseIdle = "Idle" // PhaseRunning indicates that there are actively running trials for the experiment PhaseRunning = "Running" // PhaseCompleted indicates that the experiment has exhausted it's trial budget and is no longer expecting new trials PhaseCompleted = "Completed" // PhaseFailed indicates that the experiment has failed PhaseFailed = "Failed" // PhaseDeleted indicates that the experiment has been deleted and is waiting for trials to be cleaned up PhaseDeleted = "Deleted" )
TODO Make the constant names better reflect the code, not the text
const (
// HasTrialFinalizer is a finalizer that indicates an experiment has at least one trial
HasTrialFinalizer = "hasTrialFinalizer.redskyops.dev"
)
Variables ¶
This section is empty.
Functions ¶
func ApplyCondition ¶
func ApplyCondition(status *redskyv1beta1.ExperimentStatus, conditionType redskyv1beta1.ExperimentConditionType, conditionStatus corev1.ConditionStatus, reason, message string, time *metav1.Time)
func IsFinished ¶ added in v1.11.0
func IsFinished(exp *redskyv1beta1.Experiment) bool
func NextTrialNamespace ¶
func NextTrialNamespace(ctx context.Context, c client.Client, exp *redskyv1beta1.Experiment, trialList *redskyv1beta1.TrialList) (string, error)
NextTrialNamespace searches for or creates a new namespace to run a new trial in, returning an empty string if no such namespace can be found
func PopulateTrialFromTemplate ¶
func PopulateTrialFromTemplate(exp *redskyv1beta1.Experiment, t *redskyv1beta1.Trial)
PopulateTrialFromTemplate creates a new trial for an experiment
func UpdateStatus ¶
func UpdateStatus(exp *redskyv1beta1.Experiment, trialList *redskyv1beta1.TrialList) bool
UpdateStatus will ensure the experiment's status matches what is in the supplied trial list; returns true only if changes were necessary
Types ¶
type Generator ¶ added in v1.11.0
type Generator struct { // The definition of the application to generate an experiment for. Application redskyappsv1alpha1.Application // The name of the experiment to generate. ExperimentName string // The name of the scenario to generate an experiment for. Required if there are more then one scenario. Scenario string // The name of the objective to generate an experiment for. Required if there are more then one set of objectives. Objective string // ContainerResourcesSelectors are the selectors for determining what application resources to scan for resources lists. ContainerResourcesSelectors []generation.ContainerResourcesSelector // ReplicaSelectors are the selectors for determining what application resources to scan for desired replica counts. ReplicaSelectors []generation.ReplicaSelector // IncludeApplicationResources is a flag indicating that the application resources should be included in the output. IncludeApplicationResources bool // Configure the filter options. scan.FilterOptions }
Generator is used to create an experiment definition.
func (*Generator) Execute ¶ added in v1.11.0
Execute the experiment generation pipeline, sending the results to the supplied writer.
func (*Generator) SetDefaultSelectors ¶ added in v1.11.0
func (g *Generator) SetDefaultSelectors()
SetDefaultSelectors adds the default selectors to the generator, this requires that the application already be configured on the generator.
type Visitor ¶ added in v1.10.0
type Visitor interface { // Visit an experiment section. The supplied object will be a slice or a pointer // to a type on the experiment. The return value is used to halt traversal. Visit(ctx context.Context, obj interface{}) Visitor }
Visitor is used to inspect individual sections of an experiment.