all wired up

This commit is contained in:
benbierens 2023-06-22 10:33:21 +02:00
parent ee5a466940
commit 7fdca9ffdb
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
3 changed files with 31 additions and 7 deletions

View File

@ -1,4 +1,5 @@
using DistTestCore;
using DistTestCore.Codex;
namespace CodexNetDeployer
{
@ -12,7 +13,7 @@ namespace CodexNetDeployer
string kubeNamespace,
int? numberOfCodexNodes,
int? storageQuota,
string codexLogLevel,
CodexLogLevel codexLogLevel,
TestRunnerLocation runnerLocation)
{
CodexImage = codexImage;
@ -33,7 +34,7 @@ namespace CodexNetDeployer
public string KubeNamespace { get; }
public int? NumberOfCodexNodes { get; }
public int? StorageQuota { get; }
public string CodexLogLevel { get; }
public CodexLogLevel CodexLogLevel { get; }
public TestRunnerLocation RunnerLocation { get; }
public void PrintConfig()

View File

@ -1,6 +1,4 @@
using DistTestCore;
using DistTestCore.Codex;
using Utils;
namespace CodexNetDeployer
{
@ -14,6 +12,25 @@ namespace CodexNetDeployer
}
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 lifecycleConfig = new DistTestCore.Configuration
@ -22,7 +39,7 @@ namespace CodexNetDeployer
logPath: "null",
logDebug: false,
dataFilesPath: "notUsed",
codexLogLevel: ParseEnum.Parse<CodexLogLevel>(config.CodexLogLevel),
codexLogLevel: config.CodexLogLevel,
runnerLocation: config.RunnerLocation
);
@ -35,7 +52,12 @@ namespace CodexNetDeployer
var lifecycle = new TestLifecycle(log, lifecycleConfig, timeset);
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);
}
}
}

View File

@ -2,6 +2,7 @@
using DistTestCore;
using DistTestCore.Codex;
using DistTestCore.Marketplace;
using Utils;
using Configuration = CodexNetDeployer.Configuration;
public class Program
@ -33,7 +34,7 @@ public class Program
kubeNamespace: argOrVar.Get(ArgOrVar.KubeNamespace),
numberOfCodexNodes: argOrVar.GetInt(ArgOrVar.NumberOfCodexNodes),
storageQuota: argOrVar.GetInt(ArgOrVar.StorageQuota),
codexLogLevel: argOrVar.Get(ArgOrVar.LogLevel),
codexLogLevel: ParseEnum.Parse<CodexLogLevel>(argOrVar.Get(ArgOrVar.LogLevel, nameof(CodexLogLevel.Debug))),
runnerLocation: location
);