43 lines
1.1 KiB
C#
Raw Normal View History

2023-09-12 13:32:06 +02:00
using Core;
2023-09-11 16:57:57 +02:00
using KubernetesWorkflow;
namespace CodexPlugin
{
2023-09-12 11:25:04 +02:00
public class CodexPlugin : IProjectPlugin
2023-09-11 16:57:57 +02:00
{
2023-09-13 10:03:11 +02:00
private readonly CodexStarter codexStarter;
private readonly IPluginTools tools;
2023-09-11 16:57:57 +02:00
2023-09-13 10:03:11 +02:00
public CodexPlugin(IPluginTools tools)
2023-09-11 16:57:57 +02:00
{
2023-09-13 10:03:11 +02:00
codexStarter = new CodexStarter(tools);
this.tools = tools;
2023-09-12 10:31:55 +02:00
}
2023-09-13 10:03:11 +02:00
#region IProjectPlugin Implementation
public void Announce()
2023-09-12 10:31:55 +02:00
{
2023-09-13 10:03:11 +02:00
tools.GetLog().Log("hello from codex plugin. codex container info here.");
2023-09-11 16:57:57 +02:00
}
2023-09-13 10:03:11 +02:00
public void Decommission()
2023-09-12 10:31:55 +02:00
{
}
#endregion
2023-09-11 16:57:57 +02: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);
}
}
}