rigs continuous testnet for holdmybeer test.
This commit is contained in:
parent
e340b3cd41
commit
9a117cca70
|
@ -90,6 +90,14 @@ namespace CodexNetDeployer
|
||||||
{
|
{
|
||||||
codexStart.BlockTTL = config.BlockTTL;
|
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;
|
return codexStart;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ namespace CodexNetDeployer
|
||||||
public class Configuration
|
public class Configuration
|
||||||
{
|
{
|
||||||
public const int SecondsIn1Day = 24 * 60 * 60;
|
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.")]
|
[Uniform("kube-config", "kc", "KUBECONFIG", false, "Path to Kubeconfig file. Use 'null' (default) to use local cluster.")]
|
||||||
public string KubeConfigFile { get; set; } = "null";
|
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.")]
|
[Uniform("block-ttl", "bt", "BLOCKTTL", false, "Block timeout in seconds. Default is 24 hours.")]
|
||||||
public int BlockTTL { get; set; } = SecondsIn1Day;
|
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.")]
|
[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;
|
public MetricsMode Metrics { get; set; } = MetricsMode.None;
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,10 @@ namespace CodexNetDeployer
|
||||||
initialTestTokens: config.InitialTestTokens,
|
initialTestTokens: config.InitialTestTokens,
|
||||||
minPrice: config.MinPrice,
|
minPrice: config.MinPrice,
|
||||||
maxCollateral: config.MaxCollateral,
|
maxCollateral: config.MaxCollateral,
|
||||||
maxDuration: config.MaxDuration);
|
maxDuration: config.MaxDuration,
|
||||||
|
blockTTL: config.BlockTTL,
|
||||||
|
blockMI: config.BlockMI,
|
||||||
|
blockMN: config.BlockMN);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Log(string msg)
|
private void Log(string msg)
|
||||||
|
|
|
@ -9,5 +9,7 @@ dotnet run \
|
||||||
--min-price=1024 \
|
--min-price=1024 \
|
||||||
--max-collateral=1024 \
|
--max-collateral=1024 \
|
||||||
--max-duration=3600000 \
|
--max-duration=3600000 \
|
||||||
--block-ttl=300 \
|
--block-ttl=180 \
|
||||||
|
--block-mi=120 \
|
||||||
|
--block-mn=10000 \
|
||||||
--metrics=Dashboard
|
--metrics=Dashboard
|
||||||
|
|
|
@ -16,13 +16,19 @@ namespace ContinuousTests.Tests
|
||||||
[TestMoment(t: Zero)]
|
[TestMoment(t: Zero)]
|
||||||
public void UploadTestFile()
|
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;
|
double codexDefaultBlockSize = 31 * 64 * 33;
|
||||||
var numberOfBlocks = Convert.ToInt64(Math.Ceiling(filesize.SizeInBytes / codexDefaultBlockSize));
|
var numberOfBlocks = Convert.ToInt64(Math.Ceiling(filesize.SizeInBytes / codexDefaultBlockSize));
|
||||||
var sizeInBytes = filesize.SizeInBytes;
|
var sizeInBytes = filesize.SizeInBytes;
|
||||||
Assert.That(numberOfBlocks, Is.EqualTo(1282));
|
Assert.That(numberOfBlocks, Is.EqualTo(1282));
|
||||||
|
|
||||||
|
|
||||||
file = FileManager.GenerateTestFile(filesize);
|
file = FileManager.GenerateTestFile(filesize);
|
||||||
|
|
||||||
cid = UploadFile(Nodes[0], file);
|
cid = UploadFile(Nodes[0], file);
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace DistTestCore.Codex
|
||||||
|
|
||||||
public class DeploymentMetadata
|
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;
|
DeployDateTimeUtc = DateTime.UtcNow;
|
||||||
KubeNamespace = kubeNamespace;
|
KubeNamespace = kubeNamespace;
|
||||||
|
@ -35,6 +35,9 @@ namespace DistTestCore.Codex
|
||||||
MinPrice = minPrice;
|
MinPrice = minPrice;
|
||||||
MaxCollateral = maxCollateral;
|
MaxCollateral = maxCollateral;
|
||||||
MaxDuration = maxDuration;
|
MaxDuration = maxDuration;
|
||||||
|
BlockTTL = blockTTL;
|
||||||
|
BlockMI = blockMI;
|
||||||
|
BlockMN = blockMN;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTime DeployDateTimeUtc { get; }
|
public DateTime DeployDateTimeUtc { get; }
|
||||||
|
@ -47,5 +50,8 @@ namespace DistTestCore.Codex
|
||||||
public int MinPrice { get; }
|
public int MinPrice { get; }
|
||||||
public int MaxCollateral { get; }
|
public int MaxCollateral { get; }
|
||||||
public int MaxDuration { get; }
|
public int MaxDuration { get; }
|
||||||
|
public int BlockTTL { get; }
|
||||||
|
public int BlockMI { get; }
|
||||||
|
public int BlockMN { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue