Runner correctly ingests codex-deployment.json

This commit is contained in:
benbierens 2023-06-23 10:35:23 +02:00
parent 091eae36cc
commit 9d3874c88f
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
4 changed files with 23 additions and 17 deletions

View File

@ -94,7 +94,7 @@ namespace ContinuousTests
throw new Exception($"Unvalid logpath set: '{configuration.LogPath}'"); throw new Exception($"Unvalid logpath set: '{configuration.LogPath}'");
} }
if (configuration.CodexDeployment != null && configuration.CodexDeployment.CodexContainers.Any()) if (configuration.CodexDeployment == null || !configuration.CodexDeployment.CodexContainers.Any())
{ {
throw new Exception("No Codex deployment found."); throw new Exception("No Codex deployment found.");
} }

View File

@ -1,4 +1,6 @@
namespace DistTestCore.Marketplace using Newtonsoft.Json;
namespace DistTestCore.Marketplace
{ {
public class GethStartResult public class GethStartResult
{ {
@ -9,6 +11,7 @@
CompanionNode = companionNode; CompanionNode = companionNode;
} }
[JsonIgnore]
public IMarketplaceAccessFactory MarketplaceAccessFactory { get; } public IMarketplaceAccessFactory MarketplaceAccessFactory { get; }
public MarketplaceNetwork MarketplaceNetwork { get; } public MarketplaceNetwork MarketplaceNetwork { get; }
public GethCompanionNodeInfo CompanionNode { get; } public GethCompanionNodeInfo CompanionNode { get; }

View File

@ -23,12 +23,12 @@ namespace KubernetesWorkflow
public class RunningContainer public class RunningContainer
{ {
public RunningContainer(RunningPod pod, ContainerRecipe recipe, Port[] servicePorts, StartupConfig startupConfig, Address clusterExternalAddress, Address clusterInternalAddress) public RunningContainer(RunningPod pod, ContainerRecipe recipe, Port[] servicePorts, string name, Address clusterExternalAddress, Address clusterInternalAddress)
{ {
Pod = pod; Pod = pod;
Recipe = recipe; Recipe = recipe;
ServicePorts = servicePorts; ServicePorts = servicePorts;
Name = GetContainerName(recipe, startupConfig); Name = name;
ClusterExternalAddress = clusterExternalAddress; ClusterExternalAddress = clusterExternalAddress;
ClusterInternalAddress = clusterInternalAddress; ClusterInternalAddress = clusterInternalAddress;
} }
@ -39,17 +39,5 @@ namespace KubernetesWorkflow
public Port[] ServicePorts { get; } public Port[] ServicePorts { get; }
public Address ClusterExternalAddress { get; } public Address ClusterExternalAddress { get; }
public Address ClusterInternalAddress { get; } public Address ClusterInternalAddress { get; }
private string GetContainerName(ContainerRecipe recipe, StartupConfig startupConfig)
{
if (!string.IsNullOrEmpty(startupConfig.NameOverride))
{
return $"<{startupConfig.NameOverride}{recipe.Number}>";
}
else
{
return $"<{recipe.Name}>";
}
}
} }
} }

View File

@ -81,13 +81,28 @@ namespace KubernetesWorkflow
var servicePorts = runningPod.GetServicePortsForContainerRecipe(r); var servicePorts = runningPod.GetServicePortsForContainerRecipe(r);
log.Debug($"{r} -> service ports: {string.Join(",", servicePorts.Select(p => p.Number))}"); log.Debug($"{r} -> service ports: {string.Join(",", servicePorts.Select(p => p.Number))}");
return new RunningContainer(runningPod, r, servicePorts, startupConfig, var name = GetContainerName(r, startupConfig);
return new RunningContainer(runningPod, r, servicePorts, name,
GetContainerExternalAddress(runningPod, servicePorts), GetContainerExternalAddress(runningPod, servicePorts),
GetContainerInternalAddress(r)); GetContainerInternalAddress(r));
}).ToArray(); }).ToArray();
} }
private string GetContainerName(ContainerRecipe recipe, StartupConfig startupConfig)
{
if (startupConfig == null) return "";
if (!string.IsNullOrEmpty(startupConfig.NameOverride))
{
return $"<{startupConfig.NameOverride}{recipe.Number}>";
}
else
{
return $"<{recipe.Name}>";
}
}
private Address GetContainerExternalAddress(RunningPod pod, Port[] servicePorts) private Address GetContainerExternalAddress(RunningPod pod, Port[] servicePorts)
{ {
return new Address( return new Address(