Compare commits

...

1 Commits

Author SHA1 Message Date
Shubham Chaudhary 612861870b
[Cherry-Pick for v1.9.0] (#180)
* fix(node-io-stress): Add fix for node-io-stress (#177)

Signed-off-by: Udit Gaurav <udit.gaurav@mayadata.io>

* fix(abort): fixing the result updation for abort (#178)

Signed-off-by: shubhamchaudhary <shubham.chaudhary@mayadata.io>

* refactor(experiment): covered uncaught errors (#179)

Signed-off-by: shubhamchaudhary <shubham.chaudhary@mayadata.io>

Co-authored-by: UDIT GAURAV <35391335+uditgaurav@users.noreply.github.com>
2020-10-15 18:03:02 +05:30
18 changed files with 65 additions and 34 deletions

View File

@ -124,7 +124,7 @@ func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clie
Image: experimentsDetails.LIBImage, Image: experimentsDetails.LIBImage,
ImagePullPolicy: apiv1.PullAlways, ImagePullPolicy: apiv1.PullAlways,
Command: []string{ Command: []string{
"/stress-ng", "stress-ng",
}, },
Args: GetContainerArguments(experimentsDetails), Args: GetContainerArguments(experimentsDetails),
}, },

View File

@ -35,8 +35,10 @@ func ContainerKill(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -33,8 +33,10 @@ func DiskFill(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -33,8 +33,10 @@ func KubeletServiceKill(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -35,8 +35,10 @@ func NodeCPUHog(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -33,8 +33,10 @@ func NodeDrain(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -35,8 +35,10 @@ func NodeIOStress(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -35,8 +35,10 @@ func NodeMemoryHog(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -33,8 +33,10 @@ func NodeTaint(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -36,8 +36,10 @@ func PodCPUHog(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -35,10 +35,9 @@ func PodDelete(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
if err := probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil { if err := probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialise probes details from chaosengine, err: %v", err) log.Fatalf("Unable to initialise probes details from chaosengine, err: %v", err)
} }
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment

View File

@ -35,8 +35,10 @@ func PodIOStress(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -36,8 +36,10 @@ func PodMemoryHog(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -36,8 +36,10 @@ func PodNetworkCorruption(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -36,8 +36,10 @@ func PodNetworkDuplication(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -36,8 +36,10 @@ func PodNetworkLatency(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginning of experiment //Updating the chaos result in the beginning of experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -36,8 +36,10 @@ func PodNetworkLoss(clients clients.ClientSets) {
// Intialise Chaos Result Parameters // Intialise Chaos Result Parameters
types.SetResultAttributes(&resultDetails, chaosDetails) types.SetResultAttributes(&resultDetails, chaosDetails)
// Intialise the probe details // Intialise the probe details. Bail out upon error, as we haven't entered exp business logic yet
probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails) if err = probe.InitializeProbesInChaosResultDetails(&chaosDetails, clients, &resultDetails); err != nil {
log.Fatalf("Unable to initialize the probes, err: %v", err)
}
//Updating the chaos result in the beginningo f experiment //Updating the chaos result in the beginningo f experiment
log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName) log.Infof("[PreReq]: Updating the chaos result of %v experiment (SOT)", experimentsDetails.ExperimentName)

View File

@ -39,7 +39,9 @@ func ChaosResult(chaosDetails *types.ChaosDetails, clients clients.ClientSets, r
return err return err
} }
if chaosDetails.EngineName != "" { // as the chaos pod won't be available for stopped phase
// skipping the derivation of labels from chaos pod, if phase is stopped
if chaosDetails.EngineName != "" && resultDetails.Phase != "Stopped" {
// Getting chaos pod label and passing it in chaos result // Getting chaos pod label and passing it in chaos result
chaosPod, err := clients.KubeClient.CoreV1().Pods(chaosDetails.ChaosNamespace).Get(chaosDetails.ChaosPodName, metav1.GetOptions{}) chaosPod, err := clients.KubeClient.CoreV1().Pods(chaosDetails.ChaosNamespace).Get(chaosDetails.ChaosPodName, metav1.GetOptions{})
if err != nil { if err != nil {