rewiring codex node starter
This commit is contained in:
parent
68d089874d
commit
bb81d7f037
|
@ -1,6 +1,4 @@
|
|||
using KubernetesWorkflow;
|
||||
|
||||
namespace DistTestCore.Codex
|
||||
namespace DistTestCore.Codex
|
||||
{
|
||||
public class CodexStartupConfig
|
||||
{
|
||||
|
@ -8,5 +6,8 @@ namespace DistTestCore.Codex
|
|||
public CodexLogLevel? LogLevel { get; set; }
|
||||
public ByteSize? StorageQuota { get; set; }
|
||||
public bool MetricsEnabled { get; set; }
|
||||
|
||||
//public IOnlineCodexNode? BootstrapNode { get; private set; }
|
||||
//public MarketplaceInitialConfig? MarketplaceConfig { get; private set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using DistTestCore.Codex;
|
||||
using KubernetesWorkflow;
|
||||
|
||||
namespace DistTestCore
|
||||
{
|
||||
|
@ -12,32 +13,17 @@ namespace DistTestCore
|
|||
//ICodexSetupConfig EnableMarketplace(int initialBalance);
|
||||
ICodexNodeGroup BringOnline();
|
||||
}
|
||||
|
||||
public enum Location
|
||||
{
|
||||
Unspecified,
|
||||
BensLaptop,
|
||||
BensOldGamingMachine,
|
||||
}
|
||||
|
||||
public class CodexSetupConfig : ICodexSetupConfig
|
||||
|
||||
public class CodexSetupConfig : CodexStartupConfig, ICodexSetupConfig
|
||||
{
|
||||
private readonly CodexStarter starter;
|
||||
|
||||
public int NumberOfNodes { get; }
|
||||
public Location Location { get; private set; }
|
||||
public CodexLogLevel? LogLevel { get; private set; }
|
||||
//public IOnlineCodexNode? BootstrapNode { get; private set; }
|
||||
public ByteSize? StorageQuota { get; private set; }
|
||||
public bool MetricsEnabled { get; private set; }
|
||||
//public MarketplaceInitialConfig? MarketplaceConfig { get; private set; }
|
||||
|
||||
public CodexSetupConfig(CodexStarter starter, int numberOfNodes)
|
||||
{
|
||||
this.starter = starter;
|
||||
NumberOfNodes = numberOfNodes;
|
||||
Location = Location.Unspecified;
|
||||
MetricsEnabled = false;
|
||||
}
|
||||
|
||||
public ICodexNodeGroup BringOnline()
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using KubernetesWorkflow;
|
||||
using DistTestCore.Codex;
|
||||
using KubernetesWorkflow;
|
||||
using Logging;
|
||||
|
||||
namespace DistTestCore
|
||||
|
@ -14,7 +15,13 @@ namespace DistTestCore
|
|||
|
||||
public ICodexNodeGroup BringOnline(CodexSetupConfig codexSetupConfig)
|
||||
{
|
||||
var workflow = workflowCreator.CreateWorkflow();
|
||||
var startupConfig = new StartupConfig();
|
||||
startupConfig.Add(codexSetupConfig);
|
||||
|
||||
var runningContainers = workflow.Start(codexSetupConfig.NumberOfNodes, codexSetupConfig.Location, new CodexContainerRecipe(), startupConfig);
|
||||
|
||||
// create access objects. Easy, right?
|
||||
}
|
||||
|
||||
public void DeleteAllResources()
|
||||
|
|
|
@ -16,5 +16,6 @@
|
|||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\KubernetesWorkflow\KubernetesWorkflow.csproj" />
|
||||
<ProjectReference Include="..\Logging\Logging.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
public T Get<T>()
|
||||
{
|
||||
var match = configs.Single(c => c.GetType() == typeof(T));
|
||||
var match = configs.Single(c => typeof(T).IsAssignableFrom(c.GetType()));
|
||||
return (T)match;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue