Adds blockTTL to configuration of codex containers

This commit is contained in:
benbierens 2023-06-29 16:03:45 +02:00
parent caf5de678a
commit d985e3191a
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
7 changed files with 30 additions and 4 deletions

View File

@ -87,6 +87,10 @@ namespace CodexNetDeployer
var marketplaceConfig = new MarketplaceInitialConfig(100000.Eth(), 0.TestTokens(), validatorsLeft > 0);
marketplaceConfig.AccountIndexOverride = i;
codexStart.MarketplaceConfig = marketplaceConfig;
if (config.BlockTTL != Configuration.SecondsIn1Day)
{
codexStart.BlockTTL = config.BlockTTL;
}
return codexStart;
}

View File

@ -7,6 +7,8 @@ namespace CodexNetDeployer
{
public class Configuration
{
public const int SecondsIn1Day = 24 * 60 * 60;
[Uniform("codex-image", "ci", "CODEXIMAGE", true, "Docker image of Codex.")]
public string CodexImage { get; set; } = CodexContainerRecipe.DockerImage;
@ -49,6 +51,9 @@ namespace CodexNetDeployer
[Uniform("max-duration", "md", "MAXDURATION", true, "Maximum duration in seconds for contracts which will be accepted.")]
public int MaxDuration { get; set; }
[Uniform("block-ttl", "bt", "BLOCKTTL", false, "Block timeout in seconds. Default is 24 hours.")]
public int BlockTTL { get; set; } = SecondsIn1Day;
public TestRunnerLocation RunnerLocation { get; set; } = TestRunnerLocation.InternalToCluster;
public List<string> Validate()

View File

@ -71,8 +71,16 @@ namespace ContinuousTests
var codexAccess = new CodexAccess(lifecycle, container);
var marketAccess = new MarketplaceAccess(lifecycle, marketplaceNetwork, account, codexAccess);
try
{
operation(codexAccess, marketAccess);
}
catch
{
lifecycle.DownloadLog(container);
throw;
}
}
finally
{
flow.DeleteTestResources();

View File

@ -167,7 +167,8 @@ namespace ContinuousTests
private void OverviewLog(string msg)
{
Log(msg);
overviewLog.Log(testName + ": " + msg);
var containerNames = $"({string.Join(",", nodes.Select(n => n.Container.Name))})";
overviewLog.Log( testName + ": " + msg);
}
private CodexNode[] CreateRandomNodes(int number)

View File

@ -40,6 +40,10 @@ namespace DistTestCore.Codex
{
AddEnvVar("STORAGE_QUOTA", config.StorageQuota.SizeInBytes.ToString()!);
}
if (config.BlockTTL != null)
{
AddEnvVar("BLOCK_TTL", config.BlockTTL.ToString()!);
}
if (config.MetricsEnabled)
{
AddEnvVar("METRICS_ADDR", "0.0.0.0");

View File

@ -1,4 +1,5 @@
using Logging;
using KubernetesWorkflow;
using Logging;
using Utils;
namespace DistTestCore.Codex
@ -8,13 +9,15 @@ namespace DistTestCore.Codex
private readonly BaseLog log;
private readonly ITimeSet timeSet;
public CodexNode(BaseLog log, ITimeSet timeSet, Address address)
public CodexNode(BaseLog log, RunningContainer container, ITimeSet timeSet, Address address)
{
this.log = log;
Container = container;
this.timeSet = timeSet;
Address = address;
}
public RunningContainer Container { get; }
public Address Address { get; }
public CodexDebugResponse GetDebugInfo()

View File

@ -17,5 +17,6 @@ namespace DistTestCore.Codex
public bool MetricsEnabled { get; set; }
public MarketplaceInitialConfig? MarketplaceConfig { get; set; }
public string? BootstrapSpr { get; set; }
public int? BlockTTL { get; set; }
}
}