all wired up
This commit is contained in:
parent
ee5a466940
commit
7fdca9ffdb
@ -1,4 +1,5 @@
|
|||||||
using DistTestCore;
|
using DistTestCore;
|
||||||
|
using DistTestCore.Codex;
|
||||||
|
|
||||||
namespace CodexNetDeployer
|
namespace CodexNetDeployer
|
||||||
{
|
{
|
||||||
@ -12,7 +13,7 @@ namespace CodexNetDeployer
|
|||||||
string kubeNamespace,
|
string kubeNamespace,
|
||||||
int? numberOfCodexNodes,
|
int? numberOfCodexNodes,
|
||||||
int? storageQuota,
|
int? storageQuota,
|
||||||
string codexLogLevel,
|
CodexLogLevel codexLogLevel,
|
||||||
TestRunnerLocation runnerLocation)
|
TestRunnerLocation runnerLocation)
|
||||||
{
|
{
|
||||||
CodexImage = codexImage;
|
CodexImage = codexImage;
|
||||||
@ -33,7 +34,7 @@ namespace CodexNetDeployer
|
|||||||
public string KubeNamespace { get; }
|
public string KubeNamespace { get; }
|
||||||
public int? NumberOfCodexNodes { get; }
|
public int? NumberOfCodexNodes { get; }
|
||||||
public int? StorageQuota { get; }
|
public int? StorageQuota { get; }
|
||||||
public string CodexLogLevel { get; }
|
public CodexLogLevel CodexLogLevel { get; }
|
||||||
public TestRunnerLocation RunnerLocation { get; }
|
public TestRunnerLocation RunnerLocation { get; }
|
||||||
|
|
||||||
public void PrintConfig()
|
public void PrintConfig()
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
using DistTestCore;
|
using DistTestCore;
|
||||||
using DistTestCore.Codex;
|
|
||||||
using Utils;
|
|
||||||
|
|
||||||
namespace CodexNetDeployer
|
namespace CodexNetDeployer
|
||||||
{
|
{
|
||||||
@ -14,6 +12,25 @@ namespace CodexNetDeployer
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Deploy()
|
public void Deploy()
|
||||||
|
{
|
||||||
|
Log("Initializing...");
|
||||||
|
var starter = CreateStarter();
|
||||||
|
|
||||||
|
Log("Preparing configuration...");
|
||||||
|
var setup = new CodexSetup(config.NumberOfCodexNodes!.Value, config.CodexLogLevel);
|
||||||
|
|
||||||
|
Log("Creating resources...");
|
||||||
|
var group = (CodexNodeGroup) starter.BringOnline(setup);
|
||||||
|
|
||||||
|
var containers = group.Containers;
|
||||||
|
foreach (var container in containers.Containers)
|
||||||
|
{
|
||||||
|
var pod = container.Pod.PodInfo;
|
||||||
|
Log($"Container '{container.Name}' online. Pod: '{pod.Name}@{pod.Ip}' on '{pod.K8SNodeName}'.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private CodexStarter CreateStarter()
|
||||||
{
|
{
|
||||||
var log = new NullLog();
|
var log = new NullLog();
|
||||||
var lifecycleConfig = new DistTestCore.Configuration
|
var lifecycleConfig = new DistTestCore.Configuration
|
||||||
@ -22,7 +39,7 @@ namespace CodexNetDeployer
|
|||||||
logPath: "null",
|
logPath: "null",
|
||||||
logDebug: false,
|
logDebug: false,
|
||||||
dataFilesPath: "notUsed",
|
dataFilesPath: "notUsed",
|
||||||
codexLogLevel: ParseEnum.Parse<CodexLogLevel>(config.CodexLogLevel),
|
codexLogLevel: config.CodexLogLevel,
|
||||||
runnerLocation: config.RunnerLocation
|
runnerLocation: config.RunnerLocation
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -35,7 +52,12 @@ namespace CodexNetDeployer
|
|||||||
|
|
||||||
var lifecycle = new TestLifecycle(log, lifecycleConfig, timeset);
|
var lifecycle = new TestLifecycle(log, lifecycleConfig, timeset);
|
||||||
var workflowCreator = new KubernetesWorkflow.WorkflowCreator(log, kubeConfig);
|
var workflowCreator = new KubernetesWorkflow.WorkflowCreator(log, kubeConfig);
|
||||||
var starter = new CodexStarter(lifecycle, workflowCreator);
|
return new CodexStarter(lifecycle, workflowCreator);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Log(string msg)
|
||||||
|
{
|
||||||
|
Console.WriteLine(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using DistTestCore;
|
using DistTestCore;
|
||||||
using DistTestCore.Codex;
|
using DistTestCore.Codex;
|
||||||
using DistTestCore.Marketplace;
|
using DistTestCore.Marketplace;
|
||||||
|
using Utils;
|
||||||
using Configuration = CodexNetDeployer.Configuration;
|
using Configuration = CodexNetDeployer.Configuration;
|
||||||
|
|
||||||
public class Program
|
public class Program
|
||||||
@ -33,7 +34,7 @@ public class Program
|
|||||||
kubeNamespace: argOrVar.Get(ArgOrVar.KubeNamespace),
|
kubeNamespace: argOrVar.Get(ArgOrVar.KubeNamespace),
|
||||||
numberOfCodexNodes: argOrVar.GetInt(ArgOrVar.NumberOfCodexNodes),
|
numberOfCodexNodes: argOrVar.GetInt(ArgOrVar.NumberOfCodexNodes),
|
||||||
storageQuota: argOrVar.GetInt(ArgOrVar.StorageQuota),
|
storageQuota: argOrVar.GetInt(ArgOrVar.StorageQuota),
|
||||||
codexLogLevel: argOrVar.Get(ArgOrVar.LogLevel),
|
codexLogLevel: ParseEnum.Parse<CodexLogLevel>(argOrVar.Get(ArgOrVar.LogLevel, nameof(CodexLogLevel.Debug))),
|
||||||
runnerLocation: location
|
runnerLocation: location
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user