mirror of
https://github.com/codex-storage/cs-codex-dist-tests.git
synced 2025-02-10 11:06:42 +00:00
This needs cleaning up
This commit is contained in:
parent
d33eb53003
commit
1512bd2716
@ -1,4 +1,6 @@
|
|||||||
namespace CodexDistTestCore
|
using CodexDistTestCore.Marketplace;
|
||||||
|
|
||||||
|
namespace CodexDistTestCore
|
||||||
{
|
{
|
||||||
public class CodexNodeContainer
|
public class CodexNodeContainer
|
||||||
{
|
{
|
||||||
@ -24,6 +26,8 @@
|
|||||||
public int ListenPort { get; }
|
public int ListenPort { get; }
|
||||||
public string DataDir { get; }
|
public string DataDir { get; }
|
||||||
public int MetricsPort { get; }
|
public int MetricsPort { get; }
|
||||||
|
|
||||||
|
public GethCompanionNodeContainer? GethCompanionNodeContainer { get; set; } // :C
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CodexGroupNumberSource
|
public class CodexGroupNumberSource
|
||||||
|
@ -50,16 +50,12 @@ namespace CodexDistTestCore.Config
|
|||||||
AddVar("METRICS_ADDR", "0.0.0.0");
|
AddVar("METRICS_ADDR", "0.0.0.0");
|
||||||
AddVar("METRICS_PORT", container.MetricsPort.ToString());
|
AddVar("METRICS_PORT", container.MetricsPort.ToString());
|
||||||
}
|
}
|
||||||
if (container.GethCompanionNodeContainer != null)
|
if (node.MarketplaceConfig != null)
|
||||||
{
|
{
|
||||||
// well, darn: To get the account here, the geth companion needs to have been started and account string fetched.
|
//ETH_PROVIDER
|
||||||
// but the codex node and geth companion node are in the same pod. so they start at the same time.
|
//ETH_ACCOUNT
|
||||||
// so we cannot start the codex node with the correct account string at the same time as we start the geth node that
|
//ETH_DEPLOYMENT
|
||||||
// is supposed to generate that string.
|
AddVar("ETH_ACCOUNT", container.GethCompanionNodeContainer!.Account);
|
||||||
// begin rework: Separate pod for geth companion node.
|
|
||||||
//ETH_PROVIDER
|
|
||||||
//ETH_ACCOUNT
|
|
||||||
//ETH_DEPLOYMENT
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ namespace CodexDistTestCore
|
|||||||
if (offline.MarketplaceConfig != null)
|
if (offline.MarketplaceConfig != null)
|
||||||
{
|
{
|
||||||
group.GethCompanionGroup = marketplaceController.BringOnlineMarketplace(offline);
|
group.GethCompanionGroup = marketplaceController.BringOnlineMarketplace(offline);
|
||||||
|
ConnectMarketplace(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
K8s(k => k.BringOnline(group, offline));
|
K8s(k => k.BringOnline(group, offline));
|
||||||
@ -43,10 +44,6 @@ namespace CodexDistTestCore
|
|||||||
{
|
{
|
||||||
BringOnlineMetrics(group);
|
BringOnlineMetrics(group);
|
||||||
}
|
}
|
||||||
if (offline.MarketplaceConfig != null)
|
|
||||||
{
|
|
||||||
ConnectMarketplace(group);
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Log($"{group.Describe()} online.");
|
log.Log($"{group.Describe()} online.");
|
||||||
|
|
||||||
@ -126,6 +123,8 @@ namespace CodexDistTestCore
|
|||||||
|
|
||||||
private void ConnectMarketplace(CodexNodeGroup group, OnlineCodexNode node, GethCompanionNodeContainer container)
|
private void ConnectMarketplace(CodexNodeGroup group, OnlineCodexNode node, GethCompanionNodeContainer container)
|
||||||
{
|
{
|
||||||
|
node.Container.GethCompanionNodeContainer = container; // :c
|
||||||
|
|
||||||
var access = new MarketplaceAccess(this, marketplaceController, log, group, container);
|
var access = new MarketplaceAccess(this, marketplaceController, log, group, container);
|
||||||
access.Initialize();
|
access.Initialize();
|
||||||
node.Marketplace = access;
|
node.Marketplace = access;
|
||||||
|
@ -292,10 +292,10 @@ namespace CodexDistTestCore
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<V1Container> CreateDeploymentContainers(CodexNodeGroup online, OfflineCodexNodes offline)
|
private List<V1Container> CreateDeploymentContainers(CodexNodeGroup group, OfflineCodexNodes offline)
|
||||||
{
|
{
|
||||||
var result = new List<V1Container>();
|
var result = new List<V1Container>();
|
||||||
var containers = online.GetContainers();
|
var containers = group.GetContainers();
|
||||||
foreach (var container in containers)
|
foreach (var container in containers)
|
||||||
{
|
{
|
||||||
result.Add(new V1Container
|
result.Add(new V1Container
|
||||||
@ -317,11 +317,11 @@ namespace CodexDistTestCore
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DeleteDeployment(CodexNodeGroup online)
|
private void DeleteDeployment(CodexNodeGroup group)
|
||||||
{
|
{
|
||||||
if (online.Deployment == null) return;
|
if (group.Deployment == null) return;
|
||||||
client.DeleteNamespacedDeployment(online.Deployment.Name(), K8sNamespace);
|
client.DeleteNamespacedDeployment(group.Deployment.Name(), K8sNamespace);
|
||||||
online.Deployment = null;
|
group.Deployment = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreatePrometheusDeployment(K8sPrometheusSpecs spec)
|
private void CreatePrometheusDeployment(K8sPrometheusSpecs spec)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user