cs-codex-dist-tests/CodexPlugin/CodexPlugin.cs

54 lines
1.3 KiB
C#
Raw Normal View History

2023-09-11 14:57:57 +00:00
using DistTestCore;
using KubernetesWorkflow;
2023-09-12 08:31:55 +00:00
using Logging;
2023-09-11 14:57:57 +00:00
namespace CodexPlugin
{
2023-09-12 09:25:04 +00:00
public class CodexPlugin : IProjectPlugin
2023-09-11 14:57:57 +00:00
{
2023-09-12 08:31:55 +00:00
private CodexStarter codexStarter = null!;
2023-09-11 14:57:57 +00:00
2023-09-12 08:31:55 +00:00
#region IProjectPlugin Implementation
public void Announce(ILog log)
2023-09-11 14:57:57 +00:00
{
2023-09-12 08:31:55 +00:00
log.Log("hello from codex plugin. codex container info here.");
}
public void Initialize(IPluginTools tools)
{
codexStarter = new CodexStarter(tools);
2023-09-11 14:57:57 +00:00
}
2023-09-12 08:31:55 +00:00
public void Finalize(ILog log)
{
}
#endregion
2023-09-11 14:57:57 +00:00
public RunningContainers[] StartCodexNodes(int numberOfNodes, Action<ICodexSetup> setup)
{
var codexSetup = new CodexSetup(numberOfNodes, CodexLogLevel.Trace);
setup(codexSetup);
return codexStarter.BringOnline(codexSetup);
}
public ICodexNodeGroup WrapCodexContainers(RunningContainers[] containers)
{
return codexStarter.WrapCodexContainers(containers);
}
public IOnlineCodexNode SetupCodexNode(Action<ICodexSetup> setup)
{
return null!;
}
public ICodexNodeGroup SetupCodexNodes(int number)
{
2023-09-12 09:37:20 +00:00
var rc = StartCodexNodes(number, s => { });
2023-09-11 14:57:57 +00:00
return WrapCodexContainers(rc);
}
2023-09-12 08:31:55 +00:00
2023-09-11 14:57:57 +00:00
}
}