Commit 947d8376 authored by Daniel Seybold's avatar Daniel Seybold

implemented the support for multiple elastic scaling steps

parent 29fa6966
Pipeline #73952 passed with stage
in 16 minutes and 56 seconds
......@@ -12,15 +12,14 @@ import de.uulm.omi.evaluation.task.CheckDeployment;
import de.uulm.omi.evaluation.task.CheckWorkload;
import de.uulm.omi.evaluation.task.CleanUpResources;
import de.uulm.omi.evaluation.task.CleanUpRun;
import de.uulm.omi.evaluation.task.Delay;
import de.uulm.omi.evaluation.task.DeployDB;
import de.uulm.omi.evaluation.task.FetchYcsbResult;
import de.uulm.omi.evaluation.task.InitEvaluation;
import de.uulm.omi.evaluation.task.InitRun;
import de.uulm.omi.evaluation.task.Kaa;
import de.uulm.omi.evaluation.task.LogTask;
import de.uulm.omi.evaluation.task.Plotting;
import de.uulm.omi.evaluation.task.Plotting.PlottingTask;
import de.uulm.omi.evaluation.task.Scale;
import de.uulm.omi.evaluation.task.TaskState;
import de.uulm.omi.evaluation.task.TaskType;
import de.uulm.omi.evaluation.task.YcsbWorkload;
......@@ -182,11 +181,8 @@ public class ElasticityYCSBMultiPhaseScenario extends EvaluationScenario {
//aNewRepeatFlow()
// .repeat(
aNewSequentialFlow()
.execute(new Delay(evaluationContext, this.elasticityYCSBMultiPhase.getElasticitySpec().get(this.elasticityCounter).getScalingDelay().intValue()))
.execute(new LogTask(evaluationContext, TaskType.SCALE, TaskState.STARTED))
.execute(new Scale(evaluationContext, this.dbmsClusterContext, true, this.elasticityYCSBMultiPhase
.execute(new Kaa(evaluationContext, this.dbmsClusterContext, this.elasticityYCSBMultiPhase
.getElasticitySpec()))
.execute(new LogTask(evaluationContext, TaskType.SCALE, TaskState.FINISHED))
//.execute(new IncreaseCounter(evaluationContext, this.elasticityCounter))
.build()
//)
......
......@@ -12,15 +12,14 @@ import de.uulm.omi.evaluation.task.CheckDeployment;
import de.uulm.omi.evaluation.task.CheckWorkload;
import de.uulm.omi.evaluation.task.CleanUpResources;
import de.uulm.omi.evaluation.task.CleanUpRun;
import de.uulm.omi.evaluation.task.Delay;
import de.uulm.omi.evaluation.task.DeployDB;
import de.uulm.omi.evaluation.task.FetchYcsbResult;
import de.uulm.omi.evaluation.task.InitEvaluation;
import de.uulm.omi.evaluation.task.InitRun;
import de.uulm.omi.evaluation.task.Kaa;
import de.uulm.omi.evaluation.task.LogTask;
import de.uulm.omi.evaluation.task.Plotting;
import de.uulm.omi.evaluation.task.Plotting.PlottingTask;
import de.uulm.omi.evaluation.task.Scale;
import de.uulm.omi.evaluation.task.TaskState;
import de.uulm.omi.evaluation.task.TaskType;
import de.uulm.omi.evaluation.task.YcsbWorkload;
......@@ -169,11 +168,8 @@ public class ElasticityYCSBWriteScenario extends EvaluationScenario {
//aNewRepeatFlow()
// .repeat(
aNewSequentialFlow()
.execute(new Delay(evaluationContext, this.elasticityYCSBWrite.getElasticitySpec().get(this.elasticityCounter).getScalingDelay().intValue()))
.execute(new LogTask(evaluationContext, TaskType.SCALE, TaskState.STARTED))
.execute(new Scale(evaluationContext, this.dbmsClusterContext, true, this.elasticityYCSBWrite
.execute(new Kaa(evaluationContext, this.dbmsClusterContext, this.elasticityYCSBWrite
.getElasticitySpec()))
.execute(new LogTask(evaluationContext, TaskType.SCALE, TaskState.FINISHED))
//.execute(new IncreaseCounter(evaluationContext, this.elasticityCounter))
.build()
//)
......
package de.uulm.omi.evaluation.task;
import de.uulm.omi.cloudiator.dbms.evaluator.model.ClusterContext;
import de.uulm.omi.cloudiator.dbms.evaluator.model.ElasticityStep;
import de.uulm.omi.cloudiator.dbms.evaluator.model.EvaluationContext;
import java.io.File;
import java.util.List;
import org.jeasy.flows.work.WorkReport;
import org.jeasy.flows.work.WorkStatus;
/**
* Created by Daniel Seybold on 02.03.2020.
*/
public class Kaa extends EvaluationTask {
private final List<ElasticityStep> elasticitySpec;
ClusterContext dbmsClusterContext;
public Kaa(EvaluationContext evaluationContext, ClusterContext dbmsClusterContext, List<ElasticityStep> elasticitySpec) {
super(TaskType.KAA, evaluationContext);
this.dbmsClusterContext = dbmsClusterContext;
this.elasticitySpec = elasticitySpec;
}
@Override
public WorkReport call() {
String loggerPrefix= "RUN " + this.evaluationContext.getRunCounter().intValue() +":";
String specUri = this.evaluationContext.getEvluationRun()
+ File.separator + EvaluationTask.SPECS_FOLDER
+ File.separator + EvaluationTask.ELASTICITY_SPEC;
this.writeReport(specUri, GSON.toJson(this.elasticitySpec));
WorkReport result = null;
for (ElasticityStep elasticityStep : this.elasticitySpec){
//execute SCALE Task with optional delay
result = new Delay(evaluationContext, elasticityStep.getScalingDelay().intValue()).call();
if (result.getStatus().equals(WorkStatus.FAILED)){
return result;
}
new LogTask(evaluationContext, TaskType.SCALE, TaskState.STARTED).call();
if (result.getStatus().equals(WorkStatus.FAILED)){
return result;
}
new Scale(this.evaluationContext,this.dbmsClusterContext,elasticityStep);
if (result.getStatus().equals(WorkStatus.FAILED)){
return result;
}
new LogTask(evaluationContext, TaskType.SCALE, TaskState.FINISHED).call();
if (result.getStatus().equals(WorkStatus.FAILED)){
return result;
}
}
return result;
}
}
......@@ -19,7 +19,6 @@ import de.uulm.omi.cloudiator.dbms.evaluator.model.ElasticityStep;
import de.uulm.omi.cloudiator.dbms.evaluator.model.ElasticityStep.ScalingTypeEnum;
import de.uulm.omi.cloudiator.dbms.evaluator.model.EvaluationContext;
import de.uulm.omi.utils.ColosseumClientHelper;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.Callable;
......@@ -39,18 +38,20 @@ public class Scale extends EvaluationTask {
private final long VM_CREATION_WAITING_PERIOD = 10000;
private final long INSTANCE_CREATION_WAITING_PERIOD = 20000;
private final boolean trigger;
private final ClusterContext clusterContext;
private final List<ElasticityStep> elasticitySpec;
ElasticityStep elasticityStep;
public Scale(EvaluationContext evaluationContext, ClusterContext dbmsClusterContext,
boolean trigger, List<ElasticityStep> elasticitySpec) {
ElasticityStep elasticityStep) {
super(TaskType.SCALE, evaluationContext);
this.colosseumClient = ColosseumClientHelper.getColosseumClient();
this.trigger = trigger;
this.clusterContext = dbmsClusterContext;
this.elasticitySpec = elasticitySpec;
this.elasticityStep = elasticityStep;
}
......@@ -59,18 +60,8 @@ public class Scale extends EvaluationTask {
String loggerPrefix= "RUN " + this.evaluationContext.getRunCounter().intValue() +":";
if(!trigger){
LOGGER.info(loggerPrefix + "Skipping Scale-out task as specified!");
return new DefaultWorkReport(WorkStatus.COMPLETED);
}
String specUri = this.evaluationContext.getEvluationRun()
+ File.separator + EvaluationTask.SPECS_FOLDER
+ File.separator + EvaluationTask.ELASTICITY_SPEC;
this.writeReport(specUri, GSON.toJson(this.elasticitySpec));
if(elasticitySpec.get(0).getScalingType().equals(ScalingTypeEnum.OUT)){
//check for elastic scale type
if(elasticityStep.getScalingType().equals(ScalingTypeEnum.OUT)){
LOGGER.info(loggerPrefix + " Executing SCALE-OUT as specified!");
}else{
LOGGER.warn(loggerPrefix + " Executing SCALE-IN as specified is currently not implemented, skipping!!");
......@@ -78,7 +69,6 @@ public class Scale extends EvaluationTask {
}
Long appInstanceId = Long.valueOf(this.clusterContext.getIdApplicationInstance());
checkNotNull(appInstanceId);
LOGGER.debug("Starting scaling for applicationInstanceId: " + appInstanceId);
......
......@@ -27,6 +27,7 @@ public enum TaskType {
MISC,
SPAWN_VM,
RECOVERY,
REMOTE_COMMAND
REMOTE_COMMAND,
KAA
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment