Merge branch 'feature/codex-net-deployer' into feature/continuous-testing
This commit is contained in:
commit
8bceba0182
|
@ -45,7 +45,7 @@ namespace CodexNetDeployer
|
|||
if (container != null) codexContainers.Add(container);
|
||||
}
|
||||
|
||||
return new CodexDeployment(gethResults, codexContainers.ToArray());
|
||||
return new CodexDeployment(gethResults, codexContainers.ToArray(), CreateMetadata());
|
||||
}
|
||||
|
||||
private (WorkflowCreator, TestLifecycle) CreateFacilities()
|
||||
|
@ -66,12 +66,25 @@ namespace CodexNetDeployer
|
|||
operationTimeout: timeset.K8sOperationTimeout(),
|
||||
retryDelay: timeset.WaitForK8sServiceDelay());
|
||||
|
||||
var workflowCreator = new WorkflowCreator(log, kubeConfig);
|
||||
var workflowCreator = new WorkflowCreator(log, kubeConfig, testNamespacePostfix: string.Empty);
|
||||
var lifecycle = new TestLifecycle(log, lifecycleConfig, timeset, workflowCreator);
|
||||
|
||||
return (workflowCreator, lifecycle);
|
||||
}
|
||||
|
||||
private DeploymentMetadata CreateMetadata()
|
||||
{
|
||||
return new DeploymentMetadata(
|
||||
codexImage: config.CodexImage,
|
||||
gethImage: config.GethImage,
|
||||
contractsImage: config.ContractsImage,
|
||||
kubeNamespace: config.KubeNamespace,
|
||||
numberOfCodexNodes: config.NumberOfCodexNodes!.Value,
|
||||
numberOfValidators: config.NumberOfValidators!.Value,
|
||||
storageQuotaMB: config.StorageQuota!.Value,
|
||||
codexLogLevel: config.CodexLogLevel);
|
||||
}
|
||||
|
||||
private void Log(string msg)
|
||||
{
|
||||
Console.WriteLine(msg);
|
||||
|
|
|
@ -5,13 +5,41 @@ namespace DistTestCore.Codex
|
|||
{
|
||||
public class CodexDeployment
|
||||
{
|
||||
public CodexDeployment(GethStartResult gethStartResult, RunningContainer[] codexContainers)
|
||||
public CodexDeployment(GethStartResult gethStartResult, RunningContainer[] codexContainers, DeploymentMetadata metadata)
|
||||
{
|
||||
GethStartResult = gethStartResult;
|
||||
CodexContainers = codexContainers;
|
||||
Metadata = metadata;
|
||||
}
|
||||
|
||||
public GethStartResult GethStartResult { get; }
|
||||
public RunningContainer[] CodexContainers { get; }
|
||||
public DeploymentMetadata Metadata { get; }
|
||||
}
|
||||
|
||||
public class DeploymentMetadata
|
||||
{
|
||||
public DeploymentMetadata(string codexImage, string gethImage, string contractsImage, string kubeNamespace, int numberOfCodexNodes, int numberOfValidators, int storageQuotaMB, CodexLogLevel codexLogLevel)
|
||||
{
|
||||
DeployDateTimeUtc = DateTime.UtcNow;
|
||||
CodexImage = codexImage;
|
||||
GethImage = gethImage;
|
||||
ContractsImage = contractsImage;
|
||||
KubeNamespace = kubeNamespace;
|
||||
NumberOfCodexNodes = numberOfCodexNodes;
|
||||
NumberOfValidators = numberOfValidators;
|
||||
StorageQuotaMB = storageQuotaMB;
|
||||
CodexLogLevel = codexLogLevel;
|
||||
}
|
||||
|
||||
public string CodexImage { get; }
|
||||
public DateTime DeployDateTimeUtc { get; }
|
||||
public string GethImage { get; }
|
||||
public string ContractsImage { get; }
|
||||
public string KubeNamespace { get; }
|
||||
public int NumberOfCodexNodes { get; }
|
||||
public int NumberOfValidators { get; }
|
||||
public int StorageQuotaMB { get; }
|
||||
public CodexLogLevel CodexLogLevel { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,10 +13,15 @@ namespace KubernetesWorkflow
|
|||
private readonly string testNamespace;
|
||||
|
||||
public WorkflowCreator(BaseLog log, Configuration configuration)
|
||||
: this(log, configuration, Guid.NewGuid().ToString().ToLowerInvariant())
|
||||
{
|
||||
}
|
||||
|
||||
public WorkflowCreator(BaseLog log, Configuration configuration, string testNamespacePostfix)
|
||||
{
|
||||
cluster = new K8sCluster(configuration);
|
||||
this.log = log;
|
||||
testNamespace = Guid.NewGuid().ToString().ToLowerInvariant();
|
||||
testNamespace = testNamespacePostfix;
|
||||
}
|
||||
|
||||
public StartupWorkflow CreateWorkflow()
|
||||
|
|
Loading…
Reference in New Issue