mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-06 23:43:07 +00:00
updates marketplace contract, fixes type conversions
This commit is contained in:
parent
dc7a034566
commit
0c961b8348
@ -61,7 +61,8 @@ namespace KubernetesWorkflow
|
|||||||
var startResult = controller.BringOnline(recipes, location);
|
var startResult = controller.BringOnline(recipes, location);
|
||||||
var containers = CreateContainers(startResult, recipes, startupConfig);
|
var containers = CreateContainers(startResult, recipes, startupConfig);
|
||||||
|
|
||||||
var rc = new RunningPod(Guid.NewGuid().ToString(), startupConfig, startResult, containers);
|
var info = GetPodInfo(startResult.Deployment);
|
||||||
|
var rc = new RunningPod(Guid.NewGuid().ToString(), info, startupConfig, startResult, containers);
|
||||||
cluster.Configuration.Hooks.OnContainersStarted(rc);
|
cluster.Configuration.Hooks.OnContainersStarted(rc);
|
||||||
|
|
||||||
if (startResult.ExternalService != null)
|
if (startResult.ExternalService != null)
|
||||||
@ -83,9 +84,14 @@ namespace KubernetesWorkflow
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PodInfo GetPodInfo(RunningDeployment deployment)
|
||||||
|
{
|
||||||
|
return K8s(c => c.GetPodInfo(deployment));
|
||||||
|
}
|
||||||
|
|
||||||
public PodInfo GetPodInfo(RunningContainer container)
|
public PodInfo GetPodInfo(RunningContainer container)
|
||||||
{
|
{
|
||||||
return K8s(c => c.GetPodInfo(container.RunningPod.StartResult.Deployment));
|
return GetPodInfo(container.RunningPod.StartResult.Deployment);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PodInfo GetPodInfo(RunningPod pod)
|
public PodInfo GetPodInfo(RunningPod pod)
|
||||||
|
|||||||
@ -4,9 +4,10 @@ namespace KubernetesWorkflow.Types
|
|||||||
{
|
{
|
||||||
public class RunningPod
|
public class RunningPod
|
||||||
{
|
{
|
||||||
public RunningPod(string id, StartupConfig startupConfig, StartResult startResult, RunningContainer[] containers)
|
public RunningPod(string id, PodInfo podInfo, StartupConfig startupConfig, StartResult startResult, RunningContainer[] containers)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
|
PodInfo = podInfo;
|
||||||
StartupConfig = startupConfig;
|
StartupConfig = startupConfig;
|
||||||
StartResult = startResult;
|
StartResult = startResult;
|
||||||
Containers = containers;
|
Containers = containers;
|
||||||
@ -15,6 +16,7 @@ namespace KubernetesWorkflow.Types
|
|||||||
}
|
}
|
||||||
|
|
||||||
public string Id { get; }
|
public string Id { get; }
|
||||||
|
public PodInfo PodInfo { get; }
|
||||||
public StartupConfig StartupConfig { get; }
|
public StartupConfig StartupConfig { get; }
|
||||||
public StartResult StartResult { get; }
|
public StartResult StartResult { get; }
|
||||||
public RunningContainer[] Containers { get; }
|
public RunningContainer[] Containers { get; }
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -14,7 +14,7 @@ namespace CodexPlugin
|
|||||||
name: container.Name,
|
name: container.Name,
|
||||||
imageName: container.Recipe.Image,
|
imageName: container.Recipe.Image,
|
||||||
startUtc: container.Recipe.RecipeCreatedUtc,
|
startUtc: container.Recipe.RecipeCreatedUtc,
|
||||||
discoveryEndpoint: container.GetInternalAddress(CodexContainerRecipe.DiscoveryPortTag),
|
discoveryEndpoint: SetClusterInternalIpAddress(pod, container.GetInternalAddress(CodexContainerRecipe.DiscoveryPortTag)),
|
||||||
apiEndpoint: container.GetAddress(CodexContainerRecipe.ApiPortTag),
|
apiEndpoint: container.GetAddress(CodexContainerRecipe.ApiPortTag),
|
||||||
listenEndpoint: container.GetInternalAddress(CodexContainerRecipe.ListenPortTag),
|
listenEndpoint: container.GetInternalAddress(CodexContainerRecipe.ListenPortTag),
|
||||||
ethAccount: container.Recipe.Additionals.Get<EthAccount>(),
|
ethAccount: container.Recipe.Additionals.Get<EthAccount>(),
|
||||||
@ -22,13 +22,14 @@ namespace CodexPlugin
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: is this needed for the discovery address??
|
private static Address SetClusterInternalIpAddress(RunningPod pod, Address address)
|
||||||
//var info = codexAccess.GetPodInfo();
|
{
|
||||||
//return new Address(
|
return new Address(
|
||||||
// logName: $"{GetName()}:DiscoveryPort",
|
logName: address.LogName,
|
||||||
// host: info.Ip,
|
host: pod.PodInfo.Ip,
|
||||||
// port: Container.Recipe.GetPortByTag(CodexContainerRecipe.DiscoveryPortTag)!.Number
|
port: address.Port
|
||||||
//);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
private static Address? GetMetricsEndpoint(RunningContainer container)
|
private static Address? GetMetricsEndpoint(RunningContainer container)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -78,6 +78,11 @@ namespace MarketInsights
|
|||||||
average.ProofProbability = GetNewAverage(average.ProofProbability, average.Number, requestEvent.Request.Request.Ask.ProofProbability);
|
average.ProofProbability = GetNewAverage(average.ProofProbability, average.Number, requestEvent.Request.Request.Ask.ProofProbability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private float GetNewAverage(float currentAverage, int newNumberOfValues, ulong newValue)
|
||||||
|
{
|
||||||
|
return GetNewAverage(currentAverage, newNumberOfValues, Convert.ToSingle(newValue));
|
||||||
|
}
|
||||||
|
|
||||||
private float GetNewAverage(float currentAverage, int newNumberOfValues, BigInteger newValue)
|
private float GetNewAverage(float currentAverage, int newNumberOfValues, BigInteger newValue)
|
||||||
{
|
{
|
||||||
return GetNewAverage(currentAverage, newNumberOfValues, (float)newValue);
|
return GetNewAverage(currentAverage, newNumberOfValues, (float)newValue);
|
||||||
|
|||||||
@ -95,8 +95,8 @@ namespace TestNetRewarder
|
|||||||
|
|
||||||
private bool MeetsSizeRequirement(IChainStateRequest r)
|
private bool MeetsSizeRequirement(IChainStateRequest r)
|
||||||
{
|
{
|
||||||
var slotSize = r.Request.Ask.SlotSize.ToDecimal();
|
var slotSize = r.Request.Ask.SlotSize;
|
||||||
decimal min = reward.CheckConfig.MinSlotSize.SizeInBytes;
|
ulong min = Convert.ToUInt64(reward.CheckConfig.MinSlotSize.SizeInBytes);
|
||||||
return slotSize >= min;
|
return slotSize >= min;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user