2
0
mirror of synced 2025-01-11 09:06:56 +00:00

Sets docker images in constructor of recipes

This commit is contained in:
benbierens 2023-07-17 11:12:14 +02:00
parent 6147c14c9b
commit fa7ba9149e
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
7 changed files with 45 additions and 35 deletions

View File

@ -5,12 +5,6 @@ namespace DistTestCore.Codex
{
public class CodexContainerRecipe : ContainerRecipeFactory
{
#if Arm64
public const string DockerImage = "codexstorage/nim-codex:sha-6dd7e55";
#else
public const string DockerImage = "thatbenbierens/nim-codex:loopingyeah";
//public const string DockerImage = "codexstorage/nim-codex:sha-6dd7e55";
#endif
public const string MetricsPortTag = "metrics_port";
public const string DiscoveryPortTag = "discovery-port";
@ -18,15 +12,11 @@ namespace DistTestCore.Codex
public static readonly TimeSpan MaxUploadTimePerMegabyte = TimeSpan.FromSeconds(2.0);
public static readonly TimeSpan MaxDownloadTimePerMegabyte = TimeSpan.FromSeconds(2.0);
public static string DockerImageOverride = string.Empty;
public override string Image { get; }
protected override string Image
public CodexContainerRecipe()
{
get
{
if (!string.IsNullOrEmpty(DockerImageOverride)) return DockerImageOverride;
return DockerImage;
}
Image = GetDockerImage();
}
protected override void Initialize(StartupConfig startupConfig)
@ -92,5 +82,12 @@ namespace DistTestCore.Codex
if (marketplaceConfig.AccountIndexOverride != null) return marketplaceConfig.AccountIndexOverride.Value;
return Index;
}
private string GetDockerImage()
{
var image = Environment.GetEnvironmentVariable("CODEXDOCKERIMAGE");
if (!string.IsNullOrEmpty(image)) return image;
return "codexstorage/nim-codex:sha-0265cad";
}
}
}

View File

@ -37,9 +37,10 @@ namespace DistTestCore
public void GlobalSetup()
{
fixtureLog.Log($"Codex Distributed Tests are starting...");
fixtureLog.Log($"Codex image: '{CodexContainerRecipe.DockerImage}'");
fixtureLog.Log($"Prometheus image: '{PrometheusContainerRecipe.DockerImage}'");
fixtureLog.Log($"Geth image: '{GethContainerRecipe.DockerImage}'");
fixtureLog.Log($"Codex image: '{new CodexContainerRecipe().Image}'");
fixtureLog.Log($"CodexContracts image: '{new CodexContractsContainerRecipe().Image}'");
fixtureLog.Log($"Prometheus image: '{new PrometheusContainerRecipe().Image}'");
fixtureLog.Log($"Geth image: '{new GethContainerRecipe().Image}'");
// Previous test run may have been interrupted.
// Begin by cleaning everything up.

View File

@ -4,15 +4,19 @@ namespace DistTestCore.Marketplace
{
public class CodexContractsContainerRecipe : ContainerRecipeFactory
{
#if Arm64
public const string DockerImage = "emizzle/codex-contracts-deployment:latest";
#else
public const string DockerImage = "thatbenbierens/codex-contracts-deployment:nomint2";
#endif
public const string MarketplaceAddressFilename = "/usr/app/deployments/codexdisttestnetwork/Marketplace.json";
public const string MarketplaceArtifactFilename = "/usr/app/artifacts/contracts/Marketplace.sol/Marketplace.json";
protected override string Image => DockerImage;
public override string Image { get; }
public CodexContractsContainerRecipe()
{
#if Arm64
Image = "emizzle/codex-contracts-deployment:latest";
#else
Image = "thatbenbierens/codex-contracts-deployment:nomint2";
#endif
}
protected override void Initialize(StartupConfig startupConfig)
{

View File

@ -4,19 +4,22 @@ namespace DistTestCore.Marketplace
{
public class GethContainerRecipe : ContainerRecipeFactory
{
#if Arm64
public const string DockerImage = "emizzle/geth-confenv:latest";
#else
public const string DockerImage = "thatbenbierens/geth-confenv:onethousand";
#endif
private const string defaultArgs = "--ipcdisable --syncmode full";
public const string HttpPortTag = "http_port";
public const string DiscoveryPortTag = "disc_port";
private const string defaultArgs = "--ipcdisable --syncmode full";
public const string AccountsFilename = "accounts.csv";
protected override string Image => DockerImage;
public override string Image { get; }
public GethContainerRecipe()
{
#if Arm64
Image = "emizzle/geth-confenv:latest";
#else
Image = "thatbenbierens/geth-confenv:onethousand";
#endif
}
protected override void Initialize(StartupConfig startupConfig)
{

View File

@ -4,9 +4,12 @@ namespace DistTestCore.Metrics
{
public class PrometheusContainerRecipe : ContainerRecipeFactory
{
public const string DockerImage = "thatbenbierens/prometheus-envconf:latest";
public override string Image { get; }
protected override string Image => DockerImage;
public PrometheusContainerRecipe()
{
Image = "thatbenbierens/prometheus-envconf:latest";
}
protected override void Initialize(StartupConfig startupConfig)
{

View File

@ -27,7 +27,7 @@
return recipe;
}
protected abstract string Image { get; }
public abstract string Image { get; }
protected int ContainerNumber { get; private set; } = 0;
protected int Index { get; private set; } = 0;
protected abstract void Initialize(StartupConfig config);

View File

@ -5,7 +5,9 @@ services:
context: ..
dockerfile: docker/Dockerfile
environment:
- CODEX_LOG_LEVEL=${CODEX_LOG_LEVEL:-TRACE}
- CODEX_METRICS=${CODEX_METRICS:-false}
- BRANCH="feature/docker-image-testruns"
- KUBECONFIG=kubeconfigplease
- LOGPATH="/"
- RUNNERLOCATION="ExternalToCluster"
ports:
- 8080:8080/tcp # REST API