2023-04-12 14:12:04 +00:00
|
|
|
|
using DistTestCore.Codex;
|
|
|
|
|
using KubernetesWorkflow;
|
2023-04-12 14:06:04 +00:00
|
|
|
|
using Logging;
|
|
|
|
|
|
|
|
|
|
namespace DistTestCore
|
|
|
|
|
{
|
|
|
|
|
public class CodexStarter
|
|
|
|
|
{
|
|
|
|
|
private readonly WorkflowCreator workflowCreator;
|
|
|
|
|
|
|
|
|
|
public CodexStarter(TestLog log, Configuration configuration)
|
|
|
|
|
{
|
|
|
|
|
workflowCreator = new WorkflowCreator(configuration.GetK8sConfiguration());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ICodexNodeGroup BringOnline(CodexSetupConfig codexSetupConfig)
|
|
|
|
|
{
|
2023-04-12 14:12:04 +00:00
|
|
|
|
var workflow = workflowCreator.CreateWorkflow();
|
|
|
|
|
var startupConfig = new StartupConfig();
|
|
|
|
|
startupConfig.Add(codexSetupConfig);
|
2023-04-12 14:06:04 +00:00
|
|
|
|
|
2023-04-12 14:12:04 +00:00
|
|
|
|
var runningContainers = workflow.Start(codexSetupConfig.NumberOfNodes, codexSetupConfig.Location, new CodexContainerRecipe(), startupConfig);
|
|
|
|
|
|
|
|
|
|
// create access objects. Easy, right?
|
2023-04-12 14:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void DeleteAllResources()
|
|
|
|
|
{
|
|
|
|
|
var workflow = workflowCreator.CreateWorkflow();
|
|
|
|
|
workflow.DeleteAllResources();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|