rigs continuous testnet for holdmybeer test.

This commit is contained in:
benbierens 2023-08-23 08:29:16 +02:00
parent e340b3cd41
commit 9a117cca70
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
6 changed files with 37 additions and 5 deletions

View File

@ -90,6 +90,14 @@ namespace CodexNetDeployer
{
codexStart.BlockTTL = config.BlockTTL;
}
if (config.BlockMI != Configuration.TenMinutes)
{
codexStart.BlockMaintenanceInterval = TimeSpan.FromSeconds(config.BlockMI);
}
if (config.BlockMN != 1000)
{
codexStart.BlockMaintenanceNumber = config.BlockMN;
}
return codexStart;
}

View File

@ -7,6 +7,7 @@ namespace CodexNetDeployer
public class Configuration
{
public const int SecondsIn1Day = 24 * 60 * 60;
public const int TenMinutes = 10 * 60;
[Uniform("kube-config", "kc", "KUBECONFIG", false, "Path to Kubeconfig file. Use 'null' (default) to use local cluster.")]
public string KubeConfigFile { get; set; } = "null";
@ -44,6 +45,12 @@ namespace CodexNetDeployer
[Uniform("block-ttl", "bt", "BLOCKTTL", false, "Block timeout in seconds. Default is 24 hours.")]
public int BlockTTL { get; set; } = SecondsIn1Day;
[Uniform("block-mi", "bmi", "BLOCKMI", false, "Block maintenance interval in seconds. Default is 10 minutes.")]
public int BlockMI { get; set; } = TenMinutes;
[Uniform("block-mn", "bmn", "BLOCKMN", false, "Number of blocks maintained per interval. Default is 1000 blocks.")]
public int BlockMN { get; set; } = 1000;
[Uniform("metrics", "m", "METRICS", false, "[None*, Record, Dashboard]. Determines if metrics will be recorded and if a dashboard service will be created.")]
public MetricsMode Metrics { get; set; } = MetricsMode.None;

View File

@ -106,7 +106,10 @@ namespace CodexNetDeployer
initialTestTokens: config.InitialTestTokens,
minPrice: config.MinPrice,
maxCollateral: config.MaxCollateral,
maxDuration: config.MaxDuration);
maxDuration: config.MaxDuration,
blockTTL: config.BlockTTL,
blockMI: config.BlockMI,
blockMN: config.BlockMN);
}
private void Log(string msg)

View File

@ -9,5 +9,7 @@ dotnet run \
--min-price=1024 \
--max-collateral=1024 \
--max-duration=3600000 \
--block-ttl=300 \
--block-ttl=180 \
--block-mi=120 \
--block-mn=10000 \
--metrics=Dashboard

View File

@ -16,13 +16,19 @@ namespace ContinuousTests.Tests
[TestMoment(t: Zero)]
public void UploadTestFile()
{
var filesize = 80.MB();
var metadata = Configuration.CodexDeployment.Metadata;
var maxQuotaUseMb = metadata.StorageQuotaMB / 2;
var safeTTL = Math.Max(metadata.BlockTTL, metadata.BlockMI) + 30;
var runsPerTtl = Convert.ToInt32(safeTTL / RunTestEvery.TotalSeconds);
var filesizePerUploadMb = Math.Min(80, maxQuotaUseMb / runsPerTtl);
// This filesize should keep the quota below 50% of the node's max.
var filesize = filesizePerUploadMb.MB();
double codexDefaultBlockSize = 31 * 64 * 33;
var numberOfBlocks = Convert.ToInt64(Math.Ceiling(filesize.SizeInBytes / codexDefaultBlockSize));
var sizeInBytes = filesize.SizeInBytes;
Assert.That(numberOfBlocks, Is.EqualTo(1282));
file = FileManager.GenerateTestFile(filesize);
cid = UploadFile(Nodes[0], file);

View File

@ -23,7 +23,7 @@ namespace DistTestCore.Codex
public class DeploymentMetadata
{
public DeploymentMetadata(string kubeNamespace, int numberOfCodexNodes, int numberOfValidators, int storageQuotaMB, CodexLogLevel codexLogLevel, int initialTestTokens, int minPrice, int maxCollateral, int maxDuration)
public DeploymentMetadata(string kubeNamespace, int numberOfCodexNodes, int numberOfValidators, int storageQuotaMB, CodexLogLevel codexLogLevel, int initialTestTokens, int minPrice, int maxCollateral, int maxDuration, int blockTTL, int blockMI, int blockMN)
{
DeployDateTimeUtc = DateTime.UtcNow;
KubeNamespace = kubeNamespace;
@ -35,6 +35,9 @@ namespace DistTestCore.Codex
MinPrice = minPrice;
MaxCollateral = maxCollateral;
MaxDuration = maxDuration;
BlockTTL = blockTTL;
BlockMI = blockMI;
BlockMN = blockMN;
}
public DateTime DeployDateTimeUtc { get; }
@ -47,5 +50,8 @@ namespace DistTestCore.Codex
public int MinPrice { get; }
public int MaxCollateral { get; }
public int MaxDuration { get; }
public int BlockTTL { get; }
public int BlockMI { get; }
public int BlockMN { get; }
}
}